@univerjs-pro/engine-chart 1.0.0-beta.1 → 1.0.0-beta.2
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/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/chart-builder/chart-types.d.ts +4 -0
- package/lib/types/chart-builder/conversion/chart-model-fields.d.ts +3 -0
- package/lib/types/chart-builder/conversion/chart-type-converter.d.ts +1 -3
- package/lib/types/facade/f-chart-builder-base.d.ts +38 -0
- package/lib/types/facade/f-chart.d.ts +34 -0
- package/lib/types/facade/internal/category-fields.d.ts +3 -0
- package/lib/types/index.d.ts +3 -2
- package/lib/types/models/chart-context/chart-field-selection.d.ts +1 -1
- package/lib/types/models/chart-data/internal/category-series-aggregation.d.ts +1 -2
- package/lib/types/models/chart-data/internal/data-set-category-spans.d.ts +7 -0
- package/lib/types/models/chart-data/internal/multi-level-category-axis.d.ts +10 -0
- package/lib/types/models/chart-render/converter/category-axis-domain.d.ts +6 -0
- package/lib/types/models/chart-render/converter/render-spec-operators/multi-level-category-axis-grid.operator.d.ts +2 -0
- package/lib/types/models/chart-render/converter/render-spec-operators/multi-level-category-axis-layout.d.ts +23 -0
- package/lib/types/models/chart-render/converter/render-spec-operators/multi-level-category-axis-overlay.operator.d.ts +12 -0
- package/lib/types/models/chart-render/echart-render-model.d.ts +0 -3
- package/lib/types/types.d.ts +44 -2
- package/lib/types/util.d.ts +0 -1
- package/lib/types/utils/device-pixel-ratio.d.ts +1 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +7 -7
package/lib/locale/zh-CN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x3ebccf=_0x2321;(function(_0x27b0f4,_0x331ad1){const _0x24cdb2=_0x2321,_0x3b7b17=_0x27b0f4();while(!![]){try{const _0x51755a=-parseInt(_0x24cdb2(0x176))/0x1+parseInt(_0x24cdb2(0x16a))/0x2*(-parseInt(_0x24cdb2(0x161))/0x3)+parseInt(_0x24cdb2(0x16e))/0x4*(parseInt(_0x24cdb2(0x177))/0x5)+parseInt(_0x24cdb2(0x16d))/0x6*(-parseInt(_0x24cdb2(0x17b))/0x7)+parseInt(_0x24cdb2(0x171))/0x8*(-parseInt(_0x24cdb2(0x168))/0x9)+-parseInt(_0x24cdb2(0x175))/0xa*(parseInt(_0x24cdb2(0x178))/0xb)+-parseInt(_0x24cdb2(0x17e))/0xc*(-parseInt(_0x24cdb2(0x166))/0xd);if(_0x51755a===_0x331ad1)break;else _0x3b7b17['push'](_0x3b7b17['shift']());}catch(_0x3f9b9b){_0x3b7b17['push'](_0x3b7b17['shift']());}}}(_0x551e,0xebb24));const e={'engine-chart':{'seriesDefaultName':_0x3ebccf(0x174),'categoryDefaultName':_0x3ebccf(0x164),'blank':'(空)','boxplotMin':_0x3ebccf(0x163),'boxplotQ1':_0x3ebccf(0x165),'boxplotMedian':_0x3ebccf(0x16f),'boxplotQ3':_0x3ebccf(0x173),'boxplotMax':_0x3ebccf(0x15c),'bubbleEmptyTips':_0x3ebccf(0x17d),'cloudWord':'词语','cloudFrequency':'频率','msgEmptyTips':_0x3ebccf(0x15e),'msgSankeyCircularTips':'桑基图不能包含循环数据','paretoLineName':_0x3ebccf(0x170),'pieAggregateOther':'其他','pieAggregateMembers':_0x3ebccf(0x17c),'relationEmptyTips':_0x3ebccf(0x17a),'waterfallPositive':'正值','waterfallNegative':'负值','waterfallSubtotal':'小计','candlestickSeries':_0x3ebccf(0x162),'candlestickCategory':'类别','candlestickOpen':'开盘','candlestickHigh':'最高','candlestickLow':'最低','candlestickClose':'收盘','histogramFrequency':'频数','treemapEmptyTips':_0x3ebccf(0x167),'treemapOwnValue':_0x3ebccf(0x172),'treemapChildren':'子项','sunburstEmptyTips':_0x3ebccf(0x16c),'sunburstOwnValue':_0x3ebccf(0x172),'sunburstChildren':'子项','gaugeEmptyTips':'仪表图至少需要一个有限数值。','gaugeInvalidMapping':'仪表图需要一个标签字段且只能有一个数值字段。','gaugeInvalidConfig':_0x3ebccf(0x15f),'chordEmptyTips':_0x3ebccf(0x160),'chordInvalidMapping':_0x3ebccf(0x15d),'chordInvalidConfig':_0x3ebccf(0x16b),'chordCount':_0x3ebccf(0x169),'chordAssociatedValue':_0x3ebccf(0x179)}};export{e as default};function _0x2321(_0x3184b3,_0x2f094d){_0x3184b3=_0x3184b3-0x15c;const _0x551ef7=_0x551e();let _0x232169=_0x551ef7[_0x3184b3];return _0x232169;}function _0x551e(){const _0xd9aaa8=['312815tktcum','607684SQzIBl','关联值','关系图数据源为额外添加类型列在第二列的共词矩阵','29407MbCNLA','成员数','气泡图至少需要2列,X轴、Y轴。','708WDBpXB','最大值','弦图需要不同的来源字段和目标字段,并可选一个与二者不同的数值字段。','请先添加系列开始数据可视化','仪表图配置无效,请检查刻度范围、分段区间、比例和尺寸。','弦图至少需要两个不同节点之间的一条正权重关系。','1377zQnsMu','OHLC\x20系列','最小值','类别\x20{0}','第一四分位数','1036035mVXzsW','矩形树图至少需要一个层级字段和一个数值字段。','9BfmoBw','关系计数','3284ELHdtB','弦图配置无效,请检查角度、半径、不透明度和尺寸。','旭日图至少需要一个层级字段和一个数值字段。','1074HZewwm','12MPgaBn','中位数','累积占比','2822936jwcqsT','自身值','第三四分位数','系列\x20{0}','180xsEwlT','1071366MLaoHA'];_0x551e=function(){return _0xd9aaa8;};return _0x551e();}
|
package/lib/locale/zh-HK.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const _0x37b27d=_0x31f3;function _0x31f3(_0x149c85,_0x2df99e){_0x149c85=_0x149c85-0xf7;const _0xe808f=_0xe808();let _0x31f376=_0xe808f[_0x149c85];return _0x31f376;}(function(_0x1c0f97,_0x4a51e7){const _0x15e7e1=_0x31f3,_0x4deac9=_0x1c0f97();while(!![]){try{const _0x591ef1=-parseInt(_0x15e7e1(0x10d))/0x1*(-parseInt(_0x15e7e1(0x101))/0x2)+-parseInt(_0x15e7e1(0x114))/0x3+-parseInt(_0x15e7e1(0xf7))/0x4+-parseInt(_0x15e7e1(0xf9))/0x5+-parseInt(_0x15e7e1(0x107))/0x6+parseInt(_0x15e7e1(0xfc))/0x7*(parseInt(_0x15e7e1(0x109))/0x8)+parseInt(_0x15e7e1(0x102))/0x9;if(_0x591ef1===_0x4a51e7)break;else _0x4deac9['push'](_0x4deac9['shift']());}catch(_0x3f017a){_0x4deac9['push'](_0x4deac9['shift']());}}}(_0xe808,0xbad8e));const e={'engine-chart':{'seriesDefaultName':_0x37b27d(0x115),'categoryDefaultName':_0x37b27d(0xff),'blank':'(空)','boxplotMin':_0x37b27d(0x100),'boxplotQ1':'第一四分位數','boxplotMedian':_0x37b27d(0x10f),'boxplotQ3':_0x37b27d(0x108),'boxplotMax':_0x37b27d(0x116),'bubbleEmptyTips':_0x37b27d(0xfe),'cloudWord':'詞','cloudFrequency':'頻率','msgEmptyTips':_0x37b27d(0x112),'msgSankeyCircularTips':_0x37b27d(0x106),'paretoLineName':_0x37b27d(0x117),'pieAggregateOther':'其他','pieAggregateMembers':'成員','relationEmptyTips':'關係圖資料來源為額外新增類型欄在第二欄的共詞矩陣','waterfallPositive':'正值','waterfallNegative':'負值','waterfallSubtotal':'小計','candlestickSeries':_0x37b27d(0x10c),'candlestickCategory':'類別','candlestickOpen':_0x37b27d(0xfd),'candlestickHigh':_0x37b27d(0xf8),'candlestickLow':_0x37b27d(0x110),'candlestickClose':_0x37b27d(0x10e),'histogramFrequency':'頻數','treemapEmptyTips':_0x37b27d(0x104),'treemapOwnValue':_0x37b27d(0xfb),'treemapChildren':'子項','sunburstEmptyTips':_0x37b27d(0x113),'sunburstOwnValue':_0x37b27d(0xfb),'sunburstChildren':'子項','gaugeEmptyTips':_0x37b27d(0xfa),'gaugeInvalidMapping':_0x37b27d(0x10a),'gaugeInvalidConfig':_0x37b27d(0x103),'chordEmptyTips':_0x37b27d(0x111),'chordInvalidMapping':'弦圖需要不同的來源與目標欄位,並可選擇一個與兩者不同的數值欄位。','chordInvalidConfig':_0x37b27d(0x10b),'chordCount':'關係數','chordAssociatedValue':_0x37b27d(0x105)}};function _0xe808(){const _0x52b1a3=['最小值','22KtYSPB','34840890MHNvUR','儀表圖設定無效,請檢查刻度範圍、分段區間、比例和尺寸。','矩形樹圖至少需要一個階層欄位和一個數值欄位。','關聯值','桑基圖不能包含循環數據','8915760MfCDxZ','第三四分位數','24IbEWyA','儀表圖需要一個標籤欄位,而且只能有一個數值欄位。','弦圖設定無效,請檢查角度、半徑、不透明度和尺寸。','OHLC\x20數列','34949RwSsvs','收盤價','中位數','最低價','弦圖至少需要兩個不同節點之間的一條正權重關係。','請先添加系列開始數據可視化','旭日圖至少需要一個階層欄位和一個數值欄位。','2309517oWhqih','系列\x20{0}','最大值','累積占比','4863152dprofu','最高價','6683225CqtRPe','儀表圖至少需要一個有限數值。','自身值','3075121msKGZE','開盤價','氣泡圖至少需要2欄,X軸、Y軸。','類別\x20{0}'];_0xe808=function(){return _0x52b1a3;};return _0xe808();}export{e as default};
|
package/lib/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x39b5(_0x49a4ea,_0x36e836){_0x49a4ea=_0x49a4ea-0xf5;const _0x6a15c4=_0x6a15();let _0x39b549=_0x6a15c4[_0x49a4ea];return _0x39b549;}function _0x6a15(){const _0x257d49=['153SjLiRF','請先添加系列開始數據可視化','(空)','OHLC\x20數列','2144110sCNoeA','關係數','開盤價','最大值','4362700jOFHbm','973705vMxLov','關係圖資料來源為額外新增類型欄在第二欄的共詞矩陣','儀表圖設定無效,請檢查刻度範圍、分段區間、比例和尺寸。','28889060udJlCk','7qzaZAU','旭日圖至少需要一個階層欄位和一個數值欄位。','矩形樹圖至少需要一個階層欄位和一個數值欄位。','儀表圖需要一個標籤欄位,而且只能有一個數值欄位。','26031opBzpb','累積占比','最低價','最小值','弦圖至少需要兩個不同節點之間的一條正權重關係。','類別\x20{0}','503988pOeYjN','弦圖需要不同的來源與目標欄位,並可選擇一個與兩者不同的數值欄位。','350288Mhpmzf','第一四分位數','儀表圖至少需要一個有限數值。','26GMuMCd','桑基圖不能包含循環數據','最高價','收盤價'];_0x6a15=function(){return _0x257d49;};return _0x6a15();}const _0x23a34a=_0x39b5;(function(_0x21cfd8,_0x1d7c0e){const _0x2f1e5d=_0x39b5,_0x1347b7=_0x21cfd8();while(!![]){try{const _0x2ad856=parseInt(_0x2f1e5d(0x109))/0x1+parseInt(_0x2f1e5d(0xfc))/0x2*(parseInt(_0x2f1e5d(0x111))/0x3)+parseInt(_0x2f1e5d(0x108))/0x4+parseInt(_0x2f1e5d(0x104))/0x5+parseInt(_0x2f1e5d(0xf7))/0x6*(parseInt(_0x2f1e5d(0x10d))/0x7)+-parseInt(_0x2f1e5d(0xf9))/0x8*(-parseInt(_0x2f1e5d(0x100))/0x9)+-parseInt(_0x2f1e5d(0x10c))/0xa;if(_0x2ad856===_0x1d7c0e)break;else _0x1347b7['push'](_0x1347b7['shift']());}catch(_0x524cdf){_0x1347b7['push'](_0x1347b7['shift']());}}}(_0x6a15,0x852b1));const e={'engine-chart':{'seriesDefaultName':'系列\x20{0}','categoryDefaultName':_0x23a34a(0xf6),'blank':_0x23a34a(0x102),'boxplotMin':_0x23a34a(0x114),'boxplotQ1':_0x23a34a(0xfa),'boxplotMedian':'中位數','boxplotQ3':'第三四分位數','boxplotMax':_0x23a34a(0x107),'bubbleEmptyTips':'氣泡圖至少需要2欄,X軸、Y軸。','cloudWord':'詞','cloudFrequency':'頻率','msgEmptyTips':_0x23a34a(0x101),'msgSankeyCircularTips':_0x23a34a(0xfd),'paretoLineName':_0x23a34a(0x112),'pieAggregateOther':'其他','pieAggregateMembers':'成員','relationEmptyTips':_0x23a34a(0x10a),'waterfallPositive':'正值','waterfallNegative':'負值','waterfallSubtotal':'小計','candlestickSeries':_0x23a34a(0x103),'candlestickCategory':'類別','candlestickOpen':_0x23a34a(0x106),'candlestickHigh':_0x23a34a(0xfe),'candlestickLow':_0x23a34a(0x113),'candlestickClose':_0x23a34a(0xff),'histogramFrequency':'頻數','treemapEmptyTips':_0x23a34a(0x10f),'treemapOwnValue':'自身值','treemapChildren':'子項','sunburstEmptyTips':_0x23a34a(0x10e),'sunburstOwnValue':'自身值','sunburstChildren':'子項','gaugeEmptyTips':_0x23a34a(0xfb),'gaugeInvalidMapping':_0x23a34a(0x110),'gaugeInvalidConfig':_0x23a34a(0x10b),'chordEmptyTips':_0x23a34a(0xf5),'chordInvalidMapping':_0x23a34a(0xf8),'chordInvalidConfig':'弦圖設定無效,請檢查角度、半徑、不透明度和尺寸。','chordCount':_0x23a34a(0x105),'chordAssociatedValue':'關聯值'}};export{e as default};
|
|
@@ -299,6 +299,10 @@ export interface IChartEdgeMappingSpec {
|
|
|
299
299
|
}
|
|
300
300
|
export interface IChartMappingSpec {
|
|
301
301
|
categoryIndex?: number;
|
|
302
|
+
/** Ordered category fields used by a multi-level category axis. */
|
|
303
|
+
categoryIndexes?: number[];
|
|
304
|
+
/** Whether the selected category fields render as one root-to-leaf multi-level category axis. */
|
|
305
|
+
multiLevelCategoryAxis?: boolean;
|
|
302
306
|
/** Ordered root-to-leaf hierarchy fields for hierarchy charts. */
|
|
303
307
|
hierarchyIndexes?: number[];
|
|
304
308
|
seriesIndexes?: number[];
|
|
@@ -40,6 +40,7 @@ export declare enum ChartStyleField {
|
|
|
40
40
|
export declare enum ChartContextField {
|
|
41
41
|
CategoryIndexes = "categoryIndexes",
|
|
42
42
|
Histogram = "histogram",
|
|
43
|
+
MultiLevelCategoryAxis = "multiLevelCategoryAxis",
|
|
43
44
|
SeriesIndexes = "seriesIndexes",
|
|
44
45
|
UseDateAxis = "useDateAxis"
|
|
45
46
|
}
|
|
@@ -47,9 +48,11 @@ export declare enum ChartMappingField {
|
|
|
47
48
|
Bubble = "bubble",
|
|
48
49
|
Candlestick = "candlestick",
|
|
49
50
|
CategoryIndex = "categoryIndex",
|
|
51
|
+
CategoryIndexes = "categoryIndexes",
|
|
50
52
|
Chord = "chord",
|
|
51
53
|
Edge = "edge",
|
|
52
54
|
HierarchyIndexes = "hierarchyIndexes",
|
|
55
|
+
MultiLevelCategoryAxis = "multiLevelCategoryAxis",
|
|
53
56
|
Scatter = "scatter",
|
|
54
57
|
SeriesIndexes = "seriesIndexes",
|
|
55
58
|
UseDateAxis = "useDateAxis"
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { ChartStyle } from '../../types';
|
|
2
1
|
import { ChartTypeBits, StackType } from '../../enum';
|
|
3
2
|
import { ChartTypeString } from '../chart-types';
|
|
4
3
|
export declare function chartTypeToBits(type: ChartTypeString): ChartTypeBits;
|
|
5
|
-
export declare function chartBitsToType(bits: ChartTypeBits
|
|
4
|
+
export declare function chartBitsToType(bits: ChartTypeBits): ChartTypeString;
|
|
6
5
|
export declare function getChartStackType(chartType: ChartTypeBits | undefined): StackType | undefined;
|
|
7
6
|
export declare function withChartStackType(chartType: ChartTypeBits, stackType: StackType | ''): ChartTypeBits;
|
|
8
|
-
export declare function getInitialChartStyle(type: ChartTypeString): ChartStyle | undefined;
|
|
@@ -425,6 +425,44 @@ export declare class FChartBuilderBase<TSource = never[], TDataSource = TSource,
|
|
|
425
425
|
* ```
|
|
426
426
|
*/
|
|
427
427
|
setCategoryField(index: number): this;
|
|
428
|
+
/**
|
|
429
|
+
* Sets the ordered category fields used by a multi-level category axis.
|
|
430
|
+
*
|
|
431
|
+
* This method executes synchronously.
|
|
432
|
+
*
|
|
433
|
+
* @param indexes The zero-based field indexes in root-to-leaf order.
|
|
434
|
+
* @returns This builder for chaining.
|
|
435
|
+
* @example
|
|
436
|
+
* ```ts
|
|
437
|
+
* builder.setCategoryFields([0, 1, 2]);
|
|
438
|
+
* ```
|
|
439
|
+
*/
|
|
440
|
+
setCategoryFields(indexes: readonly number[]): this;
|
|
441
|
+
/**
|
|
442
|
+
* Clears the ordered category field configuration.
|
|
443
|
+
*
|
|
444
|
+
* This method executes synchronously.
|
|
445
|
+
*
|
|
446
|
+
* @returns This builder for chaining.
|
|
447
|
+
* @example
|
|
448
|
+
* ```ts
|
|
449
|
+
* builder.clearCategoryFields();
|
|
450
|
+
* ```
|
|
451
|
+
*/
|
|
452
|
+
clearCategoryFields(): this;
|
|
453
|
+
/**
|
|
454
|
+
* Enables or disables the multi-level category axis for the selected category fields.
|
|
455
|
+
*
|
|
456
|
+
* This method executes synchronously and does not replace the selected category fields.
|
|
457
|
+
*
|
|
458
|
+
* @param enabled Whether to render the selected category fields as one multi-level axis.
|
|
459
|
+
* @returns This builder for chaining.
|
|
460
|
+
* @example
|
|
461
|
+
* ```ts
|
|
462
|
+
* builder.setMultiLevelCategoryAxis(true);
|
|
463
|
+
* ```
|
|
464
|
+
*/
|
|
465
|
+
setMultiLevelCategoryAxis(enabled: boolean): this;
|
|
428
466
|
/**
|
|
429
467
|
* Clears the category field configuration and returns this builder for chaining.
|
|
430
468
|
*
|
|
@@ -489,6 +489,40 @@ export declare class FChart<TSource, TDataSource = TSource, TInfo extends IChart
|
|
|
489
489
|
* ```
|
|
490
490
|
*/
|
|
491
491
|
setCategoryField(index: number): this;
|
|
492
|
+
/**
|
|
493
|
+
* Sets the ordered category fields used by this live Chart's multi-level category axis.
|
|
494
|
+
* @param {readonly number[]} indexes The zero-based source field indexes in root-to-leaf order.
|
|
495
|
+
* @returns {this} This live Chart facade for chaining.
|
|
496
|
+
* @example
|
|
497
|
+
* ```ts
|
|
498
|
+
* const fChart = fWorksheet.getCharts()[0];
|
|
499
|
+
* fChart.setCategoryFields([0, 1, 2]);
|
|
500
|
+
* ```
|
|
501
|
+
*/
|
|
502
|
+
setCategoryFields(indexes: readonly number[]): this;
|
|
503
|
+
/**
|
|
504
|
+
* Clears the ordered category fields used by this live Chart.
|
|
505
|
+
* @returns {this} This live Chart facade for chaining.
|
|
506
|
+
* @example
|
|
507
|
+
* ```ts
|
|
508
|
+
* const fChart = fWorksheet.getCharts()[0];
|
|
509
|
+
* fChart.clearCategoryFields();
|
|
510
|
+
* ```
|
|
511
|
+
*/
|
|
512
|
+
clearCategoryFields(): this;
|
|
513
|
+
/**
|
|
514
|
+
* Enables or disables the multi-level category axis for this live Chart's selected category fields.
|
|
515
|
+
* @param {boolean} enabled Whether to render the selected category fields as one multi-level axis.
|
|
516
|
+
* @returns {this} This live Chart facade for chaining.
|
|
517
|
+
* @example
|
|
518
|
+
* ```ts
|
|
519
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
520
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
521
|
+
* const fChart = fWorksheet.getCharts()[0];
|
|
522
|
+
* fChart.setMultiLevelCategoryAxis(true);
|
|
523
|
+
* ```
|
|
524
|
+
*/
|
|
525
|
+
setMultiLevelCategoryAxis(enabled: boolean): this;
|
|
492
526
|
/**
|
|
493
527
|
* Clears the category field mapping of this live Chart.
|
|
494
528
|
* @returns {this} This live Chart facade for chaining.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -127,10 +127,11 @@ export { toChartDataItem } from './source/chart-data-item';
|
|
|
127
127
|
export { ChartDataSource } from './source/chart-source';
|
|
128
128
|
export { StaticChartSource } from './source/static-chart-source';
|
|
129
129
|
export type { IChartCandlestickMappingSpec, IChartCandlestickSpec, IChartCandlestickStateStyleSpec, IChartChordEmphasisSpec, IChartChordLabelSpec, IChartChordLayoutSpec, IChartChordMappingSpec, IChartChordNodeStyleSpec, IChartChordRibbonStyleSpec, IChartChordSpec, IChartGaugeAnchorSpec, IChartGaugeAnglesSpec, IChartGaugeAxisLabelSpec, IChartGaugeAxisLineSpec, IChartGaugeAxisTickSpec, IChartGaugeDetailSpec, IChartGaugeFontSpec, IChartGaugePointerSpec, IChartGaugeProgressSpec, IChartGaugeRangeSpec, IChartGaugeScaleSpec, IChartGaugeSpec, IChartGaugeSplitLineSpec, IChartGaugeTitleSpec, IChartHistogramBinningSpec, IChartHistogramDataSpec, IChartHistogramSpec, IChartHistogramStyleSpec, IChartSunburstCenterLabelSpec, IChartSunburstLabelSpec, IChartSunburstSpec, IChartTreemapLabelSpec, IChartTreemapSpec, IChartValueLabelSpec, } from './types';
|
|
130
|
-
export { ChartHostRenderMode, ChartImageSourceType } from './types';
|
|
131
|
-
export type { ChartDataSourceValues, ChartDirection, ChartElementEventHandler, ChartElementEventType, ChartElementKind, ChartImageSource, ChartRenderRuntimeContext, ChartRuntimeStyle, ChartStyle, DeepNullish, DeepPartial, DimensionDefinitionLoose, IAllSeriesStyle, IAxisOptions, IBarStyle, IChartBubbleStyle, IChartCandlestickData, IChartCandlestickPoint, IChartChordData, IChartChordLink, IChartChordNode, IChartConfig, IChartContext, IChartData, IChartDataCategory, IChartDataSeries, IChartDataSource, IChartElementBounds, IChartElementEvent, IChartElementHit, IChartElementOverlay, IChartGaugeData, IChartGaugeItem, IChartHistogramBin, IChartHistogramData, IChartHost, IChartHostBorderStyle, IChartHostLease, IChartHostRect, IChartHostStyle, IChartInstance, IChartPlotArea, IChartRenderAsImageOptions, IChartRenderInput, IChartRenderInstance, IChartRenderInstanceCreateContext, IChartRenderInstanceSpecInput, IChartRenderInstanceStyleInput, IChartRenderModel, IChartRenderModelImageExportInput, IChartRenderModelImageExportOptions, IChartRenderModelImageExportResult, IChartSnapshot, IChartStyle, IChartSunburstData, IChartSunburstNode, IChartTreemapData, IChartTreemapNode, IDimensionDefinition, IDomChartHost, IGridLineStyle, IImageChartHost, ILabelStyle, ILegendStyle, IPieLabelStyle, IPointStyle, IRelationForceOptions, IRuntimeAxis, ISeriesLabelStyle, ISeriesStyle, ITrendLine, IUniverDataSet, OptionDataValue, RightYAxisOptions, } from './types';
|
|
130
|
+
export { ChartHostRenderMode, ChartImageExportFormat, ChartImageSourceType } from './types';
|
|
131
|
+
export type { ChartDataSourceValues, ChartDirection, ChartElementEventHandler, ChartElementEventType, ChartElementKind, ChartImageSource, ChartRenderRuntimeContext, ChartRuntimeStyle, ChartStyle, DeepNullish, DeepPartial, DimensionDefinitionLoose, IAllSeriesStyle, IAxisOptions, IBarStyle, IChartBubbleStyle, IChartCandlestickData, IChartCandlestickPoint, IChartChordData, IChartChordLink, IChartChordNode, IChartConfig, IChartContext, IChartData, IChartDataCategory, IChartDataCategoryLevel, IChartDataCategorySegment, IChartDataSeries, IChartDataSource, IChartElementBounds, IChartElementEvent, IChartElementHit, IChartElementOverlay, IChartGaugeData, IChartGaugeItem, IChartHistogramBin, IChartHistogramData, IChartHost, IChartHostBorderStyle, IChartHostLease, IChartHostRect, IChartHostStyle, IChartInstance, IChartPlotArea, IChartRenderAsImageOptions, IChartRenderInput, IChartRenderInstance, IChartRenderInstanceCreateContext, IChartRenderInstanceSpecInput, IChartRenderInstanceStyleInput, IChartRenderModel, IChartRenderModelImageExportInput, IChartRenderModelImageExportOptions, IChartRenderModelImageExportResult, IChartSnapshot, IChartStyle, IChartSunburstData, IChartSunburstNode, IChartTreemapData, IChartTreemapNode, IDimensionDefinition, IDomChartHost, IGridLineStyle, IImageChartHost, ILabelStyle, ILegendStyle, IPieLabelStyle, IPointStyle, IRelationForceOptions, IRuntimeAxis, ISeriesLabelStyle, ISeriesStyle, ITrendLine, IUniverDataSet, IUniverDataSetCategorySpan, OptionDataValue, RightYAxisOptions, } from './types';
|
|
132
132
|
export { chartBitsUtils, chartTypeCanUseTrendLine, mergeChartConfig, } from './util';
|
|
133
133
|
export { omitUndefinedFields, } from './utils/compact';
|
|
134
|
+
export { DEFAULT_CHART_DEVICE_PIXEL_RATIO } from './utils/device-pixel-ratio';
|
|
134
135
|
export { echarts } from './utils/echarts';
|
|
135
136
|
export { WordCloudMaskImageOptions, WordCloudResourceConfig } from './word-cloud-resource/word-cloud-resource-config';
|
|
136
137
|
export { WORD_CLOUD_DEFAULT_OPTION, WORD_CLOUD_SERIES_TYPE } from './wordcloud-chart/adapters/echarts/echarts-options';
|
|
@@ -12,7 +12,7 @@ export declare function countChartFieldTypes(field: Array<OptionDataValue | unde
|
|
|
12
12
|
strings: number;
|
|
13
13
|
total: number;
|
|
14
14
|
};
|
|
15
|
-
export declare function classifyChartFields(dataSet: Pick<IUniverDataSet, 'source' | 'sourceType'>): IChartFieldSelection;
|
|
15
|
+
export declare function classifyChartFields(dataSet: Pick<IUniverDataSet, 'source' | 'sourceType' | 'categorySpans'>): IChartFieldSelection;
|
|
16
16
|
export declare function resolveChartFieldSelectionContext(dataSet: IUniverDataSet, context: IChartContext, initializeSelection?: boolean): IChartContext;
|
|
17
17
|
/** The single compatibility boundary for the historical scalar snapshot field. */
|
|
18
18
|
export declare function normalizeChartSnapshotContext(context: IChartSnapshotContext): IChartContext;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { IChartDataAggregation } from '../../../chart-data-aggregation';
|
|
2
2
|
import type { IUniverDataSet } from '../../../types';
|
|
3
|
-
import type { IChartFieldConsumption } from '../chart-field-consumption';
|
|
4
3
|
/**
|
|
5
4
|
* Projects category/value rows while preserving source-field indexes.
|
|
6
5
|
*
|
|
7
6
|
* This runs after field-consumption validation, so callers continue to own chart-specific
|
|
8
7
|
* mapping rules and this module owns only ordinary category/value aggregation and ranking.
|
|
9
8
|
*/
|
|
10
|
-
export declare function projectCategorySeriesData(dataSet: IUniverDataSet,
|
|
9
|
+
export declare function projectCategorySeriesData(dataSet: IUniverDataSet, categoryIndexes: readonly number[], seriesIndexes: readonly number[], dataAggregation: IChartDataAggregation | undefined): IUniverDataSet;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IUniverDataSet, IUniverDataSetCategorySpan } from '../../../types';
|
|
2
|
+
export interface IDataSetCategorySpanLookup {
|
|
3
|
+
get(fieldIndex: number, itemIndex: number): IUniverDataSetCategorySpan | undefined;
|
|
4
|
+
}
|
|
5
|
+
export declare function createDataSetCategorySpanLookup(dataSet: IUniverDataSet, fieldIndexes: readonly number[], itemCount: number): IDataSetCategorySpanLookup;
|
|
6
|
+
export declare function getDataSetCategorySpan(dataSet: IUniverDataSet, fieldIndex: number, itemIndex: number): IUniverDataSetCategorySpan | undefined;
|
|
7
|
+
export declare function getEffectiveCategoryLabel(dataSet: IUniverDataSet, fieldIndex: number, itemIndex: number, categorySpanLookup?: IDataSetCategorySpanLookup): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IChartDataCategory, IUniverDataSet } from '../../../types';
|
|
2
|
+
import type { IChartLocaleTexts } from '../../common/chart-locale-texts';
|
|
3
|
+
interface INormalizeMultiLevelCategoryAxisInput {
|
|
4
|
+
dataSet: IUniverDataSet;
|
|
5
|
+
categoryIndexes: number[];
|
|
6
|
+
headers?: string[];
|
|
7
|
+
localeTexts: IChartLocaleTexts;
|
|
8
|
+
}
|
|
9
|
+
export declare function normalizeMultiLevelCategoryAxis(input: INormalizeMultiLevelCategoryAxisInput): IChartDataCategory | undefined;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IChartDataCategory } from '../../../types';
|
|
2
|
+
export interface ICategoryAxisDomain {
|
|
3
|
+
data: Array<string | number>;
|
|
4
|
+
axisLabelFormatter?: (value: unknown) => string;
|
|
5
|
+
}
|
|
6
|
+
export declare function resolveCategoryAxisDomain(category?: IChartDataCategory): ICategoryAxisDomain | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ChartStyle, EChartSpec, IChartConfig } from '../../../../types';
|
|
2
|
+
export type MultiLevelCategoryAxisSide = 'bottom' | 'left' | 'right';
|
|
3
|
+
export interface IMultiLevelCategoryAxis {
|
|
4
|
+
type?: string;
|
|
5
|
+
position?: string;
|
|
6
|
+
axisLabel?: {
|
|
7
|
+
color?: unknown;
|
|
8
|
+
show?: boolean;
|
|
9
|
+
};
|
|
10
|
+
splitLine?: {
|
|
11
|
+
lineStyle?: {
|
|
12
|
+
color?: unknown;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface IMultiLevelCategoryAxisLayout {
|
|
17
|
+
axis: IMultiLevelCategoryAxis;
|
|
18
|
+
levelInnerDepths: number[];
|
|
19
|
+
levelSizes: number[];
|
|
20
|
+
side: MultiLevelCategoryAxisSide;
|
|
21
|
+
totalDepth: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function resolveMultiLevelCategoryAxisLayout(spec: EChartSpec, style: ChartStyle, config: IChartConfig): IMultiLevelCategoryAxisLayout | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { EChartRenderSpecOperator, IChartDataCategoryHierarchy } from '../../../../types';
|
|
2
|
+
interface ICategoryAxisBand {
|
|
3
|
+
label: string;
|
|
4
|
+
level: number;
|
|
5
|
+
startIndex: number;
|
|
6
|
+
endIndex: number;
|
|
7
|
+
drawStartBoundary: boolean;
|
|
8
|
+
drawEndBoundary: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function buildCategoryAxisBands(hierarchy: IChartDataCategoryHierarchy): ICategoryAxisBand[];
|
|
11
|
+
export declare const multiLevelCategoryAxisOverlayOperator: EChartRenderSpecOperator;
|
|
12
|
+
export {};
|
|
@@ -42,7 +42,6 @@ export declare class EChartRenderEngine extends Disposable implements EChartInst
|
|
|
42
42
|
static engineName: string;
|
|
43
43
|
private _instance;
|
|
44
44
|
container: HTMLElement | string;
|
|
45
|
-
private _devicePixelRatio;
|
|
46
45
|
private _lastSpec;
|
|
47
46
|
private readonly _eventHandlers;
|
|
48
47
|
private readonly _nativeEventHandlers;
|
|
@@ -55,7 +54,6 @@ export declare class EChartRenderEngine extends Disposable implements EChartInst
|
|
|
55
54
|
private readonly _emittedElementEventKeys;
|
|
56
55
|
private _emittedElementEventKeysClearQueued;
|
|
57
56
|
constructor();
|
|
58
|
-
getDevicePixelRatio(): 1 | 2 | undefined;
|
|
59
57
|
mount(id: string | HTMLElement): void;
|
|
60
58
|
resize(echartsProviderOrOptions?: any | IChartRenderRuntimeOptions): void;
|
|
61
59
|
private _ensureChartInstance;
|
|
@@ -79,7 +77,6 @@ export declare class EChartRenderEngine extends Disposable implements EChartInst
|
|
|
79
77
|
private _handleElementEditZrHover;
|
|
80
78
|
private _handleElementEditClick;
|
|
81
79
|
private _handleElementEditZrClick;
|
|
82
|
-
private _hideTooltip;
|
|
83
80
|
private _ensureEditOverlay;
|
|
84
81
|
private _removeEditOverlay;
|
|
85
82
|
private _clearHoverBorder;
|
package/lib/types/types.d.ts
CHANGED
|
@@ -35,6 +35,11 @@ export interface IDimensionDefinition {
|
|
|
35
35
|
export type DimensionDefinitionLoose = IDimensionDefinition['name'] | IDimensionDefinition;
|
|
36
36
|
export type OptionDataValue = string | number | Date | null | undefined;
|
|
37
37
|
export type ChartDataSourceValues = OptionDataValue[][];
|
|
38
|
+
export interface IUniverDataSetCategorySpan {
|
|
39
|
+
fieldIndex: number;
|
|
40
|
+
startIndex: number;
|
|
41
|
+
endIndex: number;
|
|
42
|
+
}
|
|
38
43
|
/**
|
|
39
44
|
* Canonical chart dataset used by chart context operators and chart-data builders.
|
|
40
45
|
*
|
|
@@ -51,6 +56,11 @@ export interface IUniverDataSet {
|
|
|
51
56
|
dimensions: Array<DimensionDefinitionLoose>;
|
|
52
57
|
sourceType?: ChartSourceDataTypeEnum[][];
|
|
53
58
|
sourceLabels?: string[][];
|
|
59
|
+
/**
|
|
60
|
+
* Explicit category grouping topology. Absence enables adjacent path-prefix inference;
|
|
61
|
+
* an empty array explicitly keeps repeated adjacent values as separate groups.
|
|
62
|
+
*/
|
|
63
|
+
categorySpans?: IUniverDataSetCategorySpan[];
|
|
54
64
|
}
|
|
55
65
|
/** Ordered field names that define the persisted Candlestick OHLC mapping contract. */
|
|
56
66
|
export declare const CHART_CANDLESTICK_MAPPING_FIELDS: readonly ["openIndex", "highIndex", "lowIndex", "closeIndex"];
|
|
@@ -356,6 +366,8 @@ export interface IChartContext {
|
|
|
356
366
|
categoryType?: CategoryType;
|
|
357
367
|
/** Ordered selected Label field indexes. */
|
|
358
368
|
categoryIndexes?: number[];
|
|
369
|
+
/** Whether ordered category indexes should render as one root-to-leaf category axis. */
|
|
370
|
+
multiLevelCategoryAxis?: boolean;
|
|
359
371
|
/**
|
|
360
372
|
* the flag to indicate whether the chart use date axis, only all category data is date type, the chart will use date axis, if there are some string type data, the chart will use category axis even the flag is true.
|
|
361
373
|
*/
|
|
@@ -470,6 +482,28 @@ export interface IChartDataCategory {
|
|
|
470
482
|
useDateAxis: boolean;
|
|
471
483
|
items: IChartDataItem[];
|
|
472
484
|
keys: string[];
|
|
485
|
+
hierarchy?: IChartDataCategoryHierarchy;
|
|
486
|
+
}
|
|
487
|
+
export interface IChartDataCategoryLevel {
|
|
488
|
+
index: number;
|
|
489
|
+
name: string;
|
|
490
|
+
}
|
|
491
|
+
export interface IChartDataCategoryHierarchy {
|
|
492
|
+
levels: IChartDataCategoryLevel[];
|
|
493
|
+
roots: IChartDataCategoryGroup[];
|
|
494
|
+
}
|
|
495
|
+
export interface IChartDataCategoryGroup {
|
|
496
|
+
label: string;
|
|
497
|
+
startIndex: number;
|
|
498
|
+
endIndex: number;
|
|
499
|
+
children?: IChartDataCategoryGroup[];
|
|
500
|
+
}
|
|
501
|
+
export interface IChartDataCategorySegment {
|
|
502
|
+
level: number;
|
|
503
|
+
label: string;
|
|
504
|
+
path: string[];
|
|
505
|
+
startIndex: number;
|
|
506
|
+
endIndex: number;
|
|
473
507
|
}
|
|
474
508
|
export interface IChartDataSeries {
|
|
475
509
|
index: number;
|
|
@@ -838,7 +872,7 @@ export interface IChartSnapshot {
|
|
|
838
872
|
dataAggregation?: IChartDataAggregation;
|
|
839
873
|
}
|
|
840
874
|
/** Persisted chart field selection accepted by the snapshot reader. */
|
|
841
|
-
export interface IChartSnapshotContext extends Pick<IChartContext, 'categoryIndexes' | 'seriesIndexes' | 'histogram'> {
|
|
875
|
+
export interface IChartSnapshotContext extends Pick<IChartContext, 'categoryIndexes' | 'multiLevelCategoryAxis' | 'seriesIndexes' | 'useDateAxis' | 'histogram'> {
|
|
842
876
|
/** Historical snapshot field decoded only when `categoryIndexes` is absent. */
|
|
843
877
|
categoryIndex?: number;
|
|
844
878
|
}
|
|
@@ -901,7 +935,13 @@ export interface IChartRenderModelImageExportInput extends IChartRenderInput {
|
|
|
901
935
|
width: number;
|
|
902
936
|
height: number;
|
|
903
937
|
}
|
|
938
|
+
export declare const ChartImageExportFormat: {
|
|
939
|
+
readonly PNG: "png";
|
|
940
|
+
readonly SVG: "svg";
|
|
941
|
+
};
|
|
942
|
+
export type ChartImageExportFormat = (typeof ChartImageExportFormat)[keyof typeof ChartImageExportFormat];
|
|
904
943
|
export interface IChartRenderModelImageExportOptions {
|
|
944
|
+
format?: ChartImageExportFormat;
|
|
905
945
|
pixelRatio?: number;
|
|
906
946
|
backgroundColor?: string | null;
|
|
907
947
|
}
|
|
@@ -909,7 +949,8 @@ export interface IChartRenderModelImageExportResult {
|
|
|
909
949
|
dataUrl: string;
|
|
910
950
|
width: number;
|
|
911
951
|
height: number;
|
|
912
|
-
|
|
952
|
+
/** Explicit raster pixel ratio. Omitted when the renderer owns the default and for vector exports. */
|
|
953
|
+
pixelRatio?: number;
|
|
913
954
|
}
|
|
914
955
|
export interface IChartRenderInstance extends IDisposable {
|
|
915
956
|
readonly mode: ChartHostRenderMode;
|
|
@@ -972,6 +1013,7 @@ export type ChartImageSource = {
|
|
|
972
1013
|
export interface IChartRenderAsImageOptions {
|
|
973
1014
|
width: number;
|
|
974
1015
|
height: number;
|
|
1016
|
+
format?: ChartImageExportFormat;
|
|
975
1017
|
pixelRatio?: number;
|
|
976
1018
|
backgroundColor?: string;
|
|
977
1019
|
echartsProvider?: any;
|
package/lib/types/util.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export declare const chartBitsUtils: {
|
|
|
7
7
|
};
|
|
8
8
|
export declare function mergeChartConfig<T extends object>(current: T | undefined, update: Partial<T>): T;
|
|
9
9
|
export declare const setProperty: (data: Record<string, any>, propertyPath: string, value: any) => void;
|
|
10
|
-
export declare const getProperty: <T = any>(data: Record<string, any> | undefined, propertyPath: string) => T | undefined;
|
|
11
10
|
/**
|
|
12
11
|
* Set graphic element to data.
|
|
13
12
|
* because we use graphic element to draw watermark title, so we need to set it to data.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_CHART_DEVICE_PIXEL_RATIO = 2;
|