d3 / d3-shape

Graphical primitives for visualization, such as lines and areas.
https://d3js.org/d3-shape
ISC License
2.47k stars 304 forks source link

preattentive symbols #189

Closed mbostock closed 2 years ago

mbostock commented 2 years ago

Supersedes #176. I adjusted the implementations proposed by @hemanrobinson for style, and to fit empirically the behavior of symbolCircle when using a stroke width of 1.5px and round line caps. (See notebook.) I also updated some old D3 code for modern JavaScript style. Adds the following new symbols:

In addition, adds two new sets of symbols:

The symbolsFill is equivalent to and replaces symbols, which is now deprecated.

I considered the following alternative names:

Ultimately I don’t think the names matter too much as I expect most often the symbols will be chosen automatically automatically by Plot (using symbolsStroke—though we could perhaps make Plot smart enough to chose symbolsStroke or SymbolsFill depending on whether a fill or stroke channel is present).

TODO