Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
liihuu committed Jan 15, 2025
2 parents aa4ea6d + f07a275 commit c6d1dcc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/api/instance/scrollToDataIndex.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ outline: deep
---

# scrollToDataIndex(dataIndex, animationDuration?)
`scrollToDataIndex` 滚动到指定数据索引位置
`scrollToDataIndex` 滚动图表最右侧到指定数据索引位置

## 参考 {#reference}
<!-- @include: @/@views/api/references/instance/scrollToDataIndex.md -->
Expand Down
2 changes: 1 addition & 1 deletion docs/api/instance/scrollToTimestamp.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ outline: deep
---

# scrollToTimestamp(timestamp, animationDuration?)
`scrollToTimestamp` 滚动到指定的时间戳
`scrollToTimestamp` 滚动图表最右侧到指定的时间戳

## 参考 {#reference}
<!-- @include: @/@views/api/references/instance/scrollToTimestamp.md -->
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/api/instance/scrollToDataIndex.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ outline: deep
---

# scrollToDataIndex(dataIndex, animationDuration?)
`scrollToDataIndex` scroll to the specified data index position.
`scrollToDataIndex` scroll the right side of the chart to the specified data index position.

## Reference {#reference}
<!-- @include: @/@views/api/references/instance/scrollToDataIndex.md -->
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/api/instance/scrollToTimestamp.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ outline: deep
---

# scrollToTimestamp(timestamp, animationDuration?)
`scrollToTimestamp` scroll to the specified timestamp.
`scrollToTimestamp` scroll the right side of the chart to the specified timestamp.

## Reference {#reference}
<!-- @include: @/@views/api/references/instance/scrollToTimestamp.md -->
Expand Down
10 changes: 5 additions & 5 deletions src/Store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ export default class StoreImp implements Store {

getOverlaysByFilter (filter: OverlayFilter): Map<string, OverlayImp[]> {
const { id, groupId, paneId, name } = filter
const find: ((overlays: OverlayImp[]) => OverlayImp[]) = (overlays) => overlays.filter(overlay => {
const match: ((overlay: OverlayImp) => boolean) = overlay => {
if (isValid(id)) {
return overlay.id === id
} else {
Expand All @@ -1171,19 +1171,19 @@ export default class StoreImp implements Store {
}
}
return !isValid(name) || overlay.name === name
})
}

const map = new Map<string, OverlayImp[]>()
if (isValid(paneId)) {
const overlays = this.getOverlaysByPaneId(paneId)
map.set(paneId, find(overlays))
map.set(paneId, overlays.filter(match))
} else {
this._overlays.forEach((overlays, paneId) => {
map.set(paneId, find(overlays))
map.set(paneId, overlays.filter(match))
})
}
const progressOverlay = this._progressOverlayInfo?.overlay
if (isValid(progressOverlay)) {
if (isValid(progressOverlay) && match(progressOverlay)) {
const paneOverlays = map.get(progressOverlay.paneId) ?? []
paneOverlays.push(progressOverlay)
map.set(progressOverlay.paneId, paneOverlays)
Expand Down

0 comments on commit c6d1dcc

Please sign in to comment.