Class: MetricView

MetricView()

the display of the dataset citation and usage metrics on the dataset landing page

Screenshot

Constructor

new MetricView()

Source:

Extends

  • Backbone.View

Members

className :string

Class name to be applied to the metric buttons
Type:
  • string
Source:

events

Source:

metricName :string

Attribute to indicate the type of metric
Type:
  • string
Source:

metricsIcons :object

The font-awesome icons associated with each metric
Type:
  • object
Since:
  • 2.36.0
Source:

metricsTooltips :object

The descriptions associated with each metric for tool-tips
Type:
  • object
Since:
  • 2.36.0
Source:

model :MetricsModel

The Metric Model associated with this view
Type:
  • MetricsModel
Source:

tooltipSettings :object|boolean

Settings passed to the Formantic UI popup module to configure a tooltip shown over the metric button.
Type:
  • object | boolean
Since:
  • 2.36.0
Source:
See:

Methods

addTooltip(tooltipText)

Add a tooltip to the button with the given text
Parameters:
Name Type Description
tooltipText string The text to show in the tooltip
Source:

initialize(options)

Parameters:
Name Type Description
options object A literal object with options to pass to the view
Properties
Name Type Description
model MetricsModel The MetricsModel object associated with this view
metricName string The name of the metric view
pid string Associated dataset identifier with this view
Source:

metricButtonTemplate(options) → {string}

The template for the metric button
Parameters:
Name Type Description
options object A literal object with options for the template
Properties
Name Type Description
metricValue string The value of the metric to be displayed
metricIcon string The icon class for the metric
metricName string The name of the metric
Source:
Returns:
- The HTML string for the metric button
Type
string

onClose()

Cleans up listeners from this view
Source:

removeTooltip()

Remove any tooltip set on the button
Source:

render() → {MetricView}

Renders the apprpriate metric view on the UI
Source:
Returns:
- The MetricView object
Type
MetricView

renderError()

Manages error handling in case Metrics Service does not responsd
Source:

renderResults()

Displays the metrics count and badge on the landing page
Source:

showMetricModal(_e)

Handles the click functions and displays appropriate modals on click events
Parameters:
Name Type Description
_e Event The click event object
Source: