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

Chart plotBy does not wait for all series to load before displaying #1654

Closed
mattrunyon opened this issue Nov 20, 2023 · 0 comments · Fixed by #1729
Closed

Chart plotBy does not wait for all series to load before displaying #1654

mattrunyon opened this issue Nov 20, 2023 · 0 comments · Fixed by #1729
Assignees
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@mattrunyon
Copy link
Collaborator

mattrunyon commented Nov 20, 2023

Description

When using a plotBy, the chart will remove the loading spinner and fire its load finished event as soon as the 1st series data arrives.

This is because for a regular series/chart, the figure object from the server includes the series to plot so we can populate seriesToProcess.

For a multi-series (plotBy), the figure from the server does not include any of the actual series. So the seriesToProcess set is always empty if we have a plotBy.

I think instead of populating seriesToProcess in initAllSeries, it should be part of addSeries. Then also remove from that set if the series is inactive in initAllSeries. A plotBy sends series added events which trigger addSeries. Then we would need to not fire updated events until the load is finished. Right now we fire updated events regardless of if we're waiting on other series.

Steps to reproduce

  1. Create a chart with a plotBy in Python. This example takes advantage of downsampling being slow when there are nulls to show the series loading in at different times.
from deephaven import empty_table
from deephaven.plot.figure import Figure

t = empty_table(80000).update(["Timestamp=epochMillisToInstant(i)","x=(double)i", "y=i%12==11?null: i%5==0 ? i*2 : i", "series= i%5==0 ? `Double` : `Single`"])
f = Figure().plot_xy(series_name="Hello", t=t, x="Timestamp", y="y", by=["series"]).show()

Expected results

Loading spinner goes away when both series have loaded.

Actual results

One series displays, then 1-2 seconds later, the other series displays.

Additional details and attachments

This was discovered because I was using the load finished event to detect when the data has arrived for the docs snapshot tool. This doesn't work with plotBy and recently an unresolved promise started appearing because of this case.

@mattrunyon mattrunyon added bug Something isn't working triage Issue requires triage labels Nov 20, 2023
@vbabich vbabich added this to the December 2023 milestone Nov 21, 2023
@vbabich vbabich removed the triage Issue requires triage label Nov 21, 2023
@mofojed mofojed added the good first issue Good for newcomers label Nov 21, 2023
@mofojed mofojed assigned mofojed and ethanalvizo and unassigned mofojed Dec 6, 2023
@mofojed mofojed modified the milestones: December 2023, January 2024 Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants