observablehq / observablehq/plot

Halo for lines?

Open
#860 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
HTML
Stars
5.4k
Forks
244
PR merge metrics
No merged PRs in 30d

Description

I wonder if we want something like this…

Screen Shot 2022-05-04 at 2 55 55 PM
diff --git a/src/marks/line.js b/src/marks/line.js
index f12d798..fba2591 100644
--- a/src/marks/line.js
+++ b/src/marks/line.js
@@ -53,7 +53,11 @@ export class Line extends Mark {
               .curve(this.curve)
               .defined(i => i >= 0)
               .x(i => X[i])
-              .y(i => Y[i])))
+              .y(i => Y[i]))
+          .clone(true)
+            .each(function() { this.parentNode.insertBefore(this, this.previousSibling); })
+            .attr("stroke-width", 4)
+            .attr("stroke", "white"))
       .node();
   }
 }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/marks/line.js and inspect how the Line mark is rendered. Compare the proposed cloned white stroke with the current output and determine the intended halo behavior from the attached image; done means the line mark renders the halo consistently without disrupting existing line styling.

Written by the indexing model from the issue text.

Assessment

Tech stack
d3, javascript
Domain
data-visualization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.