You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The d in groupByRollup gives me the full entry for the data, but the d in nodeLabel only gives me the count for the data. There's no example for the productLookup object/function.
My question is, what if I have a dataset where 2 entries have the same count? How do I reliably get the label?
The text was updated successfully, but these errors were encountered:
Yeah that example is not great since the productLookup and mock.pie data are hidden.
You are correct, the groupByRollup function callback provides the data row as the first argument. The Datum is used to represent a single data row, this type is deceiving on the nodeLabel and should not be there.
The nodeLabel prop is of type LabelAccessor which is passed a generic PrimitiveValue (i.e. string | number | null).
In the case of nodeLabel the value is the value returned from groupByRollup, not the value from the valueAccessor like you were thinking.
I created a codesandbox of that example, with a few tweaks, with all the data so you you can see it better. Unfortunately codesandbox is having issues loading types but you can still play with it.
PS - Apologies for the lack of documentation it's been on our backlog for a while now.
Most definitely. Your best bet for now is to pull down the repo and run the storybook locally that way you can jump around or console.log values to see what is happening and have full typescript intellisense.
Hello, I am trying to create a pie chart with elastic, and I'm having trouble trying to label the slices.
I'm following the example here. More specifically, for the layers prop:
The
d
ingroupByRollup
gives me the full entry for the data, but thed
innodeLabel
only gives me the count for the data. There's no example for theproductLookup
object/function.My question is, what if I have a dataset where 2 entries have the same count? How do I reliably get the label?
The text was updated successfully, but these errors were encountered: