observablehq / observablehq/plot
Halo for lines?
Open
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…
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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