Skip to content

taipy.gui.extension.ElementLibrary

Bases: ABC

A library of user-defined visual elements.

TODO

get_data(library_name, payload, var_name, value)

TODO Called if implemented (ie returns a dict).

Parameters:

Name Type Description Default
library_name str

The name of this library.

required
payload dict

The payload send by the createRequestDataUpdateAction() frontend function.

required
var_name str

The name of the variable holding the data.

required
value any

The current value of the variable identified by var_name.

required

get_elements() abstractmethod

Returns the dict of all visual element declarations. TODO The default implementation returns an empty dict, indicating that this library contains no custom visual elements.

get_js_module_name()

Returns the name of the Javascript module.

Typically, Javascript module names use camel case.

This module name must be unique on the browser window scope.

TODO

Returns:

Type Description
str

The name of the Javascript module.

str

The default implementation returns camel case of self.get_name().

get_name() abstractmethod

Returns the library name.

TODO: - What is this name used for? - What if two libraries with the same same get added to the Gui?

get_resource(name)

TODO Defaults to return None? Returns a path for a resource name. Resource URL should be formed as /taipy-extension// with(see get_resource_url) - being the name parameter - the value returned by get_name()

Parameters:

Name Type Description Default
name str

The name of the resource for which a local Path should be returned.

required

get_resource_url(resource)

TODO

get_scripts()

Returns the list of resources names for the scripts.

The default implementation returns an empty list, indicating that this library contains no custom visual elements.

Clarify - this is wrong:

May be this should return some .js...

get_styles()

TODO Returns the list of resources names for the css stylesheets. Defaults to []