WebCola
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface defining an axis generator. The generic is the type of the axis domain

Type parameters

  • Domain

Hierarchy

  • Axis

Callable

  • Render the axis to the given context.

    Parameters

    • context: Selection<AxisContainerElement, any, any, any>

      A selection of SVG containers (either SVG or G elements).

    Returns void

  • Render the axis to the given context.

    Parameters

    Returns void

Index

Methods

scale

  • scale<A>(): A
  • scale(scale: AxisScale<Domain>)
  • Gets the current scale underlying the axis.

    Type parameters

    Returns A

  • Sets the scale and returns the axis.

    Parameters

    • scale: AxisScale<Domain>

      The scale to be used for axis generation

tickArguments

  • tickArguments(): any[]
  • tickArguments(args: [number])
  • tickArguments(args: [number, string])
  • tickArguments(args: [AxisTimeInterval])
  • tickArguments(args: [AxisTimeInterval, string])
  • tickArguments(args: any[])
  • Get an array containing the currently set arguments to be passed into scale.ticks and scale.tickFormat.

    Returns any[]

  • Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.

    Parameters

    • args: [number]

      An array containing a single element representing the count, i.e. number of ticks to be rendered.

  • Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.

    Parameters

    • args: [number, string]

      An array containing two elements. The first element represents the count, i.e. number of ticks to be rendered. The second element is a string representing the format specifier to customize how the tick values are formatted.

  • Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. Use with a TIME SCALE ONLY.

    Parameters

    • args: [AxisTimeInterval]

      An array containing a single element representing a time interval used to generate date-based ticks. This is typically a TimeInterval/CountableTimeInterval as defined in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15).

  • Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. Use with a TIME SCALE ONLY.

    Parameters

    • args: [AxisTimeInterval, string]

      An array containing two elements. The first element represents a time interval used to generate date-based ticks. This is typically a TimeInterval/CountableTimeInterval as defined in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15). The second element is a string representing the format specifier to customize how the tick values are formatted.

  • Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.

    Parameters

    • args: any[]

      An array with arguments suitable for the scale to be used for tick generation

tickFormat

  • tickFormat(): function | null
  • tickFormat(format: function)
  • tickFormat(format: null)
  • Returns the currently set tick format function, which defaults to null.

    Returns function | null

  • Sets the tick format function and returns the axis.

    Parameters

    • format: function

      A function mapping a value from the axis Domain to a formatted string for display purposes. When invoked, the format function is also passed a second argument representing the zero-based index of the tick label in the array of generated tick labels.

        • (domainValue: Domain, index: number): string
        • Parameters

          • domainValue: Domain
          • index: number

          Returns string

  • Reset the tick format function. A null format indicates that the scale’s default formatter should be used, which is generated by calling scale.tickFormat. In this case, the arguments specified by axis.tickArguments are likewise passed to scale.tickFormat.

    Parameters

    • format: null

      null

tickPadding

  • tickPadding(): number
  • tickPadding(padding: number)
  • Get the current padding, which defaults to 3.

    Returns number

  • Set the current padding and return the axis.

    Parameters

    • padding: number

      Padding in pixels (Default is 3).

tickSize

  • tickSize(): number
  • tickSize(size: number)
  • Get the current inner tick size, which defaults to 6.

    Returns number

  • Set the inner and outer tick size to the specified value and return the axis.

    Parameters

    • size: number

      Tick size in pixels (Default is 6).

tickSizeInner

  • tickSizeInner(): number
  • tickSizeInner(size: number)
  • Get the current inner tick size, which defaults to 6. The inner tick size controls the length of the tick lines, offset from the native position of the axis.

    Returns number

  • Set the inner tick size to the specified value and return the axis. The inner tick size controls the length of the tick lines, offset from the native position of the axis.

    Parameters

    • size: number

      Tick size in pixels (Default is 6).

tickSizeOuter

  • tickSizeOuter(): number
  • tickSizeOuter(size: number)
  • Get the current outer tick size, which defaults to 6. The outer tick size controls the length of the square ends of the domain path, offset from the native position of the axis. Thus, the “outer ticks” are not actually ticks but part of the domain path, and their position is determined by the associated scale’s domain extent. Thus, outer ticks may overlap with the first or last inner tick. An outer tick size of 0 suppresses the square ends of the domain path, instead producing a straight line.

    Returns number

  • Set the current outer tick size and return the axis. The outer tick size controls the length of the square ends of the domain path, offset from the native position of the axis. Thus, the “outer ticks” are not actually ticks but part of the domain path, and their position is determined by the associated scale’s domain extent. Thus, outer ticks may overlap with the first or last inner tick. An outer tick size of 0 suppresses the square ends of the domain path, instead producing a straight line.

    Parameters

    • size: number

      Tick size in pixels (Default is 6).

tickValues

  • tickValues(): Domain[] | null
  • tickValues(values: Domain[])
  • tickValues(values: null)
  • Returns the current tick values, which defaults to null.

    Returns Domain[] | null

  • Specified values to be used for ticks rather than using the scale’s automatic tick generator. The explicit tick values take precedent over the tick arguments set by axis.tickArguments. However, any tick arguments will still be passed to the scale’s tickFormat function if a tick format is not also set.

    Parameters

    • values: Domain[]

      An array with values from the Domain of the scale underlying the axis.

  • Clears any previously-set explicit tick values and reverts back to the scale’s tick generator.

    Parameters

    • values: null

      null

ticks

  • ticks(count: number, specifier?: string)
  • ticks(interval: AxisTimeInterval, specifier?: string)
  • ticks(arg0: any, ...args: any[])
  • Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.

    Parameters

    • count: number

      Number of ticks that should be rendered

    • Optional specifier: string

      An optional format specifier to customize how the tick values are formatted.

  • Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. Use with a TIME SCALE ONLY.

    Parameters

    • interval: AxisTimeInterval

      A time interval used to generate date-based ticks. This is typically a TimeInterval/CountableTimeInterval as defined in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15).

    • Optional specifier: string

      An optional format specifier to customize how the tick values are formatted.

  • Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.

    Parameters

    • arg0: any
    • Rest ...args: any[]

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc