deephaven / streamlit-deephaven

Deephaven Streamlit custom component
MIT License
1 stars 3 forks source link

feat: Pydeephaven support and general widgets #6

Closed jnumainville closed 7 months ago

jnumainville commented 7 months ago

Adds support for pydeephaven tables as well as general widgets Fixes #4, fixes #5 Tested with the following code

start_server(jvm_args=["-Ddeephaven.jsPlugins.plotly-express=/Users/josephnumainville/Documents/deephaven-plugins/plugins/plotly-express/src/js",
                       "-DAuthHandlers=io.deephaven.auth.AnonymousAuthenticationHandler"])
st.subheader("Streamlit Deephaven")

import deephaven.plot.express as dx
from deephaven import time_table
tt1 = time_table("PT1S").update(formulas=[
    "Latitude = Math.random()*180.0 - 90.0",
    "Longitude = Math.random()*360.0 - 180.0",
    "Magnitude = Math.random()*3 + 5"
    ])

fig = dx.density_mapbox(tt1,  lat='Latitude', lon='Longitude', z='Magnitude', radius=10,
                        center=dict(lat=0, lon=180), zoom=0, mapbox_style="carto-darkmatter")

display_dh(widget=fig)

from pydeephaven import Session
session = Session()
tt2 = session.time_table(period=1_000_000_000).update("X=i")

# Display the table.
display_dh(tt2)
jnumainville commented 7 months ago

@mofojed these are the changes that I think should work for widgets but whenever I try to access them I see an error (even when I go directly to the iframe link for a figure created in the UI directly this happens - http://localhost:10000/iframe/widget/?name=fig)

Screenshot 2024-01-23 at 3 11 13 PM
mofojed commented 7 months ago

@jnumainville what version of core are you using here? What's the stack trace? The embedded widget is working in the latest version of core, so I'm wondering if you just need an update (or if we truly screwed something up).

jnumainville commented 7 months ago

@mofojed Engine Version: 0.33.0-SNAPSHOT Web UI Version: 0.59.0 Java Version: 11.0.19 Barrage Version: 0.6.0

Not sure how helpful this stack trace is

Screenshot 2024-01-25 at 12 53 13 PM
mofojed commented 7 months ago

@jnumainville did those issues get resolved? I saw you demo'ed on Friday

jnumainville commented 7 months ago

@mofojed No, this applies specifically to the widget iframes, looking at plotly-express in particular

mofojed commented 7 months ago

I'm trying on the latest and it looks like it's working correctly:

image

If anything there seems to be a problem with the plotly-express plugin, when I tried with the latest version of that. This change is looking good.