observablehq / observablehq/plot

An easier facet frame label?

Open
#1,483 4 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

It’d be nice when faceting to have an easier way to label the facet. I find myself using the selectFirst transform for this, but I think a singleton mark like the frame mark would be easier to use.

Screenshot 2023-04-24 at 6 05 00 PM
Plot.plot({
  height: 720,
  axis: null,
  marks: [
    Plot.areaY(industries, {x: "date", y: "unemployed", fy: "industry"}),
    Plot.text(industries, Plot.selectFirst({text: "industry", fy: "industry", frameAnchor: "top-left", dx: 6, dy: 6})),
    Plot.frame()
  ]
})

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 by reading the Plot.plot example and the existing Plot.selectFirst and Plot.frame entry points shown in the issue; no source file or test is named. Define how a singleton mark would provide an easier facet label while retaining the demonstrated faceting and frame-anchor behavior, then verify the example works as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.