You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some time ago, someone requested a feature that would allow importing JsCode objects from a javascript file. See here for the initial discussion: #1942.
To satisfy my own curiosity I implemented an import hook that would allow just that. With it you can write code like this:
With a directory structure like this javascript/functions.js you could write python code as follows:
from javascript.functions import example. The result would be a JsCode object with the source code of the method. I think this would be useful for the Folium project, but it also has use cases outside of Folium. For instance, many streamlit components use a similar JsCode object to encapsulate javascript functions in python.
Would it be okay to host this as a separate project under the python-visualization organization?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Some time ago, someone requested a feature that would allow importing
JsCode
objects from a javascript file. See here for the initial discussion: #1942.To satisfy my own curiosity I implemented an import hook that would allow just that. With it you can write code like this:
With a directory structure like this
javascript/functions.js
you could write python code as follows:from javascript.functions import example
. The result would be aJsCode
object with the source code of the method. I think this would be useful for theFolium
project, but it also has use cases outside ofFolium
. For instance, manystreamlit
components use a similarJsCode
object to encapsulate javascript functions in python.Would it be okay to host this as a separate project under the
python-visualization
organization?Beta Was this translation helpful? Give feedback.
All reactions