neurocarto.util.bokeh_util

class neurocarto.util.bokeh_util.ButtonFactory
__init__(**kwargs)
class neurocarto.util.bokeh_util.SliderFactory
__init__(**kwargs)
class neurocarto.util.bokeh_util.PathAutocompleteInput

An alternative of FileInput that allow access full filepath from user’s computer.

Due to FileInput doesn’t provide full path because of browser’s security reasons, so we use AutocompleteInput provide plain text input with auto complete.

__init__(root, callback=None, mode='path', accept=None, min_characters=0, max_completions=10, case_sensitive=False, restrict=False, **kwarg)
Parameters:
  • root (Path)

  • callback (Callable[[Path | None], None] | None)

  • mode (Literal['path', 'dir', 'file'])

  • accept (list[str] | None) – accept file suffix (‘.*’) or mime type (’/’) when mode == ‘file’

  • min_characters

  • max_completions

  • case_sensitive

  • restrict

  • kwarg

input: AutocompleteInput
property root: Path
property mode: Literal['path', 'dir', 'file']
property value: str
property path: Path | None
neurocarto.util.bokeh_util.as_callback(callback, *args, **kwargs)
Parameters:

callback (Callable[[...], None])

Return type:

Callable[[str, Any, Any], None]

neurocarto.util.bokeh_util.col_layout(model, n)
Parameters:
  • model (list[UIElement])

  • n (int)

Return type:

list[UIElement]

neurocarto.util.bokeh_util.recursive_call_barrier(f)

A method decorator for adding a barrier before calling a function to prevent from recursively calling functions, such as updating functions.

XXX: does it work? https://docs.bokeh.org/en/latest/docs/reference/models/callbacks.html#bokeh.models.Callback.set_from_json

Parameters:

f

Returns:

neurocarto.util.bokeh_util.new_help_button(content, *, position='right')
Parameters:
  • content (str)

  • position (str)

Return type:

HelpButton