Components Interactions Examples Tutorials API FAQ
Options
Menu

Type parameters

  • X

  • Y

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Bar(orientation?: string): Bar

Properties

Private _barPixelWidth

_barPixelWidth: any

Private _baseline

_baseline: any

Private _baselineValue

_baselineValue: any

Private _baselineValueProvider

_baselineValueProvider: any

Protected _boundingBox

_boundingBox: Selection<void>

Protected _clipPathEnabled

_clipPathEnabled: boolean

Private _hideBarsIfAnyAreTooWide

_hideBarsIfAnyAreTooWide: any

Protected _isAnchored

_isAnchored: boolean

Protected _isSetup

_isSetup: boolean

Protected _isVertical

_isVertical: boolean

Private _labelConfig

_labelConfig: any

Private _labelFormatter

_labelFormatter: any

Private _labelsEnabled

_labelsEnabled: any

Protected _propertyBindings

_propertyBindings: Map<AccessorScaleBinding<any, any>>

Protected _propertyExtents

_propertyExtents: Map<any[]>

Protected _renderArea

_renderArea: Selection<void>

Protected _renderCallback

_renderCallback: ScaleCallback<Scale<any, any>>

Private _updateBarPixelWidthCallback

_updateBarPixelWidthCallback: any

Static ORIENTATION_HORIZONTAL

ORIENTATION_HORIZONTAL: string

Static ORIENTATION_VERTICAL

ORIENTATION_VERTICAL: string

Static Protected _ANIMATION_MAX_DURATION

_ANIMATION_MAX_DURATION: number

Static Private _BAR_AREA_CLASS

_BAR_AREA_CLASS: any

Static Private _BAR_WIDTH_RATIO

_BAR_WIDTH_RATIO: any

Static Protected _LABEL_AREA_CLASS

_LABEL_AREA_CLASS: string

Static Private _LABEL_HORIZONTAL_PADDING

_LABEL_HORIZONTAL_PADDING: any

Static Private _LABEL_VERTICAL_PADDING

_LABEL_VERTICAL_PADDING: any

Static Private _SINGLE_BAR_DIMENSION_RATIO

_SINGLE_BAR_DIMENSION_RATIO: any

Static Protected _X_KEY

_X_KEY: string

Static Protected _Y_KEY

_Y_KEY: string

Methods

Protected _addDataset

Protected _additionalPaint

  • _additionalPaint(time: number): void

Protected _animateOnNextRender

  • _animateOnNextRender(): boolean

Protected _bindProperty

  • _bindProperty(property: string, value: any, scale: Scale<any, any>): void

Protected _buildLightweightPlotEntities

Protected _createDrawer

Protected _createNodesForDataset

Private _drawLabel

  • _drawLabel(data: any, dataset: any): any

Protected _drawLabels

  • _drawLabels(): void

Private _entitiesIntersecting

  • _entitiesIntersecting(xValOrRange: any, yValOrRange: any): any

Protected _entityVisibleOnPlot

Protected _extentsForProperty

  • _extentsForProperty(property: string): any[]

Protected _filterForProperty

  • _filterForProperty(property: string): function

Protected _generateAttrToProjector

  • _generateAttrToProjector(): object

Protected _generateDrawSteps

Protected _getAnimator

Protected _getBarPixelWidth

  • _getBarPixelWidth(): number
  • Computes the barPixelWidth of all the bars in the plot.

    If the position scale of the plot is a CategoryScale and in bands mode, then the rangeBands function will be used. If the position scale of the plot is a QuantitativeScale, then the bar width is equal to the smallest distance between two adjacent data points, padded for visualisation.

    Returns number

Protected _getDataToDraw

Protected _getDrawersInOrder

  • _getDrawersInOrder(): Drawer[]

Protected _installScaleForKey

  • _installScaleForKey(scale: Scale<any, any>, key: string): void

Protected _invertPixelPoint

  • _invertPixelPoint converts a point in pixel coordinates to a point in data coordinates

    Parameters

    • point: Point

      Representation of the point in pixel coordinates

    Returns Point

    Returns the point represented in data coordinates

Protected _onDatasetUpdate

  • _onDatasetUpdate(): void

Protected _pixelPoint

  • _pixelPoint(datum: any, index: number, dataset: Dataset): Point

Protected _projectorsReady

  • _projectorsReady(): boolean

Protected _propertyProjectors

Protected _removeDataset

Protected _removeDatasetNodes

  • _removeDatasetNodes(dataset: Dataset): void

Protected _setup

  • _setup(): void

Protected _sizeFromOffer

  • _sizeFromOffer(availableWidth: number, availableHeight: number): object

Protected _uninstallScaleForKey

  • _uninstallScaleForKey(scale: Scale<any, number>, key: string): void

Private _updateBarPixelWidth

  • _updateBarPixelWidth(): any

Protected _updateExtents

  • _updateExtents(): void

Protected _updateExtentsForProperty

  • _updateExtentsForProperty(property: string): void

Private _updateValueScale

  • _updateValueScale(): any

addClass

  • addClass(cssClass: string)

addDataset

anchor

animated

  • animated(): boolean
  • animated(willAnimate: boolean)

animator

  • animator(animatorKey: string): Animator
  • animator(animatorKey: string, animator: Animator)

attr

  • Gets the AccessorScaleBinding for a particular attribute.

    Type parameters

    • A

    Parameters

    • attr: string

    Returns AccessorScaleBinding<A, number | string>

  • Sets a particular attribute to a constant value or the result of an Accessor.

    Parameters

  • Sets a particular attribute to a scaled constant value or scaled result of an Accessor. The provided Scale will account for the attribute values when autoDomain()-ing.

    Type parameters

    • A

    Parameters

    • attr: string
    • attrValue: A | Accessor<A>
    • scale: Scale<A, number | string>

      The Scale used to scale the attrValue.

autorangeMode

  • autorangeMode(): string
  • autorangeMode(autorangeMode: string)
  • Gets the automatic domain adjustment mode for visible points.

    Returns string

  • Sets the automatic domain adjustment mode for visible points to operate against the X Scale, Y Scale, or neither. If "x" or "y" is specified the adjustment is immediately performed.

    Parameters

    • autorangeMode: string

      One of "x"/"y"/"none". "x" will adjust the x Scale in relation to changes in the y domain. "y" will adjust the y Scale in relation to changes in the x domain. "none" means neither Scale will change automatically.

background

  • Gets the Selection containing the behind the visual elements of the Component.

    Will return undefined if the Component has not been anchored.

    Returns Selection<void>

    background selection for the Component

baselineValue

  • baselineValue(): X | Y
  • baselineValue(value: X | Y)
  • Gets the baseline value. The baseline is the line that the bars are drawn from.

    Returns X | Y

  • Sets the baseline value. The baseline is the line that the bars are drawn from.

    Parameters

    • value: X | Y

bounds

  • Returns Bounds

    for the component in pixel space, where the topLeft represents the component's minimum x and y values and the bottomRight represents the component's maximum x and y values.

computeLayout

  • computeLayout(origin?: Point, availableWidth?: number, availableHeight?: number)

content

  • Gets a Selection containing a that holds the visual elements of the Component.

    Will return undefined if the Component has not been anchored.

    Returns Selection<void>

    content selection for the Component

datasets

deferredRendering

  • deferredRendering(): boolean
  • deferredRendering(deferredRendering: boolean)
  • Returns the whether or not the rendering is deferred for performance boost.

    Returns boolean

    The deferred rendering option

  • Sets / unsets the deferred rendering option Activating this option improves the performance of plot interaction (pan / zoom) by performing lazy renders, only after the interaction has stopped. Because re-rendering is no longer performed during the interaction, the zooming might experience a small resolution degradation, before the lazy re-render is performed.

    This option is intended for cases where performance is an issue.

    Parameters

    • deferredRendering: boolean

destroy

  • destroy()

detach

  • detach()

entities

entitiesAt

entitiesIn

entityNearest

  • Returns the PlotEntity nearest to the query point according to the following algorithm:

    • If the query point is inside a bar, returns the PlotEntity for that bar.
    • Otherwise, gets the nearest PlotEntity by the primary direction (X for vertical, Y for horizontal), breaking ties with the secondary direction. Returns undefined if no PlotEntity can be found.

    Parameters

    Returns PlotEntity

    The nearest PlotEntity, or undefined if no PlotEntity can be found.

fixedHeight

  • fixedHeight(): boolean
  • Checks if the Component has a fixed height or if it grows to fill available space. Returns false by default on the base Component class.

    Returns boolean

fixedWidth

  • fixedWidth(): boolean
  • Checks if the Component has a fixed width or if it grows to fill available space. Returns false by default on the base Component class.

    Returns boolean

foreground

  • Gets the Selection containing the in front of the visual elements of the Component.

    Will return undefined if the Component has not been anchored.

    Returns Selection<void>

hasClass

  • hasClass(cssClass: string): boolean
  • Checks if the Component has a given CSS class.

    Parameters

    • cssClass: string

      The CSS class to check for.

    Returns boolean

height

  • height(): number

labelFormatter

labelsEnabled

  • labelsEnabled(): boolean
  • labelsEnabled(enabled: boolean)
  • Get whether bar labels are enabled.

    Returns boolean

    Whether bars should display labels or not.

  • Sets whether labels are enabled.

    Parameters

    • enabled: boolean

offAnchor

offDetach

onAnchor

onDetach

onResize

  • Sets a callback that gets called when the component resizes. The size change is not guaranteed to be reflected by the DOM at the time the callback is fired.

    Parameters

orientation

  • orientation(): string
  • Gets the orientation of the plot

    Returns string

    "vertical" | "horizontal"

origin

originToSVG

parent

redraw

  • redraw()
  • Causes the Component to re-layout and render.

    This function should be called when a CSS change has occured that could influence the layout of the Component, such as changing the font size.

removeClass

  • removeClass(cssClass: string)

removeDataset

render

  • render()

renderImmediately

  • renderImmediately()

renderTo

  • renderTo(element: String | Element | Selection<void>)

requestedSpace

  • requestedSpace(availableWidth: number, availableHeight: number): SpaceRequest

selections

showAllData

  • showAllData()
  • Adjusts the domains of both X and Y scales to show all data. This call does not override the autorange() behavior.

width

  • width(): number

x

xAlignment

  • xAlignment(): string
  • xAlignment(xAlignment: string)

y

yAlignment

  • yAlignment(): string
  • yAlignment(yAlignment: string)

Static Protected _scaledAccessor

Generated using TypeDoc