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

Images required? #26

Closed
emmanuelrflores opened this issue Sep 2, 2020 · 4 comments
Closed

Images required? #26

emmanuelrflores opened this issue Sep 2, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@emmanuelrflores
Copy link

emmanuelrflores commented Sep 2, 2020

For my use, we don't need the images. If I take out the nodeImage from the example you have, I get a 'cannot read property 'url' of undefined' at the "add images to pattern" part of the code where it tries to look for an image. Is there something that needs to be done to ignore the image?

The code below is from Chrome dev tools.

// Add images to patterns
        const patternImages = patterns.patternify({
            tag: 'image',
            selector: 'pattern-image',
            data: d => [d]
        })
            .attr('x', 0)
            .attr('y', 0)
            .attr('height', ({
                imageWidth
            }) => imageWidth)
            .attr('width', ({
                imageHeight
            }) => imageHeight)
            .attr('xlink:href', ({
                data
            }) => data.nodeImage.url) <------ HERE
            .attr('viewbox', ({
                imageWidth,
                imageHeight
            }) => `0 0 ${imageWidth * 2} ${imageHeight}`)
            .attr('preserveAspectRatio', 'xMidYMin slice')
@emmanuelrflores
Copy link
Author

Actually, I'm seeing in the latest version there's a check if data.nodeImage exists, but in the version I've pulled from npm it has the above.

@bumbeishvili
Copy link
Owner

@emmanuelrflores you are right, npm version is not updated yet, I will go ahead and will update it right away

@emmanuelrflores
Copy link
Author

Awesome! I'll close this out once it's done. Thank you for the quick reply!

@bumbeishvili
Copy link
Owner

@bumbeishvili bumbeishvili added the bug Something isn't working label Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants