Class: MetricModalView

MetricModalView()

A Bootstrap Modal that displays a DataONE dataset usage metric, such as downloads, views, or citations.

Constructor

new MetricModalView()

Source:

Extends

  • Backbone.View

Members

className :string

Classes to add to the modal
Type:
  • string
Source:

events :Object

The events this view will listen for. See https://backbonejs.org/#View-events
Type:
  • Object
Source:

id :string

An ID for this view
Type:
  • string
Source:

metricName :string

The name of the metric currently being displayed
Type:
  • string
Source:

metrics :Array.<MetricOption>

The metrics to include in the modal, in the order they will be displayed.
Type:
Source:

metricsModel :MetricsModel

The model that contains the metrics data
Type:
  • MetricsModel
Source:

subviews :Array.<Backbone.View>

Views that are subviews of this view
Type:
  • Array.<Backbone.View>
Source:

template :Underscore.Template

The underscore template for this view
Type:
  • Underscore.Template
Source:

Methods

drawMetricsChart()

Draw the metrics chart
Source:

getMetricAtOffset(n) → {string}

Get the metric name at the given offset from the current metric
Parameters:
Name Type Description
n number The offset from the current metric
Since:
  • 2.23.0
Source:
Returns:
The name of the metric at the given offset
Type
string

getNextMetric() → {string}

Get the previous metric name in the circular queue
Source:
Returns:
The name of the previous metric
Type
string

getPreviousMetric() → {string}

Get the next metric name in the circular queue
Source:
Returns:
The name of the next metric
Type
string

initialize(options)

Initialize a new MetricModalView
Parameters:
Name Type Description
options Object A literal object with options to pass to the view. The options can include:
Properties
Name Type Description
metricName string The name of the metric to display in the modal
metricsModel MetricsModel The model that contains the metrics data
pid string The DataONE PID of the dataset that the metrics are for
Source:

onClose()

Cleans up and removes all artifacts created for view
Source:

render()

Set a listener that will render the view when the modal is shown
Source:

renderView() → {MetricModalView}

Render the view
Source:
Returns:
- Returns this view
Type
MetricModalView

show()

Make the modal visible
Source:

showCitationForm()

Display the Citation registration form
Source:

showCitations()

Show the citations in the modal. Replace current content.
Source:

showNextMetricModal()

Show the next metric in the modal
Source:

showPreviousMetricModal()

Show the previous metric in the modal
Source:

showSignIn()

Show Sign In buttons
Source:

showSignInViewPopUp()

Handle the sign in click event
Source:

teardown()

Remove the modal from the DOM
Source: