You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
If you have data with highly nested nodes, it might be preferable to only show a few levels at a time, diving deeper as you select inner nodes.
If the data were TOO big (so performance would lag if you send it all to the front end) you need to do something like usage_backend_update_via_selections to fetch the appropriate data whenever the selection changes. But for intermediate-size data, we should be able to simply restrict the number of visible levels by adding a prop called something like maxLevels.
The key to this will be altering the radial range, which is set by selectedY
d3.layout.partition (note we're using v3 here) sets node.y and node.dy for all nodes such that the root node has y=0 and the deepest level of nesting has y+dy=1, while dy is 1/(total number of levels)
So the main thing we need is to change selectedY from:
ie if maxLevels is 0 or missing, keep the current behavior, otherwise restrict the end of the radial range to no more than the requested number.
Then maxLevels needs to be propagated up from the d3 component to the react wrapper component (the d3 component receives props from the react component as figure here)
It's possible that other things will be needed, like explicitly removing text and/or path elements that are collapsed against the outside edge... we'll have to see how it looks and performs to determine if this is needed.
The text was updated successfully, but these errors were encountered:
If you have data with highly nested nodes, it might be preferable to only show a few levels at a time, diving deeper as you select inner nodes.
If the data were TOO big (so performance would lag if you send it all to the front end) you need to do something like
usage_backend_update_via_selections
to fetch the appropriate data whenever the selection changes. But for intermediate-size data, we should be able to simply restrict the number of visible levels by adding a prop called something likemaxLevels
.The key to this will be altering the radial range, which is set by
selectedY
d3.layout.partition
(note we're using v3 here) setsnode.y
andnode.dy
for all nodes such that the root node hasy=0
and the deepest level of nesting hasy+dy=1
, whiledy
is 1/(total number of levels)So the main thing we need is to change
selectedY
from:to something like:
ie if
maxLevels
is0
or missing, keep the current behavior, otherwise restrict the end of the radial range to no more than the requested number.Then
maxLevels
needs to be propagated up from thed3
component to thereact
wrapper component (thed3
component receives props from thereact
component asfigure
here)It's possible that other things will be needed, like explicitly removing text and/or path elements that are collapsed against the outside edge... we'll have to see how it looks and performs to determine if this is needed.
The text was updated successfully, but these errors were encountered: