This message was deleted.
# help
s
This message was deleted.
m
Ideally, in the outputs I could invoke a function where the index is passed and then I could manipulate it and return the desired value
f
what do you mean by index?
you'd want 0 for olympians[0] ?
if so, maybe you could do something like
Copy code
fill: (d, i) => i
and then in the binning options, you could have
Copy code
fill: "first"
to use the index of the first element in the bin (?)
m
Sorry, here is more context: I wanted to do a percentogram with Plot and I want to use the color for e.d quintiles like in the original source. With the index approach, I realize I don’t get the indices in the order of x. So the result should like fill:β€œxβ€œ in the binning options, except for the domain. For the domain I would like to denote the quantiles https://observablehq.com/d/3594b4d8127400e9
f
same link πŸ˜„
m
Was that coincidence πŸ€ or you just typed the solution ?
f
I made it on April 15, but I made it public (unlisted) for you
I believe I followed the link that was trending at the time on twitter πŸ˜„
m
🀩 I don’t want to know how many more examples you have put up your sleeves πŸ˜‚ . But I am not sure if I can deduct how your coloring - which is what I want - can be transferred to my more general case..
Oh wait I can. Your fill option is independent of your data. So I can do the same as long as I know the number of bins
πŸ‘ 1