deephaven / deephaven-ipywidgets

Deephaven Community IPython Widget Library
BSD 3-Clause "New" or "Revised" License
4 stars 4 forks source link

feat: Plotly Express iframes, DHC pydeephaven, envoy header fix #29

Closed mofojed closed 10 months ago

mofojed commented 11 months ago

from deephaven_ipywidgets import DeephavenWidget import deephaven.plot.express as dx from deephaven import time_table

tt = 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(tt, lat='Latitude', lon='Longitude', z='Magnitude', radius=10, center=dict(lat=0, lon=180), zoom=0, mapbox_style="carto-darkmatter") display(DeephavenWidget(fig))

- Add support for opening DHC pydeephaven tables
  - Check if we're in a DndSession/the session_manager is there before trying to pull properties from it
  - Fixes #26, Fixes #27
  - Tested using the following snippet:
```python
from pydeephaven import Session
from deephaven_ipywidgets import DeephavenWidget
session = Session(auth_token="iris", auth_type="io.deephaven.authentication.psk.PskAuthenticationHandler")
tt = session.time_table(period=1_000_000_000).update("X=i")
display(DeephavenWidget(tt))

from deephaven import empty_table from deephaven_ipywidgets import DeephavenWidget t = empty_table(1000).update("x=i") display(DeephavenWidget(t))

jnumainville commented 10 months ago

With the incompatibility fix, does this mean the iframe will stay open when the kernel is restarted? If yes, is that something we should fix? Or at least create a ticket for? I'm not sure if there's a large amount of people using those older versions, and we could end up with dangling sessions (as was fixed for newer versions in #22)

mofojed commented 10 months ago

Yes, good call, we I'll create a ticket for older versions to handle. Lower priority though - it'll currently warn in the logs, and the session will eventually be cleaned up after hitting the ping timeout. https://github.com/deephaven/deephaven-ipywidgets/issues/31