Skip to content

Commit

Permalink
Merge pull request #15732 from apache/master
Browse files Browse the repository at this point in the history
Prepare to release 5.2.1
  • Loading branch information
pissang committed Sep 16, 2021
2 parents 41b7769 + 6384acf commit b29726d
Show file tree
Hide file tree
Showing 89 changed files with 1,718 additions and 705 deletions.
33 changes: 33 additions & 0 deletions .asf.yaml
Expand Up @@ -28,3 +28,36 @@ github:
- data-viz
- canvas
- svg
protected_branches:
master:
required_status_checks:
# strict means "Require branches to be up to date before merging".
strict: false
# contexts are the names of checks that must pass
# contexts:
# - gh-infra/jenkins
required_pull_request_reviews:
dismiss_stale_reviews: true
require_code_owner_reviews: false
required_approving_review_count: 1
required_linear_history: false
required_signatures: false
release:
required_status_checks:
strict: false
required_pull_request_reviews:
dismiss_stale_reviews: true
require_code_owner_reviews: false
required_approving_review_count: 1
required_linear_history: false
required_signatures: false
next:
required_status_checks:
strict: false
required_pull_request_reviews:
dismiss_stale_reviews: true
require_code_owner_reviews: false
required_approving_review_count: 1
required_linear_history: false
required_signatures: false

60 changes: 0 additions & 60 deletions .github/stale.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/nightly-next.yml
@@ -0,0 +1,37 @@
name: Publish Nightly Next

on:
schedule:
- cron: '0 9 * * *' # After zrender nightly published
# committers can manually trigger with workflow_dispatch
workflow_dispatch: {}
repository_dispatch:
types: publish-nightly-next

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v2
with:
ref: next

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
registry-url: https://registry.npmjs.org/
- name: Setup and publish nightly
run: |
npm ci
npm run release
npm run test
npm run test:dts
node build/prepareNightly.js --next
npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
28 changes: 28 additions & 0 deletions .github/workflows/stale.yml
@@ -0,0 +1,28 @@
name: Closing Stale Issues

permissions:
issues: write
pull-requests: write

on:
schedule:
- cron: '0 21 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- name: Close Stale Issues
uses: actions/stale@v4.0.0
with:
days-before-stale: 730
days-before-close: 7
stale-issue-label: stale
stale-pr-label: stale
stale-issue-message: 'This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.'
close-issue-message: 'This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!'
stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR. We are sorry for this but 2 years is a long time and the code base has been changed a lot. Thanks for your contribution anyway.'
close-pr-message: 'This PR has been automatically closed because it has not had recent activity. Sorry for that and we are looking forward to your next contribution.'
exempt-issue-labels: 'FAQ,priority: high'
operations-per-run: 500
ascending: true
44 changes: 27 additions & 17 deletions build/prepareNightly.js
Expand Up @@ -23,26 +23,36 @@ const packageJsonPath = __dirname + '/../package.json';
const nightlyPackageName = 'echarts-nightly';

const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
const version = packageJson.version;
const parts = /(\d+)\.(\d+)\.(\d+)($|\-.*)/.exec(version);
if (!parts) {
throw new Error(`Invalid version number ${version}`);
}
// Add date to version.
const major = +parts[1];
const minor = +parts[2];
let patch = +parts[3];
const notDev = !(parts[4] && parts[4].includes('-dev'));
if (notDev) {
// It's previous stable or rc version. Dev version should be higher.
patch++;
}

const date = new Date().toISOString().replace(/:|T|\.|-/g, '').slice(0, 8);
const nightlyVersion = `${major}.${minor}.${patch}-dev.${date}`;
function updateVersion(version) {
const isNext = process.argv.includes('--next');
const parts = /(\d+)\.(\d+)\.(\d+)($|\-)/.exec(version);
if (!parts) {
throw new Error(`Invalid version number ${version}`);
}
// Add date to version.
const major = +parts[1];
let minor = +parts[2];
let patch = +parts[3];
const isStable = !parts[4];
if (isStable) {
// It's previous stable version. Dev version should be higher.
if (isNext) {
// Increase minor version for next branch.
minor++;
}
else {
// Increase main version for master branch.
patch++;
}
}

const date = new Date().toISOString().replace(/:|T|\.|-/g, '').slice(0, 8);
return `${major}.${minor}.${patch}-dev.${date}`;
}

packageJson.name = nightlyPackageName;
packageJson.version = nightlyVersion;
packageJson.version = updateVersion(packageJson.version);

fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf-8');

Expand Down
5 changes: 4 additions & 1 deletion index.d.ts
Expand Up @@ -17,4 +17,7 @@
* under the License.
*/

export * from './types/dist/echarts';
import * as echarts from './types/dist/echarts';
// Export for UMD module.
export as namespace echarts;
export = echarts;
23 changes: 16 additions & 7 deletions src/chart/bar/BarSeries.ts
Expand Up @@ -26,7 +26,9 @@ import {
OptionDataItemObject,
SeriesSamplingOptionMixin,
SeriesLabelOption,
SeriesEncodeOptionMixin
SeriesEncodeOptionMixin,
DefaultStatesMixinEmpasis,
CallbackDataParams
} from '../../util/types';
import type Cartesian2D from '../../coord/cartesian/Cartesian2D';
import createSeriesData from '../helper/createSeriesData';
Expand All @@ -41,21 +43,28 @@ export type PolarBarLabelPosition = SeriesLabelOption['position']
export type BarSeriesLabelOption = Omit<SeriesLabelOption, 'position'>
& {position?: PolarBarLabelPosition | 'outside'};

export interface BarStateOption {
itemStyle?: BarItemStyleOption
export interface BarStateOption<TCbParams = never> {
itemStyle?: BarItemStyleOption<TCbParams>
label?: BarSeriesLabelOption
}

export interface BarItemStyleOption extends ItemStyleOption {
interface BarStatesMixin {
emphasis?: DefaultStatesMixinEmpasis
}

export interface BarItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
// Border radius is not supported for bar on polar
borderRadius?: number | number[]
}
export interface BarDataItemOption extends BarStateOption, StatesOptionMixin<BarStateOption>,
export interface BarDataItemOption extends BarStateOption,
StatesOptionMixin<BarStateOption, BarStatesMixin>,
OptionDataItemObject<OptionDataValue> {
cursor?: string
}

export interface BarSeriesOption extends BaseBarSeriesOption<BarStateOption>, BarStateOption,
export interface BarSeriesOption
extends BaseBarSeriesOption<BarStateOption<CallbackDataParams>, BarStatesMixin>,
BarStateOption<CallbackDataParams>,
SeriesStackOptionMixin, SeriesSamplingOptionMixin, SeriesEncodeOptionMixin {

type?: 'bar'
Expand Down Expand Up @@ -151,7 +160,7 @@ class BarSeriesModel extends BaseBarSeriesModel<BarSeriesOption> {
},

realtimeSort: false
});
} as BarSeriesOption);

}

Expand Down
14 changes: 3 additions & 11 deletions src/chart/bar/BarView.ts
Expand Up @@ -746,18 +746,9 @@ const elementCreator: {
seriesModel, data, newIndex, layout: SectorLayout, isRadial: boolean,
animationModel, axisModel, isUpdate, roundCap
) {
// Keep the same logic with bar in catesion: use end value to control
// direction. Notice that if clockwise is true (by default), the sector
// will always draw clockwisely, no matter whether endAngle is greater
// or less than startAngle.
const clockwise = layout.startAngle < layout.endAngle;

const ShapeClass = (!isRadial && roundCap) ? Sausage : Sector;

const sector = new ShapeClass({
shape: defaults({
clockwise: clockwise
}, layout),
shape: layout,
z2: 1
});

Expand Down Expand Up @@ -909,7 +900,8 @@ const getLayout: {
r0: layout.r0,
r: layout.r,
startAngle: layout.startAngle,
endAngle: layout.endAngle
endAngle: layout.endAngle,
clockwise: layout.clockwise
} as SectorLayout;
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/chart/bar/BaseBarSeries.ts
Expand Up @@ -24,14 +24,14 @@ import {
SeriesOnCartesianOptionMixin,
SeriesOnPolarOptionMixin,
ScaleDataValue,
DefaultExtraStateOpts
DefaultStatesMixin
} from '../../util/types';
import GlobalModel from '../../model/Global';
import Cartesian2D from '../../coord/cartesian/Cartesian2D';
import SeriesData from '../../data/SeriesData';


export interface BaseBarSeriesOption<StateOption, ExtraStateOption = DefaultExtraStateOpts>
export interface BaseBarSeriesOption<StateOption, ExtraStateOption = DefaultStatesMixin>
extends SeriesOption<StateOption, ExtraStateOption>,
SeriesOnCartesianOptionMixin,
SeriesOnPolarOptionMixin {
Expand Down
12 changes: 7 additions & 5 deletions src/chart/boxplot/BoxplotSeries.ts
Expand Up @@ -28,7 +28,8 @@ import {
OptionDataValueNumeric,
StatesOptionMixin,
SeriesEncodeOptionMixin,
DefaultEmphasisFocus
DefaultEmphasisFocus,
CallbackDataParams
} from '../../util/types';
import type Axis2D from '../../coord/cartesian/Axis2D';
import Cartesian2D from '../../coord/cartesian/Cartesian2D';
Expand All @@ -37,9 +38,8 @@ import { mixin } from 'zrender/src/core/util';
// [min, Q1, median (or Q2), Q3, max]
type BoxplotDataValue = OptionDataValueNumeric[];


export interface BoxplotStateOption {
itemStyle?: ItemStyleOption
export interface BoxplotStateOption<TCbParams = never> {
itemStyle?: ItemStyleOption<TCbParams>
label?: SeriesLabelOption
}

Expand All @@ -55,7 +55,9 @@ interface ExtraStateOption {
}
}

export interface BoxplotSeriesOption extends SeriesOption<BoxplotStateOption, ExtraStateOption>, BoxplotStateOption,
export interface BoxplotSeriesOption
extends SeriesOption<BoxplotStateOption<CallbackDataParams>, ExtraStateOption>,
BoxplotStateOption<CallbackDataParams>,
SeriesOnCartesianOptionMixin, SeriesEncodeOptionMixin {
type?: 'boxplot'

Expand Down
6 changes: 3 additions & 3 deletions src/chart/candlestick/CandlestickSeries.ts
Expand Up @@ -28,17 +28,17 @@ import {
ColorString,
SeriesLabelOption,
SeriesLargeOptionMixin,
OptionDataValueNumeric,
StatesOptionMixin,
SeriesEncodeOptionMixin,
DefaultEmphasisFocus
DefaultEmphasisFocus,
OptionDataValue
} from '../../util/types';
import SeriesData from '../../data/SeriesData';
import Cartesian2D from '../../coord/cartesian/Cartesian2D';
import { BrushCommonSelectorsForSeries } from '../../component/brush/selector';
import { mixin } from 'zrender/src/core/util';

type CandlestickDataValue = OptionDataValueNumeric[];
type CandlestickDataValue = OptionDataValue[];

interface CandlestickItemStyleOption extends ItemStyleOption {
color0?: ZRColor
Expand Down

0 comments on commit b29726d

Please sign in to comment.