Home Reference Source Test
public class | source

Aesthetic

Class that represents an aesthetic element. There will be one Aesthetic class for each class on the Legend.

Constructor Summary

Public Constructor
public

constructor(id: number, attr: string, fcolor: number[] | Function, stroke: number[], pointsize: number | null, range: number[])

Creates an instance of Aesthetic.

Member Summary

Public Members
public

This particular element will be active or not in the Legend.

public

fillColor: number[4] | Function

The color to fill the Aesthetic element(RGBA) OR a function to create this color.

public

The unique id of the Aesthetic object.

public

Outer is used for the last element of the Legend.

public

The size of the Aesthetic point to be drawn (Used only in maps that require dots to be drawn).

public

range: number[2]

The range for this particular Aesthetic element.

public

strokeColor: number[4]

Stroke color values(RGBA).

Private Members
private

This Array is used for?

private

The attribute being mapped on the Aesthetic.

private

This Array will keep track of all Features associated with this Aesthetic object.

Method Summary

Public Methods
public

addFeature(id: number, properties: {fx: string, _gisplayid: number}, triangles: {itemSize: number, numItems: number}, borders: {itemSize: number, numItems: number}, points: {itemSize: number, numItems: number})

Adds a new feature to this Aesthetic object.

public

addGroupedFeature(id: number, triangles: {buffer: WebGLBuffer, itemSize: number, numItems: number}, borders: {buffer: WebGLBuffer, itemSize: number, numItems: number}, points: {buffer: WebGLBuffer, itemSize: number, numItems: number})

Add new grouped feature.

public

Verifies the existence or not of the property Aesthethic._attr and if it fits inside this Aesthetic range.

public

Inverts this Aesthetic element state in the Legend object.

public

Returns all Features as one?

public

Gets this Aesthetic attribute.

public

Returns all Features that belong to this Aesthetic object.

public

Returns the fill color for this Aesthetic object.

public

Returns the size of this Aesthetic points.

public

Returns the stroke color for this Aesthetic object.

public

Verifies if this Aeshtetic element is enable on the Legend or not.

public

Returns if this Aesthetic is outer or not.

Public Constructors

public constructor(id: number, attr: string, fcolor: number[] | Function, stroke: number[], pointsize: number | null, range: number[]) source

Creates an instance of Aesthetic. There will be as many Aesthetic objects as the number of classes on the Legend.

Params:

NameTypeAttributeDescription
id number

The unique id of the Aesthetic object.

attr string

The attribute being mapped on this Aesthetic.

fcolor number[] | Function

The color to fill the Aesthetic element(RGBA).

stroke number[]

Stroke color values(RGBA).

pointsize number | null

Size of the Aesthetic point to be drawn (Used only in maps that require dots to be drawn).

range number[]

The range for this particular Aesthetic element.

Example:

1-> {"id":0,"attr":"f3","fcolor":[255,255,255,0.8],
        "stroke":[0,0,0,1],"pointsize":null,"range":[1,37]}
2-> {"id":1,"attr":"f3","fcolor":[255,255,0,0.8],
        "stroke":[0,0,0,1],"pointsize":null,"range":[37,78]}

Public Members

public enabled: boolean source

This particular element will be active or not in the Legend.

public fillColor: number[4] | Function source

The color to fill the Aesthetic element(RGBA) OR a function to create this color.

public id: number source

The unique id of the Aesthetic object.

public outer: boolean source

Outer is used for the last element of the Legend. Example [500, 1000]<

public pointSize: number | null source

The size of the Aesthetic point to be drawn (Used only in maps that require dots to be drawn).

public range: number[2] source

The range for this particular Aesthetic element.

public strokeColor: number[4] source

Stroke color values(RGBA).

Private Members

private _allFeatures: Array<Feature> source

This Array is used for?

private _attr: string source

The attribute being mapped on the Aesthetic.

private _features: Array<Feature> source

This Array will keep track of all Features associated with this Aesthetic object.

Public Methods

public addFeature(id: number, properties: {fx: string, _gisplayid: number}, triangles: {itemSize: number, numItems: number}, borders: {itemSize: number, numItems: number}, points: {itemSize: number, numItems: number}) source

Adds a new feature to this Aesthetic object.

Params:

NameTypeAttributeDescription
id number

The Feature id. Each feature will have a different id inside this Aesthetic object.

properties {fx: string, _gisplayid: number}

Properties associated with the Feature.

triangles {itemSize: number, numItems: number}

Number of triangles associated with the Feature.

borders {itemSize: number, numItems: number}

Number of borders associated with the Feature.

points {itemSize: number, numItems: number}

The points that belong to the Feature.

public addGroupedFeature(id: number, triangles: {buffer: WebGLBuffer, itemSize: number, numItems: number}, borders: {buffer: WebGLBuffer, itemSize: number, numItems: number}, points: {buffer: WebGLBuffer, itemSize: number, numItems: number}) source

Add new grouped feature. Only used for Maps with points.

Params:

NameTypeAttributeDescription
id number

The id of the Feature.

triangles {buffer: WebGLBuffer, itemSize: number, numItems: number}

Triangles that belong to the Feature.

borders {buffer: WebGLBuffer, itemSize: number, numItems: number}

Borders that belong to the Feature.

points {buffer: WebGLBuffer, itemSize: number, numItems: number}

Points that belong to the Feature.

See:

TODO:

  • Finish document of this method.

public checkProperty(value: string): boolean source

Verifies the existence or not of the property Aesthethic._attr and if it fits inside this Aesthetic range.

Params:

NameTypeAttributeDescription
value string

The attribute ?.

Return:

boolean

True if there's no range or it is inside the range or ?, otherwise, false.

public enableDisable(): boolean source

Inverts this Aesthetic element state in the Legend object. If it was enabled it will be disabled or vice-versa.

Return:

boolean

Inverse of current enabled value.

public getAllFeatures(): Array<Feature> source

Returns all Features as one?

Return:

Array<Feature>

All features grouped together?

public getAttr(): _attr source

Gets this Aesthetic attribute.

Return:

_attr

The string representing the attr of this Aesthetic.

public getFeatures(): Array<Feature> source

Returns all Features that belong to this Aesthetic object.

Return:

Array<Feature>

All the Features of this Aeshtetic.

public getFillColor(): fillColor source

Returns the fill color for this Aesthetic object.

Return:

fillColor

public getPointSize(): number source

Returns the size of this Aesthetic points.

Return:

number

The size of the point.

public getStrokeColor(): strokeColor source

Returns the stroke color for this Aesthetic object.

Return:

strokeColor

public isEnabled(): boolean source

Verifies if this Aeshtetic element is enable on the Legend or not.

Return:

boolean

True if it's enabled, false, otherwise.

public isOuter(): boolean source

Returns if this Aesthetic is outer or not.

Return:

boolean

true if it is outer, false, otherwise.