class FastTextAreaInput(_BkTextAreaInput): """The FastTextAreaInput enables using the `fast-textarea-input` with Bokeh.""" # value is inherited # placeholder is inherited # max_length is inherited # cols is inherited # rows is inherited appearance = properties.String( help= """Determines the appearance of the textinput. One of `outline` or `filled`. Defaults to outlined""", ) autofocus = properties.Bool( help="""The autofocus attribute. Defaults to `False`""", ) resize = properties.String(help="""The resize attribute. One of `None`, `both`, `horizontal` or `vertical`. Defaults to `None`.""", ) min_length = properties.Int( help="""The minimum length of the text string""", ) spellcheck = properties.Bool( help="""Whether or not the spell check is enabled. Default is False""") required = properties.Bool( help= """Whether or not the FastTextInput is required. Default is False""") readonly = properties.Bool( help= """Whether or not the FastTextInput is readonly. Default is False""")
class DpxToolbar(Widget): "Toolbar model" __css__ = route("view.css", "icons.css", "toolbar.css") __implementation__ = 'toolbar.ts' __javascript__ = route() frozen = props.Bool(True) open = props.Int(0) save = props.Int(0) doc = props.Int(0) quit = props.Int(0) bead = props.Int(-1) discarded = props.String('') accepted = props.String('') currentbead = props.Bool(True) currentfile = props.Int(-1) delfile = props.Int(-1) filelist = props.List(props.String) seltype = props.Bool(True) message = props.String('') helpmessage = props.String('') hasquit = props.Bool(False) hasdoc = props.Bool(False) def __init__(self, **kwa): super().__init__(name='Main:toolbar', **kwa)
class FastTextInput(_BkTextInput): # value is inherited # placeholder is inherited # list is not supported appearance = properties.String( help= """Determines the appearance of the textinput. One of `outline` or `filled`. Defaults to outlined""", ) autofocus = properties.Bool( help="""The autofocus attribute. Defaults to `False`""", ) type_of_text = properties.String( help= """Determines the type of text accepted. One of `email`, `password`, `tel`, `text` or `url`. Defaults to text. """) max_length = properties.Int( help="""The maximum length of the text string""", ) min_length = properties.Int( help="""The minimum length of the text string""", ) pattern = properties.String( help= """A regular expression that the input's value must match in order for the value to pass constraint validation""" ) size = properties.Int( help= """Valid for email, password, tel, and text input types only. Specifies how much of the input is shown""", ) spellcheck = properties.Bool( help="""Whether or not the spell check is enabled. Default is False""") required = properties.Bool( help= """Whether or not the FastTextInput is required. Default is False""") readonly = properties.Bool( help= """Whether or not the FastTextInput is readonly. Default is False""")
class DpxFitParams(Widget): "Interface to filters needed for cleaning" __css__ = route("peaksplot.css") __javascript__ = [ROUTE + "/jquery.min.js", ROUTE + "/jquery-ui.min.js"] __implementation__ = "_widget.ts" frozen = props.Bool(True) stretch = props.String("") bias = props.String("") locksequence = props.Bool(False)
class DpxDiscardedBeads(Widget): "Toolbar model" __css__ = route("groupedbeads.css", "icons.css") __implementation__ = '_widget.ts' __javascript__ = route() frozen = props.Bool(True) hassequence = props.Bool(False) discarded = props.String('') discardedhelp = props.String('') forced = props.String('') forcedhelp = props.String('')
class FastButton(_BkButton): appearance = properties.String( default="neutral", help="The appearance attribute", ) autofocus = properties.Bool( default=False, help="The autofocus attribute", )
class KeyModResponder(LayoutDOM): """capture all aspects of keydown/up events""" #__implementation__ = TypeScript(KEYBOARDRESPONDERCODE_TS) __implementation__ = "keymodresponder.ts" # can use # __css__ = '<a css file.css>' # can use # __javascript__ = 'katex.min.js' # for additional javascript # this should match with javascript/typescript implementation key = properties.String(default="") keyCode = properties.Int(default=0) altKey = properties.Bool(default=False) ctrlKey = properties.Bool(default=False) metaKey = properties.Bool(default=False) shiftKey = properties.Bool(default=False) key_num_presses = properties.Int(default=0) keypress_callback = properties.Instance(bokeh.models.callbacks.Callback, help=""" A callback to run in the browser whenever a key is pressed """)
class FastButton(_BkButton): """The FastButton enables using the `fast-button` with Bokeh.""" appearance = properties.String( default="neutral", help="The appearance attribute", ) autofocus = properties.Bool( default=False, help="The autofocus attribute", )
class DpxRamp(Widget): "Interface to filters needed for cleaning" __css__ = route("ramp.css") __javascript__ = route() __implementation__ = "_widget.ts" frozen = props.Bool(True) minhfsigma = props.Float(RampStatsTask.hfsigma[0]) maxhfsigma = props.Float(RampStatsTask.hfsigma[1]) minextension = props.Float(RampStatsTask.extension[0]) fixedextension = props.Float(RampStatsTask.extension[1]) maxextension = props.Float(RampStatsTask.extension[2]) displaytype = props.Int(0)
class DpxCleaning(Widget): "Interface to filters needed for cleaning" __css__ = route("cleaning.css") __javascript__ = route() __implementation__ = "_widget.ts" frozen = props.Bool(True) framerate = props.Float(30.) figure = props.Instance(Figure) fixedbeads = props.String("") subtracted = props.String("") subtractcurrent = props.Int(0) maxabsvalue = props.Float(getattr(DataCleaningTask, 'maxabsvalue')) maxderivate = props.Float(getattr(DataCleaningTask, 'maxderivate')) minpopulation = props.Float(getattr(DataCleaningTask, 'minpopulation')) minhfsigma = props.Float(getattr(DataCleaningTask, 'minhfsigma')) maxhfsigma = props.Float(getattr(DataCleaningTask, 'maxhfsigma')) minextent = props.Float(getattr(DataCleaningTask, 'minextent')) maxextent = props.Float(getattr(DataCleaningTask, 'maxextent')) maxsaturation = props.Float(getattr(DataCleaningTask, 'maxsaturation'))
super().validate(value, detail) if isinstance(value, param.Parameterized): return msg = "" if not detail else f"expected param.Parameterized, got {value!r}" raise ValueError(msg) _DATA_MODELS = weakref.WeakKeyDictionary() PARAM_MAPPING = { pm.Array: lambda p, kwargs: bp.Array(bp.Any, **kwargs), pm.Boolean: lambda p, kwargs: bp.Bool(**kwargs), pm.CalendarDate: lambda p, kwargs: bp.Date(**kwargs), pm.CalendarDateRange: lambda p, kwargs: bp.Tuple(bp.Date, bp.Date, **kwargs), pm.ClassSelector: lambda p, kwargs: ((bp.Instance(DataModel, **kwargs), [ (Parameterized, create_linked_datamodel) ]) if isinstance(p.class_, type) and issubclass( p.class_, param.Parameterized) else bp.Any(**kwargs)), pm.Color: lambda p, kwargs: bp.Color(**kwargs), pm.DataFrame: lambda p, kwargs: (bp.ColumnData(bp.Any, bp.Seq(bp.Any), **kwargs), [( bp.PandasDataFrame, lambda x: ColumnDataSource._data_from_df(x))]), pm.DateRange:
class SequenceTicker(BasicTicker): # pylint: disable=too-many-ancestors "Generate ticks at fixed, explicitly supplied locations." major = props.Dict(props.String, props.Seq(props.Float), default={'': []}) minor = props.Dict(props.String, props.Seq(props.Float), default={'': []}) key = props.String(default='') usedefault = props.Bool(default=True) __defaults: dict __withbase: list __model: Any __theme: SequenceTickerTheme __fig: Figure __axis: 'SequenceTicker' __implementation__ = "sequenceticker.ts" def __init__( # pylint: disable=too-many-arguments self, ctrl=None, fig=None, mdl=None, axlabel=None, loc='right', **kwa): "Sets the ticks according to the configuration" super().__init__(**kwa) self.__defaults = dict() self.__withbase = [] if ctrl: self.__theme = ctrl.theme.add(SequenceTickerTheme(), False) else: self.__theme = SequenceTickerTheme() if mdl is None: return self.__model = mdl self.__fig = fig self.__axis = type(self)(ctrl) if 'bases' not in fig.extra_y_ranges: fig.extra_y_ranges = dict(fig.extra_y_ranges, bases=Range1d(start=0., end=0.)) fig.add_layout( LinearAxis(y_range_name="bases", axis_label=axlabel, ticker=self.__axis), loc) # bokehjs will never draw minor lines unless the color is # is set at startup fig.ygrid[0].update(minor_grid_line_color='navy', minor_grid_line_alpha=0., ticker=self, y_range_name='bases') order = tuple('grid_line_' + i for i in ('color', 'width', 'dash', 'alpha')) order += tuple('minor_' + i for i in order) # type: ignore self.__defaults = {i: getattr(fig.ygrid[0], i) for i in order} self.__withbase = dict() theme = self.__model.themename for name in ('color', 'dash', 'width', 'alpha'): gridprops = themed(theme, self.__theme.grid[name]) self.__withbase['grid_line_' + name] = gridprops[0] self.__withbase['minor_grid_line_' + name] = gridprops[1] @staticmethod def init(ctrl): "init private fields" ctrl.theme.add(SequenceTickerTheme(), False) @property def axis(self): u"returns the fixed axis" return self.__axis def reset(self, resets): "Updates the ticks according to the configuration" mdl = self.__model fig = self.__fig key = (mdl.sequencemodel.currentkey if mdl.sequencemodel.currentkey is not None and len(mdl.oligos) else 'NONE') majors = {} minors = {} axis = next(i for i in fig.right if isinstance(i, LinearAxis)) resets[axis].update(axis_label_standoff=self.__theme.standoff) if key == 'NONE': resets[fig.ygrid[0]].update(self.__defaults) else: resets[fig.ygrid[0]].update(self.__withbase) for name, peaks in self.__model.hybridisations(...).items(): majors[name] = tuple(peaks['position'][peaks['orientation']]) minors[name] = tuple(peaks['position'][~peaks['orientation']]) resets[self].update(major=majors, minor=minors, key=key) minor = dict.fromkeys(majors.keys(), tuple()) # type:ignore major = {i: majors[i] + minors[i] for i in majors} resets[self.__axis].update(major=major, minor=minor, key=key)