Fix Treemap zoom when a group level is null
#1676
Merged
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.
When a
Group by
withnull
values was present in a parent group using the"Treemap"
plugin, zooming in from that level and back out would fail to properly draw the original treemap. This occurred only when zooming, as the bug is not related to the initial SVG render itself, but the attribute-modifying zoom-in/zoom-out code that changes visibility/position of the treemap SVG elements. Here, group identity was checked using the column encoding"name1|name2"
and.split("|")
, which encodes[null]
as an empty string and is indistinguishable from[]
. However, this string-encoding is only used a few times, and is generated from the correctArray
representation only for treemaps, so this PR just replaces just it with this originalArray
and removes the string-decoding for the handful of usages.This is related to #1628 and has the same behavior, except in a much narrower context e.g. only in the presence of
null
groups. This fix however is completely un-related to the fix in #1652.