Commit f5c9a1f3 authored by M Parker's avatar M Parker

Allow the chart to be altered before it is viewed in the field formatter.

parent 80a36869
......@@ -270,6 +270,20 @@ function d3_sankey_table_group_pp_field_formatter_view($entity_type, $entity, $f
$chart['nodes'] = $raw_data->getAssocArrayNodes();
$chart['links'] = $raw_data->getAssocArrayLinks();
// Allow the chart to be altered before it is viewed.
$context = array(
'entity_type' => $entity_type,
'entity' => $entity,
'field' => $field,
'instance' => $instance,
'langcode' => $langcode,
'items' => $items,
'display' => $display,
'delta' => $delta,
'item' => $item,
);
drupal_alter('d3_sankey_table_group_pp_formatter_view_chart', $chart, $context);
// Now draw the chart.
$chart = d3_draw($chart);
$element[$delta]['#markup'] = $chart;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment