Skip to content

Commit

Permalink
feature(treemap): add custom cursor properties for treemap (#20113)
Browse files Browse the repository at this point in the history
  • Loading branch information
adaelixir authored Jul 29, 2024
1 parent eeaf52e commit ce500cf
Show file tree
Hide file tree
Showing 3 changed files with 199 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/chart/treemap/TreemapSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ export interface TreemapSeriesNodeItemOption extends TreemapSeriesVisualOption,

color?: ColorString[] | 'none'

decal?: DecalObject[] | 'none'
decal?: DecalObject[] | 'none',

cursor?: string
}

export interface TreemapSeriesOption
Expand Down
3 changes: 3 additions & 0 deletions src/chart/treemap/TreemapView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,9 @@ function renderNode(
// Only for enabling highlight/downplay.
data.setItemGraphicEl(thisNode.dataIndex, group);

const cursorStyle = nodeModel.getShallow('cursor');
cursorStyle && content.attr('cursor', cursorStyle);

enableHoverFocus(group, focusOrIndices, blurScope);
}

Expand Down
193 changes: 193 additions & 0 deletions test/treemap-cursor.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ce500cf

Please sign in to comment.