Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ export interface TimeSeriesWidgetVisualizationProps extends Partial<LoadableChar
*/
legendSelection?: LegendSelection;

/**
* Whether new options fully replace previous chart options.
*/
notMerge?: boolean;

/**
* Callback that returns an updated `LegendSelection` after a user manipulations the selection via the legend
*/
Expand Down Expand Up @@ -615,7 +610,21 @@ export function TimeSeriesWidgetVisualization(props: TimeSeriesWidgetVisualizati
<BaseChart
ref={mergeRefs(props.ref, props.chartRef, chartRef, handleChartRef)}
autoHeightResize
notMerge={props.notMerge}
// `notMerge` should always be `false`. i.e., ECharts should be
// allowed to _merge_ the incoming options when they change. Note
// `replaceMerge` below which ensures that the critical components
// like the series and the axes are merged using the "replace"
// algorithm, not the "normal" algorithm.
//
// Under `notMerge`, every data refresh does a full ECharts re-init that
// destroys and re-creates the toolbox dataZoom "select" component. In
// ECharts 6.1 that rebuild re-emits a stale `dataZoom` event, so a
// single drag-to-zoom cascades into repeated refetches that settle on
// the wrong time range. See apache/echarts#21661.
//
// To guard against this, we allow ECharts to preserve the
// configuration of the toolbox, which prevents these stale fires.
notMerge={false}
replaceMerge={['series', 'xAxis', 'yAxis']}
series={allSeries}
grid={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ interface ChartVisualizationProps {
chartInfo: ChartInfo;
chartRef?: Ref<ReactEchartsRef>;
chartXRangeSelection?: Partial<ChartXRangeSelectionProps>;
notMerge?: boolean;
}

export function useChartVisualizationPlottables(chartInfo: ChartInfo) {
Expand Down Expand Up @@ -63,7 +62,6 @@ export function ChartVisualization({
chartXRangeSelection,
chartInfo,
chartRef,
notMerge,
}: ChartVisualizationProps) {
const plottables = useChartVisualizationPlottables(chartInfo);
const previousPlottables = usePrevious(
Expand Down Expand Up @@ -115,7 +113,6 @@ export function ChartVisualization({
ref={chartRef}
plottables={activePlottables}
chartXRangeSelection={chartXRangeSelection}
notMerge={notMerge}
/>
</StyledTransparentLoadingMask>
);
Expand Down
9 changes: 1 addition & 8 deletions static/app/views/explore/logs/logsGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import {
useChartVisualizationPlottables,
} from 'sentry/views/explore/components/chart/chartVisualization';
import type {ChartInfo} from 'sentry/views/explore/components/chart/types';
import {useLogsAutoRefreshEnabled} from 'sentry/views/explore/contexts/logs/logsAutoRefreshContext';
import {useLogsPageDataQueryResult} from 'sentry/views/explore/contexts/logs/logsPageData';
import {formatSort} from 'sentry/views/explore/contexts/pageParamsContext/sortBys';
import {CHART_TYPE_TO_DISPLAY_TYPE} from 'sentry/views/explore/hooks/useAddToDashboard';
Expand Down Expand Up @@ -128,7 +127,6 @@ function Graph({
visualize,
}: GraphProps) {
const isShortViewport = useIsShortViewport();
const autorefreshEnabled = useLogsAutoRefreshEnabled();
const {isEmpty: tableIsEmpty, isPending: tableIsPending} = useLogsPageDataQueryResult();

const aggregate = visualize.yAxis;
Expand Down Expand Up @@ -181,7 +179,6 @@ function Graph({
!visualize.visible && plottablesCanBeVisualized(plottables) ? (
<TimeSeriesWidgetVisualization
plottables={plottables}
notMerge={false}
showLegend="never"
showXAxis="never"
showYAxis="never"
Expand Down Expand Up @@ -263,11 +260,7 @@ function Graph({
Actions={Actions}
Visualization={
visualize.visible && (
<ChartVisualization
key={chartRemountKey}
chartInfo={chartInfo}
notMerge={!autorefreshEnabled}
/>
<ChartVisualization key={chartRemountKey} chartInfo={chartInfo} />
)
}
Footer={
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/explore/metrics/metricGraph/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function Graph({
)}
/>
) : showChart ? (
<ChartVisualization chartInfo={chartInfo} notMerge={false} />
<ChartVisualization chartInfo={chartInfo} />
) : undefined
}
Footer={
Expand Down
1 change: 0 additions & 1 deletion static/app/views/explore/spans/charts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ function Chart({
!visualize.visible && plottablesCanBeVisualized(plottables) ? (
<TimeSeriesWidgetVisualization
plottables={plottables}
notMerge={false}
showLegend="never"
showXAxis="never"
showYAxis="never"
Expand Down
Loading