diff --git a/packages/react-components/src/components/abstract-xy-output-component.tsx b/packages/react-components/src/components/abstract-xy-output-component.tsx index fdef67a3..a30ff8c0 100644 --- a/packages/react-components/src/components/abstract-xy-output-component.tsx +++ b/packages/react-components/src/components/abstract-xy-output-component.tsx @@ -25,6 +25,7 @@ import { ChartOptions } from 'chart.js'; import { Line, Scatter } from 'react-chartjs-2'; import { getAllExpandedNodeIds } from './utils/filter-tree/utils'; import { debounce } from 'lodash'; +import { isEqual } from 'lodash'; export const ZOOM_IN_RATE = 0.8; export const ZOOM_OUT_RATE = 1.25; @@ -226,7 +227,7 @@ export abstract class AbstractXYOutputComponent< componentDidUpdate(prevProps: AbstractOutputProps, prevState: AbstractXYOutputState): void { const viewRangeChanged = this.props.viewRange !== prevProps.viewRange; - const checkedSeriesChanged = this.state.checkedSeries !== prevState.checkedSeries; + const checkedSeriesChanged = !isEqual(this.state.checkedSeries, prevState.checkedSeries); const collapsedNodesChanged = this.state.collapsedNodes !== prevState.collapsedNodes; const chartWidthChanged = this.props.style.width !== prevProps.style.width || diff --git a/packages/react-components/src/components/timegraph-output-component.tsx b/packages/react-components/src/components/timegraph-output-component.tsx index 9ad43bba..0e67f1bd 100644 --- a/packages/react-components/src/components/timegraph-output-component.tsx +++ b/packages/react-components/src/components/timegraph-output-component.tsx @@ -198,7 +198,7 @@ export class TimegraphOutputComponent extends AbstractTreeOutputComponent { if ( - prevState.outputStatus === ResponseStatus.RUNNING || - !isEqual(this.state.collapsedNodes, prevState.collapsedNodes) || !isEqual(prevProps.markerCategories, this.props.markerCategories) || prevProps.markerSetId !== this.props.markerSetId ) { this.selectedMarkerCategories = this.props.markerCategories; - if (this.state.searchString?.length > 0 || this.state.filters.length > 0) { - this._debouncedUpdateSearch(); - } else { - this.chartLayer.updateChart(); - } + this.chartLayer.updateChart(); this.markersChartLayer.updateChart(); - this.arrowLayer.update(); this.rangeEventsLayer.update(); - } - if ( - !isEqual(this.state.markerCategoryEntries, prevState.markerCategoryEntries) || - !isEqual(this.state.collapsedMarkerNodes, prevState.collapsedMarkerNodes) || - !isEqual(this.state.markerLayerData, prevState.markerLayerData) - ) { - this.markersChartLayer.updateChart(); + this.arrowLayer.update(); + } else { + if ( + this.state.outputStatus !== prevState.outputStatus || + !isEqual(this.state.timegraphTree, prevState.timegraphTree) || + !isEqual(this.state.collapsedNodes, prevState.collapsedNodes) + ) { + this.chartLayer.update(); + this.arrowLayer.update(); + } + if ( + !isEqual(this.state.markerCategoryEntries, prevState.markerCategoryEntries) || + !isEqual(this.state.collapsedMarkerNodes, prevState.collapsedMarkerNodes) || + !isEqual(this.state.markerLayerData, prevState.markerLayerData) + ) { + this.markersChartLayer.updateChart(); + } } if ( !isEqual(this.state.searchString, prevState.searchString) || @@ -685,22 +688,23 @@ export class TimegraphOutputComponent extends AbstractTreeOutputComponent - {this.state.outputStatus === ResponseStatus.COMPLETED ? ( -
{ - ev.preventDefault(); - ev.stopPropagation(); - }} - style={{ height: this.props.style.height }} - > - {this.renderTimeGraphContent()} -
- ) : ( -
- {} - {'Analysis running'} +
{ + ev.preventDefault(); + ev.stopPropagation(); + }} + style={{ height: this.props.style.height }} + > + {this.renderTimeGraphContent()} +
+ {this.state.outputStatus === ResponseStatus.RUNNING && ( +
+
+ + Analysis running +
)} @@ -783,50 +787,56 @@ export class TimegraphOutputComponent extends AbstractTreeOutputComponent {this.getChartContainer()} {this.getMarkersContainer()} -
- - - - ), - className: 'timegraph-search-box', - endAdornment: ( - - - - ) - }} - value={this.state.searchString} - onChange={this.handleSearchChange} - onKeyDown={this.handleKeyDown} + {this.getSearchBar()} +
+ ); + } + + private getSearchBar() { + return ( +
+ + + + ), + className: 'timegraph-search-box', + endAdornment: ( + + + + ) + }} + value={this.state.searchString} + onChange={this.handleSearchChange} + onKeyDown={this.handleKeyDown} + /> + {this.state.filters.map((filter, index) => ( + this.removeFilter(filter)} + className="filter-chip" /> - {this.state.filters.map((filter, index) => ( - this.removeFilter(filter)} - className="filter-chip" - /> - ))} -
+ ))}
); } diff --git a/packages/react-components/src/components/trace-context-component.tsx b/packages/react-components/src/components/trace-context-component.tsx index eeb3e756..718bd657 100644 --- a/packages/react-components/src/components/trace-context-component.tsx +++ b/packages/react-components/src/components/trace-context-component.tsx @@ -188,7 +188,10 @@ export class TraceContextComponent extends React.Component { const originalStart = this.state.currentRange.getStart(); theNumber += originalStart; @@ -238,10 +241,8 @@ export class TraceContextComponent extends React.Component