Replies: 4 comments 11 replies
-
My general opinion is that you need something like three examples to generalize something like this. Of our other exported types, ignoring changing values in the export itself, a Figure seems to be a good second example, but I would encourage trying to find a third that also maps well to this idea. Figures would offer a possible answer for the ticking data part of the question - when a figure is exported, it also provides tickets for other objects, such as Tables and TableMaps. If the If the exported object itself can change over time (rather than re-export the entire thing), this might suggest that TableMap would be another good candidate to include in this model. The risk here is that TableMap might end up with some custom serialization mechanism (to handle SmartKeys), to handle its append-only updates. My hunch though is that unless these objects are gigantic, a delta would be easier to manage by resending the entire object, but I think more discussion around specific examples would make sense. If the changing part of the model can be made to fit into an associated Table (consider a Table in a TableMap that consists only of the keys), that would make for a straightforward way to pass the data. -- One final note, base64 isn't strictly required by the transport mechanism - protobuf can support a |
Beta Was this translation helpful? Give feedback.
-
As another example that may fall under this category, I've wanted a widget that could be driven off of a Deephaven table. For example, I have a table that has a single column and single ticking row, representing percentage with a value in the range
These types of widgets may be driven server + client side; or completely client side (a layout that defines w1/w2 instead of having it done via server vars). |
Beta Was this translation helpful? Give feedback.
-
I'm more interested in drilling down into how we can extend the abstractions / serialization around Specifically, I think the goals are:
|
Beta Was this translation helpful? Give feedback.
-
Another thing to consider in terms of directory structure... we may want a startup script, and also a resource file that's available on the path. Is there a way to do that cleanly @devinrsmith ? |
Beta Was this translation helpful? Give feedback.
-
Related to an investigation in what it would take to get matplotlib working in our system, I wanted to make it generic enough that we can add extensions easily for other packages as well (eg seaborn).
This is focused only on python.
I have a proof of concept in my forked repo, see the
README
there for info on how to start it up:https://github.com/mofojed/deephaven-core/tree/matplotlib
Exporting objects
Currently, we have an enum ExportedObjectType for all exported objects. To be extendable, we need some way to check if an object in the python session is an object that should be exported to the client, and then we need some way for the client to get details about that object.
Proposal is to add a
getDeephavenObject
method to any object that should be exported, and that method returns a String that is opaque to Deephaven, gets transferred to the client, and then a UI plugin there can handle the payload however it wishes (eg. base64 decode an image, JSON parse an object from a string, etc).In the case of the
matplotlib
example,getDeephavenObject
returns a base64 encoded image of the figure being exported: https://github.com/mofojed/deephaven-core/blob/cf0940e3f1737771e5fa29d1dab11a6fcbcc07f5/README.md?plain=1#L17.On the UI side that base64 encoded image is then decoded and displayed: https://github.com/mofojed/web-client-ui/blob/bb6892ed1419a74c98953a0cb74673e6dd0243f7/packages/dashboard-core-plugins/src/panels/MatPlotLibPanel.jsx#L33
Extension structure
My proposal for Deephaven Extensions is being able to provide a folder/package that contains all the files to add additional functionality on both the backend and frontend. I imagine the folder structure something like:
Not too sure what the install command/process would be yet, that is something to discuss here. But in terms of the structure:
/init
folder for initialization scripts. In the matplotlib case, this would need a script in grpc-api to pip install matplotlib and a script in py-env to extend matplotlib.figure.Figure with the getDeephavenObject method. We could add subfolders for any other initialization scripts we may need (eg. for other containers)/ui
folder for Web UI dashboard plugins. In the matplotlib case, the MatPlotLibPlugin handles it.Other Considerations
Beta Was this translation helpful? Give feedback.
All reactions