@idux/charts 1.5.1 → 1.6.0

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,5 +1,13 @@
1
1
  # @idux/charts
2
2
 
3
+ ## 1.6.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [dd3f55f]
8
+ - @idux/charts-core@1.6.0
9
+ - @idux/charts-plots@1.6.0
10
+
3
11
  ## 1.5.1
4
12
 
5
13
  ### Patch Changes
package/README.md CHANGED
@@ -26,17 +26,20 @@ Vue.use(VueCompositionAPI)
26
26
 
27
27
  ## Chart components
28
28
 
29
- | Component | Chart |
30
- | ------------------- | ---------------- |
31
- | `IxBarChart` | Bar |
32
- | `IxLineChart` | Line and area |
33
- | `IxPieChart` | Pie and doughnut |
34
- | `IxRadarChart` | Radar |
35
- | `IxGaugeChart` | Gauge |
36
- | `IxLiquidFillChart` | Liquid fill |
29
+ | Component | Chart |
30
+ | ------------------- | ---------------------------- |
31
+ | `IxBarChart` | Bar |
32
+ | `IxLineChart` | Line and area |
33
+ | `IxPieChart` | Pie and doughnut |
34
+ | `IxRadarChart` | Radar |
35
+ | `IxGaugeChart` | Gauge |
36
+ | `IxMapChart` | Map (regions, nodes, routes) |
37
+ | `IxLiquidFillChart` | Liquid fill |
37
38
 
38
39
  Also exports the generic `IxChart` component for direct ECharts options.
39
40
 
41
+ Register geometry with `registerMap(name, geoJSON)` before rendering `IxMapChart`. Compose native `geo`, `series`, and `visualMap` options; optional `createMapRegions`, `createMapNodes`, `createMapLines`, and `createMapVisualMap` helpers return ordinary ECharts configuration. There is no `mode` prop. Geometry assets are managed by the application and excluded from the library bundle. Use `validateMapData({ nodes, routes, regions })` to inspect invalid coordinates, unresolved endpoints, and duplicate identities before generating options.
42
+
40
43
  ## Quick start
41
44
 
42
45
  This example uses Vue 3 `<script setup>` with a locally imported component. The container must have a nonzero width and height.
@@ -61,13 +64,13 @@ const option: LineChartProps = {
61
64
 
62
65
  Chart components register their required ECharts modules. Global registration is also supported: use `app.use(IxLineChart)` in Vue 3 or `Vue.use(IxLineChart)` in Vue 2.
63
66
 
64
- Use an ESM subpath such as `@idux/charts/line` to import one chart family and its types. The available subpaths are `bar`, `line` (including area), `pie`, `radar`, `gauge`, and `liquid-fill`. Import the base component, ECharts theme token, and shared tooltip helpers from `@idux/charts/core`. Each chart subpath also exports the plot theme token. The aggregate entry registers the full set of charts.
67
+ Use an ESM subpath such as `@idux/charts/line` to import one chart family and its types. The available subpaths are `bar`, `line` (including area), `pie`, `radar`, `gauge`, `liquid-fill`, and `map`. Import the base component, ECharts theme token, and shared tooltip helpers from `@idux/charts/core`. Each chart subpath also exports the plot theme token. The aggregate entry registers the full set of charts.
65
68
 
66
69
  ## Configuration and themes
67
70
 
68
- - `useBarOption`, `useLineOption`, and `usePieOption` provide composable options; `createRadarOption`, `createGaugeOption`, and `createLiquidFillOption` are pure option builders.
71
+ - `useBarOption`, `useLineOption`, and `usePieOption` provide composable options; `createRadarOption`, `createGaugeOption`, `createLiquidFillOption`, and `createMapOption` are pure option builders.
69
72
  - Use Vue `provide` with `BAR_CHART_TOKEN`, `LINE_CHART_TOKEN`, or `PIE_CHART_TOKEN` to set defaults for the corresponding native and built-in layouts.
70
- - Category Bar, Line / Area, automatic Pie, Radar, Gauge, and LiquidFill support `plotTheme`. Provide reactive defaults with `PLOT_THEME_TOKEN`, or pass `plotTheme` explicitly to a pure option builder.
73
+ - Category Bar, Line / Area, automatic Pie, Radar, Gauge, LiquidFill, and Map support `plotTheme`. Provide reactive defaults with `PLOT_THEME_TOKEN`, or pass `plotTheme` explicitly to a pure option builder.
71
74
  - Option objects merge by field and arrays replace in full. Every chart component exposes `getEChartsInstance()` on its template ref.
72
75
 
73
76
  Shared HTML tooltip styles live in `@idux/charts/dist/style.css`; import them once in the application entry point.
@@ -76,11 +79,13 @@ Shared HTML tooltip styles live in `@idux/charts/dist/style.css`; import them on
76
79
 
77
80
  When data is appended and the zoom configuration is unchanged, category Bar, Line, and Area charts keep the historical window. A window at the end follows the newest data and keeps the same number of points. A full-range view continues to show all data.
78
81
 
82
+ Maps preserve compatible geo zoom and center across data refreshes, series cleanup, and theme rebuilds. Use stable `geo.id` values for multiple maps; new geometry, projection, or explicit viewport settings take precedence. Map data helpers do not read injected themes: pass `plotTheme` explicitly and regenerate when data or themes change.
83
+
79
84
  Chart components forward `role`, `aria-*`, `tabindex`, and `data-*` to the chart container.
80
85
 
81
86
  ## Loading
82
87
 
83
- Set `:loading="pending"` to show the built-in illustration and `Loading...` message without recreating the chart. Bar, Line/Area, Pie/Ring/Rose, Radar, Gauge and LiquidFill select their illustration automatically. `IxChart` and `useChart` inspect the first series: pie or absent series types use the pie fallback; all other types use the generic illustration. Both light and dark palettes are built in.
88
+ Set `:loading="pending"` to show the built-in illustration and `Loading...` message without recreating the chart. Bar, Line/Area, Pie/Ring/Rose, Radar, Gauge, LiquidFill, and Map select their illustration automatically. `IxChart` and `useChart` inspect the first series: pie or absent series types use the pie fallback; all other types use the generic illustration. Both light and dark palettes are built in.
84
89
 
85
90
  Pass an object to localize or customize the state: `:loading="pending && { text: 'Updating...', maskColor: 'transparent' }"`. Other options include `textColor`, `color` (illustration tint), `fontSize`, `fontFamily`, and `icon` (image URL or SVG source). The loading layer is DOM content; it is excluded from ECharts image exports. Native spinner options such as `showSpinner` and `spinnerRadius` no longer change the illustration.
86
91
 
@@ -96,7 +101,7 @@ Bar value labels default to `top` for basic vertical bars and `right` for basic
96
101
 
97
102
  Call `useTooltipsFormatter(title, rows, rowsPerColumn?)` from `tooltip.formatter` to reuse the built-in HTML layout. `getTooltipsColor(color)` resolves a solid swatch, and `useStripeBarTooltip(unit)` returns tooltip options for native striped bars. Import these helpers from `@idux/charts` or `@idux/charts-core`.
98
103
 
99
- [See the signatures and complete formatter example](https://github.com/IDuxFE/idux-charts/blob/main/packages/site/src/components/core/API.tab.md#自定义-tooltip).
104
+ [See the signatures and complete formatter example](https://github.com/IDuxFE/idux-charts/blob/main/packages/site/src/components/core/API.md#自定义-tooltip).
100
105
 
101
106
  ## TypeScript
102
107
 
package/README.zh.md CHANGED
@@ -26,17 +26,20 @@ Vue.use(VueCompositionAPI)
26
26
 
27
27
  ## 图表组件
28
28
 
29
- | 组件 | 图表 |
30
- | ------------------- | -------------- |
31
- | `IxBarChart` | 柱状图 |
32
- | `IxLineChart` | 折线图、面积图 |
33
- | `IxPieChart` | 饼图、环形图 |
34
- | `IxRadarChart` | 雷达图 |
35
- | `IxGaugeChart` | 仪表盘 |
36
- | `IxLiquidFillChart` | 水波图 |
29
+ | 组件 | 图表 |
30
+ | ------------------- | ------------------------ |
31
+ | `IxBarChart` | 柱状图 |
32
+ | `IxLineChart` | 折线图、面积图 |
33
+ | `IxPieChart` | 饼图、环形图 |
34
+ | `IxRadarChart` | 雷达图 |
35
+ | `IxGaugeChart` | 仪表盘 |
36
+ | `IxMapChart` | 地图(区域、节点、线路) |
37
+ | `IxLiquidFillChart` | 水波图 |
37
38
 
38
39
  此外还导出基础组件 `IxChart`,可直接传入 ECharts 配置。
39
40
 
41
+ 渲染 `IxMapChart` 前通过 `registerMap(name, geoJSON)` 注册几何数据。地图由原生 `geo`、`series`、`visualMap` 组合,不使用 `mode` 属性。可选的 `createMapRegions`、`createMapNodes`、`createMapLines`、`createMapVisualMap` 返回普通 ECharts 配置。几何由应用管理,不打入组件包;`validateMapData({ nodes, routes, regions })` 可提前检查无效坐标、缺失端点和重复标识。
42
+
40
43
  ## 快速上手
41
44
 
42
45
  以下示例使用 Vue 3 的 `<script setup>`,局部导入组件即可使用。容器必须具有有效的宽度和高度。
@@ -61,13 +64,13 @@ const option: LineChartProps = {
61
64
 
62
65
  图表组件会注册自身所需的 ECharts 模块。组件也支持全局注册:Vue 3 使用 `app.use(IxLineChart)`,Vue 2 使用 `Vue.use(IxLineChart)`。
63
66
 
64
- ESM 项目可通过 `@idux/charts/line` 等子入口导入单个图表系列及类型。支持 `bar`、`line`(含面积图)、`pie`、`radar`、`gauge` 和 `liquid-fill`。基础组件、ECharts 主题 token 和共享 Tooltip 工具可从 `@idux/charts/core` 导入,图形主题 token 从各图表子入口导入。总入口会注册全套图表模块。
67
+ ESM 项目可通过 `@idux/charts/line` 等子入口导入单个图表系列及类型。支持 `bar`、`line`(含面积图)、`pie`、`radar`、`gauge`、`liquid-fill` 和 `map`。基础组件、ECharts 主题 token 和共享 Tooltip 工具可从 `@idux/charts/core` 导入,图形主题 token 从各图表子入口导入。总入口会注册全套图表模块。
65
68
 
66
69
  ## 配置与主题
67
70
 
68
- - `useBarOption`、`useLineOption`、`usePieOption` 提供组合式配置;`createRadarOption`、`createGaugeOption`、`createLiquidFillOption` 提供纯配置构建函数。
71
+ - `useBarOption`、`useLineOption`、`usePieOption` 提供组合式配置;`createRadarOption`、`createGaugeOption`、`createLiquidFillOption`、`createMapOption` 提供纯配置构建函数。
69
72
  - `BAR_CHART_TOKEN`、`LINE_CHART_TOKEN`、`PIE_CHART_TOKEN` 通过 Vue `provide` 为对应图表的原生和内置布局提供默认配置。
70
- - 分类 Bar、Line / Area、自动 Pie、Radar、Gauge 和 LiquidFill 支持 `plotTheme`。用 `PLOT_THEME_TOKEN` 提供响应式默认值,直接调用纯配置构建函数时传入所需的 `plotTheme`。
73
+ - 分类 Bar、Line / Area、自动 Pie、Radar、Gauge、LiquidFill 和 Map 支持 `plotTheme`。用 `PLOT_THEME_TOKEN` 提供响应式默认值,直接调用纯配置构建函数时传入所需的 `plotTheme`。
71
74
  - 配置对象按字段合并,数组整体替换。所有组件的模板 ref 均可调用 `getEChartsInstance()`。
72
75
 
73
76
  共享 HTML 提示框样式位于 `@idux/charts/dist/style.css`,在应用入口导入一次即可。
@@ -76,11 +79,13 @@ ESM 项目可通过 `@idux/charts/line` 等子入口导入单个图表系列及
76
79
 
77
80
  在分类末尾追加数据且缩放配置未变时,柱状图、折线图和面积图会保留回看窗口。末端窗口以相同的点数跟随新数据,全范围视图继续显示全部数据。
78
81
 
82
+ 地图在数据刷新、清理系列及主题重建时保留兼容底图的缩放和中心位置。多底图建议提供稳定的 `geo.id`;修改底图、投影或显式视角时采用新配置。生成节点、线路和区域的函数不读取主题注入,需显式传入 `plotTheme`,并在数据或主题变化时重新调用。
83
+
79
84
  图表组件将 `role`、`aria-*`、`tabindex` 和 `data-*` 转发到图表容器。
80
85
 
81
86
  ## 加载状态
82
87
 
83
- 使用 `:loading="pending"` 即可展示内置图标和 `Loading...` 文案,保留图表实例及已有数据。柱状图、折线/面积图、饼图/环形图/玫瑰图、雷达图、仪表盘和水波图自动选择对应图标。`IxChart` 和 `useChart` 使用首个系列判断:饼图或没有系列类型时使用饼图兜底,其余类型使用通用图标。图标和遮罩均适配深浅主题。
88
+ 使用 `:loading="pending"` 即可展示内置图标和 `Loading...` 文案,保留图表实例及已有数据。柱状图、折线/面积图、饼图/环形图/玫瑰图、雷达图、仪表盘、水波图和地图自动选择对应图标。`IxChart` 和 `useChart` 使用首个系列判断:饼图或没有系列类型时使用饼图兜底,其余类型使用通用图标。图标和遮罩均适配深浅主题。
84
89
 
85
90
  传对象可定制文案和外观,如 `:loading="pending && { text: '正在加载...', maskColor: 'transparent' }"`。还支持 `textColor`、`color`(图标着色)、`fontSize`、`fontFamily` 和 `icon`(图片 URL 或 SVG 源码)。加载层为 DOM 内容,不包含在 ECharts 导出的图片中;原生旋转动画的 `showSpinner`、`spinnerRadius` 等选项不再改变图标。
86
91
 
@@ -96,7 +101,7 @@ ESM 项目可通过 `@idux/charts/line` 等子入口导入单个图表系列及
96
101
 
97
102
  在 `tooltip.formatter` 中调用 `useTooltipsFormatter(title, rows, rowsPerColumn?)` 可复用内置 HTML 排版。`getTooltipsColor(color)` 提取纯色色标,`useStripeBarTooltip(unit)` 返回原生条纹柱图的提示框配置。工具从 `@idux/charts` 或 `@idux/charts-core` 导入。
98
103
 
99
- [查看参数与完整组装示例](https://github.com/IDuxFE/idux-charts/blob/main/packages/site/src/components/core/API.tab.md#自定义-tooltip)。
104
+ [查看参数与完整组装示例](https://github.com/IDuxFE/idux-charts/blob/main/packages/site/src/components/core/API.md#自定义-tooltip)。
100
105
 
101
106
  ## TypeScript
102
107
 
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@idux/charts-core";
2
2
  export * from "@idux/charts-plots";
3
3
  // index.ts
4
- var e = "1.5.1";
4
+ var e = "1.6.0";
5
5
  export { e as version };
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.IduxCharts={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),e.version=`1.5.1`;var t=require("@idux/charts-core");Object.keys(t).forEach(function(n){n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=require("@idux/charts-plots");Object.keys(n).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})})});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.IduxCharts={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),e.version=`1.6.0`;var t=require("@idux/charts-core");Object.keys(t).forEach(function(n){n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=require("@idux/charts-plots");Object.keys(n).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})})});
package/dist/map.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from '@idux/charts-plots/dist/map/index.js';
package/dist/map.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@idux/charts-plots/dist/map/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idux/charts",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "A chart component library for Vue 2 & 3",
5
5
  "keywords": [
6
6
  "vue",
@@ -36,8 +36,8 @@
36
36
  "**/*.less"
37
37
  ],
38
38
  "dependencies": {
39
- "@idux/charts-core": "1.5.1",
40
- "@idux/charts-plots": "1.5.1"
39
+ "@idux/charts-core": "1.6.0",
40
+ "@idux/charts-plots": "1.6.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@vue/composition-api": ">=1.6.2",
@@ -92,7 +92,11 @@
92
92
  },
93
93
  "./types.d.ts": "./types.d.ts",
94
94
  "./dist/*": "./dist/*",
95
- "./package.json": "./package.json"
95
+ "./package.json": "./package.json",
96
+ "./map": {
97
+ "types": "./dist/map.d.ts",
98
+ "import": "./dist/map.js"
99
+ }
96
100
  },
97
101
  "typesVersions": {
98
102
  "*": {
@@ -116,6 +120,9 @@
116
120
  ],
117
121
  "liquid-fill": [
118
122
  "dist/liquid-fill.d.ts"
123
+ ],
124
+ "map": [
125
+ "dist/map.d.ts"
119
126
  ]
120
127
  }
121
128
  },
package/types.d.ts CHANGED
@@ -6,6 +6,7 @@ declare module 'vue' {
6
6
  IxRadarChart: (typeof import('@idux/charts-plots'))['IxRadarChart']
7
7
  IxGaugeChart: (typeof import('@idux/charts-plots'))['IxGaugeChart']
8
8
  IxLiquidFillChart: (typeof import('@idux/charts-plots'))['IxLiquidFillChart']
9
+ IxMapChart: (typeof import('@idux/charts-plots'))['IxMapChart']
9
10
  IxPieChart: (typeof import('@idux/charts-plots'))['IxPieChart']
10
11
  }
11
12
  }