Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

181
Vistas
Changing attribute of subclass within D3 based on dictionary value

What is the best way to make sure I can differentiate each line by size based on the values of my dictionary.

Problem is all lines would adjust instead of my desired line and I am not sure how to approach it.

Down below is a simplified example.

draw.axis = function ()
{
    var element; 
    function axis(g){
        element = g.append("g"); 
        
        
        element 
            .append("g")
            .attr("class", axis dotted line)
            .attr("height", 100);  //default size 
        
    }
}

var size_adjuster = [    
    {size: "big",     adjusted: false  },
    {size: "regular", adjusted: false  },
    {size: "small",   adjusted: false  },
    {size: "small",   adjusted: true   },
    {size: "big",     adjusted: true   },
];

size_adjuster = function(){
    size_adjuster.forEach(function(item) {
        if(item.size == "big" && item.adjusted == false){
            item.adjusted == true; 
            d3.selectedAll("g.axis.line line")
                .attr("height", 200);
        }
        else if(item.size == "regular" && item.adjusted == false){
            d3.selectedAll("g.axis.line line")
                .attr("height", 100);
        }
        else if(item.size == "small" && item.adjusted == false){
            d3.selectedAll("g.axis.line line")
                .attr("height", 50);
        }
    });
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda