Class: AppChartController

AppChartController~ AppChartController


new AppChartController($scope, $element, ctrlName)

Sets up a controller to glue together the generic AppChart chart drawing
component with an AngularJS directive & scope. The directive that uses this
controller must bind the following scope variables to the controller:


  • highlights - the highlights object representing the internal
    visualization status

  • data - the data object to visualize

Parameters:
Name Type Description
$scope

the AngularJS scope of the directive where the chart should
be placed.

$element

the DOM element of the directive

ctrlName

the name of the controller in the angularJS scope

Source:

Methods


<static> getFactory(ctrlName)

Returns the factory function of the controller. The factory is used in
the directives .controller property. You have to specify some "options"
to the factory. The factory callback returned will accept exactly two
parameters: $scope and $element.

Parameters:
Name Type Description
ctrlName

the name of the controller object in the AngularJS scope

Source:

dataUpdated()

To be called if the data property of the associated data object in the
directive / controller is changed or initialized.

Source:

fitChart()

Initializes the display area (x- and y-axis domain) of the chart based
on whether the highlights object specifies an area the chart should
navigate to via the xRange property and base on whether the highlight
object's "looseness" property dictates that the chart should be re-fit
to the maximum viewable area.

Source:

highlightsUpdatedHandler()

Returns a callback that can be invoked if the highlights object supplied
to the directive / controller is changed. Will delegate the highlight
change to the included AppChart object.

Source:

This function must be called when the directive using this controller links
the directive to a DOM element. It takes care of actually drawing the
chart into the DOM element.

Parameters:
Name Type Description
chartOptions

the chart options to create the AppChart with

dataTransformer

the data transform function to apply to the data
before the chart is drawn

Source:

loosenessUpdatedHandler()

Returns a callback that should be invoked any time the "looseness" value
of the highlights object is changed. The "looseness" value specifies
which amount of "guiding" the UI should enforce (looseness = 0:
storytelling mode, looseness 1 = storytelling mode with user
starting to explore the graph, looseness = 2: user has collapsed the
storytelling, looseness = 3: user has completely 'gone off on its own' and
selected other metrics, zoomed/panned in the graph etc.)

Source:

seriesHighlightedHandler()

Returns a callback that should be invoked any time a series is highlighted.
The callback accepts exactly one parameter: the seriesId. Will take care
that the highlights object (seriesId and looseness) is updated accordingly.

Source:

seriesUnhighlightedHandler()

Returns a callback that should be invoked any time a series is
unhighlighted. The callback accepts exactly one parameter: the seriesId.
Will take care that the highlights object (seriesId and looseness) is
updated accordingly.

Source:

xRangeUpdatedHandler()

Returns a callback that should be invoked every time the highlights.xRange
value is changed. Will take care that all charts scroll uniformely along
the x axis.

Source:

xyHighlightedHandler()

Returns a callback that should be invoked any time a x/y value in the
graph is highlighted (effectively, any time the mouse moves). Callback
will accept a x and y domain coordinate as its 2 parameters and update
highlights.x and highlights.y accordingly.

Source:

xyUnhighlightedHandler()

Returns a callback that should be invoked any time the mouse leaves the
graph area or no point at all is highlighted in the graph.

Source:

zoomedPannedHandler()

Returns a callback that should be invoked any time the x/y extent changes
because the user zooms or pans in the graph. Updates the highlights object
(xRange property) accordingly.

Source: