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

253
Views
How to make a d3 function as a parameter for a function?

I have a function that renders a d3 graph. But here I want to make the color dynamic taking input from front end. So parameter would an option for me.

function chart(colorX){

const color = d3.scaleOrdinal(d3.quantize(d3.interpolateRainbow, mainData.children.length + 2));

} 

Here interpolateRainbow is the d3 function that I want to make as a parameter input.

if I use colorX

const color = d3.scaleOrdinal(d3.quantize(d3.colorX, mainData.children.length + 2));

it throws error.

Anyone can help me with this plz?

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!