I'm working on d3.js, I am trying to make a stacked circles chart. I met some new stuff, like functions are defined
function myfct (xxx, {parameters}={}){ ... }
I interpreted the ", {}" part as the definition of optional parameters (? thanks for any further explanation on that)
My main question however is
chart = Pack(rollup, {
value: ([, value]) => value,
label: ([key]) => key?.split(/\s+/g).join("\n"),
title: ([key], n) => `${n.depth
? `${n.ancestors().reverse().slice(1).map(({data: [key]}) => key).join("\n")}\n`
: ""}${n.value.toLocaleString("en")}`,
width: 2000,
height: 2000,
})
This is the code they use to call the chart function, I couldn't find someplace to understand the usage of [, value] and [key], so that I can use them for my own case ? If anyone could explain or point me where to look, would be of much help, thanks !