API / geotoolkit / seismic / 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()
↳
ColorMap
Constructors
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
max | number | |
min | number | |
name | string | Color map name |
negativefillstyle | string | Positive fill style |
negativefillstyle | FillStyle | Positive fill style |
negativefillstyle-color | string | Color in CSS form |
negativefillstyle-evenoddmode | boolean | Even-odd fill mode |
negativefillstyle-fillpattern | Pattern | Pattern |
negativefillstyle-fillpattern-containername | string | An 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-patternname | string | Name of this pattern for indexing |
negativefillstyle-fillpattern-scalable | boolean | Flag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported) |
negativefillstyle-foreground | string | Foreground color |
negativefillstyle-pattern | Pattern | Pattern |
positivefillstyle | string | Positive fill style |
positivefillstyle | FillStyle | Positive fill style |
scale | KnownScales | |
size | number | Color map size |
tracelinestyle | string | Trace line style |
tracelinestyle | LineStyle | Trace line style |
tracelinestyle-color | string | Color in CSS form |
tracelinestyle-fill | string | Optional fill style to be used to fill lines generated with this style |
tracelinestyle-fill | FillStyle | Optional fill style to be used to fill lines generated with this style |
tracelinestyle-linecap | CapStyle | The line cap style |
tracelinestyle-linedashoffset | number | Line dash offset of dashed line |
tracelinestyle-linejoin | JoinStyle | The line join style |
tracelinestyle-pixelsnapmode | boolean | Pixel Snap Mode, default( |
tracelinestyle-scalable | boolean | True if width should depend on transformation |
tracelinestyle-unit | string | Optional unit for the width |
tracelinestyle-width | number | string | The line thickness |
Constructors
• new ColorMap(options?, name?)
| Name | Type |
|---|---|
Optional options | Options |
Optional name | string |
ColorProvider.constructor
Methods
▸ clone(): ColorMap
Return clone of the color map
clone
▸ Protected copyConstructor(src, deepCopy?): ColorMap
Copy constructor
| Name | Type | Description |
|---|---|---|
src | ColorMap | Source to copy from |
Optional deepCopy | boolean |
this
▸ dispose(): void
Dispose.
void
▸ exportToImage(width, height, isVertical, surface?): Surface
returns surface that represents color map
| Name | Type | Description |
|---|---|---|
width | number | The image width |
height | number | The image height |
isVertical | boolean | True if image is oriented vertically |
Optional surface | Surface | output surface |
surface The canvas surface
▸ getClassName(): string
string
▸ getColor(value): RgbaColor
Return color for the current value
| Name | Type | Description |
|---|---|---|
value | number | the specified color |
the RgbaColor.
▸ getColors(): RgbaColor[]
Return color array
▸ getMaxValue(): number
Return max
number
Maximum of ColorProvider
▸ getMinValue(): number
Return min
number
Minimum of ColorProvider
▸ getName(): string
Return name
string
▸ getNamedColor(colorName): string | NamedColorValue
Returns known color value
| Name | Type | Description |
|---|---|---|
colorName | string | color name, if not specified then returns list of known colors |
string | NamedColorValue
color
▸ getNamedColors(): NamedColor[]
Returns known colors
array of color pair
▸ getNegativeFillStyle(): FillStyle
Return negative fill style to be used instead of negative fill style
▸ getPositiveFillStyle(): FillStyle
Return positive fill style to be used instead of positive color
▸ getProperties(): OptionsOut
Returns properties
Json object with properties
▸ getRaster(xMin?, yMin?, xMax?, yMax?): Raster
Returns a new instance of Raster
| Name | Type | Description |
|---|---|---|
Optional xMin | number | x Min position to get color |
Optional yMin | number | y Min position to get color |
Optional xMax | number | x Max position to get color |
Optional yMax | number | y Max position to get color |
▸ getSize(): number
Return size
number
▸ getStopPoints(): { color: string ; value: number }[]
Return list of used Stop Points
{ color: string ; value: number }[]
▸ getTraceLineStyle(): LineStyle
Return trace line style to be used instead of trace color
▸ getTraceStatusLineStyle(status): LineStyle
Returns trace line style for specified status
| Name | Type | Description |
|---|---|---|
status | Status | trace status |
▸ getTraceStatusLineStyle(): Partial<Record<Status, LineStyle>>
Returns an object with all statuses
Partial<Record<Status, LineStyle>>
▸ hasEventListener(type, callback?): boolean
Check if a list of event listeners for this type contains this listener
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
Optional callback | Function | to be called, if null, check if any callback is registered |
boolean
ColorProvider.hasEventListener
▸ hasNamedColor(colorName): boolean
Check if specified named color exists
| Name | Type | Description |
|---|---|---|
colorName | string | color name |
boolean
true if color exists
▸ invalidate(): ColorMap
Invalidate Default ColorProvider and notify visuals for update
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isNotificationEnabled(): boolean
Return state of notification
boolean
ColorProvider.isNotificationEnabled
▸ isReversed(): boolean
Return reversed flag
boolean
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ notify<E>(type, source, args?): ColorMap
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | ColorMap | of the event |
Optional args | EventMap[E] | arguments of the event |
this
▸ 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.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
Optional type | E | type of the event |
Optional callback | (eventType: E, sender: ColorMap, args: EventMap[E]) => void | function to be called |
this
▸ 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.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of event or property |
callback | (eventType: E, sender: ColorMap, args: EventMap[E]) => void | to be called |
this
▸ reverse(): ColorMap
Reverse color map
this
▸ setAlpha(alpha): ColorMap
Set alpha value for all colors
| Name | Type | Description |
|---|---|---|
alpha | number | the alpha value of the color |
this
▸ setColors(colors, rampSize?): ColorMap
Sets colors
Throws
if color is null
| Name | Type | Description |
|---|---|---|
colors | (string | RgbaColor)[] | array of colors |
Optional rampSize | number | ramp size to interpolate |
this
▸ setName(name): ColorMap
Set name
| Name | Type | Description |
|---|---|---|
name | string | the name of the colormap |
this
▸ 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');| Name | Type | Description |
|---|---|---|
colorName | string | color name |
colorValue | string | NamedColorValue | color or title/value settings object |
this
▸ setNegativeFillStyle(style): ColorMap
Set negative fill style to be used instead of negative fill color
this
▸ setNotification(enable, force?): ColorMap
Enable / disable notification
| Name | Type | Description |
|---|---|---|
enable | boolean | enable or disable notifications |
Optional force | boolean | true if parent should be invalidated immediately |
this
▸ setPositiveFillStyle(style): ColorMap
Set positive fill style to be used instead of positive color
this
▸ setProperties(properties?): ColorMap
Sets properties
| Name | Type | Description |
|---|---|---|
Optional properties | Options | Json object with properties |
this
▸ setRange(min, max): ColorMap
Set min and max value
| Name | Type | Description |
|---|---|---|
min | number | min value in the range of colors |
max | number | max value in the range of colors |
▸ setSilent(bool): ColorMap
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ setTraceLineStyle(style): ColorMap
Set trace line style to be used instead of trace color
this
▸ setTraceStatusLineStyle(status, linestyle): ColorMap
Sets trace line style for given status
this
▸ Static getClassName(): string
string
▸ Static getColorProviderType(objectType?): ClassType<any>
Return ColorProvider constructor from the object class name or type.
Deprecated
since 4.1 Use ColorProvider implementation directly
| Name | Type | Description |
|---|---|---|
Optional objectType | string | ColorProvider class name |
ClassType<any>
ColorProvider constructor