Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(colorBy): provide option.colorBy #13731 #13788

Merged
merged 21 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP(colorBy): treemap colorBy WIP
  • Loading branch information
Ovilia committed Feb 9, 2021
commit 74535c83574cec11500087e284c3e7b75698ef5e
13 changes: 9 additions & 4 deletions src/chart/treemap/TreemapSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,16 @@ export interface TreemapSeriesVisualOption {
}

export interface TreemapSeriesLevelOption extends TreemapSeriesVisualOption,
TreemapStateOption, StatesOptionMixin<TreemapStateOption, ExtraStateOption> {
TreemapStateOption, StatesOptionMixin<TreemapStateOption, ExtraStateOption>,
TreemapColorByMixin {

color?: ColorString[] | 'none',
decal?: DecalObject[] | 'none'
}

export interface TreemapSeriesNodeItemOption extends TreemapSeriesVisualOption,
TreemapStateOption, StatesOptionMixin<TreemapStateOption, ExtraStateOption> {
TreemapStateOption, StatesOptionMixin<TreemapStateOption, ExtraStateOption>,
TreemapColorByMixin {
id?: OptionId
name?: OptionName

Expand Down Expand Up @@ -324,15 +326,18 @@ class TreemapSeriesModel extends SeriesModel<TreemapSeriesOption> {
colorAlpha: null, // Array. Specify color alpha range of each level, like [0.2, 0.8]
colorSaturation: null, // Array. Specify color saturation of each level, like [0.2, 0.5]
// colorMappingBy: 'index', // 'value' or 'index' or 'id'.
colorBy: 'dataIndex',
colorBy: 'inherit',
visibleMin: 10, // If area less than this threshold (unit: pixel^2), node will not
// be rendered. Only works when sort is 'asc' or 'desc'.
childrenVisibleMin: null, // If area of a node less than this threshold (unit: pixel^2),
// grandchildren will not show.
// Why grandchildren? If not grandchildren but children,
// some siblings show children and some not,
// the appearance may be mess and not consistent,
levels: [] // Each item: {
levels: [{
colorBy: 'childIndex'
}]
// Each item: {
// visibleMin, itemStyle, visualDimension, label
// }
// data: {
Expand Down
100 changes: 100 additions & 0 deletions test/treemap-colorBy.html

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