@equinor/videx-wellog
Version:
Visualisation components for wellbore log data
48 lines (47 loc) • 1.42 kB
TypeScript
import { ScaleHandlerTicks } from '../scale-handlers/interfaces';
import { Scale, Domain } from '../common/interfaces';
/**
* Util functions for d3 scales
*/
export default class ScaleHelper {
/**
* Get pixel ratio from scale
*/
static getPixelRatio(scale: Scale): number;
/**
* Get domain ratio from scale
*/
static getDomainRatio(scale: Scale): number;
/**
* Get the domain span of a scale
*/
static getDomainSpan(scale: Scale, absoluteValue?: boolean): number;
/**
* Get the domain span of a scale in pixels
*/
static getDomainPixelSpan(scale: Scale, domain?: Domain): number;
/**
* Get the range span of a scale in pixels
*/
static getRangeSpan(scale: Scale): number;
/**
* Creates logarithmic major and minor ticks for a log scale
*/
static createLogTicks(scale: Scale): ScaleHandlerTicks;
/**
* Creates linear major and minor ticks
*/
static createLinearTicks(scale: Scale, num?: number): ScaleHandlerTicks;
/**
* Creates major ticks only
*/
static createMajorTicks(scale: Scale): ScaleHandlerTicks;
/**
* Internal. Creates minor ticks based around a value, number of steps and step size
*/
private static createMinorTicks;
/**
* Create major and minor ticks from scale
*/
static createTicks(scale: Scale): ScaleHandlerTicks;
}