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
If you have links like A→B→C and another link that skips a layer like A→C, it’s really easy for the A→C link to intersect the B node. To illustrate in the energy flow diagram:
Here the 46 TWh link from Solid (in purple) to Industry (in blue) spuriously intersects Thermal generation and Electricity grid. Likewise the 49 Twh link from Gas to Industry intersects Electricity grid. This is mitigated only by the stroke opacity indicating overlap and that the tangents are not horizontal where the spurious intersection occurs.
One way to reduce these intersections would be to introduce dummy nodes (invisible nodes) in the intermediate layers. Since the link from Solid to Industry spans five layers, you might insert four intermediate dummy nodes: Solid→dummy→dummy→dummy→dummy→Industry. The first would help avoid intersection with Thermal generation, the next with Electricity grid, and so on. Ideally, the dummy nodes would only be used if the link intersected a node… although detecting intersection is tricky, since it requires making an assumption about how the links are rendered, and then complex Bézier math. Another possibility is that we don’t require horizontal tangents for the strokes when using the dummy nodes.
In any case, this isn’t easy—it will also require changing the representation of links so that a path (a sequence of control points) is returned rather than just a source and a target position. But I do think it could make a substantive improvement to the overall layout.
The text was updated successfully, but these errors were encountered:
mbostock
changed the title
Use dummy nodes to avoid confusing intersections.
Dummy nodes to avoid confusing intersections?
Jun 13, 2017
If you have links like A→B→C and another link that skips a layer like A→C, it’s really easy for the A→C link to intersect the B node. To illustrate in the energy flow diagram:
Here the 46 TWh link from Solid (in purple) to Industry (in blue) spuriously intersects Thermal generation and Electricity grid. Likewise the 49 Twh link from Gas to Industry intersects Electricity grid. This is mitigated only by the stroke opacity indicating overlap and that the tangents are not horizontal where the spurious intersection occurs.
One way to reduce these intersections would be to introduce dummy nodes (invisible nodes) in the intermediate layers. Since the link from Solid to Industry spans five layers, you might insert four intermediate dummy nodes: Solid→dummy→dummy→dummy→dummy→Industry. The first would help avoid intersection with Thermal generation, the next with Electricity grid, and so on. Ideally, the dummy nodes would only be used if the link intersected a node… although detecting intersection is tricky, since it requires making an assumption about how the links are rendered, and then complex Bézier math. Another possibility is that we don’t require horizontal tangents for the strokes when using the dummy nodes.
In any case, this isn’t easy—it will also require changing the representation of links so that a path (a sequence of control points) is returned rather than just a source and a target position. But I do think it could make a substantive improvement to the overall layout.
The text was updated successfully, but these errors were encountered: