title: convert local variable to global in d3.js
body: <p>Can I make <strong>data_subset</strong>(<em>pc0.on("brush", function(data_subset)</em>) as global variable?
   I would like to use the filtered data after brushing event in some other code outside this function.
  This is my first project with d3.js(or JavaScript) so I'm sorry if the question doesn't make a lot of sense.</p>
  
  <p>Sample code:</p>
  
  <pre><code>d3.csv('data/cars.csv', function(data) {
  
  
      pc0 = d3.parcoords()("#example0")
        .data(data)
          .bundlingStrength(0) // set bundling strength
          .smoothness(0)
          .bundleDimension("cylinders")
          .showControlPoints(false)
          .hideAxis(["name"])
          .render()
          .brushMode("1D-axes")
          .reorderable()
          .interactive();
  
       // create data table, row hover highlighting
          var grid0 = d3.divgrid();
  
          d3.select("#grid0")
             .datum(data.slice(0,5))
             .call(grid0)
             .selectAll(".row")
             .on({
               "mouseover": function(d0) { pc0.highlight([d0]) },
               "mouseout": pc0.unhighlight
          });
  
            // update data table on brush event
          pc0.on("brush", function(data_subset) {
             d3.select("#grid")
            .datum(data_subset.slice(0,5))
            .call(grid0)
            .selectAll(".row")
            .on({
              "mouseover": function(data_subset) { pc0.highlight([data_subset]) },
              "mouseout": pc0.unhighlight
            });          
  
        });
  </code></pre>