Como aplicar um filtro e malha a um Choropleth D3

Eu estou trabalhando com uma variação deChoropleth Quantile de Bostock.

Eu dimensionei a projeção com sucesso e integrei meus próprios dados. Atualmente, também estou filtrando os dados dos condados de json para incluir apenas os IDs do condado começando com o ID do estado 48.

Tudo funciona perfeitamente, no entanto, ainda preciso aplicar a função .mesh para combinar os arcos entre os países vizinhos. Caso contrário, quando adiciono um efeito de foco instantâneo, obtenho bordas estranhamente desiguais.

Tentei substituir a chamada de dados por uma chamada de referência (malha) em vez (veja a linha comentada abaixo) mas não funcionou.

Aqui está o meu código de trabalho:

function ready(error, us) {
  if (error) throw error;

    //define the feature of the states from the topojson file, then filter so only state 48 (texas) shows
  var states = topojson.feature(us, us.objects.states),
  state = states.features.filter(function(d) { return d.id === 48; })[0];

    //define the features for the counties and filter based on number (starting with 48)
  var counties = topojson.feature(us, us.objects.counties),
  mycounties = counties.features.filter(function(d) { if(d.id >= 48000 && d.id <=49000) return d.id; });

    //initiate the class for the state, and add an outline path
  svg.append("path")
      .datum(state)
      .attr("class", "outline")
      .attr("d", path);

    //initiate the g object for the counties
  svg.append("g")
      .attr("class", "counties")
    .selectAll("path")
    //.datum(topojson.mesh(us, us.objects.counties, function(a, b) { return a !== b; }))
    // ^I tried adding this to replace the following line, but it does not work
    .data(mycounties)
    .enter().append("path")
      .attr("fill", function(d) { return color(d.establishments = centralTexas.get(d.id)); })
      .attr("d", path)
    .append("title")
      .text(function(d) { var obj2 = jsonCounties[d.id]; if (typeof obj2 != "undefined") {return obj2.countyName + ": " + d.establishments + " Active Establishments";} });

}

Como devo fazer isso? É possível fazer uma consulta de filtro mais complicada dentro da função .mesh e eliminar totalmente a necessidade do meu

var counties = topojson.feature (us, us.objects.counties), mycounties = counties.features.filter (função (d) {if (d.id> = 48000 && d.id <= 49000) return d.id; });

código?

Ou preciso executar a função de malha nessa variável com uma sintaxe diferente?

questionAnswers(1)

yourAnswerToTheQuestion