Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

163
Visualizações
d3.js - Add parameter/data to nodes

I have a working d3.js (v 4.0) hierarchical tree. Each level in the tree structure has a type parameter field determined in the process of creating the JSON from a MySQL database.

An example of the JSON is at the end.

I want to add another data/parameter field dynamically in the d3.js script where nodes d.type == 'unit'.

That data/parameter field can be called dv.

I would need to do a separate query on the unit table for this in another script, then iterate through those nodes, where nodes d.type == 'unit', for example to change the node's appearance if dv equals something.

How should this be done?

E.g. from

  d3.json("json/data.json", function(treeData) {

Example JSON:

 "name": "1.1 Ensure the appropriateness of sample collection procedures",
              "column_to_sort_by": null,
              "type": "program_outcome",
              "children": [
                {
                  "name": "PATH5121 Clinical Biochemistry",
                  "column_to_sort_by": "PATH5121 Clinical Biochemistry",
                  "children": [
                    {
                      "name": "Learning Events - PATH5121",
                      "column_to_sort_by": null,
                      "type": "unit_group"
                    },
                    {
                      "name": "Assessments - PATH5121",
                      "column_to_sort_by": null,
                      "type": "unit_group"
                    }
                  ],
                  "type": "unit"
                },
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda