mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
feat: custom axisSpec
This commit is contained in:
parent
0dbc431e1c
commit
53f508c2d3
2 changed files with 10 additions and 6 deletions
|
|
@ -189,7 +189,7 @@ export function getColumnsFromAxis(axisSpecs, axis) {
|
|||
let keyColumns = [];
|
||||
let groupColumns = [];
|
||||
let aggregatorColumns = [];
|
||||
let otherColumns = [];
|
||||
let customColumn = {};
|
||||
|
||||
for(let axisName in axis) {
|
||||
const columns = axis[axisName];
|
||||
|
|
@ -200,7 +200,9 @@ export function getColumnsFromAxis(axisSpecs, axis) {
|
|||
} else if (aggrAxisNames.includes(axisName)) {
|
||||
aggregatorColumns = aggregatorColumns.concat(columns);
|
||||
} else {
|
||||
otherColumns = otherColumns.concat(columns);
|
||||
const axisType = axisSpecs.filter(s => s.name === axisName)[0].axisType
|
||||
if (!customColumn[axisType]) { customColumn[axisType] = []; }
|
||||
customColumn[axisType] = customColumn[axisType].concat(columns);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -208,7 +210,7 @@ export function getColumnsFromAxis(axisSpecs, axis) {
|
|||
key: keyColumns,
|
||||
group: groupColumns,
|
||||
aggregator: aggregatorColumns,
|
||||
others: otherColumns,
|
||||
custom: customColumn,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,8 @@ class AdvancedTransformation extends Transformation {
|
|||
return { 'background-color': '#cd5c5c' };
|
||||
} else if (isKey(axisSpec)) {
|
||||
return { 'background-color': '#906ebd' };
|
||||
} else {
|
||||
return { 'background-color': '#62bda9' };
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -154,7 +156,7 @@ class AdvancedTransformation extends Transformation {
|
|||
const keyColumns = columns.key;
|
||||
const groupColumns = columns.group;
|
||||
const aggregatorColumns = columns.aggregator;
|
||||
const otherColumns = columns.others
|
||||
const customColumns = columns.custom
|
||||
|
||||
let transformer = getTransformer(conf, tableData.rows, keyColumns, groupColumns, aggregatorColumns)
|
||||
|
||||
|
|
@ -163,10 +165,10 @@ class AdvancedTransformation extends Transformation {
|
|||
axis: axis, /** persisted axis */
|
||||
parameter: param, /** persisted parameter */
|
||||
column: {
|
||||
key: keyColumns, group: groupColumns, aggregator: aggregatorColumns, other: otherColumns,
|
||||
key: keyColumns, group: groupColumns, aggregator: aggregatorColumns, custom: customColumns,
|
||||
},
|
||||
|
||||
transformer: transformer, /** { rows, keyColumnName, groupNameSet, } */
|
||||
transformer: transformer,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue