@publishfx/publish-chart 2.0.2 → 2.0.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ **2.0.3** feat(chart): G2GaugeChart设置value文本的颜色和阈值保持一致
2
+ - 2026-02-05T15:06:47+08:00 [feat(chart): G2GaugeChart设置value文本的颜色和阈值保持一致](http://lf.git.oa.mt/publish_platform/web/publish/commit/6b80990920484818132164048278789e6f6aa740)
3
+
1
4
  **2.0.2** feat(chart): 优化G2GaugeChart组件,仅基于数据驱动UI,不涉及业务逻辑
2
5
  - 2026-02-05T14:07:11+08:00 [feat(chart): 优化G2GaugeChart组件,仅基于数据驱动UI,不涉及业务逻辑](http://lf.git.oa.mt/publish_platform/web/publish/commit/ad3728038c692c40a03dcb6a38f7b77b0952cccc)
3
6
 
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
- # @moonton/publish-chart
1
+ # @publishfx/publish-chart
2
2
 
3
3
  基于新架构设计的 React 图表组件库,支持离线分析模块使用的所有图表类型。
4
4
 
5
5
  ## 安装
6
6
 
7
7
  ```bash
8
- npm install @moonton/publish-chart
8
+ npm install @publishfx/publish-chart
9
9
  # 或
10
- pnpm add @moonton/publish-chart
10
+ pnpm add @publishfx/publish-chart
11
11
  ```
12
12
 
13
13
  ## 特性
@@ -30,7 +30,7 @@ import {
30
30
  defaultChartConfig,
31
31
  createFormatterService,
32
32
  createDataTransformService
33
- } from '@moonton/publish-chart';
33
+ } from '@publishfx/publish-chart';
34
34
 
35
35
  const chartServices = {
36
36
  formatter: createFormatterService(),
@@ -53,7 +53,7 @@ const chartServices = {
53
53
  如果你只需要自定义业务组件,其他服务使用库的默认配置,可以这样:
54
54
 
55
55
  ```tsx
56
- import { ChartProvider } from '@moonton/publish-chart';
56
+ import { ChartProvider } from '@publishfx/publish-chart';
57
57
 
58
58
  // 只定义 businessComponents,其他使用默认值
59
59
  const chartServices = {
@@ -73,7 +73,7 @@ const chartServices = {
73
73
  ### 2. 使用图表组件
74
74
 
75
75
  ```tsx
76
- import { BarChart, LineChart, BarLineChart } from '@moonton/publish-chart';
76
+ import { BarChart, LineChart, BarLineChart } from '@publishfx/publish-chart';
77
77
 
78
78
  <BarChart
79
79
  data={data}
@@ -219,7 +219,9 @@ const G2GaugeChart = (props)=>{
219
219
  const valueText = document.createElementNS('http://www.w3.org/2000/svg', 'text');
220
220
  valueText.setAttribute('x', String(textCenterX));
221
221
  valueText.setAttribute('y', String(valueTextY));
222
- valueText.setAttribute('fill', colors[0] || '#9596d9');
222
+ const thresholdIndex = thresholdValues.findIndex((threshold)=>value <= threshold);
223
+ const thresholdColor = thresholdColorArray[thresholdIndex] || '#9596d9';
224
+ valueText.setAttribute('fill', thresholdColor);
223
225
  valueText.setAttribute('font-size', String(valueFontSize));
224
226
  valueText.setAttribute('font-weight', 'bold');
225
227
  valueText.setAttribute('text-anchor', 'middle');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@publishfx/publish-chart",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "A React chart component library for the Publish platform, including BarChart, LineChart, BarLineChart and other visualization components",
5
5
  "type": "module",
6
6
  "keywords": [