Skip to content

Commit 7a384e1

Browse files
committed
Remove out-of-viewport data before filters
1 parent 2499e2b commit 7a384e1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/plotly-graph-card.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,10 @@ export class PlotlyGraph extends HTMLElement {
432432
meta,
433433
vars,
434434
};
435-
435+
if (!this.isBrowsing) {
436+
// to ensure the y axis autoranges to the visible data
437+
removeOutOfRange(data, this.getAutoFetchRangeWithValueMargins());
438+
}
436439
if (trace.filters) {
437440
try {
438441
for (const filter of trace.filters) {
@@ -464,10 +467,7 @@ export class PlotlyGraph extends HTMLElement {
464467
}
465468
}
466469
if (trace.internal) return;
467-
if (!this.isBrowsing) {
468-
// to ensure the y axis autoranges to the visible data
469-
removeOutOfRange(data, this.getAutoFetchRangeWithValueMargins());
470-
}
470+
471471
if (data.xs.length === 0 && data.ys.length === 0) {
472472
/*
473473
Traces with no data are removed from the legend by plotly.

0 commit comments

Comments
 (0)