@idux/charts 1.4.0 → 1.5.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 CHANGED
@@ -1,5 +1,59 @@
1
1
  # @idux/charts
2
2
 
3
+ ## 1.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 3326895: Require lodash-es 4.18.1 or later and ECharts 6.1.0 or later on the ECharts 6 compatibility line. Update Vue 2/3 playgrounds and packed-consumer tests to the patched dependency versions while retaining Vue 2.6 and legacy ECharts 5 compatibility coverage.
8
+ - Updated dependencies [3326895]
9
+ - @idux/charts-core@1.5.1
10
+ - @idux/charts-plots@1.5.1
11
+
12
+ ## 1.5.0
13
+
14
+ ### Minor Changes
15
+
16
+ - fba2efa: Add theme-aware loading illustrations to all chart components and `useChart`.
17
+
18
+ - Select illustrations for horizontal/vertical bars, lines/areas, pies/rings/roses, radar, gauge, and liquid fill. Core charts use the pie illustration for pie or unspecified series and a generic illustration for other series.
19
+ - Keep the chart instance, existing data, zoom window, and legend selection while loading. Update illustration colors and masks when the effective light/dark theme changes, and keep the overlay aligned during resize.
20
+ - Export `ChartLoadingOptions` with `text`, `textColor`, `maskColor`, `color`, `fontSize`, `fontFamily`, and `icon` options. Custom icons accept image URLs or SVG source; an undefined icon retains the plot-specific default. The default message is `Loading...`.
21
+ - Announce loading through a status region, mark the chart busy, hide active tooltips, and prevent legend wheel paging through the overlay. Remove the overlay on cleanup and restore container positioning and its prior busy state without overwriting positioning changed by the application.
22
+ - Replace demo placeholders with the shared loading state and document localized messages, custom icons, and reactive `useChart` options.
23
+
24
+ Migration: `loading` now renders a DOM illustration and message instead of the ECharts spinner. Native spinner-specific settings such as `showSpinner` and `spinnerRadius` no longer affect its appearance. Loading content is excluded from ECharts image exports. Use `icon` and the supported appearance options to customize the new state.
25
+
26
+ ### Patch Changes
27
+
28
+ - b5b4884: Provide layout-aware default value labels in category and native bar charts.
29
+
30
+ - Show basic vertical values at `top` and horizontal values at `right`, including `horizontal-above`. Hide labels for grouped bars and multiple side-by-side stack groups.
31
+ - Show one total per category for a single stack, above vertical stacks and at the right of horizontal stacks. Recalculate totals and move the label to the last valid visible segment when legend selection changes. Include valid zero values, ignore missing/non-finite measurements, and omit labels when the entire category is missing.
32
+ - Preserve top-level, series, and data-item label overrides. Exclude non-bar helper series, including stripe overlays, from group detection and stack totals, and leave their labels unchanged.
33
+ - Use opaque `#B2B8C2` for dark `horizontal-above` value labels unless an explicit label color is supplied.
34
+ - Allow direct `useBarOption` consumers to provide an optional third `getChart` callback so stack totals can read live legend selection. Automatic totals read series data; dataset users should supply a custom `label.formatter`.
35
+
36
+ Update the demos, metadata, design/API guidance, and English/Chinese READMEs to describe these defaults, with unit and browser coverage for labels, missing values, legend selection, and loading transitions.
37
+
38
+ - 7333ad7: Refine chart visual defaults and preserve explicit customization.
39
+
40
+ - Use category legend swatches with 1px rounded corners in built-in plots and the Seer theme. Export `createLegendIcon(width, height)` for matching custom legend dimensions; custom native icons and category legend data remain configurable.
41
+ - Give category Bar and Line/Area multi-row legends a 16px row gap while keeping columns aligned and paging controls within the reserved legend region.
42
+ - Make automatic Pie legend spacing depend on the initial rows per column: 20px for up to three rows and 16px for more rows, scaled with the layout height. Preserve explicit `legend.itemGap` without scaling. Use normal weight for summary captions and align paging icons with the value column.
43
+ - Soften bar shadows on every side and adapt the blur to the rendered bar geometry, including thin and short bars. Preserve explicit shadow overrides.
44
+ - Keep native bar hover backgrounds below data series and hover stripes above their bars. `useStripeBarSeries` defaults to bar `z: 2`, places stripes one level above the configured bar `z`, and propagates `zlevel`; explicit axis-pointer layers take precedence.
45
+ - Align horizontal names at the top of right Line/Area Y axes with their tick labels, respecting axis grids, label margins, and explicit name styles. Use `#A1A7B3` / `#808999` for light/dark category zero-state text unless the plot theme overrides it.
46
+ - Reduce Seer light tooltip background opacity to 0.72 and add 4px backdrop blur through the shared HTML tooltip stylesheet. Preserve explicit tooltip backgrounds and existing tooltip classes.
47
+ - Align demo titles and grids, use a shared left axis for same-unit trend comparisons, and update pie sorting examples while preserving missing-category positions and semantic risk ordering. Refresh API guides, English/Chinese package documentation, and demo metadata; retain explicit legacy-style pie comparisons and add regression coverage for the new defaults.
48
+
49
+ Verify legend columns and paging alignment with SVG layout anchors across Chromium, Firefox, and WebKit, avoiding false regressions from glyph overhang and browser screen-transform differences.
50
+
51
+ - Updated dependencies [b5b4884]
52
+ - Updated dependencies [fba2efa]
53
+ - Updated dependencies [7333ad7]
54
+ - @idux/charts-plots@1.5.0
55
+ - @idux/charts-core@1.5.0
56
+
3
57
  ## 1.4.0
4
58
 
5
59
  ### Minor Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-present IDuxFE
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -10,7 +10,7 @@ The unified entry point for iDux Charts. It re-exports all public APIs from `@id
10
10
  npm install @idux/charts echarts lodash-es
11
11
  ```
12
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.
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.1.0`. Vue 2.6 also requires `@vue/composition-api >=1.6.2` and plugin registration before creating the application.
14
14
 
15
15
  ```bash
16
16
  npm install @vue/composition-api
@@ -72,12 +72,26 @@ Use an ESM subpath such as `@idux/charts/line` to import one chart family and it
72
72
 
73
73
  Shared HTML tooltip styles live in `@idux/charts/dist/style.css`; import them once in the application entry point.
74
74
 
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.
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 loading illustration and mask unless explicitly overridden.
76
76
 
77
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
78
 
79
79
  Chart components forward `role`, `aria-*`, `tabindex`, and `data-*` to the chart container.
80
80
 
81
+ ## Loading
82
+
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.
84
+
85
+ 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
+
87
+ ## Visual defaults
88
+
89
+ Built-in Plots use rectangular category swatches with 1px rounded corners; the `seer` theme uses the same swatch. Seer light tooltips use `rgba(251, 253, 255, 0.72)`, and the shared HTML tooltip stylesheet adds a 4px backdrop blur. Customize native legend swatches with `legend.icon`, or supply category legend entries and icons through `legend.data`. Explicit `tooltip.backgroundColor` takes precedence.
90
+
91
+ Automatic multi-row legends for category Bar and Line/Area charts use a 16px row gap. Automatic Pie layouts use a base gap of 20px for up to three initial rows per column and 16px for more rows, scaled to the layout height; explicit `legend.itemGap` is not scaled. Horizontal names at the top of right Y axes in Line/Area charts align with the left edge of the tick labels unless overridden.
92
+
93
+ Bar value labels default to `top` for basic vertical bars and `right` for basic horizontal bars, including `horizontal-above`. Grouped bars hide labels. Stacked bars show one total of visible series per category, at the top for vertical stacks and at the right end for horizontal stacks. Override these defaults with `label` or `series[].label`. In dark `horizontal-above` layouts, value labels use opaque `#B2B8C2`; explicit `label.color` takes precedence.
94
+
81
95
  ## Custom tooltips
82
96
 
83
97
  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`.
package/README.zh.md CHANGED
@@ -10,7 +10,7 @@ iDux Charts 的统一入口,重新导出 `@idux/charts-core` 和 `@idux/charts
10
10
  npm install @idux/charts echarts lodash-es
11
11
  ```
12
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`,并在创建应用前注册插件。
13
+ 支持 Vue 2(含 Vue 2.6)和 Vue 3。在已有 Vue 项目中使用,依赖版本为 Vue `^2.6.0 || ^3.2.5` 和 ECharts `^5.4.3 || ^6.1.0`。Vue 2.6 还需安装 `@vue/composition-api >=1.6.2`,并在创建应用前注册插件。
14
14
 
15
15
  ```bash
16
16
  npm install @vue/composition-api
@@ -72,12 +72,26 @@ ESM 项目可通过 `@idux/charts/line` 等子入口导入单个图表系列及
72
72
 
73
73
  共享 HTML 提示框样式位于 `@idux/charts/dist/style.css`,在应用入口导入一次即可。
74
74
 
75
- - `CHART_THEME_TOKEN` 为所有图表提供响应式 ECharts 主题名称或对象;显式 `theme` 属性优先,默认回退到 `seer`。主题变化会重建实例,并恢复兼容的缩放范围和图例选择。生成的文字与辅助图形需同步设置 `PLOT_THEME_TOKEN`。暗色图表使用深色原生加载遮罩,显式配置仍优先。
75
+ - `CHART_THEME_TOKEN` 为所有图表提供响应式 ECharts 主题名称或对象;显式 `theme` 属性优先,默认回退到 `seer`。主题变化会重建实例,并恢复兼容的缩放范围和图例选择。生成的文字与辅助图形需同步设置 `PLOT_THEME_TOKEN`。暗色图表使用深色加载图标和遮罩,显式配置仍优先。
76
76
 
77
77
  在分类末尾追加数据且缩放配置未变时,柱状图、折线图和面积图会保留回看窗口。末端窗口以相同的点数跟随新数据,全范围视图继续显示全部数据。
78
78
 
79
79
  图表组件将 `role`、`aria-*`、`tabindex` 和 `data-*` 转发到图表容器。
80
80
 
81
+ ## 加载状态
82
+
83
+ 使用 `:loading="pending"` 即可展示内置图标和 `Loading...` 文案,保留图表实例及已有数据。柱状图、折线/面积图、饼图/环形图/玫瑰图、雷达图、仪表盘和水波图自动选择对应图标。`IxChart` 和 `useChart` 使用首个系列判断:饼图或没有系列类型时使用饼图兜底,其余类型使用通用图标。图标和遮罩均适配深浅主题。
84
+
85
+ 传对象可定制文案和外观,如 `:loading="pending && { text: '正在加载...', maskColor: 'transparent' }"`。还支持 `textColor`、`color`(图标着色)、`fontSize`、`fontFamily` 和 `icon`(图片 URL 或 SVG 源码)。加载层为 DOM 内容,不包含在 ECharts 导出的图片中;原生旋转动画的 `showSpinner`、`spinnerRadius` 等选项不再改变图标。
86
+
87
+ ## 视觉默认值
88
+
89
+ 内置 Plot 使用 1px 圆角矩形分类色标,`seer` 主题使用相同色标。`seer` 浅色提示框背景为 `rgba(251, 253, 255, 0.72)`,共享 HTML 提示框样式提供 4px 背景模糊。原生图例可通过 `legend.icon` 自定义色标,分类布局可通过 `legend.data` 指定图例项及图标;显式 `tooltip.backgroundColor` 优先。
90
+
91
+ 分类柱图和折线/面积图的自动多行图例行间距为 16px。自动饼图的默认行间距按初始每列行数选择 20px(不超过 3 行)或 16px,再随布局高度缩放;显式 `legend.itemGap` 不缩放。折线/面积图右侧 Y 轴顶部的水平轴名默认与刻度标签左边缘对齐,显式轴名样式优先。
92
+
93
+ 柱状图的数值标签默认规则:基础竖向图显示在 `top`,基础横向图(含 `horizontal-above`)显示在 `right`,分组图不显示;堆叠图每个分类只显示当前可见系列的总数,竖向位于顶部,横向位于整条柱子的右侧。可通过 `label` 或 `series[].label` 覆盖。暗黑模式的 `horizontal-above` 数值标签使用不透明的 `#B2B8C2`,显式 `label.color` 优先。
94
+
81
95
  ## 自定义 Tooltip
82
96
 
83
97
  在 `tooltip.formatter` 中调用 `useTooltipsFormatter(title, rows, rowsPerColumn?)` 可复用内置 HTML 排版。`getTooltipsColor(color)` 提取纯色色标,`useStripeBarTooltip(unit)` 返回原生条纹柱图的提示框配置。工具从 `@idux/charts` 或 `@idux/charts-core` 导入。
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.4.0";
4
+ var e = "1.5.1";
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.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]}})})});
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]}})})});
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-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}
1
+ .ix-chart-tooltip{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.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.4.0",
3
+ "version": "1.5.1",
4
4
  "description": "A chart component library for Vue 2 & 3",
5
5
  "keywords": [
6
6
  "vue",
@@ -36,13 +36,13 @@
36
36
  "**/*.less"
37
37
  ],
38
38
  "dependencies": {
39
- "@idux/charts-core": "1.4.0",
40
- "@idux/charts-plots": "1.4.0"
39
+ "@idux/charts-core": "1.5.1",
40
+ "@idux/charts-plots": "1.5.1"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@vue/composition-api": ">=1.6.2",
44
- "echarts": "^5.4.3 || ^6.0.0",
45
- "lodash-es": "^4.17.0",
44
+ "echarts": "^5.4.3 || ^6.1.0",
45
+ "lodash-es": "^4.18.1",
46
46
  "vue": "^2.6.0 || ^3.2.5"
47
47
  },
48
48
  "peerDependenciesMeta": {