diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 52654df348..0a7507e9d8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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) @@ -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. @@ -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. @@ -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): diff --git a/build/source-release/prepareReleaseMaterials.js b/build/source-release/prepareReleaseMaterials.js index cb96d5e301..90c98fd729 100644 --- a/build/source-release/prepareReleaseMaterials.js +++ b/build/source-release/prepareReleaseMaterials.js @@ -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. @@ -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) diff --git a/build/source-release/template/vote-result.tpl b/build/source-release/template/vote-result.tpl new file mode 100644 index 0000000000..4a92d738b2 --- /dev/null +++ b/build/source-release/template/vote-result.tpl @@ -0,0 +1,23 @@ +--- Mail To: --- +dev@echarts.apache.org +----------------------------------------------------------- + +--- 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! diff --git a/src/chart/bar/PictorialBarSeries.ts b/src/chart/bar/PictorialBarSeries.ts index 17191b639c..9ee0517ff9 100644 --- a/src/chart/bar/PictorialBarSeries.ts +++ b/src/chart/bar/PictorialBarSeries.ts @@ -128,7 +128,6 @@ class PictorialBarSeriesModel extends BaseBarSeriesModel { diff --git a/src/chart/gauge/GaugeView.ts b/src/chart/gauge/GaugeView.ts index f9fd24ddf9..b646607d75 100644 --- a/src/chart/gauge/GaugeView.ts +++ b/src/chart/gauge/GaugeView.ts @@ -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; @@ -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; @@ -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; @@ -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 diff --git a/src/chart/heatmap/HeatmapView.ts b/src/chart/heatmap/HeatmapView.ts index cd835ae048..88933e278d 100644 --- a/src/chart/heatmap/HeatmapView.ts +++ b/src/chart/heatmap/HeatmapView.ts @@ -175,12 +175,13 @@ class HeatmapView extends ChartView { ) { const coordSys = seriesModel.coordinateSystem as Cartesian2D | Calendar; + const isCartesian2d = isCoordinateSystemType(coordSys, 'cartesian2d'); let width; let height; let xAxisExtent; let yAxisExtent; - if (isCoordinateSystemType(coordSys, 'cartesian2d')) { + if (isCartesian2d) { const xAxis = coordSys.getAxis('x'); const yAxis = coordSys.getAxis('y'); @@ -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(); } @@ -212,7 +214,7 @@ class HeatmapView extends ChartView { let blurScope = emphasisModel.get('blurScope'); let emphasisDisabled = emphasisModel.get('disabled'); - const dataDims = isCoordinateSystemType(coordSys, 'cartesian2d') + const dataDims = isCartesian2d ? [ data.mapDimension('x'), data.mapDimension('y'), @@ -227,7 +229,7 @@ class HeatmapView extends ChartView { let rect; const style = data.getItemVisual(idx, 'style'); - if (isCoordinateSystemType(coordSys, 'cartesian2d')) { + if (isCartesian2d) { const dataDimX = data.get(dataDims[0], idx); const dataDimY = data.get(dataDims[1], idx); @@ -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 }); diff --git a/src/chart/helper/Symbol.ts b/src/chart/helper/Symbol.ts index d73e9ffba7..efb45428ae 100644 --- a/src/chart/helper/Symbol.ts +++ b/src/chart/helper/Symbol.ts @@ -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'; @@ -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; @@ -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; } diff --git a/src/chart/helper/SymbolDraw.ts b/src/chart/helper/SymbolDraw.ts index 1578278b6f..93e13848e1 100644 --- a/src/chart/helper/SymbolDraw.ts +++ b/src/chart/helper/SymbolDraw.ts @@ -103,7 +103,7 @@ export interface SymbolDrawItemModelOption extends SymbolOptionMixin, StatesOptionMixin, SymbolDrawStateOption { @@ -127,7 +127,7 @@ export interface SymbolDrawSeriesScope { itemModel?: Model - hoverScale?: boolean + hoverScale?: boolean | number cursorStyle?: string fadeIn?: boolean diff --git a/src/chart/line/LineSeries.ts b/src/chart/line/LineSeries.ts index 7cd8cabdb0..d46640bbc3 100644 --- a/src/chart/line/LineSeries.ts +++ b/src/chart/line/LineSeries.ts @@ -101,7 +101,7 @@ export interface LineSeriesOption extends SeriesOption { divideShape: 'clone' }, - triggerLineEvent: false, + triggerLineEvent: false }; getLegendIcon(opt: LegendIconParams): ECSymbol | Group { diff --git a/src/chart/line/helper.ts b/src/chart/line/helper.ts index e58d2e70e0..fa4da433cb 100644 --- a/src/chart/line/helper.ts +++ b/src/chart/line/helper.ts @@ -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'; @@ -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 diff --git a/src/chart/tree/TreeSeries.ts b/src/chart/tree/TreeSeries.ts index 53768bd3a0..03d85113d4 100644 --- a/src/chart/tree/TreeSeries.ts +++ b/src/chart/tree/TreeSeries.ts @@ -121,6 +121,7 @@ export interface TreeAncestors { } export interface TreeSeriesCallbackDataParams extends CallbackDataParams { + collapsed: boolean; treeAncestors?: TreeAncestors[] } @@ -240,6 +241,7 @@ class TreeSeriesModel extends SeriesModel { const node = this.getData().tree.getNodeByDataIndex(dataIndex); params.treeAncestors = wrapTreePathInfo(node, this); + params.collapsed = !node.isExpand; return params; } diff --git a/src/chart/tree/TreeView.ts b/src/chart/tree/TreeView.ts index 1a20497051..1c240fde97 100644 --- a/src/chart/tree/TreeView.ts +++ b/src/chart/tree/TreeView.ts @@ -141,8 +141,6 @@ class TreeView extends ChartView { private _max: number[]; init(ecModel: GlobalModel, api: ExtensionAPI) { - - this._controller = new RoamController(api.getZr()); this._controllerHost = { diff --git a/src/component/axis/RadiusAxisView.ts b/src/component/axis/RadiusAxisView.ts index 2cc5e7814a..b09dd50603 100644 --- a/src/component/axis/RadiusAxisView.ts +++ b/src/component/axis/RadiusAxisView.ts @@ -116,7 +116,8 @@ const axisElementBuilders: Record= 0 + r: Math.max(ticksCoords[i].coord, 0) } })); } @@ -225,4 +226,4 @@ function layoutAxis(polar: Polar, radiusAxisModel: RadiusAxisModel, axisAngle: n }; } -export default RadiusAxisView; \ No newline at end of file +export default RadiusAxisView; diff --git a/src/component/marker/MarkerView.ts b/src/component/marker/MarkerView.ts index 9af63e3760..751dd9f97e 100644 --- a/src/component/marker/MarkerView.ts +++ b/src/component/marker/MarkerView.ts @@ -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 @@ -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, @@ -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); } }); } diff --git a/src/component/toolbox/ToolboxView.ts b/src/component/toolbox/ToolboxView.ts index 67ea92151e..faa3404184 100644 --- a/src/component/toolbox/ToolboxView.ts +++ b/src/component/toolbox/ToolboxView.ts @@ -39,7 +39,6 @@ import { import { getUID } from '../../util/component'; import Displayable from 'zrender/src/graphic/Displayable'; import ZRText from 'zrender/src/graphic/Text'; -import { getECData } from '../../util/innerStore'; type IconPath = ToolboxFeatureModel['iconPaths'][string]; @@ -70,6 +69,7 @@ class ToolboxView extends ComponentView { } const itemSize = +toolboxModel.get('itemSize'); + const isVertical = toolboxModel.get('orient') === 'vertical'; const featureOpts = toolboxModel.get('feature') || {}; const features = this._features || (this._features = {}); @@ -238,15 +238,21 @@ class ToolboxView extends ComponentView { } }); - // graphic.enableHoverEmphasis(path); - (path as ExtendedPath).__title = titlesMap[iconName]; (path as graphic.Path).on('mouseover', function () { // Should not reuse above hoverStyle, which might be modified. const hoverStyle = iconStyleEmphasisModel.getItemStyle(); - const defaultTextPosition = toolboxModel.get('orient') === 'vertical' - ? (toolboxModel.get('right') == null ? 'right' as const : 'left' as const) - : (toolboxModel.get('bottom') == null ? 'bottom' as const : 'top' as const); + const defaultTextPosition = isVertical + ? ( + toolboxModel.get('right') == null && toolboxModel.get('left') !== 'right' + ? 'right' as const + : 'left' as const + ) + : ( + toolboxModel.get('bottom') == null && toolboxModel.get('top') !== 'bottom' + ? 'bottom' as const + : 'top' as const + ); textContent.setStyle({ fill: (iconStyleEmphasisModel.get('textFill') || hoverStyle.fill || hoverStyle.stroke || '#000') as string, @@ -259,11 +265,11 @@ class ToolboxView extends ComponentView { // Use enterEmphasis and leaveEmphasis provide by ec. // There are flags managed by the echarts. - enterEmphasis(this); + api.enterEmphasis(this); }) .on('mouseout', function () { if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') { - leaveEmphasis(this); + api.leaveEmphasis(this); } textContent.hide(); }); @@ -284,7 +290,7 @@ class ToolboxView extends ComponentView { group.add(listComponentHelper.makeBackground(group.getBoundingRect(), toolboxModel)); // Adjust icon title positions to avoid them out of screen - group.eachChild(function (icon: IconPath) { + isVertical || group.eachChild(function (icon: IconPath) { const titleText = (icon as ExtendedPath).__title; // const hoverStyle = icon.hoverStyle; @@ -292,7 +298,7 @@ class ToolboxView extends ComponentView { const emphasisState = icon.ensureState('emphasis'); const emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {}); const textContent = icon.getTextContent(); - const emphasisTextState = textContent && textContent.states.emphasis; + const emphasisTextState = textContent && textContent.ensureState('emphasis'); // May be background element if (emphasisTextState && !zrUtil.isFunction(emphasisTextState) && titleText) { const emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {}); @@ -307,7 +313,7 @@ class ToolboxView extends ComponentView { emphasisTextConfig.position = 'top'; needPutOnTop = true; } - const topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 8); + const topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 10); if (offsetX + rect.width / 2 > api.getWidth()) { emphasisTextConfig.position = ['100%', topOffset]; emphasisTextStyle.align = 'right'; diff --git a/src/component/toolbox/feature/DataView.ts b/src/component/toolbox/feature/DataView.ts index ca84c809c1..6efd570432 100644 --- a/src/component/toolbox/feature/DataView.ts +++ b/src/component/toolbox/feature/DataView.ts @@ -29,6 +29,7 @@ import ExtensionAPI from '../../../core/ExtensionAPI'; import { addEventListener } from 'zrender/src/core/event'; import Axis from '../../../coord/Axis'; import Cartesian2D from '../../../coord/cartesian/Cartesian2D'; +import { warn } from '../../../util/log'; /* global document */ @@ -363,7 +364,7 @@ class DataView extends ToolboxFeature { textarea.readOnly = model.get('readOnly'); const style = textarea.style; // eslint-disable-next-line max-len - style.cssText = 'width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none'; + style.cssText = 'display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none'; style.color = model.get('textColor'); style.borderColor = model.get('textareaBorderColor'); style.backgroundColor = model.get('textareaColor'); @@ -397,7 +398,7 @@ class DataView extends ToolboxFeature { || (contentToOption != null && optionToContent == null)) { if (__DEV__) { // eslint-disable-next-line - console.warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.') + warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.') } close(); return; diff --git a/src/component/toolbox/feature/SaveAsImage.ts b/src/component/toolbox/feature/SaveAsImage.ts index 7e9c690e80..8777a97891 100644 --- a/src/component/toolbox/feature/SaveAsImage.ts +++ b/src/component/toolbox/feature/SaveAsImage.ts @@ -29,7 +29,7 @@ import { isFunction } from 'zrender/src/core/util'; export interface ToolboxSaveAsImageFeatureOption extends ToolboxFeatureOption { icon?: string title?: string - type?: 'png' | 'jpg' + type?: 'png' | 'jpeg' backgroundColor?: ZRColor connectedBackgroundColor?: ZRColor diff --git a/src/component/visualMap/ContinuousView.ts b/src/component/visualMap/ContinuousView.ts index 4b9e959487..ac31cd0943 100644 --- a/src/component/visualMap/ContinuousView.ts +++ b/src/component/visualMap/ContinuousView.ts @@ -38,6 +38,7 @@ import { setAsHighDownDispatcher } from '../../util/states'; import { createSymbol } from '../../util/symbol'; import ZRImage from 'zrender/src/graphic/Image'; import { getECData } from '../../util/innerStore'; +import { createTextStyle } from '../../label/labelStyle'; const linearMap = numberUtil.linearMap; const each = zrUtil.each; @@ -184,15 +185,13 @@ class ContinuousView extends VisualMapView { const textStyleModel = this.visualMapModel.textStyleModel; this.group.add(new graphic.Text({ - style: { + style: createTextStyle(textStyleModel, { x: position[0], y: position[1], verticalAlign: orient === 'horizontal' ? 'middle' : align as TextVerticalAlign, align: orient === 'horizontal' ? align as TextAlign : 'center', - text: text, - font: textStyleModel.getFont(), - fill: textStyleModel.getTextColor() - } + text + }) })); } @@ -300,11 +299,11 @@ class ContinuousView extends VisualMapView { eventTool.stop(e.event); }, ondragend: onDragEnd, - style: { - x: 0, y: 0, text: '', - font: textStyleModel.getFont(), - fill: textStyleModel.getTextColor() - } + style: createTextStyle(textStyleModel, { + x: 0, + y: 0, + text: '' + }) }); handleLabel.ensureState('blur').style = { opacity: 0.1 @@ -360,11 +359,11 @@ class ContinuousView extends VisualMapView { const indicatorLabel = new graphic.Text({ silent: true, invisible: true, - style: { - x: 0, y: 0, text: '', - font: textStyleModel.getFont(), - fill: textStyleModel.getTextColor() - } + style: createTextStyle(textStyleModel, { + x: 0, + y: 0, + text: '' + }) }); this.group.add(indicatorLabel); diff --git a/src/component/visualMap/PiecewiseView.ts b/src/component/visualMap/PiecewiseView.ts index c62b27e2c0..f3f260593e 100644 --- a/src/component/visualMap/PiecewiseView.ts +++ b/src/component/visualMap/PiecewiseView.ts @@ -26,6 +26,7 @@ import * as helper from './helper'; import PiecewiseModel from './PiecewiseModel'; import { TextAlign } from 'zrender/src/core/types'; import { VisualMappingOption } from '../../visual/VisualMapping'; +import { createTextStyle } from '../../label/labelStyle'; class PiecewiseVisualMapView extends VisualMapView { @@ -101,8 +102,6 @@ class PiecewiseVisualMapView extends VisualMapView { this.renderBackground(thisGroup); this.positionGroup(thisGroup); - - } private _enableHoverLink(itemGroup: graphic.Group, pieceIndex: number) { @@ -157,15 +156,13 @@ class PiecewiseVisualMapView extends VisualMapView { const textStyleModel = this.visualMapModel.textStyleModel; itemGroup.add(new graphic.Text({ - style: { + style: createTextStyle(textStyleModel, { x: showLabel ? (itemAlign === 'right' ? itemSize[0] : 0) : itemSize[0] / 2, y: itemSize[1] / 2, verticalAlign: 'middle', align: showLabel ? (itemAlign as TextAlign) : 'center', - text: text, - font: textStyleModel.getFont(), - fill: textStyleModel.getTextColor() - } + text + }) })); group.add(itemGroup); diff --git a/src/core/echarts.ts b/src/core/echarts.ts index a4323a4f19..c2f24ddd06 100644 --- a/src/core/echarts.ts +++ b/src/core/echarts.ts @@ -763,7 +763,7 @@ class ECharts extends Eventful { getDataURL(opts?: { // file type 'png' by default - type?: 'png' | 'jpg' | 'svg', + type?: 'png' | 'jpeg' | 'svg', pixelRatio?: number, backgroundColor?: ZRColor, // component type array @@ -807,7 +807,7 @@ class ECharts extends Eventful { getConnectedDataURL(opts?: { // file type 'png' by default - type?: 'png' | 'jpg' | 'svg', + type?: 'png' | 'jpeg' | 'svg', pixelRatio?: number, backgroundColor?: ZRColor, connectedBackgroundColor?: ZRColor diff --git a/src/data/DataStore.ts b/src/data/DataStore.ts index ddd3c09a44..4ceb7ba894 100644 --- a/src/data/DataStore.ts +++ b/src/data/DataStore.ts @@ -290,8 +290,10 @@ class DataStore { // Parse from previous data offset. len may be changed after appendData for (let i = offset; i < len; i++) { const val = (chunk as any)[i] = ordinalMeta.parseAndCollect(chunk[i]); - dimRawExtent[0] = Math.min(val, dimRawExtent[0]); - dimRawExtent[1] = Math.max(val, dimRawExtent[1]); + if (!isNaN(val)) { + dimRawExtent[0] = Math.min(val, dimRawExtent[0]); + dimRawExtent[1] = Math.max(val, dimRawExtent[1]); + } } dim.ordinalMeta = ordinalMeta; @@ -1308,4 +1310,4 @@ class DataStore { })(); } -export default DataStore; \ No newline at end of file +export default DataStore; diff --git a/src/label/labelGuideHelper.ts b/src/label/labelGuideHelper.ts index c9a4b5bdb2..13008a7642 100644 --- a/src/label/labelGuideHelper.ts +++ b/src/label/labelGuideHelper.ts @@ -618,7 +618,7 @@ export function setLabelLineStyle( if (isLabelIgnored // Not show when label is not shown in this state. || !retrieve2(stateShow, showNormal) // Use normal state by default if not set. ) { - const stateObj = isNormal ? labelLine : (labelLine && labelLine.states.normal); + const stateObj = isNormal ? labelLine : (labelLine && labelLine.states[stateName]); if (stateObj) { stateObj.ignore = true; } diff --git a/src/scale/Ordinal.ts b/src/scale/Ordinal.ts index eb532bdf8d..dd7d255c88 100644 --- a/src/scale/Ordinal.ts +++ b/src/scale/Ordinal.ts @@ -130,6 +130,10 @@ class OrdinalScale extends Scale { } parse(val: OrdinalRawValue | OrdinalNumber): OrdinalNumber { + // Caution: Math.round(null) will return `0` rather than `NaN` + if (val == null) { + return NaN; + } return isString(val) ? this._ordinalMeta.getOrdinal(val) // val might be float. diff --git a/src/util/states.ts b/src/util/states.ts index d247cb62b4..f3886cd78a 100644 --- a/src/util/states.ts +++ b/src/util/states.ts @@ -61,6 +61,7 @@ import GlobalModel from '../model/Global'; import ExtensionAPI from '../core/ExtensionAPI'; import ComponentModel from '../model/Component'; import { error } from './log'; +import type ComponentView from '../view/Component'; // Reserve 0 as default. let _highlightNextDigit = 1; @@ -427,19 +428,28 @@ function shouldSilent(el: Element, e: ElementEvent) { export function allLeaveBlur(api: ExtensionAPI) { const model = api.getModel(); + const leaveBlurredSeries: SeriesModel[] = []; + const allComponentViews: ComponentView[] = []; model.eachComponent(function (componentType, componentModel) { const componentStates = getComponentStates(componentModel); + const isSeries = componentType === 'series'; + const view = isSeries ? api.getViewOfSeriesModel(componentModel as SeriesModel) + : api.getViewOfComponentModel(componentModel); + !isSeries && allComponentViews.push(view as ComponentView); if (componentStates.isBlured) { - const view = componentType === 'series' - ? api.getViewOfSeriesModel(componentModel as SeriesModel) - : api.getViewOfComponentModel(componentModel); // Leave blur anyway view.group.traverse(function (child) { singleLeaveBlur(child); }); + isSeries && leaveBlurredSeries.push(componentModel as SeriesModel); } componentStates.isBlured = false; }); + each(allComponentViews, function (view) { + if (view && view.toggleBlurSeries) { + view.toggleBlurSeries(leaveBlurredSeries, false, model); + } + }); } export function blurSeries( @@ -519,8 +529,8 @@ export function blurSeries( return; } const view = api.getViewOfComponentModel(componentModel); - if (view && view.blurSeries) { - view.blurSeries(blurredSeries, ecModel); + if (view && view.toggleBlurSeries) { + view.toggleBlurSeries(blurredSeries, true, ecModel); } }); } diff --git a/src/view/Component.ts b/src/view/Component.ts index 1c729a1ee3..ed7fa8ef37 100644 --- a/src/view/Component.ts +++ b/src/view/Component.ts @@ -107,11 +107,11 @@ class ComponentView { } /** - * Hook for blur target series. - * Can be used in marker for blur the markers + * Hook for toggle blur target series. + * Can be used in marker for blur or leave blur the markers */ - blurSeries(seriesModels: SeriesModel[], ecModel: GlobalModel): void { - // Do nothing; + toggleBlurSeries(seriesModels: SeriesModel[], isBlur: boolean, ecModel: GlobalModel): void { + // Do nothing; } /** diff --git a/src/visual/VisualMapping.ts b/src/visual/VisualMapping.ts index 16c7394229..8898bc7b06 100644 --- a/src/visual/VisualMapping.ts +++ b/src/visual/VisualMapping.ts @@ -28,6 +28,7 @@ import { VisualOptionUnit, ParsedValue } from '../util/types'; +import { warn } from '../util/log'; const each = zrUtil.each; const isObject = zrUtil.isObject; @@ -693,7 +694,11 @@ function setVisualToOption(thisOption: VisualMappingInnerOption, visualArr: Visu thisOption.visual = visualArr; if (thisOption.type === 'color') { thisOption.parsedVisual = zrUtil.map(visualArr, function (item: string) { - return zrColor.parse(item); + const color = zrColor.parse(item); + if (!color && __DEV__) { + warn(`'${item}' is an illegal color, fallback to '#000000'`, true); + } + return color || [0, 0, 0, 1]; }); } return visualArr; diff --git a/test/area-origin.html b/test/area-origin.html new file mode 100644 index 0000000000..b70b1689fc --- /dev/null +++ b/test/area-origin.html @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + + \ No newline at end of file diff --git a/test/dataZoom-feature.html b/test/dataZoom-feature.html index 8f2b5b0e97..6715089fd0 100644 --- a/test/dataZoom-feature.html +++ b/test/dataZoom-feature.html @@ -43,7 +43,7 @@
- +
@@ -746,6 +746,116 @@ }); + + diff --git a/test/gauge-case.html b/test/gauge-case.html index 30bd029072..94f8bd5626 100644 --- a/test/gauge-case.html +++ b/test/gauge-case.html @@ -37,8 +37,8 @@
- - +
+
+ + + + diff --git a/test/heatmap-gap-bug.html b/test/heatmap-gap-bug.html index a6793b0f12..1fd6b73dfe 100644 --- a/test/heatmap-gap-bug.html +++ b/test/heatmap-gap-bug.html @@ -97,7 +97,11 @@ - \ No newline at end of file + diff --git a/test/markPoint.html b/test/markPoint.html index bf42fbaa07..f4ca85f12f 100644 --- a/test/markPoint.html +++ b/test/markPoint.html @@ -89,7 +89,9 @@ symbolSize: 6, areaStyle: {normal: {}}, data: data1, - + emphasis: { + focus: 'series' + }, markPoint: { data: [ { diff --git a/test/pie-label.html b/test/pie-label.html index 0d1c0c4dbb..85541efd72 100644 --- a/test/pie-label.html +++ b/test/pie-label.html @@ -50,6 +50,7 @@
+
+ + diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index f7a6ad4015..1aa77623e2 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -103,6 +103,7 @@ "graphic-draggable": 1, "graphic-transition": 3, "heatmap": 1, + "heatmap-gap-bug": 1, "heatmap-map": 1, "homepage3": 1, "hoverFocus": 12, @@ -162,6 +163,7 @@ "scatter-single-axis": 2, "scatterMatrix": 3, "setOption": 1, + "splitLine": 1, "stackBar-dataZoom": 7, "sunburst-book": 1, "sunburst-canvas": 1, diff --git a/test/runTest/actions/heatmap-gap-bug.json b/test/runTest/actions/heatmap-gap-bug.json new file mode 100644 index 0000000000..5a3cfca338 --- /dev/null +++ b/test/runTest/actions/heatmap-gap-bug.json @@ -0,0 +1 @@ +[{"name":"Action 1","ops":[{"type":"mousedown","time":482,"x":413,"y":595},{"type":"mouseup","time":1742,"x":454,"y":595},{"time":1743,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1772,"x":454,"y":595}],"scrollY":0,"scrollX":0,"timestamp":1642876188713}] \ No newline at end of file diff --git a/test/runTest/actions/splitLine.json b/test/runTest/actions/splitLine.json new file mode 100644 index 0000000000..106e397bf0 --- /dev/null +++ b/test/runTest/actions/splitLine.json @@ -0,0 +1 @@ +[{"name":"Action 1","ops":[{"type":"mousedown","time":660,"x":50,"y":175},{"type":"mouseup","time":802,"x":50,"y":175},{"time":803,"delay":400,"type":"screenshot-auto"}],"scrollY":797.2000122070312,"scrollX":0,"timestamp":1648092272395}] \ No newline at end of file diff --git a/test/scatter.html b/test/scatter.html index 19d6eb30dd..c92256d0f8 100644 --- a/test/scatter.html +++ b/test/scatter.html @@ -113,6 +113,7 @@ name: names[1], type: 'scatter', emphasis: { + scale: 3, label: { show: true, position: 'top', diff --git a/test/splitLine.html b/test/splitLine.html index 5a2fe742ae..ea847a07e8 100755 --- a/test/splitLine.html +++ b/test/splitLine.html @@ -41,7 +41,7 @@
- +
@@ -201,9 +201,67 @@ + - \ No newline at end of file + diff --git a/test/toolbox-title.html b/test/toolbox-title.html index 6c5c9dfc2d..81e40a1b83 100644 --- a/test/toolbox-title.html +++ b/test/toolbox-title.html @@ -150,7 +150,7 @@ var chart = testHelper.create(echarts, 'main2', { title: [ - 'orient: horizontal; bottom left side', + 'orient: vertical; top left side', 'Text when hover on toolbox icon should not be outside of the canvas' ], option: option @@ -186,7 +186,7 @@ var chart = testHelper.create(echarts, 'main3', { title: [ - 'orient: horizontal; bottom right side', + 'orient: vertical; top right side', 'Text when hover on toolbox icon should not be outside of the canvas' ], option: option diff --git a/test/visualMap-continuous.html b/test/visualMap-continuous.html index db99d73b1e..848b510e8a 100644 --- a/test/visualMap-continuous.html +++ b/test/visualMap-continuous.html @@ -49,39 +49,30 @@
Stacked Bar (and inversed)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/visualMap-pieces.html b/test/visualMap-pieces.html index 2f6bea5a15..2ae4cdf5d4 100644 --- a/test/visualMap-pieces.html +++ b/test/visualMap-pieces.html @@ -18,7 +18,6 @@ under the License. --> - @@ -46,25 +45,15 @@ } - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file