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

Can't switch between tabs that contain dx plots #6447

Closed
mofojed opened this issue Nov 28, 2024 · 1 comment · Fixed by #6446
Closed

Can't switch between tabs that contain dx plots #6447

mofojed opened this issue Nov 28, 2024 · 1 comment · Fixed by #6446
Labels
bug Something isn't working triage

Comments

@mofojed
Copy link
Member

mofojed commented Nov 28, 2024

Description

If your tabs contain dx plots, when you try and switch between them it throws an error.

Steps to reproduce

  1. Run the following:
from deephaven import empty_table, ui
from deephaven.plot import express as dx

_sin = empty_table(100).update(["x=i", "y=Math.sin(i)"])
_cos = empty_table(100).update(["x=i", "y=Math.cos(i)"])

trigs = ui.tabs(
    ui.tab(_sin, dx.line(_sin, "x", "y"), title="Sin"),
    ui.tab(_cos, dx.line(_cos, "x", "y"), title="Cos"),
)
  1. Switch between the Sin/Cos tabs

Expected results
2. Should be able to switch between tabs without error

Actual results
2. There is an error thrown when switching tabs:

TypeError

_b.close is not a function

TypeError: _b.close is not a function
    at _PlotlyExpressChartModel.removeTable (eval at <anonymous> (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:992:34160), <anonymous>:86071:68)
    at eval (eval at <anonymous> (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:992:34160), <anonymous>:85802:52)
    at Map.forEach (<anonymous>)
    at _PlotlyExpressChartModel.unsubscribe (eval at <anonymous> (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:992:34160), <anonymous>:85802:28)
    at g.unsubscribe (http://localhost:10000/ide/assets/Chart-BRoqp4Ye.js:1:5882)
    at g.componentWillUnmount (http://localhost:10000/ide/assets/Chart-BRoqp4Ye.js:1:5307)
    at Qpe (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:39:3481)
    at G5e (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:39:5337)
    at $et (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:41:3881)
    at e.unstable_runWithPriority (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:26:3824)
    at ag (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:37:38797)
    at vv (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:41:1836)
    at gF (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:39:11114)
    at http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:37:39024
    at e.unstable_runWithPriority (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:26:3824)
    at ag (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:37:38797)
    at C5e (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:37:38970)
    at Tp (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:37:38903)
    at K2e (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:41:18391)
    at fJe (http://localhost:10000/ide/assets/vendor-uUWsOC0P.js:37:17687)

Additional details and attachments

image

Versions

Engine Version: 0.37.0
Web UI Version: 0.99.0
Java Version: 17.0.12
Groovy Version: Unknown
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

@mofojed mofojed added bug Something isn't working triage labels Nov 28, 2024
@mofojed
Copy link
Member Author

mofojed commented Nov 28, 2024

Investigating the issue, it looks like we try to close the TableSubscription, but that doesn't have a .close() method exposed anymore:
image
TableSubscription used to have a close() method, seems it was removed (inadvertently?) with the JS API refactor: https://github.com/deephaven/deephaven-core/pull/5890/files#diff-2549129f59ef633fee2fa8847e45372ca5d2c137b6cf679973f6823f2a5742d2

It looks like it's on AbstractTableSubscription, but that doesn't seem to be exposed from the subclass in JS.

@mofojed mofojed transferred this issue from deephaven/deephaven-plugins Nov 28, 2024
mofojed added a commit to mofojed/deephaven-core that referenced this issue Nov 29, 2024
- The close() method is only on `AbstractTableSubscription`, and it
appears that it doesn't automatically get added to the JS API even
though `TableSubscription` is defined as a `JsType`
- Explicitly add the method to `TableSubscription` as well.
- Fixes deephaven#6447
devinrsmith pushed a commit that referenced this issue Dec 5, 2024
- The close() method is only on `AbstractTableSubscription`, and it
appears that it doesn't automatically get added to the JS API even
though `TableSubscription` is defined as a `JsType`
- Explicitly add the method to `TableSubscription` as well.
- Fixes #6447

---------

Co-authored-by: Colin Alworth <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant