From 8a8e5cfa3219a16b596faf30397b87fa2fd963ad Mon Sep 17 00:00:00 2001 From: liihuu Date: Sun, 20 Aug 2023 04:51:19 +0800 Subject: [PATCH] chore: correct some spelling errors in words --- src/Chart.ts | 16 +++++++-------- src/extension/indicator/averagePrice.ts | 2 +- src/pane/IndicatorPane.ts | 2 +- src/pane/Pane.ts | 26 ++++++++++++------------- src/store/TimeScaleStore.ts | 8 ++++---- src/view/YAxisView.ts | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Chart.ts b/src/Chart.ts index cf5735ecc..f9757b6cc 100644 --- a/src/Chart.ts +++ b/src/Chart.ts @@ -196,7 +196,7 @@ export default class ChartImp implements Chart { const yAxisStyles = styles.yAxis const isYAxisLeft = yAxisStyles.position === YAxisPosition.Left const isOutside = !yAxisStyles.inside - const totolWidth = this._container.offsetWidth + const totalWidth = this._container.offsetWidth let mainWidth = 0 let yAxisWidth = Number.MIN_SAFE_INTEGER let yAxisLeft = 0 @@ -204,31 +204,31 @@ export default class ChartImp implements Chart { this._panes.forEach(pane => { yAxisWidth = Math.max(yAxisWidth, pane.getAxisComponent().getAutoSize()) }) - if (yAxisWidth > totolWidth) { - yAxisWidth = totolWidth + if (yAxisWidth > totalWidth) { + yAxisWidth = totalWidth } if (isOutside) { - mainWidth = totolWidth - yAxisWidth + mainWidth = totalWidth - yAxisWidth if (isYAxisLeft) { yAxisLeft = 0 mainLeft = yAxisWidth } else { - yAxisLeft = totolWidth - yAxisWidth + yAxisLeft = totalWidth - yAxisWidth mainLeft = 0 } } else { - mainWidth = totolWidth + mainWidth = totalWidth mainLeft = 0 if (isYAxisLeft) { yAxisLeft = 0 } else { - yAxisLeft = totolWidth - yAxisWidth + yAxisLeft = totalWidth - yAxisWidth } } this._chartStore.getTimeScaleStore().setTotalBarSpace(mainWidth) - const paneBounding = { width: totolWidth } + const paneBounding = { width: totalWidth } const mainBounding = { width: mainWidth, left: mainLeft } const yAxisBounding = { width: yAxisWidth, left: yAxisLeft } this._panes.forEach((pane) => { diff --git a/src/extension/indicator/averagePrice.ts b/src/extension/indicator/averagePrice.ts index 39c0f9978..f6871499b 100644 --- a/src/extension/indicator/averagePrice.ts +++ b/src/extension/indicator/averagePrice.ts @@ -20,7 +20,7 @@ interface Avp { } /** - * averager price + * average price */ const averagePrice: IndicatorTemplate = { name: 'AVP', diff --git a/src/pane/IndicatorPane.ts b/src/pane/IndicatorPane.ts index fc2272ead..fcef974a9 100644 --- a/src/pane/IndicatorPane.ts +++ b/src/pane/IndicatorPane.ts @@ -40,7 +40,7 @@ export default class IndicatorPane extends Pane { return new SeparatorWidget(container, this) } - override creatYAxisWidget (container: HTMLElement): Nullable { + override createYAxisWidget (container: HTMLElement): Nullable { return new YAxisWidget(container, this) } } diff --git a/src/pane/Pane.ts b/src/pane/Pane.ts index 7f52e808d..faed4557c 100644 --- a/src/pane/Pane.ts +++ b/src/pane/Pane.ts @@ -60,7 +60,7 @@ export const PaneIdConstants = { export default abstract class Pane implements Updater { private _container: HTMLElement - private _seriesContiainer: HTMLElement + private _seriesContainer: HTMLElement private readonly _id: string private readonly _chart: Chart private _mainWidget: DrawWidget @@ -85,7 +85,7 @@ export default abstract class Pane implements Updater { private _init (rootContainer: HTMLElement): void { this._container = rootContainer - this._seriesContiainer = createDom('div', { + this._seriesContainer = createDom('div', { width: '100%', margin: '0', padding: '0', @@ -96,16 +96,16 @@ export default abstract class Pane implements Updater { this._separatorWidget = this.createSeparatorWidget(rootContainer) const lastElement = rootContainer.lastChild if (lastElement !== null) { - rootContainer.insertBefore(this._seriesContiainer, lastElement) + rootContainer.insertBefore(this._seriesContainer, lastElement) } else { - rootContainer.appendChild(this._seriesContiainer) + rootContainer.appendChild(this._seriesContainer) } - this._mainWidget = this.createMainWidget(this._seriesContiainer) - this._yAxisWidget = this.creatYAxisWidget(this._seriesContiainer) + this._mainWidget = this.createMainWidget(this._seriesContainer) + this._yAxisWidget = this.createYAxisWidget(this._seriesContainer) } getContainer (): HTMLElement { - return this._seriesContiainer + return this._seriesContainer } getId (): string { @@ -200,12 +200,12 @@ export default abstract class Pane implements Updater { getSeparatorWidget (): Nullable { return this._separatorWidget } update (level?: UpdateLevel): void { - if (this._bounding.width !== this._seriesContiainer.offsetWidth) { - this._seriesContiainer.style.width = `${this._bounding.width}px` + if (this._bounding.width !== this._seriesContainer.offsetWidth) { + this._seriesContainer.style.width = `${this._bounding.width}px` } const seriesHeight = this._mainWidget.getBounding().height - if (seriesHeight !== this._seriesContiainer.offsetHeight) { - this._seriesContiainer.style.height = `${seriesHeight}px` + if (seriesHeight !== this._seriesContainer.offsetHeight) { + this._seriesContainer.style.height = `${seriesHeight}px` } const l = level ?? UpdateLevel.Drawer this._mainWidget.update(l) @@ -255,7 +255,7 @@ export default abstract class Pane implements Updater { } destroy (): void { - this._container.removeChild(this._seriesContiainer) + this._container.removeChild(this._seriesContainer) if (this._separatorWidget !== null) { this._container.removeChild(this._separatorWidget.getContainer()) } @@ -267,7 +267,7 @@ export default abstract class Pane implements Updater { protected createSeparatorWidget (_container: HTMLElement): Nullable { return null } - protected creatYAxisWidget (_container: HTMLElement): Nullable { return null } + protected createYAxisWidget (_container: HTMLElement): Nullable { return null } protected abstract createMainWidget (container: HTMLElement): DrawWidget } diff --git a/src/store/TimeScaleStore.ts b/src/store/TimeScaleStore.ts index 61e95d339..4ee5e9404 100644 --- a/src/store/TimeScaleStore.ts +++ b/src/store/TimeScaleStore.ts @@ -30,7 +30,7 @@ interface MinVisibleBarCount { right: number } -const BarSpaceLimitContants = { +const BarSpaceLimitConstants = { MIN: 1, MAX: 50 } @@ -46,7 +46,7 @@ export default class TimeScaleStore { private readonly _chartStore: ChartStore /** - * Time foramt + * Time format */ private _dateTimeFormat: Intl.DateTimeFormat = this._buildDateTimeFormat() as Intl.DateTimeFormat @@ -61,7 +61,7 @@ export default class TimeScaleStore { private _scrollEnabled: boolean = true /** - * Is loding data flag + * Is loading data flag */ private _loading: boolean = true @@ -221,7 +221,7 @@ export default class TimeScaleStore { } setBarSpace (barSpace: number, adjustBeforeFunc?: () => void): void { - if (barSpace < BarSpaceLimitContants.MIN || barSpace > BarSpaceLimitContants.MAX || this._barSpace === barSpace) { + if (barSpace < BarSpaceLimitConstants.MIN || barSpace > BarSpaceLimitConstants.MAX || this._barSpace === barSpace) { return } this._barSpace = barSpace diff --git a/src/view/YAxisView.ts b/src/view/YAxisView.ts index c8e080b84..bd0c5a43b 100644 --- a/src/view/YAxisView.ts +++ b/src/view/YAxisView.ts @@ -23,7 +23,7 @@ import YAxis from '../component/YAxis' import AxisView from './AxisView' -export default class YxisView extends AxisView { +export default class YAxisView extends AxisView { override getAxisStyles (styles: Styles): AxisStyle { return styles.yAxis }