deephaven / streamlit-deephaven

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

adding custom url token #3

Closed jnumainville closed 1 year ago

jnumainville commented 1 year ago

Fixes #2

Ran in dev mode: DH_DEV_MODE=true streamlit run streamlit_deephaven/__init__.py

this code:

import streamlit as st

start_server()

st.subheader("Deephaven Component Demo")

# Create a deephaven component with a simple table
# Create a table and display it
from deephaven import time_table
from deephaven.plot.figure import Figure
t = time_table("00:00:01").update(["x=i", "y=Math.sin(x)", "z=Math.cos(x)"])
os.environ["DEEPHAVEN_ST_URL"] = "http://localhost:1234"
display_dh(t, height=200)

f = Figure().plot_xy(series_name="Sine", t=t, x="x", y="y").show()
f = f.plot_xy(series_name="Cosine", t=t, x="x", y="z").show()
display_dh(f, height=400)

And verified that the iframe url started with "http://localhost:1234"