Skip to content

Commit

Permalink
Update parameter for onViewRangeChanged handler
Browse files Browse the repository at this point in the history
The performance improvement patch for the timeline chart [1] changes
the parameters provided to handlers of the onViewRangeChanged event
on the unit controller. This commit updates the Theia Trace Extension
to ensure that it works with the performance improvement patch.

[1]: eclipse-cdt-cloud/timeline-chart#246

Signed-off-by: Hoang Thuan Pham <hoang.pham@calian.ca>
  • Loading branch information
hoangphamEclipse committed May 25, 2023
1 parent e5c898d commit 677f760
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ export class TraceContextComponent extends React.Component<TraceContextProps, Tr
this.unitController.onSelectionRangeChange(range => {
this.handleTimeSelectionChange(range);
});
this.unitController.onViewRangeChanged(viewRangeParam => {
this.handleViewRangeChange(viewRangeParam);
this.unitController.onViewRangeChanged((oldRange, newRange) => {
this.handleViewRangeChange(oldRange, newRange);
});
this.tooltipComponent = React.createRef();
this.tooltipXYComponent = React.createRef();
Expand Down Expand Up @@ -442,8 +442,8 @@ export class TraceContextComponent extends React.Component<TraceContextProps, Tr
}
}

private handleViewRangeChange(viewRange: TimelineChart.TimeGraphRange) {
const { start, end } = viewRange;
private handleViewRangeChange(oldRange: TimelineChart.TimeGraphRange, newRange: TimelineChart.TimeGraphRange) {
const { start, end } = newRange;
const payload = {
experimentUUID: this.props.experiment.UUID,
timeRange: new TimeRange(start, end)
Expand All @@ -452,7 +452,7 @@ export class TraceContextComponent extends React.Component<TraceContextProps, Tr

this.setState(
prevState => ({
currentViewRange: new TimeRange(viewRange.start, viewRange.end, prevState.timeOffset)
currentViewRange: new TimeRange(newRange.start, newRange.end, prevState.timeOffset)
}),
() => this.updateHistory()
);
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13815,9 +13815,9 @@ through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8,
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=

timeline-chart@next:
version "0.3.0-next.20230419183309.9e0527f.0"
resolved "https://registry.yarnpkg.com/timeline-chart/-/timeline-chart-0.3.0-next.20230419183309.9e0527f.0.tgz#fcd6fe2b75d62c13a6f3d90c16ce250659e05383"
integrity sha512-vAjzxcubaLYeN3TXl9MQH3SYdFj2qedVPcOK/nnUE5iqE7oe8T9fcu3fSbV0E3g9hTh/VNo1gGk0KmKbMVMPFQ==
version "0.3.0-next.20230524200734.08fb2e6.0"
resolved "https://registry.yarnpkg.com/timeline-chart/-/timeline-chart-0.3.0-next.20230524200734.08fb2e6.0.tgz#ecb27b8f3f4a1cf3a07bcbc15456fc3ce7f311f1"
integrity sha512-uHfr0Z+K34gzXov0N8POhKY5ujftTY1yQDvlLb5QPkG4aJgKb/Vz9ql9CGO9EkjSoGt1mB8dwA3Y3gQxZTqS1w==
dependencies:
"@types/lodash.throttle" "^4.1.4"
glob "^7.1.6"
Expand Down

0 comments on commit 677f760

Please sign in to comment.