[Types] Wrong recursion in Mark’s _tip_ option

Open Beginner friendly
#2,459 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript

Research direction

Trace the MarkOption.tip and TipOptions type definitions, starting from the type declarations used for mark options. Exclude tip from TipOptions so nested tip values are no longer accepted, then verify that the example no longer type-checks and that valid tip options remain supported.

Written by the indexing model from the issue text.

Description

bug

MarkOption.tip is of type TipOptions. (This is a simplified statement, but true enough for this issue description).

TipOptions itself derives from MarkOptions.

This recursion lets us specify nested tips:

Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", tip: {tip: {tip: {tip: {tip: {tip: {}}}}}}}).plot()

TipOptions should probably exclude the tip property.

Related: #2423

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

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.

More from observablehq/plot

All issues in observablehq/plot

Similar issues

More Data Visualization issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.