ParasolJS / parasol-es

ES6 module for interactive visualization of multi-objective optimization problems
https://parasoljs.github.io/
MIT License
26 stars 5 forks source link

Unexpected behavior when calling .cluster() multiple times while using grid #13

Closed wraseman closed 5 years ago

wraseman commented 5 years ago

@joshhjacobson, I am creating an example in which a slider is used to define the number of clusters: image It's working well, just one hiccup. Every time the data is re-clustered, a new cluster column is added to the grid. The way I've implemented it is equivalent to this:

ps.attachGrid({container: '#grid'})
  .linked()
  .cluster({k: 4})
  .cluster({k: 3})
  .cluster({k: 2})
  .cluster({k: 3})

I think this could be fixed in cluster.js between lines 104 and 106. Could you take a stab at it when you have a chance? The same would probably have to be done for aggregateScores.js but I'm not positive.

joshhjacobson commented 5 years ago

Good catch! Yeah I think this should be a simple fix. I'll try to get to it over the weekend.