push hover labels in to the bar group extent in compare mode #2414
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2350
Adds an extra step to
Bar.setPositions
to record the position extent of each bar group, which includes two loops over the data: one to find the min and max position of the trace group, and a second to calculate the extents. I did it this way because calculating this on the fly inhoverPoints
is fairly awkward, you either have to loop over traces once for each trace (repetitious) or you could modify the hover data after finishinghoverPoints
, manipulating all the bar traces in the hover data to match their position axis coordinates (adding type-dependent logic toFx.hover
directly)... this way seemed cleaner. There may be ways to move some of these calculations into existing loops insetPositions
but the way these are set up this seems like it would entail a lot of duplication, and anyway I don't expect this to be a noticeable overhead for bars.cc @etpinard