Skip to content

Conversation

@Fil
Copy link
Contributor

@Fil Fil commented Jan 12, 2022

tbd:

  • The stroke: white is controversial, since we don't know that currentColor is black (or any dark color).
  • API design question: do we need three options (halo: true, haloStroke = "white", haloWidth = 4)?

closes #666

@Fil Fil requested a review from mbostock January 12, 2022 15:45
@Fil Fil added the question Further information is needed label Jan 16, 2022
@mbostock mbostock mentioned this pull request Jan 24, 2022
@mbostock
Copy link
Member

Another possibility is that we could add to #701 such that if a text mark has both a stroke and a fill, the paintOrder defaults to “stroke” (so that the stroke is drawn underneath the fill, rather than vice versa). That’s a little bit opinionated, but it means we don’t need a dedicated halo option, and we require the user to specify what the color will be. We already default strokeLinejoin to round, so you’d probably also want to specify strokeWidth… otherwise you only get effectively a 0.5px halo. But either way it’s a lot easier than having to duplicate the entire mark!

Fil added a commit that referenced this pull request Jan 25, 2022
…ke and strokeWidth to 3 if the stroke option is specified.

supersedes #667
closes #666
@Fil
Copy link
Contributor Author

Fil commented Jan 25, 2022

superseded by #703

@Fil Fil closed this Jan 25, 2022
@Fil Fil deleted the fil/text-halo branch January 25, 2022 08:39
mbostock pushed a commit that referenced this pull request Jan 25, 2022
…ke and strokeWidth to 3 if the stroke option is specified.

supersedes #667
closes #666
mbostock added a commit that referenced this pull request Jan 25, 2022
* make it easier to create a text halo by defaulting paintOrder to stroke and strokeWidth to 3 if the stroke option is specified.
supersedes #667
closes #666

* default paintOrder

* currentColor, not black

Co-authored-by: Mike Bostock <mbostock@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plot.text halo option(s)

3 participants