jlab-sensing / DirtViz

DirtViz is a project to visualize data collected from sensors deployed in sensor networks.
https://dirtviz.jlab.ucsc.edu/
MIT License
4 stars 8 forks source link

Aligning axis doesn't work with negative datasets #280

Open aaron-wu1 opened 1 month ago

aaron-wu1 commented 1 month ago

Describe the Bug

In alignAxis.js the logic used to calculate tick steps and max tick doesn't work with datasets with only negative datapoints. Need to refactor the math to account for negative ranges. Currently, the charts are also set to have y=0 as the minimum value. To account for purely negative datasets, a possible new service might need to be incorporated to handle this case so that y=0 is not the minimum value.

To Reproduce

Use a dataset with only negative integers.

Expected Behavior

The chart's axis should be formatted so that instead of a tickMax, it accounts for a tickMin for the negative dataset

Screenshots

If applicable, add screenshots to help explain your problem. Please use markdown code blocks for any code.

Environment

N/A

Additional Context

N/A