From 28184737d7712f9ffe749ac3543bf3b43f4200fd Mon Sep 17 00:00:00 2001 From: Sebastien Jourdain Date: Sun, 22 Jan 2023 17:26:04 -0700 Subject: [PATCH] docs(utils.tree): Add API doc --- docs/api/source/client.utils.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/api/source/client.utils.rst b/docs/api/source/client.utils.rst index 25ebdf4e..e6ced4f1 100644 --- a/docs/api/source/client.utils.rst +++ b/docs/api/source/client.utils.rst @@ -71,6 +71,18 @@ The **utils** namespace is aiming to gather user friendly methods. Trame by defa That **safe** method will strip down anything that does not serialize in a transparent manner. This method is mainly meant for debugging or exploration as ideally you should only try to exchange between the server and the client only what is really required. +.. function:: utils.tree(obj) + + Helper function to convert a JavaScript object into a vuetify.VTreeView data structure. + + .. code-block:: python + + state.variable_name = { ... } + + # ... + with layout: + vuetify.VTreeview(items=("utils.tree(variable_name)",)) + .. function:: utils.vtk.event(event) This decorator is to handle meaningful data extraction from an event of trame.widgets.vtk.Vtk{...}View into something that can be processed on the server side.