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

Interpolating curved paths #77

Closed
ludvigalden opened this issue May 4, 2018 · 3 comments
Closed

Interpolating curved paths #77

ludvigalden opened this issue May 4, 2018 · 3 comments
Labels
kind: request New feature or request that should be actioned

Comments

@ludvigalden
Copy link

ludvigalden commented May 4, 2018

Interpolating the following gives a 'Uncaught TypeError: Cannot read property 'push' of undefined':

const toggledPathCurved = "M0.9,19c-9.2,0,56.5,0,48.4,0C34.3,19,32,0.6,25.1,0.6S12.4,19,0.9,19z";
const disabledPathCurved = "M0.9,38c-9.2,0,56.5,0,48.4,0c-15,0-17.4,0-24.3,0S12.4,38,0.9,38z";

While these paths work fine:

const toggledPathSimple = "M20,380 L380,380 L380,380 Z";
const disabledPathSimple = "M20,20 L20,380 L380,380 Z";

I'm guessing it has to do with the curves.

@drcmda
Copy link
Member

drcmda commented May 4, 2018

You can only interpolate matching patterns, it doesn’t know what svg paths are otherwise, but if the structure matches it can manage, for instance if the number of points is the same as well as the format. For more complex paths use a custom interpolater, there’s an example in the examples page using flubber.

@AlexanderBollbach
Copy link

couldn't the error here be improved? i burned over an hour because some function deep in the stack was throwing a generic array error and finally found out its most likely because each path had different number of points

@drcmda drcmda reopened this Jul 21, 2018
@drcmda drcmda added the kind: request New feature or request that should be actioned label Jul 21, 2018
@drcmda
Copy link
Member

drcmda commented Jul 21, 2018

Maybe assert in develop mode would be a good idea. I can see how confusing this must've been for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: request New feature or request that should be actioned
Projects
None yet
Development

No branches or pull requests

3 participants