Home Manual Reference Source Repository
import ScaleTickIntervals from 'waves-ui-piper/src/utils/scale-tick-intervals.js'
public class | source

ScaleTickIntervals

Code to calculate which values to label in a scale between two endpoints, and how they should be labelled. Based on ScaleTickIntervals from Sonic Visualiser, relicensed for this library. Copyright 2017 QMUL.

Constructor Summary

Public Constructor
public

Method Summary

Public Methods
public

linear(min: *, max: *, n: *): *

Return an array of objects describing tick locations and labels, each object having "value" (number) and "label" (string) properties.

Public Constructors

public constructor() source

Public Methods

public linear(min: *, max: *, n: *): * source

Return an array of objects describing tick locations and labels, each object having "value" (number) and "label" (string) properties. All ticks will be within the range [min, max] and there will be approximately n+1 of them, dividing the range up into n divisions, although this number may vary based on which tick values seem best suited to labelling.

Params:

NameTypeAttributeDescription
min *
max *
n *

Return:

*