|
6 | 6 | themeColors, |
7 | 7 | } from "./plotConfig.js"; |
8 | 8 | import { formatFunction } from "./utils.js"; |
9 | | -import { downsampleLTTB, shouldDownsample } from "./downsample.js"; |
10 | 9 | import Plotly from "plotly.js-cartesian-dist"; |
11 | 10 | import tippy, { followCursor } from "tippy.js"; |
12 | 11 | import "tippy.js/dist/tippy.css"; |
@@ -157,28 +156,16 @@ class Plot { |
157 | 156 |
|
158 | 157 | #extractData(data) { |
159 | 158 | const serie = data.series.get(this.#cfg.name); |
160 | | - const dataLength = data.times.length; |
161 | 159 |
|
162 | 160 | if (this.#cfg.type == "heatmap") { |
163 | | - // Heatmaps don't downsample well, use original data |
164 | 161 | this.#dataTemplate[0].x = data.times; |
165 | 162 | this.#dataTemplate[0].z = serie; |
166 | 163 | this.#dataTemplate[0].hoverinfo = "none"; |
167 | 164 | this.#dataTemplate[0].colorbar = { len: "350", lenmode: "pixels" }; |
168 | 165 | } else { |
169 | | - // Apply downsampling for regular plots if data exceeds threshold |
170 | | - const maxPoints = 500; // Configurable threshold |
171 | | - const useDownsampling = shouldDownsample(dataLength, maxPoints); |
172 | | - |
173 | 166 | 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]; |
182 | 169 |
|
183 | 170 | this.#dataTemplate[i].stackgroup = this.#cfg.subplots[i].stackgroup; |
184 | 171 | this.#dataTemplate[i].hoveron = this.#cfg.subplots[i].hoveron; |
|
0 commit comments