Skip to content

Commit

Permalink
Merge pull request #188 from VisActor/feat/pivot-chart-axis
Browse files Browse the repository at this point in the history
Feat/pivot chart axis
  • Loading branch information
Rui-Sun committed Aug 1, 2023
2 parents 9dcf19c + 3cf12ae commit b272a9c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/vtable/src/layout/pivot-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1503,9 +1503,9 @@ export class PivotLayoutMap implements LayoutMapAPI {
const dimensionKeys: string[] = [];
if (chartSpec) {
if (this.indicatorsAsCol === false) {
dimensionKeys.push(chartSpec.xField);
dimensionKeys.push(chartSpec.xField ?? chartSpec?.series[0]?.xField);
} else {
dimensionKeys.push(chartSpec.yField);
dimensionKeys.push(chartSpec.yField ?? chartSpec?.series[0]?.yField);
}
return dimensionKeys;
}
Expand Down
18 changes: 15 additions & 3 deletions packages/vtable/src/state/hover/is-cell-hover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,21 @@ export function getCellHoverColor(cellGroup: Group, table: BaseTableAPI): string
return undefined;
}

const hoverStyle = table.isHeader(cellGroup.col, cellGroup.row)
? table.theme.headerStyle?.hover
: table.theme.bodyStyle?.hover;
let hoverStyle;
const layout = table.internalProps.layoutMap;
if (layout.isCornerHeader(cellGroup.col, cellGroup.row)) {
hoverStyle = table.theme.cornerHeaderStyle?.hover;
} else if (layout.isColumnHeader(cellGroup.col, cellGroup.row)) {
hoverStyle = table.theme.headerStyle?.hover;
} else if (layout.isRowHeader(cellGroup.col, cellGroup.row)) {
hoverStyle = table.theme.rowHeaderStyle?.hover;
} else if (layout.isBottomFrozenRow(cellGroup.col, cellGroup.row)) {
hoverStyle = table.theme.bottomFrozenStyle?.hover || table.theme.headerStyle?.hover;
} else if (layout.isRightFrozenColumn(cellGroup.col, cellGroup.row)) {
hoverStyle = table.theme.rightFrozenStyle?.hover || table.theme.rowHeaderStyle?.hover;
} else if (!table.isHeader(cellGroup.col, cellGroup.row)) {
hoverStyle = table.theme.bodyStyle?.hover;
}
const fillColor = getProp(colorKey, hoverStyle, cellGroup.col, cellGroup.row, table);
return fillColor;
}
Expand Down

0 comments on commit b272a9c

Please sign in to comment.