Generates a symbol for the given arguments.
IMPORTANT: If the rendering context of the symbol generator is null, then the symbol is returned as a path data string.
The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. All arguments passed into this function, will be passed to the accessor functions of the generator.
For example, with the default settings, no arguments are needed to produce a circle with area 64 square pixels.
Optional
d: DatumThe datum for which the symbol is to be generated.
Rest
...args: any[]Generates an symbol for the given arguments.
IMPORTANT: If the symbol generator has been configured with a rendering context, then the symbol is rendered to this context as a sequence of path method calls and this function returns void.
The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. All arguments passed into this function, will be passed to the accessor functions of the generator.
For example, with the default settings, no arguments are needed to produce a circle with area 64 square pixels.
Optional
d: DatumThe datum for which the symbol is to be generated.
Rest
...args: any[]Returns the current rendering context, which defaults to null.
Sets the context and returns this symbol generator.
Returns the current size accessor, which defaults to a function returning a constant value of 64.
Returns the current size accessor, which defaults to a function returning a constant value of 64.
Rest
...args: any[]Sets the size to the specified number and returns this symbol generator.
A fixed size (area in square pixels).
Sets the size to the specified function and returns this symbol generator.
Specifying the size as a function is useful for constructing a scatterplot with a size encoding. If you wish to scale the symbol to fit a given bounding box, rather than by area, try SVG’s getBBox.
An accessor function returning a number to be used as a symbol size. The accessor function is invoked in the same "this" context as the generator was invoked in and receives the same arguments that were passed into the symbol generator.
Rest
...args: any[]Returns the current symbol type accessor, which defaults to a function returning the circle symbol type.
Returns the current symbol type accessor, which defaults to a function returning the circle symbol type.
Rest
...args: any[]Sets the symbol type to the specified symbol type and returns this symbol generator.
A constant symbol type.
Sets the symbol type to the specified function and returns this symbol generator.
An accessor function returning a symbol type. The accessor function is invoked in the same "this" context as the generator was invoked in and receives the same arguments that were passed into the symbol generator. See symbols for the set of built-in symbol types. To implement a custom symbol type, return an object that implements symbolType.draw.
Rest
...args: any[]
A symbol generator.
Symbols provide a categorical shape encoding as is commonly used in scatterplots. Symbols are always centered at ⟨0,0⟩; use a transform (see: SVG, Canvas) to move the arc to a different position.
The first generic corresponds to the "this" context within which the symbol generator is invoked. The second generic corresponds to the data type of the datum underlying the symbol.