Skip to content

Conversation

@Fil
Copy link
Contributor

@Fil Fil commented Jun 2, 2022

This PR wants to make all of the common styles (or most of them) "variable" (#175, #380)

  • strokeDasharray (difficult case: we can't consider that an array is a columnar representation of a channel) 🌶
  • strokeDashoffset (number)
  • dx and dy
    • DX without X, DY without Y?
  • mixBlendMode
  • more?

for the text mark:

  • textAnchor
  • fontFamily
  • fontSize (was already variable)
  • fontStyle
  • fontVariant
  • fontWeight

for the arrow mark:

@Fil
Copy link
Contributor Author

Fil commented Jul 7, 2022

I'm not sure how to make dx and dy variable when X or Y are not channels; I think I'll punt on this for now, because I don't want to overcomplicate the PR—my first prototype was making changes in each and every mark, depending on X, Y, and possibly cx, cy when X and Y were not defined… booo. The current approach which shifts X seems much better, but doesn't work when X is not a channel.

@Fil Fil marked this pull request as ready for review July 7, 2022 12:28
@Fil Fil requested a review from mbostock July 11, 2022 06:14
…ont-weight, strokeDasharray, strokeDashoffset

maybeDasharrayChannel identifies arrays of numbers (possibly joined by white space or commas) as constant; a single number is an acceptable strokeDasharray option
@Fil Fil force-pushed the fil/variable-styles branch from d6f6085 to b2ca6c4 Compare July 22, 2022 14:15
@Fil
Copy link
Contributor Author

Fil commented Jul 22, 2022

rebased

@mbostock
Copy link
Member

Fil, thanks for the work here. I would like to put this on hold to focus on animation and interaction. I am concerned that this generalization may make animation more difficult to implement. Let’s discuss this week.

@Fil Fil mentioned this pull request Oct 27, 2022
2 tasks
@Fil Fil marked this pull request as draft April 3, 2023 14:59
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.

3 participants