-
-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReactiveHTML table issue with param.Array() and callbacks #3456
Comments
Holy cow, i missed the part where naming an From the user guide: Also, i was able to re-work the above to use |
Can you please isolate the problem with param.Array and raise an issue on the Param repo about it? It sounds like it should be independent of ReactiveHTML and Panel. |
I honestly don't know enough about how it works to isolate the issue. Also, it seems related to Panel since the error is raised in
Perhaps someone who has some more experience than I can point me in the right direction. |
Ah, good point. That looks like Bokeh would need the fix, so it can properly handle array values. |
Bokeh has completely rewritten their serialization protocol so I don't believe this will be an issue in Bokeh 3.0. Unfortunately I think it will also be a little while until that is released and we have upgraded to that version so I'll see if there's a workaround. |
Turns out I had already identified this as a bug and created an issue on bokeh: bokeh/bokeh#11735 |
Pushed up a temporary fix in Panel which I should be able to remove once the Bokeh 3.0 release is out. |
I've been working on a reactiveHTML table implementation and have gotten a lot of help on discord here.
But i think i've now run into some real bugs. It seems like there are some problems with callbacks using
param.Array()
parameters.I want to be able to move data between python and js, i was able to get data out of js once i realized that i must assign a new object to a param in the
data.
object, modifying one in place didnt seem to trigger the magic that updates the param on the python side (some more documentation on how this works would be great).Now, going the other way, trying to assign a new value to a param.Array() object from python triggers the following error.
This feels like an issue with the implementation of param.Array(), but i really dont know enough about whats going on under the hood to have a real sense.
if i am able to get around this issue, will updating the
data.
object in js magically update my table? it seems like probably not since i am using jinja templating instead of the${}
syntax. The user guide is very vague on what is actually different in that case, but says "The difference between Jinja2 literal templating and the JS templating syntax is important to note. While literal values are inserted during the initial rendering step they are not dynamically linked.".I have had no luck using the
${}
syntax with aparam.Array
it causes the followingValueError: Array parameter 'axis0' value must be an instance of ndarray, not Str(ndarray, sizing_mode='stretch_width').
Is there a way to trigger a js callback from python explicitly without all the magic around params?
ALL software version info
Description of expected behavior and the observed behavior
I expect to be able to assign a new array to a
param.Array()
object in python to pass the new data to the jsdata.
object.Complete, minimal, self-contained example code that reproduces the issue
This example is not as minimal as id like, but should demonstrate.
If you edit a value in the top row, it should trigger the
update_axes
callbackthe first several lines of which work, returning
I think this shows that editing the
data
param in place does not trigger theupdate_data
callback, but then does call it when re-assigning the whole parameter. That does update thedata
param on the python side, but is not passed to js. Then, trying to assign random data to thedata
param appears to actually trigger updating the js which fails with the value error.That does however trigger the
update_data
callback again, but again hasn't passed any data to .js.The text was updated successfully, but these errors were encountered: