UNPKG

@equinor/videx-wellog

Version:

Visualisation components for wellbore log data

54 lines (53 loc) 2.14 kB
import BasicScaleHandler from './basic-scale-handler'; import { Scale, Domain } from '../common/interfaces'; import { ScaleHandlerTicks, ScaleInterpolator } from './interfaces'; /** * Scale handler supporting interpolation between domains. A scale interpolator * is required to convert between the domains. This is implemented as an object * with 2 conversion functions, forward and reverse. It also needs to implement * 2 more functions, forwardInterpolatedDomain and reverseInterpolatedDomain. * These should return the corresponding domain based on the opposite domain, * i.e. MD <==> TVD. */ export default class InterpolatedScaleHandler extends BasicScaleHandler { interpolator: ScaleInterpolator; private _mode; private _alternateBase; constructor(interpolator?: ScaleInterpolator, baseDomain?: Domain); /** * Creates a function, which implements the d3.scale members required by * the tracks in the wellog component. The scale function, and its reverse, * will handle interpolation/conversion between the domains, using the * provided scale interpolator. */ createInterpolatedScale(): Scale; /** * Set mode of the scale handler. Mode is used to switch between domains, * so that the internal scale will always be according to the domain of the * current mode, while the data scale will always conform to the master mode. * mode = 0: master mode * mode = 1: alternate mode */ setMode(m: number): InterpolatedScaleHandler; /** * Rescales the domain of the internal scale according to the selected mode. */ rescaleToMode(): InterpolatedScaleHandler; /** * Return ticks based on scale's current domain and range */ ticks(mode?: number): ScaleHandlerTicks; /** * set or get base domain, according to current on mode */ baseDomain(): Domain; baseDomain(newDomain: Domain): this; /** * Getter for the current mode */ get mode(): number; /** * Overrides the getter for the scale exposed to the wellog component's tracks */ get dataScale(): Scale; }