from_json#
- k3d.helpers.from_json(input: Any, obj: Any | None = None) Any[source]#
Return JSON object deserialization.
- Parameters:
input (Any) – Input data to deserialize.
obj (Any, optional) – Object, by default None.
- Returns:
Deserialized object.
- Return type:
Any
Note
This function is used along with the ipywidgets package, which provides custom object serializations.
See ipywidgets documentation for more informations.
Examples#
# Example from helpers.array_serialization_wrap
def array_serialization_wrap(name):
return {
"to_json": (lambda input, obj: to_json(name, input, obj)),
"from_json": from_json,
}