function d3_views_plugin_style_d3::getLibraries in d3.js 7
Get d3 libraries basic info.
WARNING: This does not return field / settings info. For that info a full libraries_load is needed.
2 calls to d3_views_plugin_style_d3::getLibraries()
- d3_views_plugin_style_d3::getLibraryOptions in modules/
d3_views/ views/ plugins/ d3_views_plugin_style_d3.inc - Local function to get all libraries that are compatible with views.
- d3_views_plugin_style_d3::getVis in modules/
d3_views/ views/ plugins/ d3_views_plugin_style_d3.inc - Get the current visualization by reference.
File
- modules/
d3_views/ views/ plugins/ d3_views_plugin_style_d3.inc, line 376 - Contains the d3 style plugin.
Class
- d3_views_plugin_style_d3
- Style plugin to render a d3 visualization
Code
function getLibraries() {
if (!empty($this->libraries)) {
return $this->libraries;
}
$views_api_version = views_api_version();
// List all d3 libraries.
$libraries = d3_get_libraries();
$this->libraries = array();
foreach ($libraries as $library) {
// Skip if no views integration.
if (empty($library['views'])) {
continue;
}
// Assume library is compatible with any version if it is not specified.
if (empty($library['views']['version'])) {
$library['views']['version'] = $views_api_version;
}
if (empty($library['views']['fields'])) {
$library['views']['fields'] = array();
}
// Only add to the list if the version is compatible.
if ($library['views']['version'] <= $views_api_version) {
$this->libraries[$library['machine name']] = $library;
}
}
return $this->libraries;
}