-
Notifications
You must be signed in to change notification settings - Fork 38
Feature Request / Question: general urth-core-var
element to pull value from kernel
#534
Comments
@haobibo This is already supported as part of Let me know if this fulfills your requirements. |
@lbustelo I agree that using channel().set(var_name, var_value) is a solution, as I mentioned in my post: third line of For example, when passing a DataFrame from kernel to channel, I can also serialize it in Python/R/Scala, then using an imperative way (like I think key idea of So, I suggest that we can either generalize the |
@haobibo I rather create a new element for simpler types than generalize dataframe. I would welcome the PR and if you need guidance... let me know. |
@lbustelo OK, I will try to draft one or more elements. What about starting with elements like |
Currently,
urth-core-dataframe
is an urth element to bind to or "pull" a DataFrame variable in kernel.For example, when there exists a DataFrame variable named
aDataFrame
in a Python kernel, then user can use these code to bindaDataFrame
from back-end kernel to front-end channel asdf
:This is very useful and convenient when users are send DataFrame variables from back-end kernel to front-end. However, in many circumstances, users need to send a variable with a different data type, for instance, just a String (
str
, in any format, e.g.: JSON, XML, etc.), and then the string will be consumed by another front-end element.As an example, I am currently working on an GraphViz(http://mdaines.github.io/viz.js/) element, which consumes a string that is in the format of
dot
.Surely user can use declarativewidgets.channel().set('var_name', var_value) to pass it to front-end channel. But I guess it wold be more convenient to create an
urth-core-var
dom element to allow users to bind/"pull" value from back-end kernel to front-end channel.As an alternative, a quick but not-elegant solution is:
and
I wonder is there any existing and elegant mechanism in current version of declarativewidgets that meets such needs, or shall we create a general
urth-core-var
element to allow user bind a general variable (usingstr()
orrepr()
to serialize) more conveniently, for example:Even if this is a one-way binding (only pull from back-end kernel to front-end channel and cannot be updated from front-end channel to back-end kernel), it will also be very useful.
The text was updated successfully, but these errors were encountered: