Skip to content

Commit 7fffa68

Browse files
committed
暂时修复y轴反向无法渲染
1 parent 381ed93 commit 7fffa68

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

patches/function-plot+2.0.0-0.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
diff --git a/node_modules/function-plot/dist/graph-types/polyline.js b/node_modules/function-plot/dist/graph-types/polyline.js
2+
index 19ee726..018786b 100644
3+
--- a/node_modules/function-plot/dist/graph-types/polyline.js
4+
+++ b/node_modules/function-plot/dist/graph-types/polyline.js
5+
@@ -12,6 +12,9 @@ export default function polyline(chart) {
6+
const yRange = chart.meta.yScale.range();
7+
let yMax = yRange[0];
8+
let yMin = yRange[1];
9+
+ // Fix
10+
+ if(yMax < yMin) [yMax, yMin] = [yMin, yMax];
11+
+
12+
// workaround, clamp assuming that the bounds are finite but huge
13+
const diff = yMax - yMin;
14+
yMax += diff * 1e6;
115
diff --git a/node_modules/function-plot/dist/samplers/interval_worker_pool.js b/node_modules/function-plot/dist/samplers/interval_worker_pool.js
216
index 144edd0..784870a 100644
317
--- a/node_modules/function-plot/dist/samplers/interval_worker_pool.js

0 commit comments

Comments
 (0)