Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legends #93

Closed
wants to merge 6 commits into from
Closed

Legends #93

wants to merge 6 commits into from

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Jan 11, 2021

examples at https://observablehq.com/@data-workflows/color-legend-93

 color: { legend: true } 
 color: { legend: {
  bottom: 10,
  left: 0,
  title: "density",
  ticks: 20
} } 

TBD:

@mbostock mbostock added this to the Friends Preview milestone Feb 24, 2021
@Fil Fil self-assigned this Mar 3, 2021
@mbostock mbostock removed this from the Friends Preview milestone Mar 10, 2021
@mbostock
Copy link
Member

(This is already covered by #23 in the project board and milestone, so I don’t want to list it twice.)

@Fil
Copy link
Contributor Author

Fil commented Mar 12, 2021

I've added swatches with a configurable layout:

  • ticks to set the maximum number of columns
  • tickFormat is used to set the text (if text is empty, the swatch is not created)
  • default tickFormat cuts the text at a length that corresponds (more or less) to the column width

I think I'd want to be allowed to opt-in or out of swatches with an option.

Capture d’écran 2021-03-12 à 10 31 17

Capture d’écran 2021-03-12 à 10 31 05

Capture d’écran 2021-03-12 à 10 30 54

@Fil
Copy link
Contributor Author

Fil commented Apr 3, 2021

To help tinkering and have at least something when we need it, I've made a stand-alone version of this as a mark:
https://observablehq.com/d/f105624c9e0cbde1

Capture d’écran 2021-04-03 à 09 30 46

@Fil
Copy link
Contributor Author

Fil commented May 31, 2021

see also #425

@Fil
Copy link
Contributor Author

Fil commented Jul 21, 2021

superseded by #432

@Fil Fil closed this Jul 21, 2021
@Fil Fil deleted the color-legend branch January 24, 2023 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants