RhoInc / Webcharts

Reusable, flexible, interactive charts with JavaScript
MIT License
34 stars 6 forks source link

Allow a single control input to change multiple config properties. #18

Open jwildfire opened 8 years ago

jwildfire commented 8 years ago

Something like this? { type: "dropdown", options: ["x.column","marks[0].per[0]"], label: "Group by", values: ["Sector", "PrimaryFunction", "year", "Title"], require: true },

jwildfire commented 8 years ago

Right now you have to do something gross like this:

myChart.on("layout",function(){
    var chart=this;
    this.controls.wrap
    .select(".control-group").select("select")
    .on("change",function(){
      var value = d3.select(this).property("value");
      chart.config.marks[0].per[0]=value
      chart.config.x.column=value
      chart.draw()
    })
})
nbryant commented 8 years ago

this is actually already implemented (but undocumented) for control.type: 'dropdown'; should be easy to allow other control types to do the same.

emmorris commented 7 years ago

Update the wiki and implement this for all other control types except for subsetter.