Filter elements in d3.js

0

Hello, I am filtering certain content as if it were a search but not what I still do not achieve is to highlight those elements that coincide. My code is as follows:

  BubbleChart.prototype.buscar = function(filterText) {
    //filteredData = data;
    element = d3.select(this);
    filterText = filterText.toLowerCase();
    if (filterText !== ""){
      console.log("entro al IF");
      //this.circles.filter(function(d) { return d.Nombre.toLowerCase().indexOf(filterText) === 0 }).style("fill",'#FFFFFF');
      var test = this.data.filter(function(d) { return d.Nombre.toLowerCase().indexOf(filterText) === 0 });
      //element.style("fill", "#red").style("stroke-width", 2.0).style("stroke", "#555");
      console.log(test);
    }
  };

This is an example of the search I want to achieve:

link

    
asked by ch3k0 10.05.2016 в 17:44
source

0 answers