jmchart 1.2.20 → 1.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "jmchart",
3
- "version": "1.2.20",
3
+ "version": "1.2.22",
4
4
  "description": "chart",
5
5
  "main": "./index.js",
6
+ "miniprogram": "miniprogram_dist",
6
7
  "types": "./index.d.ts",
7
8
  "directories": {
8
9
  "example": "example"
@@ -12,7 +13,7 @@
12
13
  "clone": "git clone https://ghproxy.com/https://github.com/fefeding/jmchart.git",
13
14
  "dev": "node server.js",
14
15
  "push": "npm publish --registry=https://registry.npmjs.org",
15
- "build": "node build.js"
16
+ "build": "node build.js && mkdir -p miniprogram_dist && cp dist/jmchart.cjs.js miniprogram_dist/index.js"
16
17
  },
17
18
  "repository": {
18
19
  "type": "git",
@@ -27,18 +28,18 @@
27
28
  "bugs": {
28
29
  "url": "https://github.com/fefeding/jmchart/issues"
29
30
  },
30
- "homepage": "https://surl.fit/tools/tools/jmchart",
31
+ "homepage": "https://aigcwhere.com/opensource/jmchart",
31
32
  "dependencies": {
32
- "jmgraph": "^3.2.29"
33
+ "jmgraph": "3.3.1"
33
34
  },
34
35
  "publishConfig": {
35
36
  "registry": "https://registry.npmjs.org/"
36
37
  },
37
38
  "devDependencies": {
38
- "@babel/core": "^7.29.0",
39
+ "@babel/core": "^7.29.13",
39
40
  "@babel/plugin-proposal-class-properties": "^7.18.6",
40
41
  "canvas": "^2.11.2",
41
- "express": "^4.22.1",
42
+ "express": "^4.22.3",
42
43
  "rollup": "^2.80.0",
43
44
  "rollup-plugin-babel": "^4.4.0",
44
45
  "rollup-plugin-node-resolve": "^5.2.0",
@@ -0,0 +1,4 @@
1
+ allowBuilds:
2
+ canvas: false
3
+ minimumReleaseAgeExclude:
4
+ - jmgraph@3.3.1
package/server.js CHANGED
@@ -53,6 +53,9 @@ function startServer() {
53
53
  if (!serverInstance) {
54
54
  const app = express();
55
55
  app.use(express.static("."));
56
+ app.get("*", (req, res) => {
57
+ res.sendFile("example/index.html", { root: __dirname });
58
+ });
56
59
  serverInstance = app.listen(port, ip, () => {
57
60
  console.log(`\n🔥 开发服务器启动成功!`);
58
61
  console.log(`🌐 访问地址: http://${ip}:${port}`);
@@ -1,5 +1,5 @@
1
1
 
2
- import jmMarkLine from './markLine';
2
+ import jmMarkLine from './markLine.js';
3
3
 
4
4
  /**
5
5
  * 轴
package/src/jmChart.js CHANGED
@@ -25,7 +25,7 @@ import jmFunnelSeries from './series/funnelSeries.js';
25
25
  import jmRingProgressSeries from './series/ringProgressSeries.js';
26
26
  import jmBoxPlotSeries from './series/boxPlotSeries.js';
27
27
  import jmWordCloudSeries from './series/wordCloudSeries.js';
28
- import jmMarkLineManager from './core/markLine/manager';
28
+ import jmMarkLineManager from './core/markLine/manager.js';
29
29
 
30
30
  /**
31
31
  * jm图表组件
@@ -33,6 +33,7 @@ export default class jmLineSeries extends jmSeries {
33
33
  if(!len) return;
34
34
 
35
35
  this.style.stroke = this.style.color;
36
+ this.style.fill = null;
36
37
  this.style.item.stroke = this.style.color;
37
38
 
38
39
  const isRunningAni = this.enableAnimate && (dataChanged || this.___animateCounter > 0) && len < ANIMATION_DATA_THRESHOLD;
@@ -193,10 +194,8 @@ export default class jmLineSeries extends jmSeries {
193
194
  // 有指定绘制区域效果才展示
194
195
  if(!this.style.area || points.length < 2) return;
195
196
 
196
- // 基线:取X轴的实际Y位置(chartArea相对坐标),没有X轴时用下边界
197
- const axisY = this.graph.xAxis
198
- ? this.graph.xAxis.start.y - this.graph.chartArea.position.y
199
- : this.graph.chartArea.height;
197
+ // 基线:使用数据基准线(baseY),在 createPoints 中已根据 minY/baseYValue 正确计算
198
+ const axisY = this.baseY;
200
199
 
201
200
  // 过滤有效点
202
201
  const validPoints = points.filter(p => p.y != null && typeof p.y !== 'undefined');
@@ -233,6 +232,8 @@ export default class jmLineSeries extends jmSeries {
233
232
  const style = this.graph.utils.clone(this.style.area, {}, true);
234
233
  // 连框颜色如果没指定,就透明
235
234
  style.stroke = style.stroke || 'transparent';
235
+ // 闭合路径,确保 fill/stroke 正确封闭多边形
236
+ style.close = true;
236
237
 
237
238
  if(!style.fill) {
238
239
  const color = this.graph.utils.hexToRGBA(this.style.stroke);