qrohlf / trianglify

Algorithmically generated triangle art
http://qrohlf.com/trianglify/
GNU General Public License v3.0
10.08k stars 669 forks source link

Passing destSVG to pattern.toSVG() does not work; implementation is missing 🤦‍♂️ #134

Closed IsakUlstrup closed 3 years ago

IsakUlstrup commented 3 years ago

From the docs:

If an existing svg element is passed as the destSVG, this function will render the pattern to the pre-existing element instead of creating a new one.

The way I understand it, the attached code should work, but it doesn't. In fact it doesn't seem like passing destSVG does anything. Am I missing something?

codePen

qrohlf commented 3 years ago

@IsakUlstrup - you're right, I just looked at the code and the implementation for destSVG is completely missing. I think I accidentally deleted it when I refactored some of the SVG serialization code!

I'll update and push a new version soon. In the mean time, you'll need to make do without destSVG!

qrohlf commented 3 years ago

TODO list:

IsakUlstrup commented 3 years ago

Cool, thanks!

qrohlf commented 3 years ago

@IsakUlstrup got the implementation done (very easy change), still need to write tests before I merge it though.

In the mean time, you can npm install --save trianglify@next and that'll get you going with the fixed code.

qrohlf commented 3 years ago

This is now available in master (npm install --save trianglify@4.1.1)