How to use the beakerx.beakerx.beakerx_widgets.EasyFormComponent function in beakerx

To help you get started, we’ve selected a few beakerx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twosigma / beakerx / beakerx / beakerx / beakerx_widgets.py View on Github external
labels_dict = dict()
        for x in labels:
            labels_dict[len(labels_dict)] = x
        self._titles = labels_dict
        self.children += tuple(childrens)


class Tab(SelectionContainer):
    _view_name = Unicode('TabView').tag(sync=True)
    _model_name = Unicode('TabModel').tag(sync=True)

    def __init__(self, childrens, labels):
        super(Tab, self).__init__(childrens, labels)


class SelectMultipleWithRows(SelectMultiple, EasyFormComponent):
    def __init__(self, **kwargs):
        super(SelectMultipleWithRows, self).__init__(**kwargs)

    _view_module = Unicode('beakerx').tag(sync=True)
    _model_module = Unicode('beakerx').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)
    size = Int(5, help="The number of rows to display.").tag(sync=True)


class SelectMultipleSingle(Select, EasyFormComponent):
    def __init__(self, **kwargs):
        super(SelectMultipleSingle, self).__init__(**kwargs)

    _view_name = Unicode('SelectMultipleSingleView').tag(sync=True)
    _model_name = Unicode('SelectMultipleSingleModel').tag(sync=True)
github twosigma / beakerx / beakerx / beakerx / beakerx_widgets.py View on Github external
class BeakerxHTML(HTML, EasyFormComponent):
    def __init__(self, *args, **kwargs):
        super(BeakerxHTML, self).__init__(**kwargs)
        if len(args) > 0:
            self.value = args[0]

    _view_module = Unicode('beakerx').tag(sync=True)
    _model_module = Unicode('beakerx').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)

    layout = InstanceDict(BeakerxLayout).tag(sync=True, **widget_serialization)
    style = None


class BeakerxHTMLPre(HTML, EasyFormComponent):
    def __init__(self, **kwargs):
        super(BeakerxHTMLPre, self).__init__(**kwargs)

    _view_name = Unicode('HTMLPreView').tag(sync=True)
    _model_name = Unicode('HTMLPreModel').tag(sync=True)
    _view_module = Unicode('beakerx').tag(sync=True)
    _model_module = Unicode('beakerx').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)

    layout = InstanceDict(BeakerxLayout).tag(sync=True, **widget_serialization)
    style = None


class BeakerxButton(Button, EasyFormComponent):
    def __init__(self, **kwargs):
github twosigma / beakerx / beakerx / beakerx / beakerx_widgets.py View on Github external
_view_module_version = Unicode('*').tag(sync=True)
    editable = Bool(default_value=False).tag(sync=True)
    original_options = Union([List(), Dict()])
    style = None

    def _handle_msg(self, msg):
        if 'value' in msg['content']['data']['state']:
            value = msg['content']['data']['state']['value']
            if msg['content']['data']['state']['value'] not in self.options:
                self.options = self.original_options[:]
                self.options += (msg['content']['data']['state']['value'],)
            self.value = value
        super(BeakerxComboBox, self)._handle_msg(msg)


class BeakerxCheckbox(Checkbox, EasyFormComponent):
    def __init__(self, **kwargs):
        super(BeakerxCheckbox, self).__init__(**kwargs)

    _view_module = Unicode('beakerx').tag(sync=True)
    _model_module = Unicode('beakerx').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)

    layout = InstanceDict(BeakerxLayout).tag(sync=True, **widget_serialization)
    style = None


class BeakerxCheckboxGroup(EasyFormComponent):
    def __init__(self, **kwargs):
        super(BeakerxCheckboxGroup, self).__init__(**kwargs)
github twosigma / beakerx / beakerx / beakerx / beakerx_widgets.py View on Github external
_view_name = Unicode('SelectMultipleSingleView').tag(sync=True)
    _model_name = Unicode('SelectMultipleSingleModel').tag(sync=True)
    _view_module = Unicode('beakerx').tag(sync=True)
    _model_module = Unicode('beakerx').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)
    size = Int(5, help="The number of rows to display.").tag(sync=True)


class RadioButtons(RadioButtons, EasyFormComponent):
    def __init__(self, **kwargs):
        super(RadioButtons, self).__init__(**kwargs)


class DatePicker(BeakerxDOMWidget, EasyFormComponent):
    def __init__(self, value=None, **kwargs):
        if value is not None:
            kwargs['value'] = value
        super(DatePicker, self).__init__(**kwargs)

    _view_name = Unicode('DatePickerView').tag(sync=True)
    _model_name = Unicode('DatePickerModel').tag(sync=True)
    _view_module = Unicode('beakerx').tag(sync=True)
    _model_module = Unicode('beakerx').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)

    showTime = Bool(default_value=False,
                    help="Enable or disable user changes.").tag(sync=True)
    value = Unicode(default_value="").tag(sync=True)
    description = Unicode(default_value="").tag(sync=True)
github twosigma / beakerx / beakerx / beakerx / beakerx_widgets.py View on Github external
class BeakerxCheckboxGroup(EasyFormComponent):
    def __init__(self, **kwargs):
        super(BeakerxCheckboxGroup, self).__init__(**kwargs)

    def __set_value(self, new_value):
        for item in self.children:
            item.value = item.description in new_value

    children = []
    value = property(lambda self: [item.description for item in self.children if item.value], __set_value)

    def addChildren(self, children):
        self.children.append(children)


class BeakerxLabel(Label, EasyFormComponent):
    def __init__(self, **kwargs):
        super(BeakerxLabel, self).__init__(**kwargs)

    _view_module = Unicode('@jupyter-widgets/controls').tag(sync=True)
    _model_module = Unicode('@jupyter-widgets/controls').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)

    layout = InstanceDict(BeakerxLayout).tag(sync=True, **widget_serialization)
    style = None


class BeakerxHBox(HBox):
    def __init__(self, children=None, **kwargs):
        super(BeakerxHBox, self).__init__(**kwargs)
        if children is not None:
github twosigma / beakerx / beakerx / beakerx / beakerx_widgets.py View on Github external
class BeakerxCheckbox(Checkbox, EasyFormComponent):
    def __init__(self, **kwargs):
        super(BeakerxCheckbox, self).__init__(**kwargs)

    _view_module = Unicode('beakerx').tag(sync=True)
    _model_module = Unicode('beakerx').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)

    layout = InstanceDict(BeakerxLayout).tag(sync=True, **widget_serialization)
    style = None


class BeakerxCheckboxGroup(EasyFormComponent):
    def __init__(self, **kwargs):
        super(BeakerxCheckboxGroup, self).__init__(**kwargs)

    def __set_value(self, new_value):
        for item in self.children:
            item.value = item.description in new_value

    children = []
    value = property(lambda self: [item.description for item in self.children if item.value], __set_value)

    def addChildren(self, children):
        self.children.append(children)


class BeakerxLabel(Label, EasyFormComponent):
    def __init__(self, **kwargs):
github twosigma / beakerx / beakerx / beakerx / beakerx_widgets.py View on Github external
super(BeakerxButton, self).__init__(**kwargs)

    _view_module = Unicode('@jupyter-widgets/controls').tag(sync=True)
    _model_module = Unicode('@jupyter-widgets/controls').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)
    align_self = Unicode('*').tag(sync=True)

    layout = InstanceDict(BeakerxLayout).tag(sync=True, **widget_serialization)
    style = None

    def actionPerformed(self, *args, **kwargs):
        pass


class BeakerxComboBox(Dropdown, EasyFormComponent):
    def __init__(self, **kwargs):
        super(BeakerxComboBox, self).__init__(**kwargs)

    _view_name = Unicode('ComboBoxView').tag(sync=True)
    _model_name = Unicode('ComboBoxModel').tag(sync=True)
    _view_module = Unicode('beakerx').tag(sync=True)
    _model_module = Unicode('beakerx').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)
    editable = Bool(default_value=False).tag(sync=True)
    original_options = Union([List(), Dict()])
    style = None

    def _handle_msg(self, msg):
        if 'value' in msg['content']['data']['state']:
            value = msg['content']['data']['state']['value']
github twosigma / beakerx / beakerx / beakerx / beakerx_widgets.py View on Github external
def __init__(self, **kwargs):
        super(BeakerxText, self).__init__(**kwargs)
        self.observe(self.on_value_change, names='value')

    _view_module = Unicode('beakerx').tag(sync=True)
    _model_module = Unicode('beakerx').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)

    size = Int(default_value=-1).tag(sync=True)
    layout = InstanceDict(BeakerxLayout).tag(sync=True, **widget_serialization)
    style = None


class BeakerxHTML(HTML, EasyFormComponent):
    def __init__(self, *args, **kwargs):
        super(BeakerxHTML, self).__init__(**kwargs)
        if len(args) > 0:
            self.value = args[0]

    _view_module = Unicode('beakerx').tag(sync=True)
    _model_module = Unicode('beakerx').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)

    layout = InstanceDict(BeakerxLayout).tag(sync=True, **widget_serialization)
    style = None


class BeakerxHTMLPre(HTML, EasyFormComponent):
    def __init__(self, **kwargs):
github twosigma / beakerx / beakerx / beakerx / beakerx_widgets.py View on Github external
class BeakerxHTMLPre(HTML, EasyFormComponent):
    def __init__(self, **kwargs):
        super(BeakerxHTMLPre, self).__init__(**kwargs)

    _view_name = Unicode('HTMLPreView').tag(sync=True)
    _model_name = Unicode('HTMLPreModel').tag(sync=True)
    _view_module = Unicode('beakerx').tag(sync=True)
    _model_module = Unicode('beakerx').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)

    layout = InstanceDict(BeakerxLayout).tag(sync=True, **widget_serialization)
    style = None


class BeakerxButton(Button, EasyFormComponent):
    def __init__(self, **kwargs):
        super(BeakerxButton, self).__init__(**kwargs)

    _view_module = Unicode('@jupyter-widgets/controls').tag(sync=True)
    _model_module = Unicode('@jupyter-widgets/controls').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)
    align_self = Unicode('*').tag(sync=True)

    layout = InstanceDict(BeakerxLayout).tag(sync=True, **widget_serialization)
    style = None

    def actionPerformed(self, *args, **kwargs):
        pass
github twosigma / beakerx / beakerx / beakerx / beakerx_widgets.py View on Github external
class SelectMultipleSingle(Select, EasyFormComponent):
    def __init__(self, **kwargs):
        super(SelectMultipleSingle, self).__init__(**kwargs)

    _view_name = Unicode('SelectMultipleSingleView').tag(sync=True)
    _model_name = Unicode('SelectMultipleSingleModel').tag(sync=True)
    _view_module = Unicode('beakerx').tag(sync=True)
    _model_module = Unicode('beakerx').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)
    size = Int(5, help="The number of rows to display.").tag(sync=True)


class RadioButtons(RadioButtons, EasyFormComponent):
    def __init__(self, **kwargs):
        super(RadioButtons, self).__init__(**kwargs)


class DatePicker(BeakerxDOMWidget, EasyFormComponent):
    def __init__(self, value=None, **kwargs):
        if value is not None:
            kwargs['value'] = value
        super(DatePicker, self).__init__(**kwargs)

    _view_name = Unicode('DatePickerView').tag(sync=True)
    _model_name = Unicode('DatePickerModel').tag(sync=True)
    _view_module = Unicode('beakerx').tag(sync=True)
    _model_module = Unicode('beakerx').tag(sync=True)
    _model_module_version = Unicode('*').tag(sync=True)
    _view_module_version = Unicode('*').tag(sync=True)