Extension API
chartlets.Extension
An extension for a UI application that uses the Chartlets JS framework.
add(contribution)
Add a contribution to this extension.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
contribution
|
Contribution
|
The contribution. Its type must be an instance of one of the registered contribution types. |
required |
add_contrib_point(name, item_type)
classmethod
Add a contribution point.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the contribution point. |
required |
item_type
|
type[Contribution]
|
The type of items that can be added to the new contribution point. |
required |
get_contrib_point_names()
classmethod
Get names of all known contribution points added
by the add_contrib_point()
method.
Returns: Tuple of registered contribution point names.
to_dict()
Convert this extension into a JSON-serializable dictionary.
Returns: A dictionary representing this extension.