defineSigmaOptions
defineSigmaOptions<
P>(options):SigmaOptions<Attributes,Attributes,Attributes, { }, { }, { },P>
Defined in: packages/sigma/src/types/options.ts:75
Factory function for creating type-safe sigma options.
Types the options from the primitives declaration, so that variables and depth layers declared in primitives are checked in styles.
Type Parameters
Section titled “Type Parameters”P extends PrimitivesDeclaration
Parameters
Section titled “Parameters”options
Section titled “options”SigmaOptions<Attributes, Attributes, Attributes, { }, { }, { }, P>
Returns
Section titled “Returns”SigmaOptions<Attributes, Attributes, Attributes, { }, { }, { }, P>
Example
Section titled “Example”const options = defineSigmaOptions({ primitives: { nodes: { shapes: [sdfCircle(), sdfSquare()], variables: { borderSize: { type: "number", default: 2 }, borderColor: { type: "color", default: "#fff" }, }, layers: [layerFill()], }, edges: { paths: [pathLine(), pathCurved()] }, }, styles: { nodes: { color: "#666", shape: "circle", borderSize: 2, // Inferred from variables borderColor: "#fff", }, },});