You are here

public function GoogleVisualizationAPIHandler::postRender in Visualization API 8

Loads the global Javascript required by the Google Visualization API.

Overrides VisualizationHandlerInterface::postRender

File

src/Plugin/visualization/handler/GoogleVisualizationAPIHandler.php, line 104
Drupal\visualization\Plugin\visualization\handler\GoogleVisualizationAPIHandler.

Class

GoogleVisualizationAPIHandler
Library plugin for Visualization implementing support for Google Visualization API.

Namespace

Drupal\visualization\Plugin\visualization\handler

Code

public function postRender() {
  if (!$this->addedJavascript) {
    $js_libs['#attached']['library'][] = 'visualization/gva';
    drupal_render($js_libs);
    $this->addedJavascript = TRUE;
  }
}