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
6 changes: 3 additions & 3 deletions src/coord/Axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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<typeof calculateCategoryInterval> {
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions src/coord/CoordinateSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
2 changes: 1 addition & 1 deletion src/coord/View.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/coord/axisCommonTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down Expand Up @@ -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":
Expand Down
2 changes: 1 addition & 1 deletion src/coord/axisDefault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/coord/axisHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions src/coord/axisTickLabelBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function makeCategoryLabelsActually(axis: Axis, labelModel: Model<AxisBaseOption
labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);
}

// Cache to avoid calling interval function repeatly.
// Cache to avoid calling interval function repeatedly.
return listCacheSet(labelsCache, optionLabelInterval as CacheKey, {
labels: labels, labelCategoryInterval: numericLabelInterval
});
Expand Down Expand Up @@ -165,7 +165,7 @@ function makeCategoryTicks(axis: Axis, tickModel: AxisBaseModel) {
ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);
}

// Cache to avoid calling interval function repeatly.
// Cache to avoid calling interval function repeatedly.
return listCacheSet(ticksCache, optionTickInterval as CacheKey, {
ticks: ticks, tickCategoryInterval: tickCategoryInterval
});
Expand All @@ -186,13 +186,13 @@ function makeRealNumberLabels(axis: Axis) {
};
}

// Large category data calculation is performence sensitive, and ticks and label
// probably be fetched by multiple times. So we cache the result.
// Large category data calculation is performance sensitive, and ticks and label
// probably will be fetched multiple times. So we cache the result.
// axis is created each time during a ec process, so we do not need to clear cache.
function getListCache(axis: Axis, prop: 'ticks'): InnerStore['ticks'];
function getListCache(axis: Axis, prop: 'labels'): InnerStore['labels'];
function getListCache(axis: Axis, prop: 'ticks' | 'labels') {
// Because key can be funciton, and cache size always be small, we use array cache.
// Because key can be a function, and cache size always is small, we use array cache.
return inner(axis)[prop] || (inner(axis)[prop] = []);
}

Expand Down Expand Up @@ -296,7 +296,7 @@ export function calculateCategoryInterval(axis: Axis) {
// point is not the same when zooming in or zooming out.
&& lastAutoInterval > 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]
) {
Expand Down
2 changes: 1 addition & 1 deletion src/coord/cartesian/defaultAxisExtentFromData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/coord/geo/Geo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down Expand Up @@ -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());
}

Expand Down
8 changes: 4 additions & 4 deletions src/coord/geo/GeoModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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%'`.
Expand Down Expand Up @@ -157,8 +157,8 @@ class GeoModel extends ComponentModel<GeoOption> {
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

Expand Down
2 changes: 1 addition & 1 deletion src/coord/geo/GeoSVGResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 2 additions & 2 deletions src/coord/geo/geoTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -178,4 +178,4 @@ export interface GeoProjection {
* project will be ignored if projectStream is given.
*/
stream?(outStream: ProjectionStream): ProjectionStream
}
}
2 changes: 1 addition & 1 deletion src/coord/parallel/Parallel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/coord/parallel/ParallelModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ParallelModel extends ComponentModel<ParallelCoordinateSystemOption> {
dimensions: DimensionName[];

/**
* Coresponding to dimensions.
* Corresponding to dimensions.
*/
parallelAxisIndex: number[];

Expand Down
8 changes: 4 additions & 4 deletions src/coord/scaleRawExtentInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/layout/barGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/util/graphic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -669,4 +669,4 @@ export {
OrientedBoundingRect,
Point,
Path
};
};
2 changes: 1 addition & 1 deletion src/util/symbol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<SymbolCtor> = {
Expand Down
8 changes: 4 additions & 4 deletions src/util/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/visual/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<object>();
ecModel.eachSeries((seriesModel: SeriesModel) => {
const colorBy = seriesModel.getColorBy();
Expand Down