observablehq / observablehq/plot

shorthand for scale type and color scheme

Open
#1,116 0 comments 0 reactions 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 want to be able to say

color: "blues"

as shorthand for

color: {scheme: "blues"}

and likewise I could imagine

y: "sqrt"

as shorthand for

y: {type: "sqrt"}

Basically for any scale option that’s defined as a string, we check if it’s a valid scale type. And for color, we also check if it’s a valid color scheme. (These sets should be non-overlapping.) We do something similar for the projection option in #1111 and it’s nice.

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 tracing how scale options and color schemes are interpreted, using the examples in this issue and the projection shorthand discussed in #1111 as comparison points. Done means valid string scale types are accepted as {type: ...}, valid color schemes as {scheme: ...}, and existing option behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.