CANVE / canve-viz

CANVE visualizer UI
3 stars 1 forks source link

Display text labels along edges #54

Closed danielabar closed 8 years ago

danielabar commented 8 years ago

SVG textPath can be used to draw text along a path (which the edges have been converted to from lines as part of #48 ).

As part of #48, this has been used to display edgeKind along the edge path. Now a few more complexities to handle:

danielabar commented 8 years ago

To detect upside down, consider a point that is drawn to the right of the given source point, some distance (eg: x+10), and on the same y plane. Now label the source point a fixed point. Then calculate the angle between the newly added point and the target point, using the fixed point as an anchor.

Then use the angle to determine:

matanox commented 8 years ago

+1 for the trigonometry

matanox commented 8 years ago

Pointwise: label should likely animate along the "neighbors" highlight animation, for harmony, other considerations aside... (how it would animate (color tween, size tween, font weight tween) depends on the overall harmony).