Public constructor.
A promise that resolves to the parent view when a child view is displayed.
Construct layout delta object and send layoutDelta message to the Python side
Edit ID of message that triggered the creation of the layout delta
Construct trace deltas array for the requested trace indexes and send traceDeltas message to the Python side Array of indexes of traces for which to compute deltas
Edit ID of message that triggered the creation of trace deltas
Build and send a points callback message to the Python side
data object as provided by the plotly_click, plotly_hover, plotly_unhover, or plotly_selected events
Name of the triggering event. One of 'plotly_click', 'plotly_hover', 'plotly_unhover', or 'plotly_selected'
Build InputDeviceState data structure from data supplied by the plotly_click, plotly_hover, or plotly_select events
Build Points data structure from data supplied by the plotly_click, plotly_hover, or plotly_select events
Build Selector data structure from data supplied by the plotly_select event
Create msg callbacks for a comm msg.
Create and promise that resolves to a child view of a given model
Make an event delegation handler for the given eventName and selector
and attach it to this.el.
If selector is empty, the listener will be bound to this.el. If not, a
new handler that will recursively traverse up the event target's DOM
hierarchy looking for a node that matches the selector. If one is found,
the event's delegateTarget property is set to it and the return the
result of calling bound listener with the parameters given to the
handler.
This does not properly handle selectors for things like focus and blur (see https://github.com/jquery/jquery/blob/7d21f02b9ec9f655583e898350badf89165ed4d5/src/event.js#L442 for some similar exceptional cases).
Purge Plotly.js data structures from the notebook output display element when the view is destroyed
Handle Plotly.addTraces request
Handle Plotly.animate request
Handle Plotly.deleteTraces request
Handle Plotly.moveTraces request
Handle Plotly.relayout request
Handle Plotly.restyle request
Handle Plotly.update request
Events hash or a method returning the events hash that maps events/selectors to methods on your View.
For assigning events as object hash, do it like this: this.events =
Return the figure's _fullData array merged with its data array
The merge ensures that for any properties that el._fullData and el.data have in common, we return the version from el.data
Named colorscales are one example of why this is needed. The el.data array will hold named colorscale strings (e.g. 'Viridis'), while the el._fullData array will hold the actual colorscale array. e.g.
el.data[0].marker.colorscale == 'Viridis' but
el._fullData[0].marker.colorscale = [[..., ...], ...]
Performing the merge allows our FigureModel to retain the 'Viridis' string, rather than having it overridded by the colorscale array.
Return the figure's _fullLayout object merged with its layout object
See getFullData documentation for discussion of why the merge is necessary
Handle message sent to the front end.
Used to focus or blur the widget.
Handle plotly_click events emitted by the Plotly.js library
Handle plotly_deselect events emitted by the Plotly.js library
Stub for future handling of plotly_doubleclick
Handle plotly_hover events emitted by the Plotly.js library
Handle plotly_relayout events emitted by the Plotly.js library
Handle ploty_restyle events emitted by the Plotly.js library
Handle plotly_selected events emitted by the Plotly.js library
Handle plotly_unhover events emitted by the Plotly.js library
Handle plotly_update events emitted by the Plotly.js library
Public constructor
The perform_render method is called by processLuminoMessage after the widget's DOM element has been attached to the notebook output cell. This happens after the initialize of the FigureModel, and it won't happen at all if the Python FigureWidget is never displayed in a notebook output cell
For use with views as ES classes. If you define a preinitialize method, it will be invoked when the view is first created, before any instantiation logic is run.
Respond to phosphorjs events
Render a view
the view or a promise to the view.
Send a custom msg associated with this view.
Triggered on model change.
Update view to be consistent with this.model
Update the DOM classes applied to an element, default to this.el.
Update the DOM classes applied to the widget based on a single trait's value.
Given a trait value classes map, this function automatically handles applying the appropriate classes to the widget element and removing classes that are no longer valid.
class_map: dictionary Dictionary of trait values to class lists. Example: { success: ['alert', 'alert-success'], info: ['alert', 'alert-info'], warning: ['alert', 'alert-warning'], danger: ['alert', 'alert-danger'] }; trait_name: string Name of the trait to check the value of. el: optional DOM element handle, defaults to this.el Element that the classes are applied to.
Do not use, prefer TypeScript's extend functionality.
Generated using TypeDoc
A FigureView manages the visual presentation of a single Plotly.js figure for a single notebook output cell. Each FigureView has a reference to FigureModel. Multiple views may share a single model instance, as is the case when a Python FigureWidget is displayed in multiple notebook output cells.