Documentation / @ripl/charts / createSymbol
Function: createSymbol() ​
createSymbol(
type,options):SymbolElement
Defined in: charts/src/components/symbols.ts:98
Creates a marker element for the given symbol type. The returned element exposes cx/cy/radius, so hosts treat every symbol identically for positioning and animation. Pass the equal-area circle radius through symbolRadius when sizing non-circle symbols.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
type | SymbolType | The symbol shape to create. |
options | Shape2DOptions<CircleState> | Shape options (cx, cy, radius, paint, events). radius is applied as-is. |
Returns ​
A Circle for 'circle', otherwise a regular Polygon oriented for the shape.
Example ​
ts
const marker = createSymbol('triangle', {
cx: 100,
cy: 80,
radius: symbolRadius('triangle', 4),
fill: '#3b82f6',
});