Open hayden-t opened 1 year ago
This is a bad idea to do it like this because you never know when the API changes and touches your custom value.
JavaScript offers symbols for that use case. https://javascript.info/symbol
Anyway, I think the documentation should mention that the cells sites contain references to your original sites objects, since this is useful to know. Otherwise, you might assumes the cells sites are just copies of those sites.
var sites = [ {x: 200, y: 200, specialValue: yes}]
and then that specialValueis now attached in the output of cells when the voronoi is calculated:
diagram.cells[i].site['specialValue']