ashiguruma / patternomaly

Easily generate patterns for use in data graphics
MIT License
524 stars 37 forks source link

duplicates when auto-generating patterns #34

Open theme1256 opened 4 years ago

theme1256 commented 4 years ago

I have an issue with the auto-generation of patterns. Sometimes it generates the same pattern twice, which kinda defeats the purpose.

In my implementation, it happens more often than, what might be good.

image

barath99 commented 2 years ago

You can create an array of patterns as a workaround for this issue, like below:

let patterns = [ draw('square', '#1f77b4'), draw('line', '#ff7f0e'), draw('triangle', '#2ca02c')]

And accessing the elements through a loop might solve this issue of duplicates.