@idux/charts 1.0.0 → 1.1.1
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 +30 -0
- package/README.md +88 -0
- package/README.zh.md +88 -0
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +3 -3
- package/types.d.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @idux/charts
|
|
2
2
|
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [2e89956]
|
|
8
|
+
- Updated dependencies [879376a]
|
|
9
|
+
- @idux/charts-plots@1.1.1
|
|
10
|
+
- @idux/charts-core@1.2.0
|
|
11
|
+
|
|
12
|
+
## 1.1.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- 1934758: Add responsive built-in Pie layouts with alignment, paged legends and zero/missing-data presentation, plus explicit layout modes and main-series style overrides. Pie calls without the new layout controls retain 1.0.0 rendering and total calculation; opt into the built-in presentation with `layoutMode: 'auto'` or `align`. Existing explicit geometry and native option overrides retain their compatibility path.
|
|
17
|
+
|
|
18
|
+
Expand component guides, demos and packed Vue 2/Vue 3 playground coverage, including cross-version declaration and browser regression tests.
|
|
19
|
+
|
|
20
|
+
- 887b91a: Add Radar, Gauge and LiquidFill components with pure option builders, public prop types and reactive plot theme/typography configuration. Extend core option types for the new series and coordinate systems.
|
|
21
|
+
|
|
22
|
+
Schedule automatic chart resizing on the next animation frame to avoid ResizeObserver delivery loops, and cancel pending resize work when auto-resize is disabled or the chart is disposed.
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- 34ae7b4: Preserve the built-in Pie radius when a wider legend still fits beside the chart. Reserve the standalone chart inset only when the legend is hidden, avoiding unnecessary shrinking with platform-dependent font widths.
|
|
27
|
+
- Updated dependencies [1934758]
|
|
28
|
+
- Updated dependencies [34ae7b4]
|
|
29
|
+
- Updated dependencies [887b91a]
|
|
30
|
+
- @idux/charts-plots@1.1.0
|
|
31
|
+
- @idux/charts-core@1.1.0
|
|
32
|
+
|
|
3
33
|
## 1.0.0
|
|
4
34
|
|
|
5
35
|
### Major Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# @idux/charts
|
|
2
|
+
|
|
3
|
+
English | [简体中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
The unified entry point for iDux Charts. It re-exports all public APIs from `@idux/charts-core` and `@idux/charts-plots`, and provides shared tooltip styles and `version`. This is the usual starting point for applications.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @idux/charts echarts lodash-es
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Supports Vue 2 (including Vue 2.6) and Vue 3. Use in an existing Vue project with peer dependencies Vue `^2.6.0 || ^3.2.5` and ECharts `^5.4.3 || ^6.0.0`. Vue 2.6 also requires `@vue/composition-api >=1.6.2` and plugin registration before creating the application.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @vue/composition-api
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
// Vue 2.6
|
|
21
|
+
import Vue from 'vue'
|
|
22
|
+
import VueCompositionAPI from '@vue/composition-api'
|
|
23
|
+
|
|
24
|
+
Vue.use(VueCompositionAPI)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Chart components
|
|
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 |
|
|
37
|
+
|
|
38
|
+
Also exports the generic `IxChart` component for direct ECharts options.
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
This example uses Vue 3 `<script setup>` with a locally imported component. The container must have a nonzero width and height.
|
|
43
|
+
|
|
44
|
+
```vue
|
|
45
|
+
<script setup lang="ts">
|
|
46
|
+
import { IxLineChart, type LineChartProps } from '@idux/charts'
|
|
47
|
+
import '@idux/charts/dist/style.css'
|
|
48
|
+
|
|
49
|
+
const data = [123, 324, 156, 244, 188]
|
|
50
|
+
const option: LineChartProps = {
|
|
51
|
+
xAxis: { data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'] },
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
<div style="height: 320px">
|
|
57
|
+
<IxLineChart :data="data" v-bind="option" />
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
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
|
+
|
|
64
|
+
## Configuration and themes
|
|
65
|
+
|
|
66
|
+
- `useBarOption`, `useLineOption`, and `usePieOption` provide composable options; `createRadarOption`, `createGaugeOption`, and `createLiquidFillOption` are pure option builders.
|
|
67
|
+
- Use Vue `provide` with `BAR_CHART_TOKEN`, `LINE_CHART_TOKEN`, or `PIE_CHART_TOKEN` for shared chart configuration.
|
|
68
|
+
- Pie automatic layout, Radar, Gauge, and LiquidFill support `plotTheme`. Provide reactive shared defaults with `PLOT_THEME_TOKEN`; pure option builders require an explicit `plotTheme`.
|
|
69
|
+
- All charts support the ECharts `theme`. Bar and Line use ECharts styling options and do not consume `plotTheme`.
|
|
70
|
+
|
|
71
|
+
Shared HTML tooltip styles live in `@idux/charts/dist/style.css`; import them once in the application entry point.
|
|
72
|
+
|
|
73
|
+
- `CHART_THEME_TOKEN` supplies a reactive ECharts theme name/object to all charts. Explicit `theme` props override it; the fallback is `seer`. Theme changes recreate instances; coordinate `PLOT_THEME_TOKEN` for generated labels and graphics. Dark charts use a dark native loading mask unless explicitly overridden.
|
|
74
|
+
|
|
75
|
+
## TypeScript
|
|
76
|
+
|
|
77
|
+
`*ChartProps` types describe chart configuration and allow extension fields. `*ChartPublicProps` expose named public properties while preserving their types and optionality for component type adapters. See the [repository README](https://github.com/IDuxFE/idux-charts/blob/main/README.md#typescript-prop-types) for adapter details.
|
|
78
|
+
|
|
79
|
+
## Documentation
|
|
80
|
+
|
|
81
|
+
- [iDux Charts](https://charts.idux.site)
|
|
82
|
+
- [Configuration guide](https://github.com/IDuxFE/idux-charts/blob/main/packages/site/src/0-guide/GettingStarted.page.md)
|
|
83
|
+
- [Vue 2 / Vue 3 playgrounds](https://github.com/IDuxFE/idux-charts/blob/main/playgrounds/README.md)
|
|
84
|
+
- [Repository and development](https://github.com/IDuxFE/idux-charts/blob/main/README.md)
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
MIT © 2023-present IDuxFE
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# @idux/charts
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 简体中文
|
|
4
|
+
|
|
5
|
+
iDux Charts 的统一入口,重新导出 `@idux/charts-core` 和 `@idux/charts-plots` 的全部公开 API,并提供共享提示框样式及 `version`。应用项目通常从此包开始使用。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @idux/charts echarts lodash-es
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
支持 Vue 2(含 Vue 2.6)和 Vue 3。在已有 Vue 项目中使用,依赖版本为 Vue `^2.6.0 || ^3.2.5` 和 ECharts `^5.4.3 || ^6.0.0`。Vue 2.6 还需安装 `@vue/composition-api >=1.6.2`,并在创建应用前注册插件。
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @vue/composition-api
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
// Vue 2.6
|
|
21
|
+
import Vue from 'vue'
|
|
22
|
+
import VueCompositionAPI from '@vue/composition-api'
|
|
23
|
+
|
|
24
|
+
Vue.use(VueCompositionAPI)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 图表组件
|
|
28
|
+
|
|
29
|
+
| 组件 | 图表 |
|
|
30
|
+
| ------------------- | -------------- |
|
|
31
|
+
| `IxBarChart` | 柱状图 |
|
|
32
|
+
| `IxLineChart` | 折线图、面积图 |
|
|
33
|
+
| `IxPieChart` | 饼图、环形图 |
|
|
34
|
+
| `IxRadarChart` | 雷达图 |
|
|
35
|
+
| `IxGaugeChart` | 仪表盘 |
|
|
36
|
+
| `IxLiquidFillChart` | 水波图 |
|
|
37
|
+
|
|
38
|
+
此外还导出基础组件 `IxChart`,可直接传入 ECharts 配置。
|
|
39
|
+
|
|
40
|
+
## 快速上手
|
|
41
|
+
|
|
42
|
+
以下示例使用 Vue 3 的 `<script setup>`,局部导入组件即可使用。容器必须具有有效的宽度和高度。
|
|
43
|
+
|
|
44
|
+
```vue
|
|
45
|
+
<script setup lang="ts">
|
|
46
|
+
import { IxLineChart, type LineChartProps } from '@idux/charts'
|
|
47
|
+
import '@idux/charts/dist/style.css'
|
|
48
|
+
|
|
49
|
+
const data = [123, 324, 156, 244, 188]
|
|
50
|
+
const option: LineChartProps = {
|
|
51
|
+
xAxis: { data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'] },
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
<div style="height: 320px">
|
|
57
|
+
<IxLineChart :data="data" v-bind="option" />
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
图表组件会注册自身所需的 ECharts 模块。组件也支持全局注册:Vue 3 使用 `app.use(IxLineChart)`,Vue 2 使用 `Vue.use(IxLineChart)`。
|
|
63
|
+
|
|
64
|
+
## 配置与主题
|
|
65
|
+
|
|
66
|
+
- `useBarOption`、`useLineOption`、`usePieOption` 提供组合式配置;`createRadarOption`、`createGaugeOption`、`createLiquidFillOption` 提供纯配置构建函数。
|
|
67
|
+
- `BAR_CHART_TOKEN`、`LINE_CHART_TOKEN`、`PIE_CHART_TOKEN` 可通过 Vue `provide` 设置对应图表的共享配置。
|
|
68
|
+
- Pie 自动布局、Radar、Gauge、LiquidFill 支持 `plotTheme`,可用 `PLOT_THEME_TOKEN` 提供响应式共享默认值;纯配置构建函数需要显式传入 `plotTheme`。
|
|
69
|
+
- 所有图表支持 ECharts 的 `theme`;Bar、Line 不消费 `plotTheme`,继续使用 ECharts 样式配置。
|
|
70
|
+
|
|
71
|
+
共享 HTML 提示框样式位于 `@idux/charts/dist/style.css`,在应用入口导入一次即可。
|
|
72
|
+
|
|
73
|
+
- `CHART_THEME_TOKEN` 为所有图表提供响应式 ECharts 主题名称或对象;显式 `theme` 属性优先,默认回退到 `seer`。主题变化会重建实例,生成的文字与辅助图形需同步设置 `PLOT_THEME_TOKEN`。暗色图表使用深色原生加载遮罩,显式配置仍优先。
|
|
74
|
+
|
|
75
|
+
## TypeScript
|
|
76
|
+
|
|
77
|
+
`*ChartProps` 用于图表配置,允许扩展字段;`*ChartPublicProps` 提供具名公开属性类型,保留属性的类型及可选性,便于编写组件类型适配。具体适配说明见[仓库 README](https://github.com/IDuxFE/idux-charts/blob/main/README.zh.md#typescript-属性类型)。
|
|
78
|
+
|
|
79
|
+
## 文档
|
|
80
|
+
|
|
81
|
+
- [iDux Charts](https://charts.idux.site)
|
|
82
|
+
- [配置指南](https://github.com/IDuxFE/idux-charts/blob/main/packages/site/src/0-guide/GettingStarted.page.md)
|
|
83
|
+
- [Vue 2 / Vue 3 示例项目](https://github.com/IDuxFE/idux-charts/blob/main/playgrounds/README.zh.md)
|
|
84
|
+
- [仓库与开发指南](https://github.com/IDuxFE/idux-charts/blob/main/README.zh.md)
|
|
85
|
+
|
|
86
|
+
## 许可证
|
|
87
|
+
|
|
88
|
+
MIT © 2023-present IDuxFE
|
package/dist/index.js
CHANGED
package/dist/index.umd.cjs
CHANGED
|
@@ -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.
|
|
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.1.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]}})})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idux/charts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "A chart component library for Vue 2 & 3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"**/*.css"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@idux/charts-
|
|
39
|
-
"@idux/charts-
|
|
38
|
+
"@idux/charts-plots": "1.1.1",
|
|
39
|
+
"@idux/charts-core": "1.2.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@vue/composition-api": ">=1.6.2",
|
package/types.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ declare module 'vue' {
|
|
|
3
3
|
IxChart: (typeof import('@idux/charts-core'))['IxChart']
|
|
4
4
|
IxBarChart: (typeof import('@idux/charts-plots'))['IxBarChart']
|
|
5
5
|
IxLineChart: (typeof import('@idux/charts-plots'))['IxLineChart']
|
|
6
|
+
IxRadarChart: (typeof import('@idux/charts-plots'))['IxRadarChart']
|
|
7
|
+
IxGaugeChart: (typeof import('@idux/charts-plots'))['IxGaugeChart']
|
|
8
|
+
IxLiquidFillChart: (typeof import('@idux/charts-plots'))['IxLiquidFillChart']
|
|
6
9
|
IxPieChart: (typeof import('@idux/charts-plots'))['IxPieChart']
|
|
7
10
|
}
|
|
8
11
|
}
|