提交 5162c4f2 编写于 作者: P plainheart

chore: enhance the script compatibility in Windows and fix some lint errors.

上级 5826ca55
......@@ -57,10 +57,10 @@
"test:dts": "node build/testDts.js",
"mktest": "node test/build/mktest.js",
"mktest:help": "node test/build/mktest.js -h",
"checktype": "./node_modules/.bin/tsc --noEmit",
"lint": "./node_modules/.bin/eslint src/**/*.ts extension-src/**/*.ts",
"lint:fix": "./node_modules/.bin/eslint --fix src/**/*.ts extension-src/**/*.ts",
"lint:dist": "echo 'It might take a while. Please wait ...' && ./node_modules/.bin/jshint --config .jshintrc-dist dist/echarts.js"
"checktype": "tsc --noEmit",
"lint": "eslint src/**/*.ts extension-src/**/*.ts",
"lint:fix": "eslint --fix src/**/*.ts extension-src/**/*.ts",
"lint:dist": "echo 'It might take a while. Please wait ...' && jshint --config .jshintrc-dist dist/echarts.js"
},
"dependencies": {
"tslib": "2.0.3",
......
......@@ -40,8 +40,6 @@ import {
} from '../../util/types';
import GlobalModel from '../../model/Global';
import List from '../../data/List';
import ComponentModel from '../../model/Component';
type FunnelLabelOption = Omit<SeriesLabelOption, 'position'> & {
position?: LabelOption['position']
......
......@@ -27,7 +27,6 @@ import List from '../../data/List';
import { ColorString } from '../../util/types';
import { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper';
import { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';
import { retrieveVisualColorForTooltipMarker } from '../../component/tooltip/tooltipMarkup';
const opacityAccessPath = ['itemStyle', 'opacity'] as const;
......@@ -210,4 +209,4 @@ class FunnelView extends ChartView {
}
export default FunnelView;
\ No newline at end of file
export default FunnelView;
......@@ -81,7 +81,7 @@ function createSymbol(name: 'fromSymbol' | 'toSymbol', lineData: LineList, idx:
? symbolOffset : [symbolOffset, symbolOffset];
symbolOffsetArr[0] = parsePercent(symbolOffsetArr[0], symbolSizeArr[0]);
symbolOffsetArr[1] = parsePercent(retrieve2(symbolOffsetArr[1], symbolOffsetArr[0]),symbolSizeArr[1]);
symbolOffsetArr[1] = parsePercent(retrieve2(symbolOffsetArr[1], symbolOffsetArr[0]), symbolSizeArr[1]);
const symbolPath = symbolUtil.createSymbol(
symbolType,
......
......@@ -19,7 +19,6 @@
import LineSeries from './LineSeries';
import LineView from './LineView';
import LineSeriesModel from './LineSeries';
// In case developer forget to include grid component
......@@ -37,7 +36,7 @@ export function install(registers: EChartsExtensionInstallRegisters) {
registers.registerVisual({
seriesType: 'line',
reset: function (seriesModel: LineSeriesModel) {
reset: function (seriesModel: LineSeries) {
const data = seriesModel.getData();
// Visual coding for legend
const lineStyle = seriesModel.getModel('lineStyle').getLineStyle();
......@@ -56,4 +55,4 @@ export function install(registers: EChartsExtensionInstallRegisters) {
dataSample('line')
);
}
\ No newline at end of file
}
......@@ -260,9 +260,7 @@ class SankeySeriesModel extends SeriesModel<SankeySeriesOption> {
}
}
optionUpdated() {
const option = this.option;
}
optionUpdated() {}
// Override Series.getDataParams()
getDataParams(dataIndex: number, dataType: 'node' | 'edge') {
......@@ -332,4 +330,4 @@ class SankeySeriesModel extends SeriesModel<SankeySeriesOption> {
};
}
export default SankeySeriesModel;
\ No newline at end of file
export default SankeySeriesModel;
......@@ -20,7 +20,6 @@
import BaseAxisPointer, {AxisPointerElementOptions} from './BaseAxisPointer';
import * as viewHelper from './viewHelper';
import * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper';
import AxisView from '../axis/AxisView';
import CartesianAxisModel from '../../coord/cartesian/AxisModel';
import ExtensionAPI from '../../core/ExtensionAPI';
import { ScaleDataValue, VerticalAlign, HorizontalAlign, CommonAxisPointerOption } from '../../util/types';
......@@ -176,4 +175,4 @@ function getAxisDimIndex(axis: Axis2D) {
return axis.dim === 'x' ? 0 : 1;
}
export default CartesianAxisPointer;
\ No newline at end of file
export default CartesianAxisPointer;
......@@ -22,8 +22,8 @@ import * as graphic from '../../util/graphic';
import * as viewHelper from './viewHelper';
import * as matrix from 'zrender/src/core/matrix';
import AxisBuilder from '../axis/AxisBuilder';
import AxisView from '../axis/AxisView';
import {OptionDataValue,
import {
OptionDataValue,
ScaleDataValue,
CommonAxisPointerOption,
ZRTextAlign,
......@@ -191,4 +191,4 @@ const pointerShapeBuilder = {
}
};
export default PolarAxisPointer;
\ No newline at end of file
export default PolarAxisPointer;
......@@ -31,7 +31,6 @@ import {
LayoutOrient, Payload, ZRTextVerticalAlign, ZRTextAlign, ZRElementEvent, ParsedValue
} from '../../util/types';
import SliderZoomModel from './SliderZoomModel';
import ComponentView from '../../view/Component';
import { RectLike } from 'zrender/src/core/BoundingRect';
import Axis from '../../coord/Axis';
import SeriesModel from '../../model/Series';
......@@ -42,7 +41,7 @@ import { createSymbol, symbolBuildProxies } from '../../util/symbol';
import { deprecateLog } from '../../util/log';
import { PointLike } from 'zrender/src/core/Point';
import Displayable from 'zrender/src/graphic/Displayable';
import {createTextStyle} from "../../label/labelStyle";
import {createTextStyle} from '../../label/labelStyle';
const Rect = graphic.Rect;
......
......@@ -401,10 +401,22 @@ class MarkLineView extends MarkerView {
data.setItemVisual(idx, {
symbolKeepAspect: itemModel.get('symbolKeepAspect'),
// `0` should be considered as a valid value, so use `retrieve2` instead of `||`
symbolOffset: retrieve2(itemModel.get('symbolOffset'), (symbolOffset as (string | number)[])[isFrom ? 0 : 1]),
symbolRotate: retrieve2(itemModel.get('symbolRotate', true), (symbolRotate as number[])[isFrom ? 0 : 1]),
symbolSize: retrieve2(itemModel.get('symbolSize'), (symbolSize as number[])[isFrom ? 0 : 1]),
symbol: retrieve2(itemModel.get('symbol', true), (symbolType as string[])[isFrom ? 0 : 1]),
symbolOffset: retrieve2(
itemModel.get('symbolOffset'),
(symbolOffset as (string | number)[])[isFrom ? 0 : 1]
),
symbolRotate: retrieve2(
itemModel.get('symbolRotate', true),
(symbolRotate as number[])[isFrom ? 0 : 1]
),
symbolSize: retrieve2(
itemModel.get('symbolSize'),
(symbolSize as number[])[isFrom ? 0 : 1]
),
symbol: retrieve2(
itemModel.get('symbol', true),
(symbolType as string[])[isFrom ? 0 : 1]
),
style
});
}
......
......@@ -73,7 +73,10 @@ abstract class MarkerView extends ComponentView {
blurSeries(seriesModelList: SeriesModel[]) {
each(seriesModelList, seriesModel => {
const markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, this.type as 'markPoint' | 'markLine' | 'markArea');
const markerModel = MarkerModel.getMarkerModelFromSeries(
seriesModel,
this.type as 'markPoint' | 'markLine' | 'markArea'
);
if (markerModel) {
const data = markerModel.getData();
data.eachItemGraphicEl(function (el) {
......@@ -93,4 +96,4 @@ abstract class MarkerView extends ComponentView {
): void;
}
export default MarkerView;
\ No newline at end of file
export default MarkerView;
......@@ -39,5 +39,5 @@ export function install(registers: EChartsExtensionInstallRegisters) {
// visual is for unselected data
data.setVisual('legendSymbol', 'roundRect');
}
})
}
\ No newline at end of file
});
}
......@@ -101,7 +101,9 @@ class SliderTimelineModel extends TimelineModel {
playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z', // jshint ignore:line
stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z', // jshint ignore:line
// eslint-disable-next-line max-len
nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z', // jshint ignore:line
// eslint-disable-next-line max-len
prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z', // jshint ignore:line
prevBtnSize: 18,
......@@ -152,4 +154,4 @@ interface SliderTimelineModel extends DataFormatMixin {
mixin(SliderTimelineModel, DataFormatMixin.prototype);
export default SliderTimelineModel;
\ No newline at end of file
export default SliderTimelineModel;
......@@ -28,6 +28,8 @@ import { addEventListener } from 'zrender/src/core/event';
import Axis from '../../../coord/Axis';
import Cartesian2D from '../../../coord/cartesian/Cartesian2D';
/* global document */
const BLOCK_SPLITER = new Array(60).join('-');
const ITEM_SPLITER = '\t';
......
......@@ -41,6 +41,8 @@ export interface ToolboxSaveAsImageFeatureOption extends ToolboxFeatureOption {
lang?: string[]
}
/* global window, document */
class SaveAsImage extends ToolboxFeature<ToolboxSaveAsImageFeatureOption> {
onclick(ecModel: GlobalModel, api: ExtensionAPI) {
......@@ -84,7 +86,7 @@ class SaveAsImage extends ToolboxFeature<ToolboxSaveAsImageFeatureOption> {
// otherwise, like `svg` data uri exported by zrender,
// there will be an error, for it's not encoded with base64.
// (just a url-encoded string through `encodeURIComponent`)
base64Encoded && (bstr = atob(bstr));
base64Encoded && (bstr = window.atob(bstr));
const filename = title + '.' + type;
if (window.navigator.msSaveOrOpenBlob) {
let n = bstr.length;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册