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

272
Views
d3 map with nested arrow function use in Grouped Bar Chart Example d3.js

I am trying to modify this example to my purposes: https://observablehq.com/@d3/grouped-bar-chart

I was able to do so in Observable and plain Javascript. However I am using react and typescript in my personal project and do not know how the double arrow function parameter works.

I.e. What does:

GroupedBarChart(stateages, {
  x: d => d.state, ....

and then:

x = (d, i) => i,
const X = d3.map(data, x);

here do exactly?

In the first, I select the state attribute of every datapoint

but then of every datapoints datapoint (?) I select the numeric index.

How would I write this concisely without using it as a parameter in the function call?

I've tried d3.map(data.state, (d, i) => i) with no luck.

Thanks a lot for any pointers and hints you can give!

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!