Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/core/CoordinateSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class CoordinateSystemManager {

create(ecModel: GlobalModel, api: ExtensionAPI): void {
let coordinateSystems: CoordinateSystemMaster[] = [];
zrUtil.each(coordinateSystemCreators, function (creater, type) {
const list = creater.create(ecModel, api);
zrUtil.each(coordinateSystemCreators, function (creator, type) {
const list = creator.create(ecModel, api);
coordinateSystems = coordinateSystems.concat(list || []);
});

Expand Down
12 changes: 6 additions & 6 deletions src/core/Scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,12 @@ class Scheduler {
}
const performArgs: PerformArgs = scheduler.getPerformArgs(task, opt.block);
// FIXME
// if intending to decalare `performRawSeries` in handlers, only
// if intending to declare `performRawSeries` in handlers, only
// stream-independent (specifically, data item independent) operations can be
// performed. Because is a series is filtered, most of the tasks will not
// performed. Because if a series is filtered, most of the tasks will not
// be performed. A stream-dependent operation probably cause wrong biz logic.
// Perhaps we should not provide a separate callback for this case instead
// of providing the config `performRawSeries`. The stream-dependent operaions
// of providing the config `performRawSeries`. The stream-dependent operations
// and stream-independent operations should better not be mixed.
performArgs.skip = !stageHandler.performRawSeries
&& ecModel.isSeriesFiltered(task.context.model);
Expand Down Expand Up @@ -509,10 +509,10 @@ class Scheduler {
else if (getTargetSeries) {
getTargetSeries(ecModel, api).each(createStub);
}
// Otherwise, (usually it is legancy case), the overall task will only be
// executed when upstream dirty. Otherwise the progressive rendering of all
// Otherwise, (usually it is legacy case), the overall task will only be
// executed when upstream is dirty. Otherwise the progressive rendering of all
// pipelines will be disabled unexpectedly. But it still needs stubs to receive
// dirty info from upsteam.
// dirty info from upstream.
else {
overallProgress = false;
each(ecModel.getSeries(), createStub);
Expand Down
34 changes: 17 additions & 17 deletions src/core/echarts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const PRIORITY_PROCESSOR_SERIES_FILTER = 800;
// So data stack stage should be in front of data processing stage.
const PRIORITY_PROCESSOR_DATASTACK = 900;
// "Data filter" will block the stream, so it should be
// put at the begining of data processing.
// put at the beginning of data processing.
const PRIORITY_PROCESSOR_FILTER = 1000;
const PRIORITY_PROCESSOR_DEFAULT = 2000;
const PRIORITY_PROCESSOR_STATISTIC = 5000;
Expand Down Expand Up @@ -541,8 +541,8 @@ class ECharts extends Eventful<ECEventDefinition> {

// Do not update coordinate system here. Because that coord system update in
// each frame is not a good user experience. So we follow the rule that
// the extent of the coordinate system is determin in the first frame (the
// frame is executed immedietely after task reset.
// the extent of the coordinate system is determined in the first frame (the
// frame is executed immediately after task reset.
// this._coordSysMgr.update(ecModel, api);

// console.log('--- ec frame visual ---', remainTime);
Expand Down Expand Up @@ -1382,9 +1382,9 @@ class ECharts extends Eventful<ECEventDefinition> {
this._zr.flush();
}
else if (flush !== false && env.browser.weChat) {
// In WeChat embeded browser, `requestAnimationFrame` and `setInterval`
// In WeChat embedded browser, `requestAnimationFrame` and `setInterval`
// hang when sliding page (on touch event), which cause that zr does not
// refresh util user interaction finished, which is not expected.
// refresh until user interaction finished, which is not expected.
// But `dispatchAction` may be called too frequently when pan on touch
// screen, which impacts performance if do not throttle them.
this._throttledZrFlush();
Expand Down Expand Up @@ -1474,7 +1474,7 @@ class ECharts extends Eventful<ECEventDefinition> {
: ecModel.eachSeries(doPrepare);

function doPrepare(model: ComponentModel): void {
// By defaut view will be reused if possible for the case that `setOption` with "notMerge"
// By default view will be reused if possible for the case that `setOption` with "notMerge"
// mode and need to enable transition animation. (Usually, when they have the same id, or
// especially no id but have the same type & name & index. See the `model.id` generation
// rule in `makeIdAndName` and `viewId` generation rule here).
Expand Down Expand Up @@ -1677,20 +1677,20 @@ class ECharts extends Eventful<ECEventDefinition> {
// Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.

// Create new coordinate system each update
// In LineView may save the old coordinate system and use it to get the orignal point
// In LineView may save the old coordinate system and use it to get the original point.
coordSysMgr.create(ecModel, api);

scheduler.performDataProcessorTasks(ecModel, payload);

// Current stream render is not supported in data process. So we can update
// stream modes after data processing, where the filtered data is used to
// deteming whether use progressive rendering.
// determine whether to use progressive rendering.
updateStreamModes(this, ecModel);

// We update stream modes before coordinate system updated, then the modes info
// can be fetched when coord sys updating (consider the barGrid extent fix). But
// the drawback is the full coord info can not be fetched. Fortunately this full
// coord is not requied in stream mode updater currently.
// coord is not required in stream mode updater currently.
coordSysMgr.update(ecModel, api);

clearColorPalette(ecModel);
Expand Down Expand Up @@ -2019,8 +2019,8 @@ class ECharts extends Eventful<ECEventDefinition> {

ecIns.trigger('rendered', params);

// The `finished` event should not be triggered repeatly,
// so it should only be triggered when rendering indeed happend
// The `finished` event should not be triggered repeatedly,
// so it should only be triggered when rendering indeed happens
// in zrender. (Consider the case that dipatchAction is keep
// triggering when mouse move).
if (
Expand Down Expand Up @@ -2221,7 +2221,7 @@ class ECharts extends Eventful<ECEventDefinition> {

chartView.group.silent = !!seriesModel.get('silent');
// Should not call markRedraw on group, because it will disable zrender
// increamental render (alway render from the __startIndex each frame)
// incremental render (always render from the __startIndex each frame)
// chartView.group.markRedraw();

updateBlend(seriesModel, chartView);
Expand Down Expand Up @@ -2335,7 +2335,7 @@ class ECharts extends Eventful<ECEventDefinition> {
chartView.eachRendered((el: Displayable) => {
// FIXME marker and other components
if (!el.isGroup) {
// DONT mark the element dirty. In case element is incremental and don't wan't to rerender.
// DON'T mark the element dirty. In case element is incremental and don't want to rerender.
el.style.blend = blendMode;
}
});
Expand Down Expand Up @@ -2447,7 +2447,7 @@ class ECharts extends Eventful<ECEventDefinition> {
savePathStates(el);
}

// Only updated on changed element. In case element is incremental and don't wan't to rerender.
// Only updated on changed element. In case element is incremental and don't want to rerender.
// TODO, a more proper way?
if (el.__dirty) {
const prevStates = el.prevStates;
Expand All @@ -2471,7 +2471,7 @@ class ECharts extends Eventful<ECEventDefinition> {
}
}

// The use higlighted and selected flag to toggle states.
// Use highlighted and selected flag to toggle states.
if (el.__dirty) {
applyElementStates(el);
}
Expand Down Expand Up @@ -2734,7 +2734,7 @@ export function disConnect(groupId: string): void {
}

/**
* Alias and backword compat
* Alias and backward compatibility
*/
export const disconnect = disConnect;

Expand Down Expand Up @@ -3016,7 +3016,7 @@ export const registerTransform = registerExternalTransform;



// Buitlin global visual
// Builtin global visual
registerVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);
registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);
registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);
Expand Down
4 changes: 2 additions & 2 deletions src/core/impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { error } from '../util/log';


// Implementation of exported APIs. For example registerMap, getMap.
// The implentations will be registered when installing the component.
// The implementations will be registered when installing the component.
// Avoid these code being bundled to the core module.

const implsStore: Record<string, any> = {};
Expand All @@ -43,4 +43,4 @@ export function getImpl(name: string) {
}
}
return implsStore[name];
}
}
6 changes: 3 additions & 3 deletions src/core/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,11 @@ export class Task<Ctx extends TaskContext> {
}

setOutputEnd(end: number): void {
// This only happend in dataTask, dataZoom, map, currently.
// This only happens in dataTask, dataZoom, map, currently.
// where dataZoom do not set end each time, but only set
// when reset. So we should record the setted end, in case
// when reset. So we should record the set end, in case
// that the stub of dataZoom perform again and earse the
// setted end by upstream.
// set end by upstream.
this._outputDueEnd = this._settedOutputEnd = end;
}

Expand Down
4 changes: 2 additions & 2 deletions src/export/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export * as util from './api/util';

export {default as env} from 'zrender/src/core/env';

// --------------------- Export for Exension Usage ---------------------
// --------------------- Export for Extension Usage ---------------------
// export {SeriesData};
export {SeriesData as List}; // TODO: Compatitable with exists echarts-gl code
export {default as Model} from '../model/Model';
Expand All @@ -77,7 +77,7 @@ export {brushSingle as innerDrawElementOnCanvas} from 'zrender/src/canvas/graphi
// Should use `ComponentModel.extend` or `class XXXX extend ComponentModel` to create class.
// Then use `registerComponentModel` in `install` parameter when `use` this extension. For example:
// class Bar3DModel extends ComponentModel {}
// export function install(registers) { regsiters.registerComponentModel(Bar3DModel); }
// export function install(registers) { registers.registerComponentModel(Bar3DModel); }
// echarts.use(install);
export function extendComponentModel(proto: object): ComponentModel {
const Model = (ComponentModel as ComponentModelConstructor).extend(proto) as any;
Expand Down
12 changes: 6 additions & 6 deletions src/export/api/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { createTextStyle as innerCreateTextStyle } from '../../label/labelStyle'
import { DisplayState, TextCommonOption } from '../../util/types';

/**
* Create a muti dimension List structure from seriesModel.
* Create a multi dimension List structure from seriesModel.
*/
export function createList(seriesModel: SeriesModel) {
return createSeriesData(null, seriesModel);
Expand Down Expand Up @@ -86,9 +86,9 @@ export function createScale(dataExtent: number[], option: object | AxisBaseModel
// FIXME
// Currently AxisModelCommonMixin has nothing to do with the
// the requirements of `axisHelper.createScaleByModel`. For
// example the method `getCategories` and `getOrdinalMeta`
// are required for `'category'` axis, and ecModel are required
// for `'time'` axis. But occationally echarts-gl happened
// example the methods `getCategories` and `getOrdinalMeta`
// are required for `'category'` axis, and ecModel is required
// for `'time'` axis. But occasionally echarts-gl happened
// to only use `'value'` axis.
// zrUtil.mixin(axisModel, AxisModelCommonMixin);
}
Expand All @@ -103,7 +103,7 @@ export function createScale(dataExtent: number[], option: object | AxisBaseModel
/**
* Mixin common methods to axis model,
*
* Inlcude methods
* Include methods
* `getFormattedLabels() => Array.<string>`
* `getCategories() => Array.<string>`
* `getMin(origin: boolean) => number`
Expand All @@ -127,4 +127,4 @@ export function createTextStyle(
) {
opts = opts || {};
return innerCreateTextStyle(textStyleModel, null, null, opts.state !== 'normal');
}
}
6 changes: 3 additions & 3 deletions src/model/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ class ComponentModel<Opt extends ComponentOption = ComponentOption> extends Mode

/**
* Because simplified concept is probably better, series.name (or component.name)
* has been having too many resposibilities:
* has been having too many responsibilities:
* (1) Generating id (which requires name in option should not be modified).
* (2) As an index to mapping series when merging option or calling API (a name
* can refer to more then one components, which is convinient is some case).
* can refer to more than one component, which is convenient is some cases).
* (3) Display.
* @readOnly But injected
*/
Expand Down Expand Up @@ -281,7 +281,7 @@ class ComponentModel<Opt extends ComponentOption = ComponentOption> extends Mode
getReferringComponents(mainType: ComponentMainType, opt: QueryReferringOpt): {
// Always be array rather than null/undefined, which is convenient to use.
models: ComponentModel[];
// Whether target compoent specified
// Whether target component is specified
specified: boolean;
} {
const indexKey = (mainType + 'Index') as keyof Opt;
Expand Down
4 changes: 2 additions & 2 deletions src/model/Global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,8 @@ echarts.use([${seriesImportName}]);`);
};

initBase = function (ecModel: GlobalModel, baseOption: ECUnitOption & AriaOptionMixin): void {
// Using OPTION_INNER_KEY to mark that this option can not be used outside,
// i.e. `chart.setOption(chart.getModel().option);` is forbiden.
// Using OPTION_INNER_KEY to mark that this option cannot be used outside,
// i.e. `chart.setOption(chart.getModel().option);` is forbidden.
ecModel.option = {} as ECUnitOption;
ecModel.option[OPTION_INNER_KEY] = OPTION_INNER_VALUE;

Expand Down
14 changes: 7 additions & 7 deletions src/model/OptionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class OptionManager {

// For simplicity, timeline options and media options do not support merge,
// that is, if you `setOption` twice and both has timeline options, the latter
// timeline opitons will not be merged to the formers, but just substitude them.
// timeline options will not be merged to the former, but just substitute them.
if (newParsedOption.timelineOptions.length) {
optionBackup.timelineOptions = newParsedOption.timelineOptions;
}
Expand Down Expand Up @@ -392,10 +392,10 @@ function applyMediaQuery(query: MediaQuery, ecWidth: number, ecHeight: number):
const realMap = {
width: ecWidth,
height: ecHeight,
aspectratio: ecWidth / ecHeight // lowser case for convenientce.
aspectratio: ecWidth / ecHeight // lower case for convenience.
};

let applicatable = true;
let applicable = true;

each(query, function (value: number, attr) {
const matched = attr.match(QUERY_REG);
Expand All @@ -408,11 +408,11 @@ function applyMediaQuery(query: MediaQuery, ecWidth: number, ecHeight: number):
const realAttr = matched[2].toLowerCase();

if (!compare(realMap[realAttr as keyof typeof realMap], value, operator)) {
applicatable = false;
applicable = false;
}
});

return applicatable;
return applicable;
}

function compare(real: number, expect: number, operator: string): boolean {
Expand Down Expand Up @@ -449,9 +449,9 @@ function indicesEquals(indices1: number[], indices2: number[]): boolean {
* this might be the only simple way to implement that feature.
*
* MEMO: We've considered some other approaches:
* 1. Each model handle its self restoration but not uniform treatment.
* 1. Each model handles its self restoration but not uniform treatment.
* (Too complex in logic and error-prone)
* 2. Use a shadow ecModel. (Performace expensive)
* 2. Use a shadow ecModel. (Performance expensive)
*
* FIXME: A possible solution:
* Add a extra level of model for each component model. The inheritance chain would be:
Expand Down
8 changes: 4 additions & 4 deletions src/model/Series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const SERIES_UNIVERSAL_TRANSITION_PROP = '__universalTransitionEnabled';

interface SeriesModel {
/**
* Convinient for override in extended class.
* Convenient for override in extended class.
* Implement it if needed.
*/
preventIncremental(): boolean;
Expand Down Expand Up @@ -319,7 +319,7 @@ class SeriesModel<Opt extends SeriesOption = SeriesOption> extends ComponentMode

/**
* Init a data structure from data related option in series
* Must be overriden.
* Must be overridden.
*/
getInitialData(option: Opt, ecModel: GlobalModel): SeriesData {
return;
Expand Down Expand Up @@ -426,7 +426,7 @@ class SeriesModel<Opt extends SeriesOption = SeriesOption> extends ComponentMode
/**
* Get base axis if has coordinate system and has axis.
* By default use coordSys.getBaseAxis();
* Can be overrided for some chart.
* Can be overridden for some chart.
* @return {type} description
*/
getBaseAxis(): Axis {
Expand Down Expand Up @@ -615,7 +615,7 @@ class SeriesModel<Opt extends SeriesOption = SeriesOption> extends ComponentMode
const selectedMap = option.selectedMap;
for (let i = 0; i < len; i++) {
const dataIndex = innerDataIndices[i];
// TODO diffrent types of data share same object.
// TODO different types of data share same object.
const nameOrId = getSelectionKey(data, dataIndex);
selectedMap[nameOrId] = true;
this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);
Expand Down
6 changes: 3 additions & 3 deletions src/model/internalComponentCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import { isComponentIdInternal } from '../util/model';
// It is added since echarts 3.
// (3) Why keep supporting "internal component" in global model rather than
// make each type components manage their models themselves?
// Because a protential feature that reproduce a chart from a diffferent chart instance
// might be useful in some BI analysis scenario, where the entire state need to be
// retrieved from the current chart instance. So we'd bettern manage the all of the
// Because a potential feature that reproduces a chart from a different chart instance
// might be useful in some BI analysis scenario, where the entire state needs to be
// retrieved from the current chart instance. So we'd better manage all of the
// state universally.
// (4) Internal component always merged in "replaceMerge" approach, that is, if the existing
// internal components does not matched by a new option with the same id, it will be
Expand Down
Loading