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

dx charts flickering on every update within a panel #1063

Open
jnumainville opened this issue Dec 13, 2024 · 1 comment
Open

dx charts flickering on every update within a panel #1063

jnumainville opened this issue Dec 13, 2024 · 1 comment
Labels
bug Something isn't working triage

Comments

@jnumainville
Copy link
Collaborator

Description

dx charts are flickering on every update within a panel, even with memoization

Steps to reproduce

Run the following code

from deephaven import ui
import deephaven.plot.express as dx
from deephaven import agg

iris = dx.data.iris()

@ui.component
def create_chart():
    return dx.histogram(iris, x="SepalLength")

@ui.component
def flickering_memo():
  chart = ui.use_memo(lambda: create_chart(), [])
  text, set_text = ui.use_state(False)

  return [
    ui.button(text, on_press=lambda: set_text(not text)),
    chart
  ]

output = flickering_memo()

Then click the button

Expected results

Button changes value but chart does not change at all

Actual results

Chart quickly flickers

Versions

Engine Version: 0.37.1
Web UI Version: 0.99.2
Python Version: 3.8.19
Java Version: 19.0.1
Groovy Version: 3.0.22
Barrage Version: 0.7.2
Browser Name: Chrome 131
User Agent OS: macOS 10.15.7
@deephaven/js-plugin-plotly-express: 0.12.0
@deephaven/js-plugin-ui: 0.23.1

@jnumainville jnumainville added bug Something isn't working triage labels Dec 13, 2024
@jnumainville
Copy link
Collaborator Author

It's worth noting that the flickering is because of @ui.component

This does not flicker:

from deephaven import ui
import deephaven.plot.express as dx
from deephaven import agg

iris = dx.data.iris()

def create_chart():
    return dx.histogram(iris, x="SepalLength")

@ui.component
def flickering_memo():
  chart = ui.use_memo(lambda: create_chart(), [])
  text, set_text = ui.use_state(False)

  return [
    ui.button(text, on_press=lambda: set_text(not text)),
    chart
  ]

output = flickering_memo()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant