Skip to content

Commit

Permalink
chore: correct some spelling errors in words
Browse files Browse the repository at this point in the history
  • Loading branch information
liihuu committed Aug 19, 2023
1 parent 4bb4d03 commit 8a8e5cf
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
16 changes: 8 additions & 8 deletions src/Chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,39 +196,39 @@ 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
let mainLeft = 0
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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/extension/indicator/averagePrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface Avp {
}

/**
* averager price
* average price
*/
const averagePrice: IndicatorTemplate<Avp> = {
name: 'AVP',
Expand Down
2 changes: 1 addition & 1 deletion src/pane/IndicatorPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class IndicatorPane extends Pane<YAxis> {
return new SeparatorWidget(container, this)
}

override creatYAxisWidget (container: HTMLElement): Nullable<YAxisWidget> {
override createYAxisWidget (container: HTMLElement): Nullable<YAxisWidget> {
return new YAxisWidget(container, this)
}
}
26 changes: 13 additions & 13 deletions src/pane/Pane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const PaneIdConstants = {

export default abstract class Pane<C extends Axis = Axis> implements Updater {
private _container: HTMLElement
private _seriesContiainer: HTMLElement
private _seriesContainer: HTMLElement
private readonly _id: string
private readonly _chart: Chart
private _mainWidget: DrawWidget<C>
Expand All @@ -85,7 +85,7 @@ export default abstract class Pane<C extends Axis = Axis> implements Updater {

private _init (rootContainer: HTMLElement): void {
this._container = rootContainer
this._seriesContiainer = createDom('div', {
this._seriesContainer = createDom('div', {
width: '100%',
margin: '0',
padding: '0',
Expand All @@ -96,16 +96,16 @@ export default abstract class Pane<C extends Axis = Axis> 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 {
Expand Down Expand Up @@ -200,12 +200,12 @@ export default abstract class Pane<C extends Axis = Axis> implements Updater {
getSeparatorWidget (): Nullable<SeparatorWidget> { 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)
Expand Down Expand Up @@ -255,7 +255,7 @@ export default abstract class Pane<C extends Axis = Axis> implements Updater {
}

destroy (): void {
this._container.removeChild(this._seriesContiainer)
this._container.removeChild(this._seriesContainer)
if (this._separatorWidget !== null) {
this._container.removeChild(this._separatorWidget.getContainer())
}
Expand All @@ -267,7 +267,7 @@ export default abstract class Pane<C extends Axis = Axis> implements Updater {

protected createSeparatorWidget (_container: HTMLElement): Nullable<SeparatorWidget> { return null }

protected creatYAxisWidget (_container: HTMLElement): Nullable<YAxisWidget> { return null }
protected createYAxisWidget (_container: HTMLElement): Nullable<YAxisWidget> { return null }

protected abstract createMainWidget (container: HTMLElement): DrawWidget<C>
}
8 changes: 4 additions & 4 deletions src/store/TimeScaleStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface MinVisibleBarCount {
right: number
}

const BarSpaceLimitContants = {
const BarSpaceLimitConstants = {
MIN: 1,
MAX: 50
}
Expand All @@ -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

Expand All @@ -61,7 +61,7 @@ export default class TimeScaleStore {
private _scrollEnabled: boolean = true

/**
* Is loding data flag
* Is loading data flag
*/
private _loading: boolean = true

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/view/YAxisView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import YAxis from '../component/YAxis'

import AxisView from './AxisView'

export default class YxisView extends AxisView<YAxis> {
export default class YAxisView extends AxisView<YAxis> {
override getAxisStyles (styles: Styles): AxisStyle {
return styles.yAxis
}
Expand Down

0 comments on commit 8a8e5cf

Please sign in to comment.