function d3_views_plugin_style_d3::getDefaultValues in d3.js 7
Default value for a field mapping.
Parameters
string $key1: The base view field key.
string $key2: For view fields that have sub-fields, this is the sub-field key.
Return value
object Object with field, and aggregation properties.
File
- modules/
d3_views/ views/ plugins/ d3_views_plugin_style_d3.inc, line 170 - Contains the d3 style plugin.
Class
- d3_views_plugin_style_d3
- Style plugin to render a d3 visualization
Code
function getDefaultValues($key1, $key2 = NULL, $form_state = NULL) {
$default = new StdClass();
$default->field = FALSE;
$default->aggregation = FALSE;
$options = $this
->getFieldOptions($form_state);
if (!is_null($key2)) {
return !empty($options[$key1][$key2]) ? (object) $options[$key1][$key2] : $default;
}
return !empty($options[$key1]) ? (object) $options[$key1] : $default;
}