JavaScript & React libraryAPIEnumerationsCosmographPointColorStrategy

Enumeration: CosmographPointColorStrategy

Enumeration Members

Enumeration MemberValueDescription
Categorical"categorical"Uses colors from pointColorPalette for pointColorBy data without interpolation. - For numeric data: Creates equal-width buckets mapped to pointColorPalette colors - For categorical data: Assigns colors from pointColorPalette in order, cycling when unique values exceed palette length - Uses unknownColor for nullish values - Has effect only if pointColorBy provided.
Continuous"continuous"Interpolates colors from pointColorPalette over pointColorBy data. - For numeric data: Creates continuous color scale between pointColorPalette colors - For categorical data: Creates evenly-spaced color scale by interpolating between pointColorPalette colors to match the number of unique values in pointColorBy so every value is a unique color. - Uses unknownColor for nullish values - Has effect only if pointColorBy provided.
Map"map"Uses color mapping from pointColorByMap to values in pointColorBy. - Applies exact color from CosmographConfig.pointColorByMap for matching values - Falls back to unknownColor when value is not found in map or invalid - Has effect only if pointColorByMap and pointColorBy provided
Degree"degree"Colors points based on their degree (number of connections) using interpolated pointColorPalette with quantile-based boundaries. - Maps point degrees to continuous color scale between pointColorPalette colors - Minimum and maximum values are clamped to 5th and 95th percentiles of total degree distribution - Has effect only if links provided
PreciseDegree"preciseDegree"Colors points based on their degree (number of connections) using interpolated pointColorPalette without quantile-based boundaries. - Maps point degrees to continuous color scale between pointColorPalette colors - Has effect only if links provided
LinkDirection"linkDirection"Colors points based on their link direction using pointColorPalette. - Has effect only if links provided
Direct"direct"Directly uses pointColorBy column values as colors. - Applies the color if it’s a valid color string (hex, rgb, named color, etc) or an array of [r, g, b, a] - If pointColorByFn exists, applies it to transform pointColorBy values into custom colors with it - Falls back to unknownColor if invalid color - If neither CosmographConfig.pointColorBy nor CosmographConfig.pointColorByFn exist, colors all points with unknownColor
Single"single"Colors all points uniformly to the same color specified by pointDefaultColor.