kepler.gl icon indicating copy to clipboard operation
kepler.gl copied to clipboard

[jupyter] WIP python save_to_json function

Open chrisgervang opened this issue 3 years ago • 3 comments

  • The goal is to export the entire map as a json by calling the following javascript code, and access it from a python function call: const exportedData = state.keplerGl.map.visState.schema.save(state.keplerGl.map)

  • Adds a save_to_json python function to compliment the save_to_html function.

This PR is not yet functional. I'm unsure how to implement a low level async data exchange between python->js->python.

Research links: https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Asynchronous.html#Waiting-for-user-interaction https://ipywidgets.readthedocs.io/en/latest/embedding.html#python-interface https://stackoverflow.com/questions/33845775/send-json-data-to-jupyter-notebook-frontend-via-comm/33846113 https://github.com/jupyter-widgets/ipywidgets/blob/master/docs/source/examples/Widget%20Low%20Level.ipynb https://github.com/jupyter-widgets/ipywidgets/blob/24628f006c8a468994eba7a6e964fe619c992267/ipywidgets/widgets/widget.py#L260 https://github.com/jupyter-widgets/ipywidgets/blob/master/packages/base/src/widget.ts

chrisgervang avatar Mar 29 '21 17:03 chrisgervang

published 2.5.1 with utils in dist

heshan0131 avatar Mar 30 '21 20:03 heshan0131

what is the goal of the exported json? Loaded back to kepler? then you want to use the getMapJaon method and pass in the entire state. not just visState

heshan0131 avatar Mar 30 '21 20:03 heshan0131

Hello! Any news on this MR? Is the save_to_json something still being worked on?

SebastianoX avatar Jul 07 '23 15:07 SebastianoX