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

Ordering of Clustering Arguments #4

Closed wraseman closed 6 years ago

wraseman commented 6 years ago

I've noticed a number of issues with the clustering arguments. First of all, the arguments only seem to work correctly when typed in the correct order (i.e., cluster(k, chartIDs, vars, palette, options, std, hidden))

For instance, the following works as expected:

var ps = Parasol(data)('.parcoords') .cluster(k=3, chartIDs = [0,1,2], vars = cluster_vars, palette = d3.schemeAccent, options = {}, std = true, hidden = true)

But this does not:

var ps = Parasol(data)('.parcoords') .cluster(k=3, chartIDs = [0,1,2], vars = cluster_vars, options = {}, std = true, palette = d3.schemeAccent, hidden = true)

wraseman commented 6 years ago

Also, it would be more intuitive if Parasol.cluster() could be used without the user having to input any arguments at all. To do this, we would need to have a default k (I would suggest 3) and chartIDs (I would suggest all Parasol charts).

joshhjacobson commented 6 years ago

This is a result of the gaps in my knowledge of basic Javascript. Turns out named parameters aren't allowed! The fix is pretty simple though, and will actually be more flexible in the long run. This thread and this thread provide a good idea of what is going on.

I'll close the issue after I implement an official solution.