diff --git a/src/coord/Axis.ts b/src/coord/Axis.ts index 7a334a0a4b..a71051507c 100644 --- a/src/coord/Axis.ts +++ b/src/coord/Axis.ts @@ -232,7 +232,7 @@ class Axis { * Notice here we only get the default tick model. For splitLine * or splitArea, we should pass the splitLineModel or splitAreaModel * manually when calling `getTicksCoords`. - * In GL, this method may be overrided to: + * In GL, this method may be overridden to: * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));` */ getTickModel(): Model { @@ -262,7 +262,7 @@ class Axis { /** * Only be called in category axis. - * Can be overrided, consider other axes like in 3D. + * Can be overridden, consider other axes like in 3D. * @return Auto interval for cateogry axis tick and label */ calculateCategoryInterval(): ReturnType { @@ -338,7 +338,7 @@ function fixOnBandTicksCoords( function littleThan(a: number, b: number): boolean { // Avoid rounding error cause calculated tick coord different with extent. - // It may cause an extra unecessary tick added. + // It may cause an extra unnecessary tick added. a = round(a); b = round(b); return inverse ? a > b : a < b; diff --git a/src/coord/CoordinateSystem.ts b/src/coord/CoordinateSystem.ts index b27f66acfa..f89235b77b 100644 --- a/src/coord/CoordinateSystem.ts +++ b/src/coord/CoordinateSystem.ts @@ -57,17 +57,17 @@ export interface CoordinateSystemMaster { update?: (ecModel: GlobalModel, api: ExtensionAPI) => void; - // This methods is also responsible for determine whether this - // coodinate system is applicable to the given `finder`. - // Each coordinate system will be tried, util one returns none + // This methods is also responsible for determining whether this + // coordinate system is applicable to the given `finder`. + // Each coordinate system will be tried, until one returns non- // null/undefined value. convertToPixel?( ecModel: GlobalModel, finder: ParsedModelFinder, value: ScaleDataValue | ScaleDataValue[] ): number | number[]; - // This methods is also responsible for determine whether this - // coodinate system is applicable to the given `finder`. - // Each coordinate system will be tried, util one returns none + // This methods is also responsible for determining whether this + // coordinate system is applicable to the given `finder`. + // Each coordinate system will be tried, until one returns non- // null/undefined value. convertFromPixel?( ecModel: GlobalModel, finder: ParsedModelFinder, pixelValue: number | number[] diff --git a/src/coord/View.ts b/src/coord/View.ts index 23e6a8ad75..60fbb0318f 100644 --- a/src/coord/View.ts +++ b/src/coord/View.ts @@ -310,7 +310,7 @@ class View extends Transformable implements CoordinateSystemMaster, CoordinateSy * @return {number} */ // getScalarScale() { - // // Use determinant square root of transform to mutiply scalar + // // Use determinant square root of transform to multiply scalar // let m = this.transform; // let det = Math.sqrt(Math.abs(m[0] * m[3] - m[2] * m[1])); // return det; diff --git a/src/coord/axisCommonTypes.ts b/src/coord/axisCommonTypes.ts index 5cf6a8a916..bb4d1b7bf1 100644 --- a/src/coord/axisCommonTypes.ts +++ b/src/coord/axisCommonTypes.ts @@ -91,7 +91,7 @@ export interface NumericAxisBaseOptionCommon extends AxisBaseOptionCommon { boundaryGap?: [number | string, number | string] /** - * AxisTick and axisLabel and splitLine are caculated based on splitNumber. + * AxisTick and axisLabel and splitLine are calculated based on splitNumber. */ splitNumber?: number; /** @@ -128,7 +128,7 @@ export interface CategoryAxisBaseOption extends AxisBaseOptionCommon { })[]; /* * Set false to faster category collection. - * Only usefull in the case like: category is + * Only useful in the case like: category is * ['2012-01-01', '2012-01-02', ...], where the input * data has been ensured not duplicate and is large data. * null means "auto": diff --git a/src/coord/axisDefault.ts b/src/coord/axisDefault.ts index 05bc4083ee..4d2c6674b3 100644 --- a/src/coord/axisDefault.ts +++ b/src/coord/axisDefault.ts @@ -151,7 +151,7 @@ const valueAxis: AxisBaseOption = zrUtil.merge({ show: false, // Split number of minor ticks. The value should be in range of (0, 100) splitNumber: 5, - // Lenght of minor tick + // Length of minor tick length: 3, // Line style diff --git a/src/coord/axisHelper.ts b/src/coord/axisHelper.ts index 770caeb2af..53485fb31e 100644 --- a/src/coord/axisHelper.ts +++ b/src/coord/axisHelper.ts @@ -147,7 +147,7 @@ function adjustScaleForOverflow( } // Precondition of calling this method: -// The scale extent has been initailized using series data extent via +// The scale extent has been initialized using series data extent via // `scale.setExtent` or `scale.unionExtentFromData`; export function niceScaleExtent( scale: Scale, diff --git a/src/coord/axisTickLabelBuilder.ts b/src/coord/axisTickLabelBuilder.ts index fbc2e5c975..6ac305f9bd 100644 --- a/src/coord/axisTickLabelBuilder.ts +++ b/src/coord/axisTickLabelBuilder.ts @@ -123,7 +123,7 @@ function makeCategoryLabelsActually(axis: Axis, labelModel: Model interval // If the axis change is caused by chart resize, the cache should not - // be used. Otherwise some hiden labels might not be shown again. + // be used. Otherwise some hidden labels might not be shown again. && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1] ) { diff --git a/src/coord/cartesian/defaultAxisExtentFromData.ts b/src/coord/cartesian/defaultAxisExtentFromData.ts index 1ca8442446..736eafee91 100644 --- a/src/coord/cartesian/defaultAxisExtentFromData.ts +++ b/src/coord/cartesian/defaultAxisExtentFromData.ts @@ -141,7 +141,7 @@ function calculateFilteredExtent( let tarAxisRecord: AxisRecord; function addCondition(axis: Axis, axisRecord: AxisRecord) { - // But for simplicity and safty and performance, we only adopt this + // But for simplicity and safety and performance, we only adopt this // feature on category axis at present. const condExtent = axisRecord.condExtent; const rawExtentResult = axisRecord.rawExtentResult; diff --git a/src/coord/geo/Geo.ts b/src/coord/geo/Geo.ts index e0b44025f7..130d959163 100644 --- a/src/coord/geo/Geo.ts +++ b/src/coord/geo/Geo.ts @@ -137,7 +137,7 @@ class Geo extends View { // Ignore default aspect scale if projection exits. this.aspectScale = projection ? 1 : zrUtil.retrieve2(opt.aspectScale, defaultParams.aspectScale); - // Not invert longitute if projection exits. + // Not invert longitude if projection exits. this._invertLongitute = projection ? false : defaultParams.invertLongitute; } @@ -148,7 +148,7 @@ class Geo extends View { rect = rect.clone(); if (invertLongitute) { - // Longitute is inverted + // Longitude is inverted. rect.y = -rect.y - rect.height; } @@ -196,7 +196,7 @@ class Geo extends View { */ getGeoCoord(name: string): number[] { const region = this._regionsMap.get(name); - // calcualte center only on demand. + // Calculate center only on demand. return this._nameCoordMap.get(name) || (region && region.getCenter()); } diff --git a/src/coord/geo/GeoModel.ts b/src/coord/geo/GeoModel.ts index e22d294542..c3dde67848 100644 --- a/src/coord/geo/GeoModel.ts +++ b/src/coord/geo/GeoModel.ts @@ -82,8 +82,8 @@ export interface GeoCommonOptionMixin extends RoamOptionMixin { aspectScale?: number; // Layout with center and size - // If you wan't to put map in a fixed size box with right aspect ratio - // This two properties may more conveninet + // If you want to put map in a fixed size box with right aspect ratio + // This two properties may be more convenient // Like: `40` or `'50%'`. layoutCenter?: (number | string)[]; // Like: `40` or `'50%'`. @@ -157,8 +157,8 @@ class GeoModel extends ComponentModel { aspectScale: null, // /// Layout with center and size - // If you wan't to put map in a fixed size box with right aspect ratio - // This two properties may more conveninet + // If you want to put map in a fixed size box with right aspect ratio + // This two properties may be more convenient // layoutCenter: [50%, 50%] // layoutSize: 100 diff --git a/src/coord/geo/GeoSVGResource.ts b/src/coord/geo/GeoSVGResource.ts index 02590684e3..b423f85839 100644 --- a/src/coord/geo/GeoSVGResource.ts +++ b/src/coord/geo/GeoSVGResource.ts @@ -168,7 +168,7 @@ export class GeoSVGResource implements GeoResource { // If both `svgWidth/svgHeight/viewBox` are specified in a SVG file, the transform rule will be: // 0. `boundingRect` is `(0, 0, svgWidth, svgHeight)`. Set it to Geo['_rect'] (View['_rect']). // 1. Make a transform from `viewBox` to `boundingRect`. - // Note: only suport `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve + // Note: only support `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve // the aspect ratio. // 2. Make a transform from boundingRect to Geo['_viewRect'] (View['_viewRect']) // (`Geo`/`View` will do this job). diff --git a/src/coord/geo/geoTypes.ts b/src/coord/geo/geoTypes.ts index db4477d9a7..b66cf6e182 100644 --- a/src/coord/geo/geoTypes.ts +++ b/src/coord/geo/geoTypes.ts @@ -76,7 +76,7 @@ type GeoJSONGeometry = type GeoJSONGeometryCompressed = // GeoJSONGeometryPoint // | GeoJSONGeometryMultiPoint - // Currenly only Polygon and MultiPolygon can be parsed from compression. + // Currently only Polygon and MultiPolygon can be parsed from compression. | GeoJSONGeometryPolygonCompressed | GeoJSONGeometryMultiPolygonCompressed | GeoJSONGeometryLineStringCompressed @@ -178,4 +178,4 @@ export interface GeoProjection { * project will be ignored if projectStream is given. */ stream?(outStream: ProjectionStream): ProjectionStream -} \ No newline at end of file +} diff --git a/src/coord/parallel/Parallel.ts b/src/coord/parallel/Parallel.ts index f8c472dad1..c694f55ff1 100644 --- a/src/coord/parallel/Parallel.ts +++ b/src/coord/parallel/Parallel.ts @@ -454,7 +454,7 @@ class Parallel implements CoordinateSystemMaster, CoordinateSystem { return {behavior: 'none', axisExpandWindow: axisExpandWindow}; } - // Conver the point from global to expand coordinates. + // Convert the point from global to expand coordinates. const pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos; // For dragging operation convenience, the window should not be diff --git a/src/coord/parallel/ParallelModel.ts b/src/coord/parallel/ParallelModel.ts index 9044d313dd..edbe7c4846 100644 --- a/src/coord/parallel/ParallelModel.ts +++ b/src/coord/parallel/ParallelModel.ts @@ -70,7 +70,7 @@ class ParallelModel extends ComponentModel { dimensions: DimensionName[]; /** - * Coresponding to dimensions. + * Corresponding to dimensions. */ parallelAxisIndex: number[]; diff --git a/src/coord/scaleRawExtentInfo.ts b/src/coord/scaleRawExtentInfo.ts index d0753cc985..52f6b8d062 100644 --- a/src/coord/scaleRawExtentInfo.ts +++ b/src/coord/scaleRawExtentInfo.ts @@ -80,7 +80,7 @@ export class ScaleRawExtentInfo { } /** - * Parameters depending on ouside (like model, user callback) + * Parameters depending on outside (like model, user callback) * are prepared and fixed here. */ private _prepareParams( @@ -100,7 +100,7 @@ export class ScaleRawExtentInfo { const modelMinRaw = this._modelMinRaw = model.get('min', true); if (isFunction(modelMinRaw)) { - // This callback alway provide users the full data extent (before data filtered). + // This callback always provides users the full data extent (before data is filtered). this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({ min: dataExtent[0], max: dataExtent[1] @@ -112,7 +112,7 @@ export class ScaleRawExtentInfo { const modelMaxRaw = this._modelMaxRaw = model.get('max', true); if (isFunction(modelMaxRaw)) { - // This callback alway provide users the full data extent (before data filtered). + // This callback always provides users the full data extent (before data is filtered). this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({ min: dataExtent[0], max: dataExtent[1] @@ -285,7 +285,7 @@ const DATA_MIN_MAX_ATTR = { min: '_dataMin', max: '_dataMax' } as const; * (3) `coordSys.update` use it to finally decide the scale extent. * But the callback of `min`/`max` should not be called multiple times. * The code below should not be implemented repeatedly either. - * So we cache the result in the scale instance, which will be recreated at the begining + * So we cache the result in the scale instance, which will be recreated at the beginning * of the workflow (because `scale` instance will be recreated each round of the workflow). */ export function ensureScaleRawExtentInfo( diff --git a/src/layout/barGrid.ts b/src/layout/barGrid.ts index 519f3eee5a..726c084f82 100644 --- a/src/layout/barGrid.ts +++ b/src/layout/barGrid.ts @@ -347,7 +347,7 @@ function doCalBarWidthAndOffset(seriesInfoList: LayoutSeriesInfo[]) { if (maxWidth && maxWidth < finalWidth) { finalWidth = Math.min(maxWidth, remainedWidth); } - // `minWidth` has higher priority. `minWidth` decide that wheter the + // `minWidth` has higher priority. `minWidth` decide that whether the // bar is able to be visible. So `minWidth` should not be restricted // by `maxWidth` or `remainedWidth` (which is from `bandWidth`). In // the extreme cases for `value` axis, bars are allowed to overlap diff --git a/src/util/graphic.ts b/src/util/graphic.ts index 0c09c04fae..af8f469db5 100644 --- a/src/util/graphic.ts +++ b/src/util/graphic.ts @@ -527,7 +527,7 @@ export function lineLineIntersect( const ny = b2y - b1y; // `vec_m` and `vec_n` are parallel iff - // exising `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`. + // existing `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`. const nmCrossProduct = crossProduct2d(nx, ny, mx, my); if (nearZero(nmCrossProduct)) { return false; @@ -669,4 +669,4 @@ export { OrientedBoundingRect, Point, Path -}; \ No newline at end of file +}; diff --git a/src/util/symbol.ts b/src/util/symbol.ts index 602ea48e5c..fed92641e5 100644 --- a/src/util/symbol.ts +++ b/src/util/symbol.ts @@ -171,7 +171,7 @@ const Arrow = graphic.Path.extend({ }); /** - * Map of path contructors + * Map of path constructors */ // TODO Use function to build symbol path. const symbolCtors: Dictionary = { diff --git a/src/util/types.ts b/src/util/types.ts index 4dedd94285..34b99d0a8a 100644 --- a/src/util/types.ts +++ b/src/util/types.ts @@ -357,7 +357,7 @@ export type OrdinalNumber = number; // The number mapped from each OrdinalRawVal * ```js * { ordinalNumbers: [2, 5, 3, 4] } * ``` - * means that ordinal 2 should be diplayed on tick 0, + * means that ordinal 2 should be displayed on tick 0, * ordinal 5 should be displayed on tick 1, ... */ export type OrdinalSortInfo = { @@ -1114,12 +1114,12 @@ export interface SeriesLineLabelOption extends LineLabelOption { export interface LabelLayoutOptionCallbackParams { /** * Index of data which the label represents. - * It can be null if label does't represent any data. + * It can be null if label doesn't represent any data. */ dataIndex?: number, /** * Type of data which the label represents. - * It can be null if label does't represent any data. + * It can be null if label doesn't represent any data. */ dataType?: SeriesDataType, seriesIndex: number, @@ -1375,7 +1375,7 @@ export interface CommonAxisPointerOption { triggerTooltip?: boolean /** - * current value. When using axisPointer.handle, value can be set to define the initail position of axisPointer. + * current value. When using axisPointer.handle, value can be set to define the initial position of axisPointer. */ value?: ScaleDataValue diff --git a/src/visual/style.ts b/src/visual/style.ts index b0937229bc..19ab5c6892 100644 --- a/src/visual/style.ts +++ b/src/visual/style.ts @@ -92,8 +92,8 @@ const seriesStyleTask: StageHandler = { const hasAutoColor = globalStyle.fill === 'auto' || globalStyle.stroke === 'auto'; // Get from color palette by default. if (!globalStyle[colorKey] || colorCallback || hasAutoColor) { - // Note: if some series has color specified (e.g., by itemStyle.color), we DO NOT - // make it effect palette. Bacause some scenarios users need to make some series + // Note: If some series has color specified (e.g., by itemStyle.color), we DO NOT + // make it effect palette. Because some scenarios users need to make some series // transparent or as background, which should better not effect the palette. const colorPalette = seriesModel.getColorFromPalette( // TODO series count changed. @@ -177,8 +177,8 @@ const dataStyleTask: StageHandler = { const dataColorPaletteTask: StageHandler = { performRawSeries: true, overallReset(ecModel) { - // Each type of series use one scope. - // Pie and funnel are using diferrent scopes + // Each type of series uses one scope. + // Pie and funnel are using different scopes. const paletteScopeGroupByType = createHashMap(); ecModel.eachSeries((seriesModel: SeriesModel) => { const colorBy = seriesModel.getColorBy();