Home Reference Source Test
public class | source

ColorBrewer

This class will contain all ColorBrewer color schemes and methods to query said color schemes. These queries can be: by their type(Diverging, Qualitative and Sequential), name(Spectral, RdYlGn, etc etc) and number of classes(3,4...).

See:

Static Method Summary

Static Public Methods
public static

byName(name: string): Object

This is just an alias for the method getColorSchemesByName(name).

public static

byNameAndNumber(name: string, numberOfClasses: number): Array<RGB>

For the given color scheme name and number of classes returns the RGB colors associated with them.

public static

byNumber(numberOfClasses: number): Object

Returns all ColorSchemes that contain the number of class given as input.

public static

Returns an object of color schemes with only those the objects for the specified number of classes.

public static
this method was deprecated. Use byNumber(n) or getAllColorSchemesByNumberOfClasses(n) instead.
public static

getChangeMapDefaults(dataNature: string , numClasses: number ): Array<number>

Returns the default color for Change Maps taking in consideration the given number of classes and nature of data currently being used.

public static

getChorochromaticDefaults(dataNature: string , numClasses: number ): Array<number>

Returns the default color for Chorocromatic Maps taking in consideration the given number of classes and nature of data currently being used.

public static

getChoroplethDefaults(dataNature: string , numClasses: number ): Array<number>

Returns the default color for Choropleth Maps taking in consideration the given number of classes and nature of data currently being used.

public static

Returns the ColorBrewer object of type of color schemes.

public static

getColorScheme(type: string, name: string, numOfClasses: number): Array<RGB>

Returns an array with numOfClasses elements that are the colors for the given type of color scheme and it's name.

public static

Return an object with multiple color schemes for each number of classes associated with the color scheme given as input.

public static

getColors(name: string, numberOfClasses: number): Array<Array<number>>

Given the color scheme name and the number of classes returns an Array of colors associated with the given name and number of classes.

public static

getColorsHex(name: string, numberOfClasses: number): Array<Array<string>>

Given the color scheme name and the number of classes returns an Array of colors associated with the given name and number of classes.

public static

getDefautls(mapName: *, numClasses: *, dataNature: *): *

######################## DEFAULTS #######################################

public static

Returns all the ColorBrewer diverging color schemes.

public static

getDotMapDefaults(dataNature: string , numClasses: number ): Array<number>

Returns the default color for Dot Maps taking in consideration the given number of classes and nature of data currently being used.

public static

getProportionalSymbolsDefaults(dataNature: string , numClasses: number ): Array<number>

Returns the default color for Proportional Symbols Maps taking in consideration the given number of classes and nature of data currently being used.

public static

Returns all the ColorBrewer qualitative color schemes.

public static

Returns all the ColorBrewer the sequential color schemes.

Static Public Methods

public static byName(name: string): Object source

This is just an alias for the method getColorSchemesByName(name).

Params:

NameTypeAttributeDescription
name string

Return:

Object

an object with multiple color schemes for each number of classes associated with the color scheme given as input.

public static byNameAndNumber(name: string, numberOfClasses: number): Array<RGB> source

For the given color scheme name and number of classes returns the RGB colors associated with them.

Params:

NameTypeAttributeDescription
name string
numberOfClasses number

Return:

Array<RGB>

Array of colors associated with color scheme name and number of classes.

public static byNumber(numberOfClasses: number): Object source

Returns all ColorSchemes that contain the number of class given as input.

Params:

NameTypeAttributeDescription
numberOfClasses number

number of classes to search for.

Return:

Object

Object with

public static getAllColorSchemesByNumberOfClasses(numberOfClasses: number): Object source

Returns an object of color schemes with only those the objects for the specified number of classes.

Params:

NameTypeAttributeDescription
numberOfClasses number

Return:

Object

an object of color schemes with only those the objects for the specified number of classes.

public static getAllColorSchemesByNumberOfClassesAsArray(numberOfClasses: number): Array<Object> source

this method was deprecated. Use byNumber(n) or getAllColorSchemesByNumberOfClasses(n) instead.

Params:

NameTypeAttributeDescription
numberOfClasses number

Return:

Array<Object>

public static getChangeMapDefaults(dataNature: string , numClasses: number ): Array<number> source

Returns the default color for Change Maps taking in consideration the given number of classes and nature of data currently being used.

Params:

NameTypeAttributeDescription
dataNature string

The type of data.

numClasses number

The number of classes.

Return:

Array<number>

the default color for the given number of classes and nature of data currently being used.

public static getChorochromaticDefaults(dataNature: string , numClasses: number ): Array<number> source

Returns the default color for Chorocromatic Maps taking in consideration the given number of classes and nature of data currently being used.

Params:

NameTypeAttributeDescription
dataNature string

The type of data.

numClasses number

The number of classes.

Return:

Array<number>

the default color for the given number of classes and nature of data currently being used.

public static getChoroplethDefaults(dataNature: string , numClasses: number ): Array<number> source

Returns the default color for Choropleth Maps taking in consideration the given number of classes and nature of data currently being used.

Params:

NameTypeAttributeDescription
dataNature string

The type of data.

numClasses number

The number of classes.

Return:

Array<number>

the default color for the given number of classes and nature of data currently being used.

public static getColorBrewerVariable(): Object source

Returns the ColorBrewer object of type of color schemes.

Return:

Object

the ColorBrewer object of type of color schemes.

See:

public static getColorScheme(type: string, name: string, numOfClasses: number): Array<RGB> source

Returns an array with numOfClasses elements that are the colors for the given type of color scheme and it's name.

Params:

NameTypeAttributeDescription
type string

The type of color scheme (Options are: Sequential, Diverging and Qualitative).

name string

Name of the color scheme to search.

numOfClasses number

Number of classes to search.

Return:

Array<RGB>

Array with the colors given by Color Brewer.

public static getColorSchemesByName(name: string): Object source

Return an object with multiple color schemes for each number of classes associated with the color scheme given as input.

Params:

NameTypeAttributeDescription
name string

Return:

Object

an object with multiple color schemes for each number of classes associated with the color scheme given as input.

public static getColors(name: string, numberOfClasses: number): Array<Array<number>> source

Given the color scheme name and the number of classes returns an Array of colors associated with the given name and number of classes.

Params:

NameTypeAttributeDescription
name string

color name

numberOfClasses number

number of classes

Return:

Array<Array<number>>

Colors of the color scheme. As many as number of classes given.

See:

public static getColorsHex(name: string, numberOfClasses: number): Array<Array<string>> source

Given the color scheme name and the number of classes returns an Array of colors associated with the given name and number of classes.

Params:

NameTypeAttributeDescription
name string

color name

numberOfClasses number

number of classes

Return:

Array<Array<string>>

Colors of the color scheme in hexacedimal format.

See:

public static getDefautls(mapName: *, numClasses: *, dataNature: *): * source

######################## DEFAULTS #######################################

Params:

NameTypeAttributeDescription
mapName *
numClasses *
dataNature *

Return:

*

public static getDivergingColorSchemes(): Object source

Returns all the ColorBrewer diverging color schemes.

Return:

Object

all the ColorBrewer diverging color schemes.

public static getDotMapDefaults(dataNature: string , numClasses: number ): Array<number> source

Returns the default color for Dot Maps taking in consideration the given number of classes and nature of data currently being used.

Params:

NameTypeAttributeDescription
dataNature string

The type of data.

numClasses number

The number of classes.

Return:

Array<number>

the default color for the given number of classes and nature of data currently being used.

public static getProportionalSymbolsDefaults(dataNature: string , numClasses: number ): Array<number> source

Returns the default color for Proportional Symbols Maps taking in consideration the given number of classes and nature of data currently being used.

Params:

NameTypeAttributeDescription
dataNature string

The type of data.

numClasses number

The number of classes.

Return:

Array<number>

the default color for the given number of classes and nature of data currently being used.

public static getQualitativeColorSchemes(): Object source

Returns all the ColorBrewer qualitative color schemes.

Return:

Object

all the ColorBrewer qualitative color schemes.

public static getSequentialColorSchemes(): Object source

Returns all the ColorBrewer the sequential color schemes.

Return:

Object

all the ColorBrewer sequential color schemes.