Customizing your visualization
RenderBase offers a number of customizable aspects of a visualization.
For example, if your visualization has a certain limit on the number of data points it supports,
you can set the RenderBase.meta.dataLimit
variable to that limit. The
meta
attribute is an instance of the MetaInfo
class. This class
holds all aspects that you can customize.
MetaInfo
The MetaInfo class holds the aspects of a visualization that you can customize. Typically, you
set these aspects during the initialization of the visualization (the
create
function):
protected create( _node: HTMLElement ): void
{
// Categorical legends should use a circle symbol.
this.meta.legendShape = "circle";
// Limit the categories slot to 250 elements.
this.meta.slotLimits.set( "categories", 250 );
// Limit the number of data points to 1000.
this.meta.dataLimit = 1000;
}
Here is an overview of the supported aspects:
legendShape
- Defines the shape of elements in a categorical (swatch) legend. Possible values arecircle
,rectangle
,square
,triangle
,cross
,donut
,line
,diamond
,star
,triangle-down
,triangle-up
,triangle-left
ortriangle-right
. It can also benull
to indicate that the host should use a default shape or the stringnone
to indicate that no shape should be displayed.slotLimits
- Slot limits define the number of supported tuples in a slot. It is implemented as a map from slot name to limit value. If you don’t want to limit the slot, remove the slot name from the map or set its value to -1.dataLimit
- Defines the maximum number of data points the visualizations supports. Set to -1 to indicate that there is no limit.