[perf] remove convertMainData from plot-builder
Bug: b/362831653
Change-Id: I1521877c2836092a9b5ceb02510d169ac239c3ae
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/903983
Reviewed-by: Hao Wu <haowoo@google.com>
Commit-Queue: Hao Wu <haowoo@google.com>
Auto-Submit: Leina Sun <sunxiaodi@google.com>
diff --git a/perf/modules/common/plot-builder.ts b/perf/modules/common/plot-builder.ts
index 93d719f..f22e824 100644
--- a/perf/modules/common/plot-builder.ts
+++ b/perf/modules/common/plot-builder.ts
@@ -64,52 +64,6 @@
return rows;
};
-// ConvertMainData takes the chartData, formats it for Google Chart library.
-// The primary difference between this and CovertData is the inclusion of
-// anomalies.
-export function convertMainData(chartData: ChartData) {
- // The data for the plot must be of the format:
- // [
- // [x-axis label, line1 label, line2 label, ...],
- // [x_value, line1 value, line2 value, ...], // first point
- // [x_value, line1 value, line2 value, ...], // second point
- // ...
- // ]
-
- // add all columns to data first.
- const columns: [any] = [chartData.xLabel];
- const lineKeys = Object.keys(chartData.lines);
- lineKeys.forEach((key) => {
- columns.push(key);
- // if the point requires some custom styling (ie/ to change the point to
- // an anomaly), it needs a style column. So, we add a style column for each
- // "trace". If it doesn't need anything, the value for this column should
- // be null.
- // https://developers.google.com/chart/interactive/docs/roles#what-roles-are-available
- columns.push({ type: 'string', role: 'style' });
- });
-
- // then add the rows. first row defines the columns.
- const rows: [any] = [columns];
- const rowCount = chartData.lines[lineKeys[0]].length;
- for (let i = 0; i < rowCount; i++) {
- // Add the xValue which is the same for all lines
- const row = [chartData.lines[lineKeys[0]][i].x] as any[];
- lineKeys.forEach((key) => {
- // For each line, add the y value for datapoint at index i.
- row.push(chartData.lines[key][i].y);
- if (chartData.lines[key][i].anomaly) {
- row.push('point { size: 10; shape-type: triangle; }');
- } else {
- row.push(null);
- }
- });
- rows[i + 1] = row;
- }
-
- return rows;
-}
-
export function ConvertData(chartData: ChartData) {
/*
The data in the plot needs to be in the following format.