Options
All
  • Public
  • Public/Protected
  • All
Menu

@equinor/videx-wellog - v0.3.0

Index

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

D3Selection

D3Selection: any

Interface to abstract d3 selection

DataAccessorFunction

DataAccessorFunction: function

When used in combination with a Track, it is the track's responsibillity to fetch and pass down data to the plots. This is configured by providing a data accessor callback function, where the track's data are made available as the input argument and the returned value will be used by the plot.

example

data => data //default

example

data => data.dataSeries[1].dataPoints

Type declaration

    • (data: any): any
    • Parameters

      • data: any

      Returns any

DebounceFunction

DebounceFunction: function

Type declaration

    • (func: Function, ...args: any): void
    • Parameters

      • func: Function
      • Rest ...args: any

      Returns void

DefinedFunction

DefinedFunction: function

Function to control what data to plot, where y is the value/range part of a plot data tuplet and x is the domain part of a prop data tuplet

example

(y, x) => Number.isFinite(y) && Number.isFinite(x)

Type declaration

    • (y?: number, x?: number): boolean
    • Parameters

      • Optional y: number
      • Optional x: number

      Returns boolean

DifferentialPlotData

DifferentialPlotData: Triplet<number>[]

Data format used by differential plot

example

[[0, 10, 0.5], [10, 21, 0.78], [20, 19, 1.21] ... ]

Domain

Domain: Tuplet<number> | number[]

Domain of a scale. Represented as a number array on the form [from, to]

LegendOnInitFunction

LegendOnInitFunction: function

Type declaration

LegendOnUpdateFunction

LegendOnUpdateFunction: function

Type declaration

LegendRowsFunction

LegendRowsFunction: function

Type declaration

    • Parameters

      Returns number

LegendTriggerFunction

LegendTriggerFunction: function

Type declaration

    • (): void
    • Returns void

PlotCreatorFunction

PlotCreatorFunction: function

Type declaration

PlotData

PlotData: Tuplet<number>[]

Data format used by plots

example

[[0, 10], [10, 21], [20, 19] ... ]

Range

Range: Tuplet<number> | number[]

Range to scale a domain value to. Represented as a number array on the form [from, to]

ReducerFunction

ReducerFunction: function

Type declaration

Triplet

Triplet<T>: [T, T, T]

Generic array of three values [T, T, T]

Type parameters

  • T

Tuplet

Tuplet<T>: [T, T]

Generic array of two values [T, T]

Type parameters

  • T

Variables

Const colorMajor

colorMajor: "#ccc" = "#ccc"

major ticks color

Const colorMinor

colorMinor: "#ddd" = "#ddd"

minor ticks color

Const legendBaseSize

legendBaseSize: 25 = 25

Const minSize

minSize: 10 = 10

Const scaleLegendConfig

scaleLegendConfig: LegendConfig = ({elementType: 'svg',getLegendRows: () => 2,onInit: (elm, track, updateTrigger) => {track.legendUpdate = updateTrigger;const lg = select(elm);lg.selectAll('g.scale-legend').remove();const g = lg.append('g').attr('class', 'scale-legend');g.append('text').classed('scale-title', true).attr('font-weight', '600').style('text-anchor', 'middle');g.append('text').attr('class', 'scale-range').style('text-anchor', 'middle');g.append('text').attr('class', 'scale-units').style('text-anchor', 'middle');},onUpdate: onUpdateLegend,})

Config object required for track config in order to add legend

Const strokeMajor

strokeMajor: 2 = 2

major stroke width

Const strokeMinor

strokeMinor: 1 = 1

minor stroke width

Const ticksFactor

ticksFactor: 60 = 60

Const titleBarBaseSize

titleBarBaseSize: 18 = 18

Const titleFontSizeFactor

titleFontSizeFactor: 0.7 = 0.7

Const uiScaleFactor

uiScaleFactor: 800 = 800

Const wheelPanFactor

wheelPanFactor: 50 = 50

Functions

computeLabelBounds

computeLabelBoundsHorizontal

createDifferentialPlot

createOverlay

createPlotType

createScale

debouncer

  • Creates a debounce function that can be used to easily throttle function calls

    Parameters

    • Default value debounceInterval: number = 20

    Returns DebounceFunction

getGraphTrackLegendRows

  • getGraphTrackLegendRows(track: GraphTrack): number

hashString

  • hashString(str: string): number
  • Simple and quick hashing function for strings

    Parameters

    • str: string

    Returns number

numberFormatter

  • numberFormatter(v: number, decimals?: number): string
  • Format a numeric value as a string, rounded to the specified number of decimals.

    Parameters

    • v: number
    • Default value decimals: number = 1

    Returns string

onUpdateLegend

patchPlotOptions

renderAreaPlotLegend

renderBasicPlotLegend

  • renderBasicPlotLegend(g: D3Selection, bounds: LegendBounds, label: string, unit: string, domain: number[], color: string, addLabelBg?: boolean): void
  • Renders a basic/standard set of layout that are common for most plot-type legends

    Parameters

    • g: D3Selection
    • bounds: LegendBounds
    • label: string
    • unit: string
    • domain: number[]
    • color: string
    • Default value addLabelBg: boolean = false

    Returns void

renderDifferentialPlotLegend

renderDotPlotLegend

renderHorizontalTicks

renderLinePlotLegend

renderLineStepPlotLegend

renderTextLabels

  • renderTextLabels(g: D3Selection, bounds: LegendBounds, label: string, unit: string, domain: number[], color: string, addLabelBg?: boolean): void
  • Renders label, min/max values for domain and unit

    Parameters

    • g: D3Selection
    • bounds: LegendBounds
    • label: string
    • unit: string
    • domain: number[]
    • color: string
    • Default value addLabelBg: boolean = false

    Returns void

renderTicks

round

  • round(v: number, decimals: number): number
  • Rounding function that rounds of to specified decimal

    Parameters

    • v: number
    • decimals: number

    Returns number

setAttrs

  • Set multiple attributes on all elements in selection instead of using selection.attr for each attribute to set.

    Parameters

    Returns D3Selection

setPlotData

  • setPlotData(plots: Plot[], data: any, scale: Scale): void

setProps

  • Wrapper for setAttrs and setStyles, setting both attributes and styles on each element in seletion.

    Parameters

    • selection: D3Selection
    • props: object
      • Optional attrs?: object
      • Optional styles?: object

    Returns D3Selection

setStyles

stepCustom

updateLegendRows

Object literals

Const defaultOptions

defaultOptions: object

autoResize

autoResize: boolean = true

domain

domain: number[] = [0, 1000]

horizontal

horizontal: boolean = false

plotFactory

plotFactory: PlotFactory = defaultPlotFactory

scale

scale: string = "linear"

showLegend

showLegend: boolean = true

showTitles

showTitles: boolean = true

togglePlotFromLegend

togglePlotFromLegend: boolean = true

transitionDuration

transitionDuration: number = 0

Const defaults

defaults: object

Default options

horizontal

horizontal: boolean = false

maxWidth

maxWidth: null = null

width

width: number = 3

Const noInterpolator

noInterpolator: object

Default no-ops interpolator

forward

  • forward(v: number): number

forwardInterpolatedDomain

  • forwardInterpolatedDomain(domain: [number, number] | number[]): [number, number] | number[]

reverse

  • reverse(v: number): number

reverseInterpolatedDomain

  • reverseInterpolatedDomain(domain: [number, number] | number[]): [number, number] | number[]

Const plotFactory

plotFactory: object

Dictionary of plot creator functions for available plot types. You may pass your own factory dictionary if you need to support custom plot types not part of this lib.

area

area: function = createPlotType(AreaPlot)

Type declaration

differential

differential: createDifferentialPlot = createDifferentialPlot

dot

dot: function = createPlotType(DotPlot)

Type declaration

line

line: function = createPlotType(LinePlot)

Type declaration

linestep

linestep: function = createPlotType(LineStepPlot)

Type declaration

Generated using TypeDoc