1

What's the correct way to load a new set of metrics/horizons? i.e. if a user were allowed to choose from a list of metrics in a multi-select.

Right now, I have a working implementation that simply runs d3.select('#graph1').html(''); and reruns the horizon setup d3.select("#graph1").selectAll(".horizon").data(my_datum.map(load_metric)).enter().insert("div", ".bottom"); BUT this seems to cause all previously loaded to to disappear from the horizon after an incremental set is loaded.

Martin
  • 770
  • 6
  • 22
  • 1
    I'm not familiar with cubism, but in D3 you would use the enter/update/exit pattern described e.g. in [this tutorial](http://mbostock.github.io/d3/tutorial/circle.html). – Lars Kotthoff Sep 06 '13 at 08:31
  • I read the docs some more and found: `d3.select(".horizon").call(horizon.remove).remove();` BUT this doesn't work if the horizons are created in chain call `d3.select("body").selectAll(".horizon").data(metrics).enter().append("div").attr("class", "horizon").call(horizon);` https://github.com/square/cubism/wiki/Horizon#wiki-remove – Martin Sep 06 '13 at 21:30

0 Answers0