Skip to content

Commit 8a353c9

Browse files
committed
internal/static: disable downsampling
1 parent 31483a5 commit 8a353c9

File tree

2 files changed

+2
-145
lines changed

2 files changed

+2
-145
lines changed

internal/static/src/downsample.js

Lines changed: 0 additions & 130 deletions
This file was deleted.

internal/static/src/plot.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
themeColors,
77
} from "./plotConfig.js";
88
import { formatFunction } from "./utils.js";
9-
import { downsampleLTTB, shouldDownsample } from "./downsample.js";
109
import Plotly from "plotly.js-cartesian-dist";
1110
import tippy, { followCursor } from "tippy.js";
1211
import "tippy.js/dist/tippy.css";
@@ -157,28 +156,16 @@ class Plot {
157156

158157
#extractData(data) {
159158
const serie = data.series.get(this.#cfg.name);
160-
const dataLength = data.times.length;
161159

162160
if (this.#cfg.type == "heatmap") {
163-
// Heatmaps don't downsample well, use original data
164161
this.#dataTemplate[0].x = data.times;
165162
this.#dataTemplate[0].z = serie;
166163
this.#dataTemplate[0].hoverinfo = "none";
167164
this.#dataTemplate[0].colorbar = { len: "350", lenmode: "pixels" };
168165
} else {
169-
// Apply downsampling for regular plots if data exceeds threshold
170-
const maxPoints = 500; // Configurable threshold
171-
const useDownsampling = shouldDownsample(dataLength, maxPoints);
172-
173166
for (let i = 0; i < this.#dataTemplate.length; i++) {
174-
if (useDownsampling) {
175-
const downsampled = downsampleLTTB(data.times, serie[i], maxPoints);
176-
this.#dataTemplate[i].x = downsampled.x;
177-
this.#dataTemplate[i].y = downsampled.y;
178-
} else {
179-
this.#dataTemplate[i].x = data.times;
180-
this.#dataTemplate[i].y = serie[i];
181-
}
167+
this.#dataTemplate[i].x = data.times;
168+
this.#dataTemplate[i].y = serie[i];
182169

183170
this.#dataTemplate[i].stackgroup = this.#cfg.subplots[i].stackgroup;
184171
this.#dataTemplate[i].hoveron = this.#cfg.subplots[i].hoveron;

0 commit comments

Comments
 (0)