API Docs for:
Show:

components.nf-bars Class

Adds a bar graph to an nf-graph component.

Requires the graph has xScaleType === 'ordinal'*

** showTrackingDot defaults to false in this component **

Methods

_trackedDataChanged

() private

Observes changes to tracked data and sends the didTrack action.

_unregisterGraphic

() private

calls unregisterGraphic on didInsertElement.

getActualTrackData

(
  • renderX
  • renderY
  • data
)
Object

Gets the actual data at a rendered tracking point passed to it. This is overridden in nf-area to account for stacking of data.

Parameters:

  • renderX Number

    the x domain value the data is rendered at

  • renderY Number

    the y domain value the data is rendered at

  • data Object

    the raw data from the point

Returns:

Object:

simple x, y point structure

init

()

Initalization method that gets the nf-graph parent and assigns it to graph NOTE: all object that mixin and have init, must call super.init()

Properties

barClick

String

The name of the action to fire when a bar is clicked.

Default: null

bars

Unknown

The bar models used to render the bars.

barScale

d3.scale

A scale provided by nf-bars-group to offset the bar rectangle output

barWidth

Number

The width of each bar.

classprop

String

The name of the property on each data item containing the className for the bar rectangle

Default: 'className'

data

Array

Gets or sets the data used by the component to plot itself.

Default: null

didTrack

String

The action to send on didTrack.

Default: null

firstVisibleData

Object

The first element from renderedData that is actually visible within the x domain.

getBarClass

Unknown private

Gets the function to get the classname from each data item.

graph

components.nf-graph

The parent graph for a component.

Default: null

graphHeight

Number

The graph content height

group

components.nf-bars-group

The nf-bars-group this belongs to, if any.

Default: null

groupIndex

Number

The index of this component within the group, if any.

Default: null

hoverData

Object an object with the following values: - point: an x, y pair for the exact px coordinates inside the graph-content - graphX: domain x value at mouse position - graphY: domain y value at mouse position - x: nearest x data value - y: nearest y data value - data: nearest raw data - renderX: domain x value to render a tracking dot at (stacked areas are offset) - renderY: domain x value to render a tracking dot at (stacked areas are offset) - mouseX: mouse x position in pixels - mouseY: mouse y position in pixels

The value of the data that is being tracked by the component, ONLY if the graph-content is currently being hovered.

Default: null

lastVisibleData

Object

The last element from renderedData that is actually visible within the x domain.

renderedData

Array

The list of data points from mixins.graph-data-graphc/mappedData:property that fits within the x domain, plus up to one data point outside of that domain in each direction.

scaleOffsetX

Number

The offset, in pixels, for the x scale

Default: 0

scaleOffsetY

Number

The offset, in pixels, for the y scale

Default: 0

scaleZoomX

Number

The zoom multiplier for the x scale

Default: 1

scaleZoomY

Number

The zoom multiplier for the y scale

Default: 1

showTrackingDot

Boolean

Gets or sets whether the tracking dot should be shown at all.

Default: true

trackedData

Object an object with the following values: - point: an x, y pair for the exact px coordinates inside the graph-content - graphX: domain x value at mouse position - graphY: domain y value at mouse position - x: nearest x data value - y: nearest y data value - data: nearest raw data - renderX: domain x value to render a tracking dot at (stacked areas are offset) - renderY: domain x value to render a tracking dot at (stacked areas are offset) - mouseX: mouse x position in pixels - mouseY: mouse y position in pixels

The value of the data that is being tracked by the component.

Default: null

trackingDotRadius

Number

The radius of the tracking dot in pixels

Default: 2.5

trackingMode

String

Gets or sets the tracking mode of the component.

Possible values are:

  • 'none': no tracking behavior
  • 'hover': only track while mouse hover
  • 'snap-last': track while mouse hover, but snap to the last data element when not hovering
  • 'snap-first': track while mouse hover, but snap to the first data element when not hovering
  • 'selected-hover': The same as 'hover' tracking mode, but only when the compononent is selected
  • 'selected-snap-last': The same as 'snap-last' tracking mode, but only when the compononent is selected
  • 'selected-snap-first': The same as 'snap-first' tracking mode, but only when the compononent is selected

Default: 'none'

xprop

String

The path of the property on each object in data to use as x data to plot on the graph.

Default: 'x'

xPropFn

Function

The function to get the x value from each data object

xScale

d3.scale

The x scale used by this component

yprop

String

The path of the property on each object in data to use as y data to plot on the graph.

Default: 'y'

yPropFn

Function

The function to get the y value from each data object

yScale

d3.scale

The y scale used by this component