Returns the relative URL where the model's resource would be located on the server.
Handle when a widget comm is closed.
Handle incoming comm msg.
Handle status msgs.
execution_state : ('busy', 'idle', 'starting')
Input a trace index specification and return an Array of trace indexes where:
Array of trace indexes
Create msg callbacks for a comm msg.
Return an object containing all the attributes that have changed, or false if there are no changed attributes. Useful for determining what parts of a view need to be updated and/or what attributes need to be persisted to the server. Unset attributes will be set to undefined. You can also pass an attributes object to diff against the model, determining if there would be a change.
Close model
true if the comm is already being closed. If false, the comm will be closed.
Handle addTraces message
Handle animate message
Log changes to the _data trait
This should only happed on FigureModel initialization
Handle deleteTraces message
Log changes to the _layout trait
This should only happed on FigureModel initialization
Handle moveTraces message
Handle relayout message
Handle removeLayoutProps message
Handle removeTraceProps message
Handle restyle message
Handle update message
For strongly-typed access to attributes, use the get method only privately in public getter properties.
Get the serializable state of the model.
If drop_default is truthy, attributes that are equal to their default values are dropped.
Initialize FigureModel. Called when the Python FigureWidget is first constructed
Test to see if the model has been synced with the server.
As of backbone 1.1, backbone ignores patch if it thinks the
model has never been pushed.
on_some_change(['key1', 'key2'], foo, context) differs from on('change:key1 change:key2', foo, context). If the widget attributes key1 and key2 are both modified, the second form will result in foo being called twice while the first will call foo only once.
For use with models as ES classes. If you define a preinitialize method, it will be invoked when the Model is first created, before any instantiation logic is run for the Model.
Push this model's state to the back-end
This invokes a Backbone.Sync.
Send a custom msg over the comm.
Send a sync message to the kernel.
If a message is sent successfully, this returns the message ID of that message. Otherwise it returns an empty string
Serialize widget state.
A serializer is a function which takes in a state attribute and a widget, and synchronously returns a JSONable object. The returned object will have toJSON called if possible, and the final result should be a primitive object that is a snapshot of the widget state that may have binary array buffers.
Set one or more values.
We just call the super method, in which val and options are optional. Handles both "key", value and {key: value} -style arguments.
Handle when a widget is updated from the backend.
This function is meant for internal use only. Values set here will not be propagated on a sync.
Handle sync to the back-end. Called when a model.save() is called.
Make sure a comm exists.
method : create, update, patch, delete, read
create/update always send the full attribute set
patch - only send attributes listed in options.attrs, and if we
are queuing up messages, combine with previous messages that have
not been sent yet
model : the model we are syncing
will normally be the same as this
options : dict
the attrs key, if it exists, gives an {attr: value} dict that
should be synced, otherwise, sync all attributes.
Serialize the model. See the deserialization function at the top of this file and the kernel-side serializer/deserializer.
Returns a promise for the deserialized state. The second argument is an instance of widget manager, which is required for the deserialization of widget models.
Do not use, prefer TypeScript's extend functionality.
Generated using TypeDoc
A FigureModel holds a mirror copy of the state of a FigureWidget on the Python side. There is a one-to-one relationship between JavaScript FigureModels and Python FigureWidgets. The JavaScript FigureModel is initialized as soon as a Python FigureWidget initialized, this happens even before the widget is first displayed in the Notebook