Last updated

API / geotoolkit / seismic / util / ColorMap / ColorMap

Class: ColorMap

util.ColorMap.ColorMap

Define a colormap which represents a range of color values which can be mapped to samples based on density.
It has reserved values for positive and negative fill color. The toolkit also has several default colormaps available,
please refer to SeismicColors getDefault()

Hierarchy

Table of contents

Constructors
Methods
Css Properties
Name Type Description
maxnumber
minnumber
namestringColor map name
negativefillstylestringPositive fill style
negativefillstyleFillStylePositive fill style
negativefillstyle-colorstringColor in CSS form
negativefillstyle-evenoddmodebooleanEven-odd fill mode
negativefillstyle-fillpatternPatternPattern
negativefillstyle-fillpattern-containernamestringAn optional container name, which creates an image pattern. This parameter is used for serialization if you want to save are reference to pattern instead of the pattern itself
negativefillstyle-fillpattern-patternnamestringName of this pattern for indexing
negativefillstyle-fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
negativefillstyle-foregroundstringForeground color
negativefillstyle-patternPatternPattern
positivefillstylestringPositive fill style
positivefillstyleFillStylePositive fill style
scaleKnownScales
sizenumberColor map size
tracelinestylestringTrace line style
tracelinestyleLineStyleTrace line style
tracelinestyle-colorstringColor in CSS form
tracelinestyle-fillstringOptional fill style to be used to fill lines generated with this style
tracelinestyle-fillFillStyleOptional fill style to be used to fill lines generated with this style
tracelinestyle-linecapCapStyleThe line cap style
tracelinestyle-linedashoffsetnumberLine dash offset of dashed line
tracelinestyle-linejoinJoinStyleThe line join style
tracelinestyle-pixelsnapmodebooleanPixel Snap Mode, default(
tracelinestyle-scalablebooleanTrue if width should depend on transformation
tracelinestyle-unitstringOptional unit for the width
tracelinestyle-widthnumber | stringThe line thickness

Contents

Constructors

new ColorMap(options, name)

new ColorMap(options?, name?)

Parameters

Name Type
Optional optionsOptions
Optional namestring

Overrides

ColorProvider.constructor

Methods

clone

clone(): ColorMap

Return clone of the color map

Returns

ColorMap

clone

Overrides

ColorProvider.clone


copyConstructor

Protected copyConstructor(src, deepCopy?): ColorMap

Copy constructor

Parameters

Name Type Description
srcColorMapSource to copy from
Optional deepCopyboolean

Returns

ColorMap

this

Overrides

ColorProvider.copyConstructor


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

ColorProvider.dispose


exportToImage

exportToImage(width, height, isVertical, surface?): Surface

returns surface that represents color map

Parameters

Name Type Description
widthnumberThe image width
heightnumberThe image height
isVerticalbooleanTrue if image is oriented vertically
Optional surfaceSurfaceoutput surface

Returns

Surface

surface The canvas surface

Inherited from

ColorProvider.exportToImage


getClassName

getClassName(): string

Returns

string

Inherited from

ColorProvider.getClassName


getColor

getColor(value): RgbaColor

Return color for the current value

Parameters

Name Type Description
valuenumberthe specified color

Returns

RgbaColor

the RgbaColor.

Overrides

ColorProvider.getColor


getColors

getColors(): RgbaColor[]

Return color array

Returns

RgbaColor[]


getMaxValue

getMaxValue(): number

Return max

Returns

number

Maximum of ColorProvider

Overrides

ColorProvider.getMaxValue


getMinValue

getMinValue(): number

Return min

Returns

number

Minimum of ColorProvider

Overrides

ColorProvider.getMinValue


getName

getName(): string

Return name

Returns

string


getNamedColor

getNamedColor(colorName): string | NamedColorValue

Returns known color value

Parameters

Name Type Description
colorNamestringcolor name, if not specified then returns list of known colors

Returns

string | NamedColorValue

color

Inherited from

ColorProvider.getNamedColor


getNamedColors

getNamedColors(): NamedColor[]

Returns known colors

Returns

NamedColor[]

array of color pair

Inherited from

ColorProvider.getNamedColors


getNegativeFillStyle

getNegativeFillStyle(): FillStyle

Return negative fill style to be used instead of negative fill style

Returns

FillStyle


getPositiveFillStyle

getPositiveFillStyle(): FillStyle

Return positive fill style to be used instead of positive color

Returns

FillStyle


getProperties

getProperties(): OptionsOut

Returns properties

Returns

OptionsOut

Json object with properties

Overrides

ColorProvider.getProperties


getRaster

getRaster(xMin?, yMin?, xMax?, yMax?): Raster

Returns a new instance of Raster

Parameters

Name Type Description
Optional xMinnumberx Min position to get color
Optional yMinnumbery Min position to get color
Optional xMaxnumberx Max position to get color
Optional yMaxnumbery Max position to get color

Returns

Raster

Inherited from

ColorProvider.getRaster


getSize

getSize(): number

Return size

Returns

number


getStopPoints

getStopPoints(): { color: string ; value: number }[]

Return list of used Stop Points

Returns

{ color: string ; value: number }[]

Overrides

ColorProvider.getStopPoints


getTraceLineStyle

getTraceLineStyle(): LineStyle

Return trace line style to be used instead of trace color

Returns

LineStyle


getTraceStatusLineStyle

getTraceStatusLineStyle(status): LineStyle

Returns trace line style for specified status

Parameters

Name Type Description
statusStatustrace status

Returns

LineStyle

getTraceStatusLineStyle(): Partial<Record<Status, LineStyle>>

Returns an object with all statuses

Returns

Partial<Record<Status, LineStyle>>


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

ColorProvider.hasEventListener


hasNamedColor

hasNamedColor(colorName): boolean

Check if specified named color exists

Parameters

Name Type Description
colorNamestringcolor name

Returns

boolean

true if color exists

Inherited from

ColorProvider.hasNamedColor


invalidate

invalidate(): ColorMap

Invalidate Default ColorProvider and notify visuals for update

Returns

ColorMap

Overrides

ColorProvider.invalidate


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

ColorProvider.isDisposed


isNotificationEnabled

isNotificationEnabled(): boolean

Return state of notification

Returns

boolean

Overrides

ColorProvider.isNotificationEnabled


isReversed

isReversed(): boolean

Return reversed flag

Returns

boolean


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

ColorProvider.isSilent


notify

notify<E>(type, source, args?): ColorMap

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceColorMapof the event
Optional argsEventMap[E]arguments of the event

Returns

ColorMap

this

Overrides

ColorProvider.notify


off

off<E>(type?, callback?): ColorMap

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: ColorMap, args: EventMap[E]) => voidfunction to be called

Returns

ColorMap

this

Overrides

ColorProvider.off


on

on<E>(type, callback): ColorMap

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: ColorMap, args: EventMap[E]) => voidto be called

Returns

ColorMap

this

Overrides

ColorProvider.on


reverse

reverse(): ColorMap

Reverse color map

Returns

ColorMap

this


setAlpha

setAlpha(alpha): ColorMap

Set alpha value for all colors

Parameters

Name Type Description
alphanumberthe alpha value of the color

Returns

ColorMap

this


setColors

setColors(colors, rampSize?): ColorMap

Sets colors

Throws

if color is null

Parameters

Name Type Description
colors(string | RgbaColor)[]array of colors
Optional rampSizenumberramp size to interpolate

Returns

ColorMap

this


setName

setName(name): ColorMap

Set name

Parameters

Name Type Description
namestringthe name of the colormap

Returns

ColorMap

this


setNamedColor

setNamedColor(colorName, colorValue): ColorMap

Set color value

Example

import {KnownColors} from '@int/geotoolkit/util/ColorProvider';
colorProvider.setNamedColor(KnownColors.NaN, { // set color for NaN values
'title': 'absent', // title to use when displaying, e.g. by ColorBar shape
'enabled': true, // enable state (default is not false)
'value': 'black' // color to use for NaNs
});

Example

// use 'red' color for values greater than maxValue (default '+∞' title is used)
colorProvider.setNamedColor(KnownColors.PositiveInfinity, 'red');

Parameters

Name Type Description
colorNamestringcolor name
colorValuestring | NamedColorValuecolor or title/value settings object

Returns

ColorMap

this

Inherited from

ColorProvider.setNamedColor


setNegativeFillStyle

setNegativeFillStyle(style): ColorMap

Set negative fill style to be used instead of negative fill color

Parameters

Name Type Description
styleTypeobject can be in format of constructor FillStyle

Returns

ColorMap

this


setNotification

setNotification(enable, force?): ColorMap

Enable / disable notification

Parameters

Name Type Description
enablebooleanenable or disable notifications
Optional forcebooleantrue if parent should be invalidated immediately

Returns

ColorMap

this

Overrides

ColorProvider.setNotification


setPositiveFillStyle

setPositiveFillStyle(style): ColorMap

Set positive fill style to be used instead of positive color

Parameters

Name Type Description
styleTypeobject can be in format of constructor FillStyle

Returns

ColorMap

this


setProperties

setProperties(properties?): ColorMap

Sets properties

Parameters

Name Type Description
Optional propertiesOptionsJson object with properties

Returns

ColorMap

this

Overrides

ColorProvider.setProperties


setRange

setRange(min, max): ColorMap

Set min and max value

Parameters

Name Type Description
minnumbermin value in the range of colors
maxnumbermax value in the range of colors

Returns

ColorMap


setSilent

setSilent(bool): ColorMap

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

ColorMap

this

Inherited from

ColorProvider.setSilent


setTraceLineStyle

setTraceLineStyle(style): ColorMap

Set trace line style to be used instead of trace color

Parameters

Name Type Description
styleTypeobject can be in format of constructor LineStyle

Returns

ColorMap

this


setTraceStatusLineStyle

setTraceStatusLineStyle(status, linestyle): ColorMap

Sets trace line style for given status

Parameters

Name Type Description
statusStatustrace status
linestyleTypeline style

Returns

ColorMap

this


getClassName

Static getClassName(): string

Returns

string

Inherited from

ColorProvider.getClassName


getColorProviderType

Static getColorProviderType(objectType?): ClassType<any>

Return ColorProvider constructor from the object class name or type.

Deprecated

since 4.1 Use ColorProvider implementation directly

Parameters

Name Type Description
Optional objectTypestringColorProvider class name

Returns

ClassType<any>

ColorProvider constructor

Inherited from

ColorProvider.getColorProviderType