function d3_theme in d3.js 7
Implements hook_theme().
File
- ./
d3.module, line 50 - D3 module file for creating visualizations with d3.js.
Code
function d3_theme() {
foreach (libraries_info() as $path => $library) {
// Call this function to get all fields - i.e. library path.
$library = libraries_detect($path);
// If a template was specified in the .info file or hook_libraries_info.
if (isset($library['template'])) {
// Change d3.[library name] to d3_[library name] for a theme key.
$theme_key = str_replace('.', '_', $library['machine name']);
$themes[$theme_key] = array(
'variables' => array(),
'template' => $library['template'],
'path' => $library['library path'],
);
}
}
$themes['d3'] = array(
'variables' => array(
'type' => NULL,
'library' => array(),
'vis_id' => NULL,
),
'template' => 'd3',
);
$themes['d3_graphapi'] = array(
'variables' => array(
'graph' => NULL,
'config' => NULL,
),
);
return $themes;
}