Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

207
Views
How to change the color of a node based on changed data in d3?
nodes = g.append("g")
           .attr("class", "net_node")
           .selectAll("circle")
           .data(data).enter()
           .append("circle")
           .attr("fill", function(d) {
                return color.palette(d.group);
                })

The nodes are defined as follows.

In the pallete, colors are assigned according to the group number.

I do not know the current method, so when other data is input, I delete the svg and run it again.

svg.remove();
view(new_data);

How to change nodes.data and change color

I've read a lot of posts and tried a lot but still can't figure out the answer

thank you.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!