Closed stockiNail closed 2 years ago
I set this as draft because I have forgotten to manage dataset.tree
as array of numbers.
@kurkle do you think a sample is needed (importing zoom plugin)? And some tests (even if we didn't do for datalabels)?
zoom.drag
doesn't seem working...
@kurkle do you think a sample is needed (importing zoom plugin)? And some tests (even if we didn't do for datalabels)?
A sample would be ok. I'm undecided about tests. Let's do those later in any case.
I'm still struggling with zoom.drag
. I'm debugging in CHART.JS and in the controller because the scales are changing their min/max without any reason, only click on the chart. I'm going in deep... it seems something related to meta._parsed array.....
I think it would make things easier to move away from the tree
before doing this.
I think it would make things easier to move away from the
tree
before doing this.
Yes, t could be. But if you agree, I'd like to understand better how it works in CHART.JS (forgive my lack of knowledge on this internal parts of code) and probably this analysis will help me (at least me ;)) to understand better how to remove tree
option in favor to data
(for instance implementing parse
method).
@kurkle if think I understood why I have issues with zoom.drag
.
First of all, it's not related to zoom.drag
itself but it's related to updateRangeFromParsed
method of DatasetController
.
This method is looking for scale.axis
value to calculate the range of the scale and in treemap controller data, we store x
and y
properties (location of the element). CHART.JS is expecting x and y as property for data structure as object.
I think the final solution is to separate the data parsing and the element size calculation (planned for version 3). Now I'm looking for a workaround.
@kurkle Overriding updateRangeFromParsed
method, drag is working.
Off topic: do you know why zoom plugin draw the "drag" rectangle in the beforeDatasetsDraw
hook instead of the after one?
Ready for review. Sorry but the updateRangeFromParsed
issue was time consuming to fix.
@kurkle Overriding
updateRangeFromParsed
method, drag is working. Off topic: do you know why zoom plugin draw the "drag" rectangle in thebeforeDatasetsDraw
hook instead of the after one?
I think its so that for example points/lines are drawn on top of the drag area, but am not sure.
I think its so that for example points/lines are drawn on top of the drag area, but am not sure.
Yes, I didn't add another comment but yes. Nevertheless for treemap, it's quite useless because the drag area is not visible (below the elements). I'd like to submit a PR to zoom plugin, adding drawTime
option to zoom.drag (like in the annotation plugin). What do you think?
Fix #140 Fix #139 codepen: https://codepen.io/stockinail/pen/bGMQRLN