fair-acc / chart-fx

A scientific charting library focused on performance optimised real-time data visualisation at 25 Hz update rates for data sets with a few 10 thousand up to 5 million data points.
GNU Lesser General Public License v3.0
507 stars 93 forks source link

[10pt, 10pt]Restructure layout computations to make rendered output more consistent #579

Closed wirew0rm closed 1 year ago

wirew0rm commented 1 year ago

Goals:

Items to be investigated implemented:

ennerf commented 1 year ago

As per discussion on June 21 with Alex and updated July 21.

Deterministic layout and hierarchy changes

Smaller changes that would be better in a separate PR.

ennerf commented 1 year ago

I think the goals have all been achieved and are ready for review. The style nodes ended up not being necessary.

ennerf commented 1 year ago

Below are some before and after pictures

Before After Comment
image image The chart anatomy parts can still be fully accessed, but without the need for StackPane wrappers
image image All of the extra layout panes were removed and have been replaced with a small hierarchy of custom panes. Axis layouts are now deterministic and can be done without recursion.
image image labels don't disapper when resizing
image image tick label spacing is now computed correctly
image image disabled ranges now correctly remove the invalid tick labels (bottom left)
image image enabling an axis does not break the label positioning anymore
image image all rotations and overlap strategies get correctly rendered

Most importantly, the data rendered on the chart is now always consistent with the value shown on the axes.

Here is a video of one of our applications that used to have significant rendering issues: Deterministic Layout PR