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

Live plot is blank on initial open #597

Open
MisterMartin opened this issue Mar 9, 2023 · 2 comments
Open

Live plot is blank on initial open #597

MisterMartin opened this issue Mar 9, 2023 · 2 comments
Assignees
Labels
bug reported bug

Comments

@MisterMartin
Copy link
Member

For some instruments, the live plot starts out with now data. If you active the live update and wait a little while, it will eventually populate.

This behavior appeared in 1.1.0-rc3. But the live plot was completely broken before that.

See the 3d PAWS portal. Instrument id's 1 & 3 behave properly, but instruments ids 4 & 5 demonstrate this behavior.

@MisterMartin MisterMartin added the bug reported bug label Mar 9, 2023
@mdye
Copy link
Collaborator

mdye commented Mar 10, 2023

I tracked down one of the problems, and have created a branch to fix the issue: highcharts-fix-597

One of the variable names contained a tab at the end of it's name ("MCP Temperature 1 "). When out dynamically created code tried to turn this in to JSON for the highcharts label it broke (JSON required tabs -among other things - the be escaped). The fix is to trim whitespace from the beginning and end of the variable names while generating the JSON.

This gets the plot to load, but there is still an error preventing the live updating. I'm working on that next.

@mdye
Copy link
Collaborator

mdye commented Mar 10, 2023

I was able to fix another bug, also on the highcharts-fix-597 branch.

In generating the graph, data for multiple variables are returned simultaneously. When there were data for one variable but not another there was not a check to make sure the (multidimensional) array was not empty before attempting to access sub-elements of that array.

E.g. live_last_times[series_index] = points[points.length - 1][0];

The fix is the verify that the array contains at least one element before accessing it:
if (points.length > 0) { live_last_times[series_index] = points[points.length - 1][0]; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug reported bug
Projects
Status: In progress
Development

No branches or pull requests

2 participants