Skip to content
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

fix: Ensure title is added to default figure #396

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

jnumainville
Copy link
Collaborator

Fixes #147

This was because the title was not being added to the default figure, but it should be as it is assumed to never change.

Tested with the code in the issue as well

from deephaven import empty_table, merge, time_table
from deephaven.plot import express as dx

t0 = empty_table(0).update(["x=i", "y=i*Math.random()*i", "z=i%5"])
t1 = empty_table(10).update(["x=i", "y=i*Math.random()*i", "z=i%5"])
t2 = time_table("PT1s").update(["x=i", "y=i*Math.random()*i", "z=i%5"]).drop_columns(["Timestamp"])
t3 = t2.where("x > 1")
p0 = dx.line(t0, x="x", y="y", by=["z"], title="Hello World0")
p1 = dx.line(t1, x="x", y="y", by=["z"], title="Hello World1")
p2 = dx.line(t2, x="x", y="y", by=["z"], title="Hello World2")
p3 = dx.line(t3, x="x", y="y", by=["z"], title="Hello World3")

@jnumainville jnumainville requested a review from mofojed April 2, 2024 17:51
@jnumainville jnumainville self-assigned this Apr 2, 2024
@dsmmcken
Copy link
Contributor

dsmmcken commented Apr 2, 2024

as it is assumed to never change.

maybe not a relevant comment, but titles can change if it was a dh.ui variable yeah?

@ui.component
def mycomponent():
  [my_title, set_title] = useState()
  i = ui.input("", onchange ... set_title)
  p=dx.line(t, title=title)

@jnumainville
Copy link
Collaborator Author

as it is assumed to never change.

maybe not a relevant comment, but titles can change if it was a dh.ui variable yeah?

@ui.component
def mycomponent():
  [my_title, set_title] = useState()
  i = ui.input("", onchange ... set_title)
  p=dx.line(t, title=title)

Yes titles can change in that case, but that creates a new chart, it doesn't modify this one.
This case was already handled by #386

@jnumainville jnumainville merged commit 2f0a8a0 into deephaven:main Apr 3, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deephaven express figure titles does not appear if data starts out blank
3 participants