neuralib.dashboard.example

class neuralib.dashboard.example.Graph[source]

Bases: ViewComponent

render_dots: GlyphRenderer
render_line: GlyphRenderer
__init__()[source]
data: ColumnDataSource
plot(fig, **kwargs)[source]

plot data in figure.

Parameters:
  • fig (figure) – Figure.

  • kwargs – plotting parameters.

update()[source]

update the plot

list_renders(pattern=None, recursive=False)

list all renders for those name contain pattern.

Parameters:
  • pattern (str | None) – str in attribute name

  • recursive (bool) – recursive find all renders from ViewComponent attributes.

Returns:

Return type:

list[GlyphRenderer]

set_visible(visible, pattern=None)

Set the visible state of renders for those name contain pattern. It is a recursive function that it also update the renders inside the ViewComponent attributes.

Parameters:
  • visible (bool)

  • pattern (str | None) – str in attribute name

class neuralib.dashboard.example.Top[source]

Bases: View

graph: Graph
property title: str
setup()[source]

setup application top view. This function is called by BokehServer only once when the server created and opened the web browser.

In this function, you need to initialize the UI components and return the layout.

Return type:

Model

update()[source]

Top level UI components updating function. This function is called by BokehServer when setup() has done.

In this function, you need to initialize the data and update the UI components’ state.

get_arg(key)
Parameters:

key (str)

Return type:

list[str]

on_message(message, reset)

for logging purpose. i.e., TextAreaInput bokeh widget

Parameters:
  • message (str)

  • reset (bool)

run_later(callback, *args, **kwargs)
Parameters:

callback (Callable)

run_periodic(cycle, callback, *args, **kwargs)
Parameters:
  • cycle (int)

  • callback (Callable)

run_timeout(delay, callback, *args, **kwargs)
Parameters:
  • delay (int)

  • callback (Callable)

document: Document