Components Interactions Examples Tutorials API FAQ
Options
Menu

Class ModifiedLog

Hierarchy

Implements

Index

Constructors

constructor

  • A ModifiedLog Scale acts as a regular log scale for large numbers. As it approaches 0, it gradually becomes linear. Consequently, a ModifiedLog Scale can process 0 and negative numbers.

    For x >= base, scale(x) = log(x).

    For 0 < x < base, scale(x) will become more and more linear as it approaches 0.

    At x == 0, scale(x) == 0.

    For negative values, scale(-x) = -scale(x).

    The range and domain for the scale should also be set, using the range() and domain() accessors, respectively.

    For range, provide a two-element array giving the minimum and maximum of values produced when scaling.

    For domain provide a two-element array giving the minimum and maximum of the values that will be scaled.

    constructor

    Parameters

    • Optional base: number

    Returns ModifiedLog

Properties

Private _base

_base: any

Private _d3Scale

_d3Scale: any

Private _pivot

_pivot: any

Private _untransformedDomain

_untransformedDomain: any

Static Protected _DEFAULT_NUM_TICKS

_DEFAULT_NUM_TICKS: number

Methods

Private _adjustedLog

  • _adjustedLog(x: any): any
  • Returns an adjusted log10 value for graphing purposes. The first adjustment is that negative values are changed to positive during the calculations, and then the answer is negated at the end. The second is that, for values less than 10, an increasingly large (0 to 1) scaling factor is added such that at 0 the value is adjusted to 1, resulting in a returned result of 0.

    Parameters

    • x: any

    Returns any

Protected _autoDomainIfAutomaticMode

  • _autoDomainIfAutomaticMode(): void

Protected _backingScaleDomain

  • _backingScaleDomain(): number[]
  • _backingScaleDomain(values: number[])

Protected _defaultExtent

  • _defaultExtent(): number[]

Protected _dispatchUpdate

  • _dispatchUpdate(): void

Protected _expandSingleValueDomain

  • _expandSingleValueDomain(singleValueDomain: number[]): number[]

Protected _getAllIncludedValues

  • _getAllIncludedValues(): number[]

Protected _getDomain

  • _getDomain(): number[]

Protected _getExtent

  • _getExtent(): number[]

Protected _getRange

  • _getRange(): number[]

Private _howManyTicks

  • _howManyTicks(lower: any, upper: any): any
  • How many ticks does the range [lower, upper] deserve?

    e.g. if your domain was [10, 1000] and I asked _howManyTicks(10, 100), I would get 1/2 of the ticks. The range 10, 100 takes up 1/2 of the distance when plotted.

    Parameters

    • lower: any
    • upper: any

    Returns any

Private _invertedAdjustedLog

  • _invertedAdjustedLog(x: any): any

Private _logTicks

  • _logTicks(lower: any, upper: any): any
  • Return an appropriate number of ticks from lower to upper.

    This will first try to fit as many powers of this.base as it can from lower to upper.

    If it still has ticks after that, it will generate ticks in "clusters", e.g. [20, 30, ... 90, 100] would be a cluster, [200, 300, ... 900, 1000] would be another cluster.

    This function will generate clusters as large as it can while not drastically exceeding its number of ticks.

    Parameters

    • lower: any
    • upper: any

    Returns any

Protected _niceDomain

  • _niceDomain(domain: number[], count?: number): number[]

Protected _setDomain

  • _setDomain(values: number[]): void

Protected _setRange

  • _setRange(values: number[]): void

addIncludedValuesProvider

addPaddingExceptionsProvider

autoDomain

  • autoDomain()

defaultTicks

  • defaultTicks(): number[]

domain

  • domain(): number[]
  • domain(values: number[])

domainMax

  • domainMax(): number
  • domainMax(domainMax: number)

domainMin

  • domainMin(): number
  • domainMin(domainMin: number)

extentOfValues

  • extentOfValues(values: number[]): number[]

getTransformationDomain

  • getTransformationDomain(): [number, number]

invert

  • invert(x: number): number

invertedTransformation

  • invertedTransformation(value: number): number

offUpdate

onUpdate

padProportion

  • padProportion(): number
  • padProportion(padProportion: number)

pan

  • pan(translateAmount: number): void

range

  • range(): number[]
  • range(values: number[])

removeIncludedValuesProvider

removePaddingExceptionsProvider

scale

  • scale(x: number): number

scaleTransformation

  • scaleTransformation(value: number): number

snappingDomainEnabled

  • snappingDomainEnabled(): boolean
  • snappingDomainEnabled(snappingDomainEnabled: boolean)

tickGenerator

ticks

  • ticks(): number[]

zoom

  • zoom(magnifyAmount: number, centerValue: number): void

Generated using TypeDoc