waveform_editor.gui.dict_editor.DictEditor

class waveform_editor.gui.dict_editor.DictEditor(key_options, names, *, description, disabled, loading, align, aspect_ratio, css_classes, design, height, height_policy, margin, max_height, max_width, min_height, min_width, sizing_mode, styles, stylesheets, tags, visible, width, width_policy, value, name, **kwargs)

Bases: CompositeWidget

A Panel widget for editing Python dictionaries in a tabular interface.

__init__(key_options, names, *, description, disabled, loading, align, aspect_ratio, css_classes, design, height, height_policy, margin, max_height, max_width, min_height, min_width, sizing_mode, styles, stylesheets, tags, visible, width, width_policy, value, name, **kwargs)

Initialize the DictEditor widget.

Parameters:
key_options

List of allowed keys shown in the dropdown editor.

names

Tuple of column names to display for keys and values.

Methods

__init__(key_options, names, *, description, ...)

Initialize the DictEditor widget.

clone(**params)

Makes a copy of the object sharing the same parameters.

controls([parameters, jslink])

Creates a set of widgets which allow manipulating the parameters on this instance.

delete_selected_row(event)

embed([max_states, max_opts, json, ...])

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model.

from_param(parameter, **params)

Construct a widget from a Parameter and link the two bi-directionally.

from_values(values, **params)

Creates an instance of this Widget where the parameters are inferred from the data.

get_root([doc, comm, preprocess])

Returns the root model and applies pre-processing hooks

jscallback([args])

Allows defining a JS callback to be triggered when a property changes on the source object.

jslink(target[, code, args, bidirectional])

Links properties on the this Reactive object to those on the target Reactive object in JS code.

link(target[, callbacks, bidirectional])

Links the parameters on this Reactive object to attributes on the target Parameterized object.

on_cell_update(event)

Callback for when a cell in the Tabulator is edited.

save(filename[, title, resources, template, ...])

Saves Panel objects to file.

select([selector])

Iterates over the Viewable and any potential children in the applying the Selector.

servable([title, location, area, target])

Serves the object or adds it to the configured pn.state.template if in a panel serve context, writes to the DOM if in a pyodide context and returns the Panel object to allow it to display itself in a notebook context.

server_doc([doc, title, location])

Returns a serveable bokeh Document with the panel attached

show([title, port, address, ...])

Starts a Bokeh server and displays the Viewable in a new tab.

update_value()

Update the Tabulator widget to reflect the current dictionary.

Attributes

align

aspect_ratio

css_classes

description

design

disabled

height

height_policy

loading

margin

max_height

max_width

min_height

min_width

name

param

rx

sizing_mode

styles

stylesheets

tags

value

visible

width

width_policy

clone(**params) Viewable

Makes a copy of the object sharing the same parameters.

Parameters

params: Keyword arguments override the parameters on the clone.

Returns

Cloned Viewable object

controls(parameters: list[str] = [], jslink: bool = True, **kwargs) BasePanel

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters

parameters: list(str)

An explicit list of parameters to return controls for.

jslink: bool

Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

kwargs: dict

Additional kwargs to pass to the Param pane(s) used to generate the controls widgets.

Returns

A layout of the controls

embed(max_states: int = 1000, max_opts: int = 3, json: bool = False, json_prefix: str = '', save_path: str = './', load_path: str | None = None, progress: bool = False, states={}) Mimebundle

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters

max_states: int

The maximum number of states to embed

max_opts: int

The maximum number of states for a single widget

json: boolean (default=True)

Whether to export the data to json files

json_prefix: str (default='')

Prefix for JSON filename

save_path: str (default='./')

The path to save json files to

load_path: str (default=None)

The path or URL the json files will be loaded from.

progress: boolean (default=False)

Whether to report progress

states: dict (default={})

A dictionary specifying the widget values to embed for each widget

classmethod from_param(parameter: param.Parameter, **params) T

Construct a widget from a Parameter and link the two bi-directionally.

Parameters

parameter: param.Parameter

A parameter to create the widget from.

Returns

Widget instance linked to the supplied parameter

classmethod from_values(values, **params)

Creates an instance of this Widget where the parameters are inferred from the data.

Parameters

values: Iterable

The values to infer the parameters from.

params: dict

Additional parameters to pass to the widget.

get_root(doc: Document | None = None, comm: Comm | None = None, preprocess: bool = True) Model

Returns the root model and applies pre-processing hooks

Parameters

doc: bokeh.Document

Bokeh document the bokeh model will be attached to.

comm: pyviz_comms.Comm

Optional pyviz_comms when working in notebook

preprocess: boolean (default=True)

Whether to run preprocessing hooks

Returns

Returns the bokeh model corresponding to this panel object

jscallback(args: dict[str, Any] = {}, **callbacks: str) Callback

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters

args: dict

A mapping of objects to make available to the JS callback

callbacks: dict

A mapping between properties on the source model and the code to execute when that property changes

Returns

callback: Callback

The Callback which can be used to disable the callback.

Links properties on the this Reactive object to those on the target Reactive object in JS code.

Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters

target: panel.viewable.Viewable | bokeh.model.Model | holoviews.core.dimension.Dimensioned

The target to link the value to.

code: dict

Custom code which will be executed when the widget value changes.

args: dict

A mapping of objects to make available to the JS callback

bidirectional: boolean

Whether to link source and target bi-directionally

links: dict

A mapping between properties on the source model and the target model property to link it to.

Returns

link: GenericLink

The GenericLink which can be used unlink the widget and the target model.

Links the parameters on this Reactive object to attributes on the target Parameterized object.

Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters

target: param.Parameterized

The target object of the link.

callbacks: dict | None

Maps from a parameter in the source object to a callback.

bidirectional: bool

Whether to link source and target bi-directionally

links: dict

Maps between parameters on this object to the parameters on the supplied object.

on_cell_update(event)

Callback for when a cell in the Tabulator is edited.

save(filename: str | PathLike | IO, title: str | None = None, resources: Resources | None = None, template: str | Template | None = None, template_variables: dict[str, Any] = {}, embed: bool = False, max_states: int = 1000, max_opts: int = 3, embed_json: bool = False, json_prefix: str = '', save_path: str = './', load_path: str | None = None, progress: bool = True, embed_states: dict[Any, Any] = {}, as_png: bool | None = None, **kwargs) None

Saves Panel objects to file.

Parameters

filename: str or file-like object

Filename to save the plot to

title: string

Optional title for the plot

resources: bokeh resources

One of the valid bokeh.resources (e.g. CDN or INLINE)

template:

passed to underlying io.save

template_variables:

passed to underlying io.save

embed: bool

Whether the state space should be embedded in the saved file.

max_states: int

The maximum number of states to embed

max_opts: int

The maximum number of states for a single widget

embed_json: boolean (default=True)

Whether to export the data to json files

json_prefix: str (default='')

Prefix for the auto-generated json directory

save_path: str (default='./')

The path to save json files to

load_path: str (default=None)

The path or URL the json files will be loaded from.

progress: boolean (default=True)

Whether to report progress

embed_states: dict (default={})

A dictionary specifying the widget values to embed for each widget

as_png: boolean (default=None)

To save as a .png. If None save_png will be true if filename is string and ends with png.

select(selector: type | Callable[[Viewable], bool] | None = None) list[panel.viewable.Viewable]

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector: type or callable or None

The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables: list(Viewable)

servable(title: str | None = None, location: bool | Location = True, area: str = 'main', target: str | None = None) Self

Serves the object or adds it to the configured pn.state.template if in a panel serve context, writes to the DOM if in a pyodide context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

titlestr

A string title to give the Document (if served as an app)

locationboolean or panel.io.location.Location

Whether to create a Location component to observe and set the URL location.

area: str (deprecated)

The area of a template to add the component too. Only has an effect if pn.config.template has been set.

target: str

Target area to write to. If a template has been configured on pn.config.template this refers to the target area in the template while in pyodide this refers to the ID of the DOM node to write to.

Returns

The Panel object itself

server_doc(doc: Document | None = None, title: str | None = None, location: bool | Location = True) Document

Returns a serveable bokeh Document with the panel attached

Parameters

docbokeh.Document (optional)

The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

titlestr

A string title to give the Document

locationboolean or panel.io.location.Location

Whether to create a Location component to observe and set the URL location.

Returns

docbokeh.Document

The bokeh document the panel was attached to

show(title: str | None = None, port: int = 0, address: str | None = None, websocket_origin: str | None = None, threaded: bool = False, verbose: bool = True, open: bool = True, location: bool | Location = True, **kwargs) StoppableThread | Server

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters

titlestr | None

A string title to give the Document (if served as an app)

port: int (optional, default=0)

Allows specifying a specific port

addressstr

The address the server should listen on for HTTP requests.

websocket_origin: str or list(str) (optional)

A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, "localhost" is used.

threaded: boolean (optional, default=False)

Whether to launch the Server on a separate thread, allowing interactive use.

verbose: boolean (optional, default=True)

Whether to print the address and port

openboolean (optional, default=True)

Whether to open the server in a new browser tab

locationboolean or panel.io.location.Location

Whether to create a Location component to observe and set the URL location.

Returns

server: bokeh.server.Server or panel.io.server.StoppableThread

Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

update_value()

Update the Tabulator widget to reflect the current dictionary.


Last update: 2026-05-21