Class: renderFeature

renderFeature($scope)

render feature

Implementation for a feature.
Makes use of the mediator pattern in order to subscribe the feature to the plugin's event, through the $scope reference which is passed to it.

Functionaliy


This feature is responsible for representing data values in an svg, including
the load of the svg in the DOM. Subscribed events
  • init-edit-mode
  • panel-initialized
  • render

Constructor

new renderFeature($scope)

constructor - description
Important the use of _.cloneDeep to ensure that no two instances of the same plugin share references of the same variables.
Parameters:
Name Type Description
$scope type A reference to the plugin's scope for the subscription to events
Source:
Requires:
  • module:D3.js

Requires

  • module:D3.js

Methods

(static) actualizarColores()

actualizarColores - Changes the instance of color scale to be used by D3.

For discrete representation (fixed number of colors) an ad-hoc function is done.
For continous representation (range of colors) a D3.js scale function is used, based on
domain and color selected.
Source:

(static) cargarPlano(target, dir)

cargarPlano - Loads the svg resource into the DOM, hanging from the
element specified by the elementIdentifyer id attribute.
Parameters:
Name Type Description
target type id attribute
dir type svg resource url from where it is served
Source:

(static) onInitEditMode()

onInitEditMode - Handler for the event : init-edit-mode
Source:

(static) onPanelInitialized()

onPanelInitialized - Handler for the event : panel-initialized
Renders the svg and data for the first time. Including :
  1. Create a first instance of the color scale
  2. Load and append it to the specified element by the panelDivId identyfier
  3. Create an event for rendering the data over the svg
Source:

(static) onRender()

onRender - Handler for the event : render
Requires of an element containing the svg to update based on the data
Source:

(static) renderSala(target, data)

renderSala - Renders data on the svg resource
Color applied to each element specified is provided by the function loaded in scaleColor.
Parameters:
Name Type Description
target type DOM element from which it hangs the svg
data type TimeSeries processed data, in the form of pairs [metric, value]
Source: