Skip to content

Commit

Permalink
Merge pull request #16756 from apache/master
Browse files Browse the repository at this point in the history
Merge master into release for 5.3.2
  • Loading branch information
plainheart authored Mar 28, 2022
2 parents 06ee7c1 + 65f6044 commit a6769e8
Show file tree
Hide file tree
Showing 42 changed files with 764 additions and 320 deletions.
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Contributions can be made in varied ways:
- Help others in the issues
- Help solve problems with the issues
- Remind the authors to provide a demo if they are reporting for a bug
- Try to reproduce the problem as describe in the issues
- Try to reproduce the problem as described in the issues
- Make pull requests to fix bugs or implement new features
- Improve or translate the documents
- Discuss in the [mailing list](https://echarts.apache.org/en/maillist.html)
Expand All @@ -29,11 +29,11 @@ Any questions in the form of *how can I use echarts to* or *how to use echarts x

## Release Milestone Discussion

We will start the discussion about the bugs to fix and features of each release in the [mailing list](https://echarts.apache.org/en/maillist.html). You may subscribe to our [mailing list](https://echarts.apache.org/en/maillist.html) to give your valuable advice in milestone dicussions.
We will start the discussion about the bugs to fix and the features of each release in the [mailing list](https://echarts.apache.org/en/maillist.html). You may subscribe to our [mailing list](https://echarts.apache.org/en/maillist.html) to give your valuable advice in milestone discussions.

Regarding the release plan, we will release a mior version at the end of every month. Here is some detail.
Regarding the release plan, we will release a minor version at the end of every month. Here is some detail.

1. Assume our current stable release is 4.3.0. We will start the discussion of milestone of the release two versions ahead, which is 4.5.0 at the beginning of each month. At this time we should also kickoff the developing of the next release, which is 4.4.0.
1. Assume our current stable release is 4.3.0. We will start the discussion of the milestone of the release two versions ahead, which is 4.5.0 at the beginning of each month. At this time we should also kickoff the development of the next release, which is 4.4.0.
2. Finish 4.4.0 developing at about 22th of this month and start the testing. And the 4.5.0 milestone discussion is frozen and published on the [GitHub](https://github.com/apache/echarts/milestone/14)
3. Vote in the mailing list for the 4.4.0 release at the end of this month.

Expand All @@ -48,7 +48,7 @@ Wiki: [How to setup the dev environment](https://github.com/apache/echarts/wiki/
## Some hints about using code from other authors

+ About using some algorithms/formulas or inspired by other's work:
+ We can be inspired from other people’s work. There is no problem with copying ideas and no problems associated with that so long as the code is entirely yours and you aren’t violating the license of the inspirational work. You can just follow "normal" source code rules.
+ We can be inspired by other people’s work. There is no problem with copying ideas and no problems associated with that so long as the code is entirely yours and you aren’t violating the license of the inspirational work. You can just follow "normal" source code rules.
+ But when you copy the code, even parts of files, it must remain under the copyright of the original authors.
+ What's the right thing to do for the public good here? I'll go with:
+ Be transparent when implementing an existing idea/algorithm.
Expand All @@ -62,7 +62,7 @@ Wiki: [How to setup the dev environment](https://github.com/apache/echarts/wiki/
+ Licenses that are compatible with the Apache license:
+ BSD and MIT are compatible with the Apache license but CC_BY_SA is not (https://apache.org/legal/resolved.html#cc-sa).
+ Stack Overflow:
+ before intending to copy code from Stack Overlow, we must check:
+ before intending to copy code from Stack Overflow, we must check:
+ https://apache.org/legal/resolved.html#stackoverflow
+ https://issues.apache.org/jira/browse/LEGAL-471
+ Wikipedia (and most Wikimedia Foundation projects):
Expand Down
9 changes: 9 additions & 0 deletions build/source-release/prepareReleaseMaterials.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ console.log('[Release Commit] ' + releaseCommit);
console.log('[Release Name] ' + releaseFullName);

const voteTpl = fse.readFileSync(pathTool.join(__dirname, './template/vote-release.tpl'), 'utf-8');
const voteResultTpl = fse.readFileSync(pathTool.join(__dirname, './template/vote-result.tpl'), 'utf-8');
const announceTpl = fse.readFileSync(pathTool.join(__dirname, './template/announce-release.tpl'), 'utf-8');
const voteUntil = new Date(+new Date() + (72 + 12) * 3600 * 1000); // 3.5 day.

Expand All @@ -95,6 +96,14 @@ fse.writeFileSync(
'utf-8'
);

fse.ensureDirSync(outDir);
fse.writeFileSync(
pathTool.resolve(outDir, 'vote-result.txt'),
voteResultTpl.replace(/{{ECHARTS_RELEASE_VERSION}}/g, rcVersion)
.replace(/{{ECHARTS_RELEASE_VERSION_FULL_NAME}}/g, releaseFullName),
'utf-8'
);

fse.writeFileSync(
pathTool.resolve(outDir, 'announce.txt'),
announceTpl.replace(/{{ECHARTS_RELEASE_VERSION}}/g, stableVersion)
Expand Down
23 changes: 23 additions & 0 deletions build/source-release/template/vote-result.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--- Mail To: ---
[email protected]
-----------------------------------------------------------

--- Subject: ---
[RESULT] [VOTE] Release {{ECHARTS_RELEASE_VERSION_FULL_NAME}}
-----------------------------------------------------------

Thanks to all who voted or provided comments!

We received ______NUMBER_OF_+1_VOTES______ +1 votes from the PMC members, and the release has PASSED:

+1 ______NAME______ (binding)

Other votes from the community:

+1 ______NAME______

Vote thread:
https://lists.apache.org/thread/xxx

I'm going to release the source release of Apache ECharts {{ECHARTS_RELEASE_VERSION}}.
Thank you all for making this happen!
1 change: 0 additions & 1 deletion src/chart/bar/PictorialBarSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ class PictorialBarSeriesModel extends BaseBarSeriesModel<PictorialBarSeriesOptio

coordinateSystem: Cartesian2D;


hasSymbolVisual = true;
defaultSymbol = 'roundRect';

Expand Down
2 changes: 1 addition & 1 deletion src/chart/effectScatter/EffectScatterSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type ScatterDataValue = OptionDataValue | OptionDataValue[];
interface EffectScatterStatesOptionMixin {
emphasis?: {
focus?: DefaultEmphasisFocus
scale?: boolean
scale?: boolean | number
}
}
export interface EffectScatterStateOption<TCbParams = never> {
Expand Down
17 changes: 7 additions & 10 deletions src/chart/gauge/GaugeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {createSymbol} from '../../util/symbol';
import ZRImage from 'zrender/src/graphic/Image';
import {extend, isFunction, isString} from 'zrender/src/core/util';
import {setCommonECData} from '../../util/innerStore';
import { normalizeArcAngles } from 'zrender/src/core/PathProxy';

type ECSymbol = ReturnType<typeof createSymbol>;

Expand Down Expand Up @@ -72,8 +73,6 @@ function formatLabel(value: number, labelFormatter: string | ((value: number) =>
return label;
}

const PI2 = Math.PI * 2;

class GaugeView extends ChartView {
static type = 'gauge' as const;
type = GaugeView.type;
Expand Down Expand Up @@ -119,8 +118,12 @@ class GaugeView extends ChartView {
const showAxis = axisLineModel.get('show');
const lineStyleModel = axisLineModel.getModel('lineStyle');
const axisLineWidth = lineStyleModel.get('width');
const angleRangeSpan = !((endAngle - startAngle) % PI2) && endAngle !== startAngle
? PI2 : (endAngle - startAngle) % PI2;

const angles = [startAngle, endAngle];
normalizeArcAngles(angles, !clockwise);
startAngle = angles[0];
endAngle = angles[1];
const angleRangeSpan = endAngle - startAngle;

let prevEndAngle = startAngle;

Expand Down Expand Up @@ -173,12 +176,6 @@ class GaugeView extends ChartView {
return colorList[i - 1][1];
};

if (!clockwise) {
const tmp = startAngle;
startAngle = endAngle;
endAngle = tmp;
}

this._renderTicks(
seriesModel, ecModel, api, getColor, posInfo,
startAngle, endAngle, clockwise, axisLineWidth
Expand Down
20 changes: 11 additions & 9 deletions src/chart/heatmap/HeatmapView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,13 @@ class HeatmapView extends ChartView {
) {

const coordSys = seriesModel.coordinateSystem as Cartesian2D | Calendar;
const isCartesian2d = isCoordinateSystemType<Cartesian2D>(coordSys, 'cartesian2d');
let width;
let height;
let xAxisExtent;
let yAxisExtent;

if (isCoordinateSystemType<Cartesian2D>(coordSys, 'cartesian2d')) {
if (isCartesian2d) {
const xAxis = coordSys.getAxis('x');
const yAxis = coordSys.getAxis('y');

Expand All @@ -193,8 +194,9 @@ class HeatmapView extends ChartView {
}
}

width = xAxis.getBandWidth();
height = yAxis.getBandWidth();
// add 0.5px to avoid the gaps
width = xAxis.getBandWidth() + .5;
height = yAxis.getBandWidth() + .5;
xAxisExtent = xAxis.scale.getExtent();
yAxisExtent = yAxis.scale.getExtent();
}
Expand All @@ -212,7 +214,7 @@ class HeatmapView extends ChartView {
let blurScope = emphasisModel.get('blurScope');
let emphasisDisabled = emphasisModel.get('disabled');

const dataDims = isCoordinateSystemType<Cartesian2D>(coordSys, 'cartesian2d')
const dataDims = isCartesian2d
? [
data.mapDimension('x'),
data.mapDimension('y'),
Expand All @@ -227,7 +229,7 @@ class HeatmapView extends ChartView {
let rect;
const style = data.getItemVisual(idx, 'style');

if (isCoordinateSystemType<Cartesian2D>(coordSys, 'cartesian2d')) {
if (isCartesian2d) {
const dataDimX = data.get(dataDims[0], idx);
const dataDimY = data.get(dataDims[1], idx);

Expand All @@ -248,10 +250,10 @@ class HeatmapView extends ChartView {

rect = new graphic.Rect({
shape: {
x: Math.floor(Math.round(point[0]) - width / 2),
y: Math.floor(Math.round(point[1]) - height / 2),
width: Math.ceil(width),
height: Math.ceil(height)
x: point[0] - width / 2,
y: point[1] - height / 2,
width,
height
},
style
});
Expand Down
8 changes: 4 additions & 4 deletions src/chart/helper/Symbol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { ColorString, BlurScope, AnimationOption, ZRColor, AnimationOptionMixin
import SeriesModel from '../../model/Series';
import { PathProps } from 'zrender/src/graphic/Path';
import { SymbolDrawSeriesScope, SymbolDrawItemModelOption } from './SymbolDraw';
import { extend } from 'zrender/src/core/util';
import { extend, isNumber } from 'zrender/src/core/util';
import { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';
import ZRImage from 'zrender/src/graphic/Image';
import { saveOldStyle } from '../../animation/basicTrasition';
Expand Down Expand Up @@ -221,8 +221,8 @@ class Symbol extends graphic.Group {

let labelStatesModels;

let hoverScale;
let cursorStyle;
let hoverScale: SymbolDrawSeriesScope['hoverScale'];
let cursorStyle: SymbolDrawSeriesScope['cursorStyle'];

if (seriesScope) {
emphasisItemStyle = seriesScope.emphasisItemStyle;
Expand Down Expand Up @@ -337,7 +337,7 @@ class Symbol extends graphic.Group {
symbolPath.ensureState('blur').style = blurItemStyle;

if (hoverScale) {
const scaleRatio = Math.max(1.1, 3 / this._sizeY);
const scaleRatio = Math.max(isNumber(hoverScale) ? hoverScale : 1.1, 3 / this._sizeY);
emphasisState.scaleX = this._sizeX * scaleRatio;
emphasisState.scaleY = this._sizeY * scaleRatio;
}
Expand Down
4 changes: 2 additions & 2 deletions src/chart/helper/SymbolDraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export interface SymbolDrawItemModelOption extends SymbolOptionMixin<object>,
StatesOptionMixin<SymbolDrawStateOption, {
emphasis?: {
focus?: DefaultEmphasisFocus
scale?: boolean
scale?: boolean | number
}
}>,
SymbolDrawStateOption {
Expand All @@ -127,7 +127,7 @@ export interface SymbolDrawSeriesScope {

itemModel?: Model<SymbolDrawItemModelOption>

hoverScale?: boolean
hoverScale?: boolean | number

cursorStyle?: string
fadeIn?: boolean
Expand Down
4 changes: 2 additions & 2 deletions src/chart/line/LineSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export interface LineSeriesOption extends SeriesOption<LineStateOption<CallbackD
lineStyle?: LineStyleOption

areaStyle?: AreaStyleOption & {
origin?: 'auto' | 'start' | 'end'
origin?: 'auto' | 'start' | 'end' | number
}

step?: false | 'start' | 'end' | 'middle'
Expand Down Expand Up @@ -213,7 +213,7 @@ class LineSeriesModel extends SeriesModel<LineSeriesOption> {
divideShape: 'clone'
},

triggerLineEvent: false,
triggerLineEvent: false
};

getLegendIcon(opt: LegendIconParams): ECSymbol | Group {
Expand Down
7 changes: 6 additions & 1 deletion src/chart/line/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import {isDimensionStacked} from '../../data/helper/dataStackHelper';
import {map} from 'zrender/src/core/util';
import {isNumber, map} from 'zrender/src/core/util';
import type Polar from '../../coord/polar/Polar';
import type Cartesian2D from '../../coord/cartesian/Cartesian2D';
import SeriesData from '../../data/SeriesData';
Expand Down Expand Up @@ -90,6 +90,11 @@ function getValueStart(valueAxis: Axis, valueOrigin: LineSeriesOption['areaStyle
else if (valueOrigin === 'end') {
valueStart = extent[1];
}
// If origin is specified as a number, use it as
// valueStart directly
else if (isNumber(valueOrigin) && !isNaN(valueOrigin)){
valueStart = valueOrigin;
}
// auto
else {
// Both positive
Expand Down
2 changes: 2 additions & 0 deletions src/chart/tree/TreeSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export interface TreeAncestors {
}

export interface TreeSeriesCallbackDataParams extends CallbackDataParams {
collapsed: boolean;
treeAncestors?: TreeAncestors[]
}

Expand Down Expand Up @@ -240,6 +241,7 @@ class TreeSeriesModel extends SeriesModel<TreeSeriesOption> {

const node = this.getData().tree.getNodeByDataIndex(dataIndex);
params.treeAncestors = wrapTreePathInfo(node, this);
params.collapsed = !node.isExpand;

return params;
}
Expand Down
2 changes: 0 additions & 2 deletions src/chart/tree/TreeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ class TreeView extends ChartView {
private _max: number[];

init(ecModel: GlobalModel, api: ExtensionAPI) {


this._controller = new RoamController(api.getZr());

this._controllerHost = {
Expand Down
5 changes: 3 additions & 2 deletions src/component/axis/RadiusAxisView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ const axisElementBuilders: Record<typeof selfBuilderAttrs[number], AxisElementBu
shape: {
cx: polar.cx,
cy: polar.cy,
r: ticksCoords[i].coord
// ensure circle radius >= 0
r: Math.max(ticksCoords[i].coord, 0)
}
}));
}
Expand Down Expand Up @@ -225,4 +226,4 @@ function layoutAxis(polar: Polar, radiusAxisModel: RadiusAxisModel, axisAngle: n
};
}

export default RadiusAxisView;
export default RadiusAxisView;
6 changes: 3 additions & 3 deletions src/component/marker/MarkerView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import ExtensionAPI from '../../core/ExtensionAPI';
import { makeInner } from '../../util/model';
import SeriesModel from '../../model/Series';
import Group from 'zrender/src/graphic/Group';
import { enterBlur } from '../../util/states';
import { enterBlur, leaveBlur } from '../../util/states';

const inner = makeInner<{
keep: boolean
Expand Down Expand Up @@ -71,7 +71,7 @@ abstract class MarkerView extends ComponentView {
inner(drawGroup).keep = true;
}

blurSeries(seriesModelList: SeriesModel[]) {
toggleBlurSeries(seriesModelList: SeriesModel[], isBlur: boolean) {
each(seriesModelList, seriesModel => {
const markerModel = MarkerModel.getMarkerModelFromSeries(
seriesModel,
Expand All @@ -81,7 +81,7 @@ abstract class MarkerView extends ComponentView {
const data = markerModel.getData();
data.eachItemGraphicEl(function (el) {
if (el) {
enterBlur(el);
isBlur ? enterBlur(el) : leaveBlur(el);
}
});
}
Expand Down
Loading

0 comments on commit a6769e8

Please sign in to comment.