Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this be used with Canvas/WebGL? #35

Closed
richardwestenra opened this issue Jul 15, 2020 · 1 comment · Fixed by #36
Closed

Can this be used with Canvas/WebGL? #35

richardwestenra opened this issue Jul 15, 2020 · 1 comment · Fixed by #36
Assignees

Comments

@richardwestenra
Copy link

Hey, we are using this on Kedro-Viz to great effect, but we've been finding that our transitions and rendering are very slow on large graphs, so I've been considering switching the SVG rendering to Canvas/WebGL. But I'd need to find alternatives for all of our functionality first.

From a look over the code, this library appears to convert SVG path d attribute strings into arrays of x/y points, then interpolate them, then convert them back to SVG strings again. But if I wanted to just pass it two pure arrays of points and have it process them as is without converting to/from SVG strings, is there a mechanism to do that? Looks like there might be some private functions to do it but I can't identify exactly where. If it's reasonably doable, would you be happy to expose and document it?

e.g. something like:

import { interpolateRawPath } from 'd3-interpolate-path';

var previous = [[0,0], [50,50]];
var next = [[10,10], [10,20], [150,150]];
var current = interpolateRawPath(previous, next)(0.5);

Thanks for your work on this, I really appreciate it!

@pbeshai
Copy link
Owner

pbeshai commented Jul 15, 2020

Good idea, resolved in v2.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants