0

This is from d3fc.....module.. What is the' row =>' ? Is this d3 function?? but i can't find meaning of this.. in d3 offical ....d3fc offical.....site...

const lineSeries = fc.seriesSvgLine()
.mainValue(d => d.close)
.crossValue(d => d.date);

const chart = fc.chartSvgCartesian(
d3.scaleTime(),
d3.scaleLinear()
)
.yOrient('left')
.plotArea(lineSeries);

const xExtent = fc.extentDate()
.accessors([d => d.date]);

const yExtent = fc.extentLinear()
.accessors([d => d.high, d => d.low]);

 const parseDate = d3.timeParse("%d-%b-%y");

d3.csv('data.csv',
row => ({
open: row.Open,
close: row.Close,
high: row.High,
low: row.Low,
date: parseDate(row.Date)
})).then(data => {

chart.xDomain(xExtent(data))
  .yDomain(yExtent(data));

d3.select('#chart-element')
  .datum(data)
  .call(chart);
});

'row =>' is something like 'function(d)'? 'row' is 'd' 'function' is '=>'?

nyedidikeke
  • 5,016
  • 7
  • 33
  • 49
HARU
  • 11
  • 1
  • 3
    [JavaScript arrow function.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) Nothing specifically to do with d3. – Pointy Nov 24 '18 at 18:29
  • 3
    Possible duplicate of [What's the meaning of "=>" (an arrow formed from equals & greater than) in JavaScript?](https://stackoverflow.com/questions/24900875/whats-the-meaning-of-an-arrow-formed-from-equals-greater-than-in-javas) – kemicofa ghost Nov 24 '18 at 18:31

0 Answers0