protected function AcquiaLiftReport::buildStabilityReport in Acquia Lift Connector 7
Returns a render array representing the stability report for targeting features for the given dates.
Parameters
array $report_data: Reporting data for the selected dates and decision.
Return value
array A render array representing the targeting report
1 call to AcquiaLiftReport::buildStabilityReport()
- AcquiaLiftReport::buildCampaignReports in plugins/
agent_types/ AcquiaLiftAgent.inc - Implements PersonalizeAgentReportInterface::buildCampaignReports().
File
- plugins/
agent_types/ AcquiaLiftAgent.inc, line 2571 - Provides an agent type for Acquia Lift
Class
- AcquiaLiftReport
- Responsible retrieving and generating reports on the Acquia Lift agent.
Code
protected function buildStabilityReport($report_data) {
$build = array();
if ($report_data['targeting'] === FALSE) {
return array();
}
$data = $report_data['targeting'];
$rows = array();
$show_favored_selection = FALSE;
foreach ($data as $feature => $f) {
$row_data = array(
$f['feature_label'],
);
if (isset($f['favored_selection_number'])) {
$show_favored_selection = TRUE;
$row_data[] = $this
->getVariationLabel($f['favored_selection_number'] - 1, $f['favored_selection_number'] == 1);
}
$row_data[] = array(
'data' => $f['percent_traffic'],
'class' => array(
$f['percent_traffic_graph'],
),
);
$row_data[] = array(
'data' => $f['stability'],
'class' => $f['stability_positive'] ? array(
'acquia-lift-report-positive',
) : array(
'acquia-lift-report-negative',
),
);
$rows[] = array(
'data' => $row_data,
'data-acquia-lift-feature' => $feature,
);
}
$header[] = t('Context');
if ($show_favored_selection) {
$header[] = t('Best Variation');
}
$header[] = t('Percent of Traffic');
$header[] = t('Stability');
$build['content'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
'#sticky' => FALSE,
);
return $build;
}