chart-fx
chart-fx copied to clipboard
refactor layouting code
goals/current problems
- reduce hierarchy depth
- prevent layout/rendering loops caused by resizing during rendering
- increase flexibility (allowing e.g. 3D axes/plots)
- some size computations are currently performed in the render step (mainly computation of axis labels and size)
- tick computations are performed in the rendering step of the axes, but the grid is drawn before the axis (#410)
- correctness: currently the axes and charts rendered are not always consistent in every render loop, which is inconvenient for exporting images of the rendered chart => after the render step is completed, the display should be consistent. (There might be things like clipped/overlapping text until the next repaint if it is not preventable, but the data should be correct.)
current state

scenegraph

implementation
- use a single canvas as the root element to also allow for 3D plots and allow more flexible axis types?
- most chart elements already use a canvas and some sort of coordinate transform
- would need to implement custom mouse event handling
- would decrease the usefulness of common javafx tooling?
- extensibility with standard controls?
- use a custom layouting container which computes the positions of all chart elements in a flat hierarchy
- first compute data ranges from renderers in layout step, then compute axes ticks, then render charts and axes
... to be extended/discussed further