# link plot custom lines

**URL:** <https://talk.observablehq.com/t/link-plot-custom-lines/7216>\
**Category:** Help\
**Created:** [October 29, 2022, 1:25pm UTC](https://talk.observablehq.com/t/link-plot-custom-lines/7216 "2022-10-29T13:25:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![njcode](https://avatars.discourse-cdn.com/v4/letter/n/cdc98d/32.png) [@njcode](https://talk.observablehq.com/u/njcode)\
**Post date:** [October 29, 2022, 1:25pm UTC](https://talk.observablehq.com/t/link-plot-custom-lines/7216/1 "2022-10-29T13:25:25Z")

</div>

Sorry if this is a bit simple, I am not sure where to start.

If I want to use properties of these special lines types as marks, for example, using a squiggle in a link plot, how do I bring them in and apply them?

IOW how to put this: [044 Fifteen silly ways to draw a line / Saneef H. Ansari / Observable](https://observablehq.com/@saneef/15-silly-ways-to-draw-a-line)  
into this: [Link Mark / Observable Plot / Observable / Observable](https://observablehq.com/@observablehq/plot-link)

---

<div class="post-metadata">

**Author:** ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)\
**Post date:** [October 31, 2022, 10:44am UTC](https://talk.observablehq.com/t/link-plot-custom-lines/7216/2 "2022-10-31T10:44:04Z")

</div>

This is not at all simple!

First, Plot uses SVG and the silly lines are drawn in canvas, so we need a way to create a canvas mark. Second, the code cannot be imported as is, because we need each function call to have a possibly different canvas for each plot.

I’ve put up a minimalist version in this notebook to get you started.

> **[Fifteen silly ways to draw a line in Plot](https://observablehq.com/@recifs/fifteen-silly-ways-to-draw-a-line-in-plot)**
>
> Suggestion for https://talk.observablehq.com/t/link-plot-custom-lines/7216

It still needs a bit of work if we want to support color, opacity, and line width as plot channels (I’ve set them as fixed values in the code).

Also, it only does two silly ways; adding the thirteen others is not too difficult, you just need to paste the code and append ctx to the arguments list.

---

<div class="post-metadata">

**Author:** ![njcode](https://avatars.discourse-cdn.com/v4/letter/n/cdc98d/32.png) [@njcode](https://talk.observablehq.com/u/njcode)\
**Post date:** [November 2, 2022, 2:05pm UTC](https://talk.observablehq.com/t/link-plot-custom-lines/7216/3 "2022-11-02T14:05:46Z")

</div>

Thanks @Fil! I will take a look and try to put this info to good use.

Re: simplicity: one reason I struggle with when to plod vs when to ask is that esp. at my experience level, I am quite bad at predicting when something will turn out to be simple. So increasingly I lean toward asking after a quick search.

Really appreciate your work here. I hope others will find this useful also. I’m never going to be some d3 pro but I do hope to use it to show data densely (faithfully) and expressively (interestingly) where other solutions fail. A possible downside is that I tend to look to d3 to solve the weirder problems or more indulgent whims. I must say, impulsively asking about some thorny problem, and having smarter people actually substantially help with it, could become somewhat addictive.

One visualization theme I come back to is how to assist intuition especially where humans are bad at thinking about scale. The reason I am so interested in particular uses of dots and squiggles is that I want to show a lot of data–approaching or achieving 1:1 :: mark:unit–where possible. With small quantities, drawing by hand can be fun and effective. But if you want to select data and use it to draw thousands or millions of things with precision and fidelity, d3 is better. I want visualizations to do things that cartoons do but that are difficult or tedious to draw. To get back to some kind of higher-trust society, I think we need to use more of our ‘cartoon-brain’ to get some kind of handle on the various ‘hyperobjects’ we confront. This conversation touches on some of what I mean:

> **[David Roberts explains how America's information crisis has impacted...](https://www.nbcnews.com/think/opinion/assessing-america-s-information-crisis-david-roberts-podcast-transcript-ncna943701)**
>
> Chris Hayes speaks with journalist David Roberts about how the erosion of trust and manipulation of information has impacted the conservative movement.

---

<div class="post-metadata">

**Author:** ![mootari](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mootari/32/581_2.png) [@mootari](https://talk.observablehq.com/u/mootari)\
**Post date:** [November 2, 2022, 2:51pm UTC](https://talk.observablehq.com/t/link-plot-custom-lines/7216/4 "2022-11-02T14:51:06Z")

</div>

@njcode Regarding D3, I often find that it already helps to learn what’s in a toolbox, even without learning the individual tools in details.

Here’s a work-in-progress notebook that may help you to get a bird’s eye view on D3:

> **[D3 Documentation Index](https://observablehq.com/@mootari/d3-documentation)**
>
> A.k.a. "Where's my D3?" D3 is made up of multiple smaller libraries which get bundled into the \`d3\` that you're familiar with. While it is handy to have them all accessible via \`d3\`, it can sometimes be challenging to figure out to which package a...

---

<div class="post-metadata">

**Author:** ![njcode](https://avatars.discourse-cdn.com/v4/letter/n/cdc98d/32.png) [@njcode](https://talk.observablehq.com/u/njcode)\
**Post date:** [November 2, 2022, 3:43pm UTC](https://talk.observablehq.com/t/link-plot-custom-lines/7216/5 "2022-11-02T15:43:03Z")

</div>

Awesome, I will check this out. Thanks!
