Application Programming Interface (API)

Feature Analyzer Help

HGD_Product
Smart M.App Analyzer
HGD_Portfolio_Suite
Hexagon Smart M.App

Analyzer.getFilterConfiguration

Gets the current chart and spatial filter configuration set by the user.

Expects:

  • targetViewName (optional) - defines a target view name. An Analyzer View will respond if targetViewName matches the current view name, or null/undefined.

Analyzer.onGetFilterConfiguration

Callback that contains the filter configuration for the view which Analyzer.getFilterConfiguration was called.

Returns:

  • viewName - contains the name of the Analyzer View where the event originated.
  • spatialFilter - if a spatial filter is defined in the view, it will be returned here. This object will contain the GeoJSON object of the coordinates that were used to define the spatial filter.
  • businessIntelligenceWidgets - contains all filters defined for all charts and additional vector layers (e.g. the boundary layer).

Analyzer.setFilterConfiguration

Sets the filters in the Analyzer View.

Expects:

  • targetViewName (optional) - defines a target view name. An Analyzer View will respond if targetViewName matches the current view name, or null/undefined.
  • spatialFilter - will set a new spatial filter if defined.
  • businessIntelligenceWidgets - contains chart, vector layer definitions, and filters.

Analyzer.getFieldNames

Gets a list of field names in the dataset.

Expects:

targetViewName (optional) - defines a target view name. An Analyzer View will respond if targetViewName matches the current view name, or null/undefined.

Analyzer.onGetFieldNames

Callback is called from the view which Analyzer.getFieldNames was called.

Returns:

  • viewName - contains the name of the Analyzer View where the event originated.
  • fieldNames - contains an array of field names in the main feature dataset.

Analyzer.getStatistics

Gets the statistics for a specific field in the dataset.

Expects:

  • targetViewName (optional) - defines a target view name. An Analyzer View will respond if targetViewName matches the current view name, or null/undefined.
  • allRecords (optional) - if set to true, will return statistics for the entire dataset and not for just what has been filtered.

Analyzer.onGetStatistics

Gets the statistics for a specific field in the dataset.

Returns:

  • viewName - contains the name of the Analyzer View where the event originated.
  • minimumValue, maximumValue, mean, standardDeviation, variance, range, sum, notANumberDetected

Analyzer.updateView

Updates the map position and zoom.

Expects:

  • targetViewName (optional) - defines a target view name. An Analyzer View will respond if targetViewName matches the current view name, or null/undefined.
  • center - lat/lng pair of coordinates representing the centerpoint of the view.
  • zoom - a value indicating the current zoom level.

Analyzer.onViewUpdated

A callback that is triggered when the user moves the map window.

Returns:

  • viewName - contains the name of the Analyzer View where the event originated.
  • center - lat/lng pair of coordinates representing the centerpoint of the view.
  • zoom - a value indicating the current zoom level.

Analyzer.onFiltered

A callback that is triggered when the user sets a filter on a chart or defines a spatial filter.

Returns:

  • viewName - contains the name of the Analyzer View where the event originated.
  • count - contains the total number of records that have not been filtered out.
  • total - contains the total number of records in the analyzer dataset.
  • Additional boundary layer properties returned:
    • mouse - contains the lat/lng of the point clicked by the user.
    • filters - Contains the active filters of the boundary layer. If this collection is empty, all boundaries are displayed. If not empty, only items listed in this collection are displayed on the map.
    • data -
      key: contains the key of the item clicked by the user. If this key exists in filters array above, then the filter for this item is on (meaning the user has selected this boundary).
      feature: contains the GeoJSON entry for the selected boundary feature while feature.properties contain attribute data for the selected boundary feature.

Analyzer.loadView

Loads an in-memory Analyzer View.

Expects:

  • targetViewName (optional) - defines a target view name. An Analyzer View will respond if targetViewName matches the current view name, or null/undefined.
  • View - Analyzer View JSON object.

Analyzer.replaceOnlineUrl

Replaces the data in the current view with new data with the given URL.

Expects:

  • targetViewName (optional) - Defines a target view name. An Analyzer View will respond if targetViewName matches the current view name, or null/undefined.
  • onlineUrl - the URL of the new data source.

Analyzer.onViewReady

Triggered when the Analyzer View has been completely loaded.

Returns:

  • viewName - contains the name of the Analyzer View where the event originated.