benfred / venn.js

Area proportional Venn and Euler diagrams in JavaScript
MIT License
1.04k stars 218 forks source link

Adding + removing circles re-use same colors #100

Closed glentakahashi closed 7 years ago

glentakahashi commented 7 years ago

For example, if you start with two circles blue + green, remove one of them, then add another back, both with be blue.

This is when you dynamically update the data

benfred commented 7 years ago

Do you have an example? This should just work.

For instance in this post http://www.benfrederickson.com/distance-metrics - if you change the artist to something unrelated , and then change back to the original the colours for each artist will be the same as when first presented

glentakahashi commented 7 years ago

Sorry my bad, I wasn't re-using the same VennDiagram object. (I was creating a new one on each call).

I got this working