@idux/charts 1.2.1 → 1.4.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,31 @@
1
1
  # @idux/charts
2
2
 
3
+ ## 1.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5ce1ad3: Add ESM subpath imports for individual chart families and the base chart utilities, so applications can bundle only the chart modules they use.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [0139b71]
12
+ - Updated dependencies [5ce1ad3]
13
+ - Updated dependencies [6c78c3f]
14
+ - Updated dependencies [2598246]
15
+ - @idux/charts-core@1.4.0
16
+ - @idux/charts-plots@1.4.0
17
+
18
+ ## 1.3.0
19
+
20
+ ### Patch Changes
21
+
22
+ - 98141f5: Keep tooltip rows at 32px and vertically center their labels and values when the host page has no box-sizing reset.
23
+ - Updated dependencies [98141f5]
24
+ - Updated dependencies [98141f5]
25
+ - Updated dependencies [98141f5]
26
+ - @idux/charts-plots@1.3.0
27
+ - @idux/charts-core@1.3.0
28
+
3
29
  ## 1.2.1
4
30
 
5
31
  ### Patch Changes
package/README.md CHANGED
@@ -61,16 +61,28 @@ const option: LineChartProps = {
61
61
 
62
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
63
 
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.
65
+
64
66
  ## Configuration and themes
65
67
 
66
68
  - `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`.
69
+ - 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.
71
+ - Option objects merge by field and arrays replace in full. Every chart component exposes `getEChartsInstance()` on its template ref.
70
72
 
71
73
  Shared HTML tooltip styles live in `@idux/charts/dist/style.css`; import them once in the application entry point.
72
74
 
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.
75
+ - `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 and restore compatible zoom ranges and legend selections. Coordinate `PLOT_THEME_TOKEN` for generated labels and graphics. Dark charts use a dark native loading mask unless explicitly overridden.
76
+
77
+ 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
+
79
+ Chart components forward `role`, `aria-*`, `tabindex`, and `data-*` to the chart container.
80
+
81
+ ## Custom tooltips
82
+
83
+ 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`.
84
+
85
+ [See the signatures and complete formatter example](https://github.com/IDuxFE/idux-charts/blob/main/packages/site/src/components/core/API.tab.md#自定义-tooltip).
74
86
 
75
87
  ## TypeScript
76
88
 
package/README.zh.md CHANGED
@@ -61,16 +61,28 @@ const option: LineChartProps = {
61
61
 
62
62
  图表组件会注册自身所需的 ECharts 模块。组件也支持全局注册:Vue 3 使用 `app.use(IxLineChart)`,Vue 2 使用 `Vue.use(IxLineChart)`。
63
63
 
64
+ ESM 项目可通过 `@idux/charts/line` 等子入口导入单个图表系列及类型。支持 `bar`、`line`(含面积图)、`pie`、`radar`、`gauge` 和 `liquid-fill`。基础组件、ECharts 主题 token 和共享 Tooltip 工具可从 `@idux/charts/core` 导入,图形主题 token 从各图表子入口导入。总入口会注册全套图表模块。
65
+
64
66
  ## 配置与主题
65
67
 
66
68
  - `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 样式配置。
69
+ - `BAR_CHART_TOKEN`、`LINE_CHART_TOKEN`、`PIE_CHART_TOKEN` 通过 Vue `provide` 为对应图表的原生和内置布局提供默认配置。
70
+ - 分类 Bar、Line / Area、自动 Pie、Radar、Gauge 和 LiquidFill 支持 `plotTheme`。用 `PLOT_THEME_TOKEN` 提供响应式默认值,直接调用纯配置构建函数时传入所需的 `plotTheme`。
71
+ - 配置对象按字段合并,数组整体替换。所有组件的模板 ref 均可调用 `getEChartsInstance()`。
70
72
 
71
73
  共享 HTML 提示框样式位于 `@idux/charts/dist/style.css`,在应用入口导入一次即可。
72
74
 
73
- - `CHART_THEME_TOKEN` 为所有图表提供响应式 ECharts 主题名称或对象;显式 `theme` 属性优先,默认回退到 `seer`。主题变化会重建实例,生成的文字与辅助图形需同步设置 `PLOT_THEME_TOKEN`。暗色图表使用深色原生加载遮罩,显式配置仍优先。
75
+ - `CHART_THEME_TOKEN` 为所有图表提供响应式 ECharts 主题名称或对象;显式 `theme` 属性优先,默认回退到 `seer`。主题变化会重建实例,并恢复兼容的缩放范围和图例选择。生成的文字与辅助图形需同步设置 `PLOT_THEME_TOKEN`。暗色图表使用深色原生加载遮罩,显式配置仍优先。
76
+
77
+ 在分类末尾追加数据且缩放配置未变时,柱状图、折线图和面积图会保留回看窗口。末端窗口以相同的点数跟随新数据,全范围视图继续显示全部数据。
78
+
79
+ 图表组件将 `role`、`aria-*`、`tabindex` 和 `data-*` 转发到图表容器。
80
+
81
+ ## 自定义 Tooltip
82
+
83
+ 在 `tooltip.formatter` 中调用 `useTooltipsFormatter(title, rows, rowsPerColumn?)` 可复用内置 HTML 排版。`getTooltipsColor(color)` 提取纯色色标,`useStripeBarTooltip(unit)` 返回原生条纹柱图的提示框配置。工具从 `@idux/charts` 或 `@idux/charts-core` 导入。
84
+
85
+ [查看参数与完整组装示例](https://github.com/IDuxFE/idux-charts/blob/main/packages/site/src/components/core/API.tab.md#自定义-tooltip)。
74
86
 
75
87
  ## TypeScript
76
88
 
package/dist/bar.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from '@idux/charts-plots/dist/bar/index.js';
package/dist/bar.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@idux/charts-plots/dist/bar/index.js";
package/dist/core.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from '@idux/charts-core';
package/dist/core.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@idux/charts-core";
@@ -0,0 +1 @@
1
+ export * from '@idux/charts-plots/dist/gauge/index.js';
package/dist/gauge.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@idux/charts-plots/dist/gauge/index.js";
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.2.1";
4
+ var e = "1.4.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.2.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.4.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/line.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from '@idux/charts-plots/dist/line/index.js';
package/dist/line.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@idux/charts-plots/dist/line/index.js";
@@ -0,0 +1 @@
1
+ export * from '@idux/charts-plots/dist/liquid-fill/index.js';
@@ -0,0 +1 @@
1
+ export * from "@idux/charts-plots/dist/liquid-fill/index.js";
package/dist/pie.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from '@idux/charts-plots/dist/pie/index.js';
package/dist/pie.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@idux/charts-plots/dist/pie/index.js";
@@ -0,0 +1 @@
1
+ export * from '@idux/charts-plots/dist/radar/index.js';
package/dist/radar.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@idux/charts-plots/dist/radar/index.js";
package/dist/style.css CHANGED
@@ -1,2 +1,2 @@
1
- .charts-tooltips{min-width:180px}.charts-tooltips-title{color:inherit;margin-bottom:8px;font-size:12px;font-weight:600;line-height:14px}.charts-tooltips-item{height:32px;color:inherit;background:var(--ix-chart-tooltip-item-background,#fff);box-shadow:var(--ix-chart-tooltip-item-shadow,0px 4px 12px 0px #0237b31a);border-radius:2px;justify-content:space-between;margin-bottom:4px;padding:6px 12px;font-size:12px;line-height:20px;display:flex;position:relative}.charts-tooltips-item:last-child{margin-bottom:0}.charts-tooltips-item-border{width:2px;height:100%;box-shadow:var(--ix-chart-tooltip-marker-shadow,0px 2px 8px 0px #e8f4ff);background:#458fff;border-radius:2px 0 0 2px;position:absolute;top:0;left:0}[data-ix-chart-theme=light]{--ix-chart-tooltip-item-background:#fff;--ix-chart-tooltip-item-shadow:0px 4px 12px 0px #0237b31a;--ix-chart-tooltip-marker-shadow:0px 2px 8px 0px #e8f4ff}[data-ix-chart-theme=dark]{--ix-chart-tooltip-item-background:#1c232e;--ix-chart-tooltip-item-shadow:0px 4px 12px 0px #00000040;--ix-chart-tooltip-marker-shadow:none}
1
+ .charts-tooltips{min-width:180px}.charts-tooltips-title{color:inherit;margin-bottom:8px;font-size:12px;font-weight:600;line-height:14px}.charts-tooltips-columns{max-width:min(var(--ix-chart-tooltip-columns-max-width,100vw), calc(100vw - 48px));gap:8px;max-height:calc(100vh - 64px);display:flex;overflow:auto}.charts-tooltips-column{flex:none;min-width:180px}.charts-tooltips-column .charts-tooltips-item{gap:12px}.charts-tooltips-item{box-sizing:border-box;height:32px;color:inherit;background:var(--ix-chart-tooltip-item-background,#fff);box-shadow:var(--ix-chart-tooltip-item-shadow,0px 4px 12px 0px #0237b31a);border-radius:2px;justify-content:space-between;align-items:center;margin-bottom:4px;padding:6px 12px;font-size:12px;line-height:20px;display:flex;position:relative}.charts-tooltips-item:last-child{margin-bottom:0}.charts-tooltips-item-border{width:2px;height:100%;box-shadow:var(--ix-chart-tooltip-marker-shadow,0px 2px 8px 0px #e8f4ff);background:#458fff;border-radius:2px 0 0 2px;position:absolute;top:0;left:0}[data-ix-chart-theme=light]{--ix-chart-tooltip-item-background:#fff;--ix-chart-tooltip-item-shadow:0px 4px 12px 0px #0237b31a;--ix-chart-tooltip-marker-shadow:0px 2px 8px 0px #e8f4ff}[data-ix-chart-theme=dark]{--ix-chart-tooltip-item-background:#1c232e;--ix-chart-tooltip-item-shadow:0px 4px 12px 0px #00000040;--ix-chart-tooltip-marker-shadow:none}
2
2
  /*$vite$:1*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idux/charts",
3
- "version": "1.2.1",
3
+ "version": "1.4.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-plots": "1.2.1",
40
- "@idux/charts-core": "1.2.1"
39
+ "@idux/charts-core": "1.4.0",
40
+ "@idux/charts-plots": "1.4.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@vue/composition-api": ">=1.6.2",
@@ -53,8 +53,74 @@
53
53
  "devDependencies": {
54
54
  "echarts": "^6.1.0"
55
55
  },
56
+ "exports": {
57
+ ".": {
58
+ "types": "./dist/index.d.ts",
59
+ "import": "./dist/index.js",
60
+ "require": "./dist/index.umd.cjs"
61
+ },
62
+ "./core": {
63
+ "types": "./dist/core.d.ts",
64
+ "import": "./dist/core.js"
65
+ },
66
+ "./bar": {
67
+ "types": "./dist/bar.d.ts",
68
+ "import": "./dist/bar.js"
69
+ },
70
+ "./line": {
71
+ "types": "./dist/line.d.ts",
72
+ "import": "./dist/line.js"
73
+ },
74
+ "./pie": {
75
+ "types": "./dist/pie.d.ts",
76
+ "import": "./dist/pie.js"
77
+ },
78
+ "./radar": {
79
+ "types": "./dist/radar.d.ts",
80
+ "import": "./dist/radar.js"
81
+ },
82
+ "./gauge": {
83
+ "types": "./dist/gauge.d.ts",
84
+ "import": "./dist/gauge.js"
85
+ },
86
+ "./liquid-fill": {
87
+ "types": "./dist/liquid-fill.d.ts",
88
+ "import": "./dist/liquid-fill.js"
89
+ },
90
+ "./types": {
91
+ "types": "./types.d.ts"
92
+ },
93
+ "./types.d.ts": "./types.d.ts",
94
+ "./dist/*": "./dist/*",
95
+ "./package.json": "./package.json"
96
+ },
97
+ "typesVersions": {
98
+ "*": {
99
+ "core": [
100
+ "dist/core.d.ts"
101
+ ],
102
+ "bar": [
103
+ "dist/bar.d.ts"
104
+ ],
105
+ "line": [
106
+ "dist/line.d.ts"
107
+ ],
108
+ "pie": [
109
+ "dist/pie.d.ts"
110
+ ],
111
+ "radar": [
112
+ "dist/radar.d.ts"
113
+ ],
114
+ "gauge": [
115
+ "dist/gauge.d.ts"
116
+ ],
117
+ "liquid-fill": [
118
+ "dist/liquid-fill.d.ts"
119
+ ]
120
+ }
121
+ },
56
122
  "scripts": {
57
123
  "clean": "rimraf dist node_modules",
58
- "build": "rimraf dist && vite build"
124
+ "build": "rimraf dist && vite build && vite build --mode modular"
59
125
  }
60
126
  }