Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

testing react.js with svg graph rendering #2

Open
forresto opened this Issue · 10 comments

3 participants

@forresto
Owner

wheel zoom
react-svg-zui

@forresto forresto referenced this issue in the-grid/the-graph
Closed

svg #66

@forresto
Owner

zui prototyping

svg-icon-zui

@forresto
Owner

Just prototyping with the one new thing + vanilla svg. But I'm interested to see if ART+canvas can speed stuff up to 60fps. From working with vanilla canvas 2d, I imagine that the number of draw commands would be fine. Seems like React's functional structure will make it easy to switch.

The big constraint for us is clicking on overlapping curves, and SVG makes that easy. Somebody said art might do that level of hit testing... @subtleGradient know if that's right?

(SVG Font Awesome looks pretty good in there too, and css is easy... but we'll go canvas if it's worth it.)

@subtleGradient

ART can render to SVG, canvas or VML. I'm not sure about the hit testing. @sebmarkbage How's ART for hit-testing?

@forresto forresto referenced this issue in noflo/noflo-ui
Closed

graph autolayout testing #53

@sebmarkbage

ART does hit testing the same way SVG does. Uses isPointInPath.

Also working on a different hit testing that can trace nearest path without actually hitting it.

@sebmarkbage

Oh actually, we may not handle hit testing on strokes. Should fix that.

@subtleGradient

You'd probably want to expand the stroke's hit area far larger than its visible pixels.

@sebmarkbage

People tend to do that by doing a fat invisible stroke. That's a naive solution though because when you have overlapping lines, the nearest line to your pointer may not be the top invisible one. Which gives a bad experience. That's why we don't use this technique and don't have a strong need to support hit testing on strokes.

Instead, I want to release the hit testing plugin for React that tracks the nearest line rather than an invisible hit area. That's a much better solution.

It works like this http://bl.ocks.org/mbostock/8027637 but uses a more efficient algorithm for common use cases.

@forresto
Owner
@forresto forresto referenced this issue from a commit
@forresto drag groups #2 82a93e9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.