petal
Draws a petal: a wedge whose sides follow the enclosing coordinate system's angular and radial axes. It is the polar counterpart of rect, for flower and rose glyphs where a rectangle's straight sides would look wrong.
python
from gofish import chart, stack, petal, polar
chart(seafood, coord=polar()) \
.flow(stack(by="species", dir="x")) \
.mark(petal(w="count", fill="species")) \
.render(w=300, h=300)Signature
python
petal(*, x=None, cx=None, x2=None, w=None, em_x=None,
y=None, cy=None, y2=None, h=None, em_y=None,
dims=None,
fill=None, stroke=None, stroke_width=None) -> MarkUse it inside a polar() or clock() coordinate space, where w/h read as the angular and radial extents. dims={"theta": ..., "r": ...} names the same two axes by their polar names (see Axis names).
Parameters
A polar-only wedge/petal shape (Petal.tsx). Box geometry via the shared dims channels.
| Option | Type | Default | Description |
|---|---|---|---|
fill | str | Fill color, or a field name for a color scale. | |
stroke | str | Stroke color. Defaults to fill. | |
stroke_width | float | 0 | Stroke width in pixels. |
debug | bool | Dev-only flag: logs this mark's key and datum to the console as it is built. It changes nothing about what is drawn. |
Box dimensions
| Option | Type | Default | Description |
|---|---|---|---|
x | int | float | str | Left edge position. | |
cx | int | float | str | Center x. | |
x2 | int | float | str | Right edge position. | |
w | int | float | str | Width. | |
em_x | bool | Embed x in the parent's x space. | |
y | int | float | str | Start edge on y: the top edge where y reads top-down, the bottom edge where it grows upward. | |
cy | int | float | str | Center y. | |
y2 | int | float | str | Other y edge position. | |
h | int | float | str | Height. | |
em_y | bool | Embed y in the parent's y space. | |
dims | dict | Box dimensions by axis name: x/y, or a name the enclosing coordinate space declares (polar theta/r, geo lon/lat). Each value is a position (like x) or an interval {min, center, max, size, embedded}. |
