Options
All
  • Public
  • Public/Protected
  • All
Menu

Class QuantizeScale<DomainValue, RangeValue>

Type parameters

  • DomainValue: QuantitativeValue

  • RangeValue: QuantitativeValue

Hierarchy

  • DomainRangeScale<[DomainValue, DomainValue], RangeValue[], any>
    • QuantizeScale

Index

Constructors

constructor

  • new QuantizeScale<DomainValue, RangeValue>(): QuantizeScale<DomainValue, RangeValue>
  • Type parameters

    • DomainValue: QuantitativeValue

    • RangeValue: QuantitativeValue

    Returns QuantizeScale<DomainValue, RangeValue>

Properties

Protected Optional bindDomainValue

bindDomainValue?: string

Protected Optional bindRangeValue

bindRangeValue?: any

Protected Optional domainValue

domainValue?: DomainCreator<[DomainValue, DomainValue]>

Protected Optional nameValue

nameValue?: string

Protected Optional niceValue

niceValue?: number | boolean

Protected Optional rangeValue

rangeValue?: (args: ScaleCreationContext) => RangeValue[]

Type declaration

    • (args: ScaleCreationContext): RangeValue[]
    • Parameters

      • args: ScaleCreationContext

      Returns RangeValue[]

Protected Optional reverseValue

reverseValue?: boolean

Protected Optional zeroValue

zeroValue?: boolean

Accessors

Protected bindDomainArray

  • get bindDomainArray(): string[]

Protected defaultDomain

  • get defaultDomain(): Domain

Protected defaultRange

  • get defaultRange(): Range

Methods

build

  • build(arg: ScaleCreationContext): Scales
  • Parameters

    • arg: ScaleCreationContext

    Returns Scales

createScale

  • createScale(args: ScaleCreationContext): {}
  • Parameters

    • args: ScaleCreationContext

    Returns {}

    domain

    • domain(arg?: string | [DomainValue, DomainValue] | DomainCreator<[DomainValue, DomainValue]>): QuantizeScale<DomainValue, RangeValue>
    • Sets the domain of the scale

      Parameters

      • Optional arg: string | [DomainValue, DomainValue] | DomainCreator<[DomainValue, DomainValue]>

        The domain argument

      Returns QuantizeScale<DomainValue, RangeValue>

    Protected domainContainsZero

    • domainContainsZero(domain: [DomainValue, DomainValue]): boolean

    Protected getDomain

    • getDomain(args: ScaleCreationContext): [DomainValue, DomainValue]
    • Parameters

      • args: ScaleCreationContext

      Returns [DomainValue, DomainValue]

    Protected getRange

    • getRange(args: ScaleCreationContext): RangeValue[]
    • Parameters

      • args: ScaleCreationContext

      Returns RangeValue[]

    handleRangeBind

    • handleRangeBind(): any[]

    name

    • Sets the name of the scale

      Parameters

      • Optional value: string

        The name of the scale

      Returns QuantizeScale<DomainValue, RangeValue>

    nice

    • nice(value?: number | boolean): QuantizeScale<DomainValue, RangeValue>
    • Extends the domain so that it starts and ends on nice round values.

      Parameters

      • Optional value: number | boolean

      Returns QuantizeScale<DomainValue, RangeValue>

    Protected processDomainValues

    • processDomainValues(values: QuantitativeValue[]): [DomainValue, DomainValue]
    • Parameters

      • values: QuantitativeValue[]

      Returns [DomainValue, DomainValue]

    range

    reverse

    • reverse(reversed?: boolean): QuantizeScale<DomainValue, RangeValue>

    Protected reverseRange

    • reverseRange(range: RangeValue[]): RangeValue[]
    • Parameters

      • range: RangeValue[]

      Returns RangeValue[]

    zero

    • Boolean flag indicating if the scale domain should include zero. The default value is true for linear, sqrt and pow, and false otherwise.

      Parameters

      • Optional value: boolean

      Returns QuantizeScale<DomainValue, RangeValue>