Returns the name of the slot this palette is linked to, or null if the palette is not linked to a slot.
Determine the fill color for a data point. The fill follows the 'selected' state of a data point. If the data set has selected data points, then the ones that are selected get the normal color as fill color and the ones that are not selected get a 60% transparent color.
// Set fill color of elements in a d3 selection.
selection.attr( "fill", _d => palette.getFillColor( _d ) )
The data point or tuple to determine the color for. If null
is
passed, the method behaves the same as getColor.
The color of the data point as a string.
Determine the outline color for a data point. The outline color depends on
both the 'highlight' state and the 'selected' state. If the point is neither
highlighted or selected, null
is returned to indicate that no outline needs
to be rendered. If the point is highlighted or part of a selection, then
the returned color is a darker version of the actual data point color.
// Set outline color of elements in a d3 selection.
selection.attr( "stroke", _d => palette.getOutlineColor( _d ) )
The data point or tuple to determine the color for. If null
is
passed, the method behaves the same as getColor.
The color of the data point as a string or null if no outline is needed.
Representation of a categorical palette. Can be used to determine a color given a data tuple.