// This program loads the configuration file called "visConfig.json". require(["d3", "model", "chiasm/runtime", "./senseYourCityData"], function (d3, Model, Runtime, senseYourCityData) { // Instantiate the Chiasm runtime within the container. var runtime = Runtime(document.getElementById("container")); // Attach the data API plugin to the runtime. runtime.plugins.senseYourCityData = senseYourCityData; // Load the visualization configuration. d3.json("visConfig.json", function (err, config) { runtime.config = config; }); // Toggle visibility of the configuration editor. d3.select("#gear").on("click", function(){ runtime.getComponent("editor", function(editor){ if(editor.size != "0px"){ editor.size = "0px"; } else { editor.size = "325px"; } }); }); });