function d3_libraries_info_alter in d3.js 7
Implements hook_libraries_info_alter().
File
- ./
d3.module, line 249 - D3 module file for creating visualizations with d3.js.
Code
function d3_libraries_info_alter(&$libraries) {
foreach (d3_get_libraries() as $library_name => $library) {
// Automatically add in the d3.drupal dependency so that each
// d3.library doesn't have to.
$libraries[$library_name]['dependencies'][] = 'd3.drupal';
// Add in a function to process additional info file information.
$libraries[$library_name]['callbacks']['post-detect'][] = 'd3_detect_library_info';
}
// By default, the libraries module only checks the libraries folders.
// We need to add this module's libraries path to the library info.
$path = drupal_get_path('module', 'd3') . '/libraries/';
foreach (d3_default_libraries() as $library_name) {
// Change library path to path/to/module/d3/libraries
$libraries[$library_name]['library path'] = $path . $library_name;
}
}