This message was deleted.
# show-and-tell
s
This message was deleted.
🙌 2
🎉 1
f
excellent! do you want to share the code?
p
Will do, let me clean it up a bit first... I have multiple charts in the same notebook.
Here is the notebook: https://observablehq.com/d/be108bfcf6540c3f I would love to get some feedback on how to simplify the code.
f
it's pretty good already!!
how did you come up with the
(a, b, c, layout)
pattern? In the documentation it would be:
(index, scales, channels, dimensions, context)
p
Well, it is common javascript that you can name the arguments of a function whatever you want. I named the arguments I wasn't interested in
a
,
b
, and
c
. I named
layout
that way because I didn't know better 🙂... I haven't read the docs for this, I just assumed that since a mark is a function it should take some arguments to work so I created a function
(a,b,c,d,e,f,g,h) => console.log(a,b,c,d,e,f,g,h)
and put it in the marks array to figure out what the arguments where.
Now that I know that there are docs for this I will have to look them up!
f
yeah—I was curious about how you found your way. thanks!
p
I am trying to add d3-annotations to a
(index, scales, channels, dimensions, context) => { svg
...
}
section but I haven't figured it out yet. That is the next step.
👍 1