Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
4c9428b
feat: new theme color
Ovilia Mar 26, 2025
1b19b82
design: gray tokens
Ovilia Mar 27, 2025
6fdd2be
design: colors using tokens
Ovilia Mar 28, 2025
294ed78
feat: update theme
Ovilia Mar 31, 2025
17a3bad
feat: first round color all changed
Ovilia Apr 1, 2025
5f0184b
Merge branch 'v6' into feat-theme
Ovilia Apr 8, 2025
6629fb2
feat: update dataZoom theme
Ovilia Apr 9, 2025
3898955
fix: adjust themes
Ovilia Apr 23, 2025
c88e9f7
feat: update themes
Ovilia Apr 24, 2025
74ddbde
fix: fix unit test cases
Ovilia Apr 25, 2025
e23ed44
feat(theme): use containDataZoom to avoid overlap
Ovilia May 8, 2025
230ca04
fix(theme): adjust grid, legend, tokens
Ovilia May 8, 2025
f3c93a6
fix(theme): revert containDataZoom and update theme
Ovilia May 8, 2025
8fd6cd4
fix(theme): remove comment
Ovilia May 9, 2025
731aac4
feat(theme): add dark theme
Ovilia May 12, 2025
0882edd
feat(theme): remove light colorLayer
Ovilia May 12, 2025
7b34b19
fix(theme): update according to the pr review
Ovilia May 20, 2025
77826be
fix: update styles
Ovilia May 23, 2025
6bcfe10
test: sync test helper.
100pah May 24, 2025
139206b
test: manually sync visual test updates.
100pah May 24, 2025
f9b2a82
chore(theme): support theme in visual test
Ovilia May 26, 2025
8ddd15d
feat(visualMap): support specify `seriesId` on visualMap option; prev…
100pah May 26, 2025
8005bc3
test: support using theme in visual test
Ovilia May 27, 2025
f74b153
feat(theme): WIP v5 theme
Ovilia May 27, 2025
88d658a
fix(theme): update v5 theme
Ovilia May 28, 2025
e7867e1
chore(test): support mark diff as expected
Ovilia May 29, 2025
bd4d965
Merge branch 'v6' into feat-theme
Ovilia May 29, 2025
c448109
test(theme): fix test cases of v6
Ovilia May 30, 2025
6beeef2
feat(matrix & calendar): (1). Support matrix col/row size option. (2)…
100pah May 30, 2025
7e49f51
fix(matrix): fix test case and typo
100pah May 31, 2025
418b818
Merge branch 'v6' into feat-matrix-enhance
100pah Jun 1, 2025
13cf562
refactor(layout): unify margin/padding apply util.
100pah Jun 1, 2025
a4ac203
feat(matrix): (1). Support sankey, tree, treemap layout on matrix and…
100pah Jun 1, 2025
5d555a2
feat(matrix): (1) Add lineOverflow to long text in cells. (2) Fix tex…
100pah Jun 2, 2025
acf99c7
chore: fix visual test
Ovilia Jun 4, 2025
a09d775
chore: merge branch 'feat-matrix' into 'feat-matrix-enhance'
plainheart Jun 4, 2025
21d4124
fix: remove an unintentionally added test case
Ovilia Jun 4, 2025
4181b3f
chore: merge v6
Ovilia Jun 4, 2025
72f92ba
chore(test): fix default actual source
Ovilia Jun 4, 2025
3c33ba5
chore: remove unintentionally added files
Ovilia Jun 4, 2025
a1d61c2
chore: remove unintentionally added import
Ovilia Jun 4, 2025
31cf386
tweak(series data): Add validator to hint incorrect option.
100pah Jun 4, 2025
3123a3a
test(matrix): Add an application case.
100pah Jun 4, 2025
4a978a0
feat(matrix): fix treemap breadcrumb layout in matrix.
100pah Jun 4, 2025
b60f105
Merge pull request #20865 from apache/feat-theme
Ovilia Jun 5, 2025
5c11b74
fix(rich-text-inherit-plain): see https://github.com/apache/echarts/…
100pah Jun 5, 2025
ad7c5c8
fix(rich-inherit-plain): fix and add test case.
100pah Jun 5, 2025
9003873
Merge pull request #21016 from apache/fix/rich-inherit-plain-label-2
plainheart Jun 8, 2025
29230b8
Merge remote-tracking branch 'origin/v6' into feat-matrix-enhance
100pah Jun 8, 2025
59e8c64
feat(matrix): change the definition of cell.size and levelSize - base…
100pah Jun 9, 2025
1a3e819
feat(matrix): (1) Fix text truncate area. (2) Remove extra padding, u…
100pah Jun 9, 2025
9b3f71e
test(matrix): Add visual test (partial, not complete)
100pah Jun 9, 2025
069e686
test: temporarily change zrender dep.
100pah Jun 9, 2025
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
10 changes: 4 additions & 6 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
"dependencies": {
"tslib": "2.3.0",
"zrender": "github:ecomfe/zrender#v6"
"zrender": "github:ecomfe/zrender#feat/ignore-host-silent"
},
"devDependencies": {
"@babel/code-frame": "7.10.4",
Expand Down
14 changes: 9 additions & 5 deletions src/chart/bar/BarSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ import type Polar from '../../coord/polar/Polar';
import { inheritDefaultOption } from '../../util/component';
import SeriesData from '../../data/SeriesData';
import { BrushCommonSelectorsForSeries } from '../../component/brush/selector';
import tokens from '../../visual/tokens';

export type PolarBarLabelPosition = SeriesLabelOption['position']
| 'start' | 'insideStart' | 'middle' | 'end' | 'insideEnd';
type PolarBarLabelPositionExtra = 'start' | 'insideStart' | 'middle' | 'end' | 'insideEnd';
export type PolarBarLabelPosition = SeriesLabelOption['position'] | PolarBarLabelPositionExtra;

export type BarSeriesLabelOption = Omit<SeriesLabelOption, 'position'>
& {position?: PolarBarLabelPosition | 'outside'};
export type BarSeriesLabelOption = SeriesLabelOption<
CallbackDataParams,
{positionExtra: PolarBarLabelPositionExtra | 'outside'}
>;

export interface BarStateOption<TCbParams = never> {
itemStyle?: BarItemStyleOption<TCbParams>
Expand Down Expand Up @@ -155,7 +158,8 @@ class BarSeriesModel extends BaseBarSeriesModel<BarSeriesOption> {

select: {
itemStyle: {
borderColor: '#212121'
borderColor: tokens.color.primary,
borderWidth: 2
}
},

Expand Down
9 changes: 8 additions & 1 deletion src/chart/bar/BaseBarSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ export interface BaseBarSeriesOption<StateOption, ExtraStateOption extends State
*/
barGap?: string | number

/**
* @private
*/
defaultBarGap?: string | number

/**
* Gap between each category. Default to be 20%. can be an absolute pixel value.
*/
Expand Down Expand Up @@ -199,7 +204,9 @@ class BaseBarSeriesModel<Opts extends BaseBarSeriesOption<unknown> = BaseBarSeri
large: false,
largeThreshold: 400,
progressive: 3e3,
progressiveChunkMode: 'mod'
progressiveChunkMode: 'mod',

defaultBarGap: '10%'
};
}

Expand Down
8 changes: 5 additions & 3 deletions src/chart/bar/PictorialBarSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ import {
StatesOptionMixin,
OptionDataItemObject,
DefaultEmphasisFocus,
SeriesEncodeOptionMixin
SeriesEncodeOptionMixin,
CallbackDataParams
} from '../../util/types';
import type Cartesian2D from '../../coord/cartesian/Cartesian2D';
import { inheritDefaultOption } from '../../util/component';
import tokens from '../../visual/tokens';

export interface PictorialBarStateOption {
itemStyle?: ItemStyleOption
label?: SeriesLabelOption
label?: SeriesLabelOption<CallbackDataParams, {positionExtra: 'outside'}>
}

interface PictorialBarSeriesSymbolOption {
Expand Down Expand Up @@ -169,7 +171,7 @@ class PictorialBarSeriesModel extends BaseBarSeriesModel<PictorialBarSeriesOptio

select: {
itemStyle: {
borderColor: '#212121'
borderColor: tokens.color.primary
}
}
});
Expand Down
5 changes: 3 additions & 2 deletions src/chart/boxplot/BoxplotSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
import type Axis2D from '../../coord/cartesian/Axis2D';
import Cartesian2D from '../../coord/cartesian/Cartesian2D';
import { mixin } from 'zrender/src/core/util';
import tokens from '../../visual/tokens';

// [min, Q1, median (or Q2), Q3, max]
type BoxplotDataValue = OptionDataValueNumeric[];
Expand Down Expand Up @@ -111,7 +112,7 @@ class BoxplotSeriesModel extends SeriesModel<BoxplotSeriesOption> {
boxWidth: [7, 50],

itemStyle: {
color: '#fff',
color: tokens.color.neutral00,
borderWidth: 1
},

Expand All @@ -123,7 +124,7 @@ class BoxplotSeriesModel extends SeriesModel<BoxplotSeriesOption> {
shadowBlur: 5,
shadowOffsetX: 1,
shadowOffsetY: 1,
shadowColor: 'rgba(0,0,0,0.2)'
shadowColor: tokens.color.shadow
}
},

Expand Down
25 changes: 22 additions & 3 deletions src/chart/custom/CustomSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ import {
AnimationOption,
BlurScope,
CallbackDataParams,
CoordinateSystemDataLayout,
Dictionary,
DimensionLoose,
ItemStyleOption,
LabelOption,
NullUndefined,
OptionDataValue,
OrdinalRawValue,
ParsedValue,
Expand Down Expand Up @@ -303,13 +305,30 @@ export interface CustomSeriesRenderItemParamsCoordSys {
}
export interface CustomSeriesRenderItemCoordinateSystemAPI {
coord(
data: OptionDataValue | OptionDataValue[],
clamp?: boolean
// @see `CoordinateSystemDataCoord`
data: (OptionDataValue | NullUndefined)
| (OptionDataValue | NullUndefined)[]
| (OptionDataValue | OptionDataValue[] | NullUndefined)[],
// Some coord sys may support `clamp?: boolean` there.
// Can also be an `{xxx?: ...}` here.
opt?: unknown
): number[];
size?(
// Represents a range, rather than a absolute value.
// e.g., `dataSize: [5, 100]` represents
// data range `5` in x and data range `100` in y.
dataSize: OptionDataValue | OptionDataValue[],
// Represents a data point, based on which to calculate size.
// Some axis, such as logarithm, size varies in different points.
dataItem?: OptionDataValue | OptionDataValue[]
): number | number[];
layout?(
// @see `CoordinateSystemDataCoord`
data: (OptionDataValue | NullUndefined)
| (OptionDataValue | NullUndefined)[]
| (OptionDataValue | OptionDataValue[] | NullUndefined)[],
opt?: unknown
): CoordinateSystemDataLayout;
}

export type WrapEncodeDefRet = Dictionary<number[]>;
Expand Down Expand Up @@ -396,7 +415,7 @@ export default class CustomSeriesModel extends SeriesModel<CustomSeriesOption> {
static type = 'series.custom';
readonly type = CustomSeriesModel.type;

static dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];
static dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar', 'matrix'];

// preventAutoZ = true;

Expand Down
5 changes: 4 additions & 1 deletion src/chart/custom/CustomView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ import {
} from '../../animation/customGraphicKeyframeAnimation';
import type SeriesModel from '../../model/Series';
import { getCustomSeries } from './customSeriesRegister';
import tokens from '../../visual/tokens';

const EMPHASIS = 'emphasis' as const;
const NORMAL = 'normal' as const;
Expand Down Expand Up @@ -155,6 +156,8 @@ const attachedTxInfoTmp = {


/**
* FIXME: register rather than import directly, for size.
*
* To reduce total package size of each coordinate systems, the modules `prepareCustom`
* of each coordinate systems are not required by each coordinate systems directly, but
* required by the module `custom`.
Expand Down Expand Up @@ -811,7 +814,7 @@ function makeRenderItem(
visualColor != null && (itemStyle.fill = visualColor);
opacity != null && (itemStyle.opacity = opacity);

const opt = {inheritColor: isString(visualColor) ? visualColor : '#000'};
const opt = {inheritColor: isString(visualColor) ? visualColor : tokens.color.neutral99};
const labelModel = getLabelModel(dataIndexInside, NORMAL);
// Now that the feature of "auto adjust text fill/stroke" has been migrated to zrender
// since ec5, we should set `isAttached` as `false` here and make compat in
Expand Down
8 changes: 5 additions & 3 deletions src/chart/funnel/FunnelSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
} from '../../util/types';
import GlobalModel from '../../model/Global';
import SeriesData from '../../data/SeriesData';
import tokens from '../../visual/tokens';

type FunnelLabelOption = Omit<SeriesLabelOption, 'position'> & {
position?: LabelOption['position']
Expand Down Expand Up @@ -147,14 +148,15 @@ class FunnelSeriesModel extends SeriesModel<FunnelSeriesOption> {
}

static defaultOption: FunnelSeriesOption = {
coordinateSystemUsage: 'box',
// zlevel: 0, // 一级层叠
z: 2, // 二级层叠
legendHoverLink: true,
colorBy: 'data',
left: 80,
top: 60,
right: 80,
bottom: 60,
bottom: 65,
// width: {totalWidth} - left - right,
// height: {totalHeight} - top - bottom,

Expand Down Expand Up @@ -182,7 +184,7 @@ class FunnelSeriesModel extends SeriesModel<FunnelSeriesOption> {
},
itemStyle: {
// color: 各异,
borderColor: '#fff',
borderColor: tokens.color.neutral00,
borderWidth: 1
},
emphasis: {
Expand All @@ -192,7 +194,7 @@ class FunnelSeriesModel extends SeriesModel<FunnelSeriesOption> {
},
select: {
itemStyle: {
borderColor: '#212121'
borderColor: tokens.color.primary
}
}
};
Expand Down
11 changes: 8 additions & 3 deletions src/chart/funnel/FunnelView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,17 @@ class FunnelPiece extends graphic.Polygon {
} }
);

const labelModel = itemModel.getModel('label');
const labelColor = labelModel.get('color');
const overrideColor = labelColor === 'inherit'
? visualColor
: null;

polygon.setTextConfig({
local: true,
inside: !!labelLayout.inside,
insideStroke: visualColor,
// insideFill: 'auto',
outsideFill: visualColor
insideStroke: overrideColor,
outsideFill: overrideColor
});

const linePoints = labelLayout.linePoints;
Expand Down
6 changes: 5 additions & 1 deletion src/chart/funnel/funnelLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import SeriesData from '../../data/SeriesData';
import GlobalModel from '../../model/Global';
import { isFunction } from 'zrender/src/core/util';


function getSortedIndices(data: SeriesData, sort: FunnelSeriesOption['sort']) {
const valueDim = data.mapDimension('value');
const valueArr = data.mapArray(valueDim, function (val: number) {
Expand Down Expand Up @@ -242,7 +243,10 @@ export default function funnelLayout(ecModel: GlobalModel, api: ExtensionAPI) {
const data = seriesModel.getData();
const valueDim = data.mapDimension('value');
const sort = seriesModel.get('sort');
const viewRect = layout.getViewRect(seriesModel, api);

const layoutRef = layout.createBoxLayoutReference(seriesModel, api);
const viewRect = layout.getLayoutRect(seriesModel.getBoxLayoutParams(), layoutRef.refContainer);

const orient = seriesModel.get('orient');
const viewWidth = viewRect.width;
const viewHeight = viewRect.height;
Expand Down
21 changes: 11 additions & 10 deletions src/chart/gauge/GaugeSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
} from '../../util/types';
import GlobalModel from '../../model/Global';
import SeriesData from '../../data/SeriesData';
import tokens from '../../visual/tokens';

// [percent, color]
type GaugeColorStop = [number, ColorString];
Expand Down Expand Up @@ -218,7 +219,7 @@ class GaugeSeriesModel extends SeriesModel<GaugeSeriesOption> {
show: true,
roundCap: false,
lineStyle: { // 属性lineStyle控制线条样式
color: [[1, '#E6EBF8']],
color: [[1, tokens.color.neutral10]],
width: 10
}
},
Expand All @@ -240,7 +241,7 @@ class GaugeSeriesModel extends SeriesModel<GaugeSeriesOption> {
distance: 10,
// 属性lineStyle(详见lineStyle)控制线条样式
lineStyle: {
color: '#63677A',
color: tokens.color.axisTick,
width: 3,
type: 'solid'
}
Expand All @@ -256,7 +257,7 @@ class GaugeSeriesModel extends SeriesModel<GaugeSeriesOption> {
distance: 10,
// 属性lineStyle控制线条样式
lineStyle: {
color: '#63677A',
color: tokens.color.axisTickMinor,
width: 1,
type: 'solid'
}
Expand All @@ -265,7 +266,7 @@ class GaugeSeriesModel extends SeriesModel<GaugeSeriesOption> {
show: true,
distance: 15,
// formatter: null,
color: '#464646',
color: tokens.color.axisLabel,
fontSize: 12,
rotate: 0
},
Expand All @@ -286,9 +287,9 @@ class GaugeSeriesModel extends SeriesModel<GaugeSeriesOption> {
offsetCenter: [0, 0],
keepAspect: false,
itemStyle: {
color: '#fff',
color: tokens.color.neutral00,
borderWidth: 0,
borderColor: '#5470c6'
borderColor: tokens.color.theme[0]
}
},

Expand All @@ -297,23 +298,23 @@ class GaugeSeriesModel extends SeriesModel<GaugeSeriesOption> {
// x, y,单位px
offsetCenter: [0, '20%'],
// 其余属性默认使用全局文本样式,详见TEXTSTYLE
color: '#464646',
color: tokens.color.secondary,
fontSize: 16,
valueAnimation: false
},
detail: {
show: true,
backgroundColor: 'rgba(0,0,0,0)',
backgroundColor: tokens.color.transparent,
borderWidth: 0,
borderColor: '#ccc',
borderColor: tokens.color.neutral40,
width: 100,
height: null, // self-adaption
padding: [5, 10],
// x, y,单位px
offsetCenter: [0, '40%'],
// formatter: null,
// 其余属性默认使用全局文本样式,详见TEXTSTYLE
color: '#464646',
color: tokens.color.primary,
fontSize: 30,
fontWeight: 'bold',
lineHeight: 30,
Expand Down
Loading
Loading