@univerjs-pro/sheets-chart 1.0.0-beta.0 → 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/{sheet-chart-builder-adapter.d.ts → sheet-chart-config-adapter.d.ts} +17 -8
- package/lib/types/chart-builder/types.d.ts +5 -1
- package/lib/types/chart-source/category-span-projection.d.ts +10 -0
- package/lib/types/chart-source/chart-source.d.ts +5 -13
- package/lib/types/chart-source/initial-chart-context.d.ts +7 -0
- package/lib/types/chart-source/source-util.d.ts +5 -1
- package/lib/types/commands/chart-persisted-context.d.ts +1 -1
- package/lib/types/common/util.d.ts +0 -1
- package/lib/types/config/config.d.ts +2 -0
- package/lib/types/facade/f-enum.d.ts +27 -0
- package/lib/types/facade/f-worksheet.d.ts +134 -0
- package/lib/types/facade/index.d.ts +3 -3
- package/lib/types/index.d.ts +4 -6
- package/lib/types/services/chart-model.service.d.ts +1 -0
- package/lib/types/services/sheets-chart.service.d.ts +4 -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 +11 -10
- package/lib/types/chart-builder/sheet-chart-builder.d.ts +0 -17
- package/lib/types/chart-builder/sheet-chart-create-spec.d.ts +0 -6
- package/lib/types/facade/chart/f-sheet-chart-builder.d.ts +0 -83
- package/lib/types/facade/chart/f-sheet-charts.d.ts +0 -100
- package/lib/types/facade/chart/sheet-chart-command-adapter.d.ts +0 -13
- package/lib/types/facade/f-worksheet-charts.d.ts +0 -12
package/lib/locale/vi-VN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x8b7a49=_0xae99;(function(_0x4be58e,_0x2f3e89){const _0x2ebfd3=_0xae99,_0x4881ad=_0x4be58e();while(!![]){try{const _0xbab55=parseInt(_0x2ebfd3(0x16d))/0x1+parseInt(_0x2ebfd3(0x160))/0x2*(-parseInt(_0x2ebfd3(0x15e))/0x3)+parseInt(_0x2ebfd3(0x166))/0x4+parseInt(_0x2ebfd3(0x150))/0x5+parseInt(_0x2ebfd3(0x15d))/0x6*(-parseInt(_0x2ebfd3(0x14f))/0x7)+parseInt(_0x2ebfd3(0x161))/0x8+parseInt(_0x2ebfd3(0x156))/0x9*(parseInt(_0x2ebfd3(0x153))/0xa);if(_0xbab55===_0x2f3e89)break;else _0x4881ad['push'](_0x4881ad['shift']());}catch(_0x2f6eea){_0x4881ad['push'](_0x4881ad['shift']());}}}(_0x64df,0x6e677));function _0xae99(_0x290c15,_0x18b19f){_0x290c15=_0x290c15-0x145;const _0x64df0b=_0x64df();let _0xae99a6=_0x64df0b[_0x290c15];return _0xae99a6;}const e={'sheets-chart':{'seriesDefaultName':_0x8b7a49(0x169),'categoryDefaultName':'Danh\x20mục\x20{0}','blank':_0x8b7a49(0x16c),'msg':{'emptyTips':_0x8b7a49(0x15b),'sankeyCircularTips':_0x8b7a49(0x167)},'bubble':{'emptyTips':_0x8b7a49(0x147)},'relation':{'emptyTips':_0x8b7a49(0x158)},'cloud':{'word':'Từ','frequency':_0x8b7a49(0x16b)},'waterfall':{'positive':'Giá\x20trị\x20dương','negative':_0x8b7a49(0x164),'subtotal':_0x8b7a49(0x15c)},'pareto':{'lineName':_0x8b7a49(0x14b)},'boxplot':{'min':'Giá\x20trị\x20nhỏ\x20nhất','q1':'Phần\x20tư\x20thứ\x20nhất','median':'Trung\x20vị','q3':_0x8b7a49(0x152),'max':'Giá\x20trị\x20lớn\x20nhất'},'candlestick':{'series':'Chuỗi\x20OHLC','category':_0x8b7a49(0x14c),'open':'Giá\x20mở\x20cửa','high':'Giá\x20cao\x20nhất','low':_0x8b7a49(0x149),'close':'Giá\x20đóng\x20cửa'},'histogram':{'frequency':_0x8b7a49(0x16b)},'pie':{'aggregateOther':'Khác','aggregateMembers':_0x8b7a49(0x16e)},'treemap':{'hierarchy':_0x8b7a49(0x146),'value':_0x8b7a49(0x159),'ownValue':'Giá\x20trị\x20riêng','children':'Phần\x20tử\x20con','diagnostic':_0x8b7a49(0x16a)},'sunburst':{'hierarchy':_0x8b7a49(0x15f),'value':_0x8b7a49(0x151),'ownValue':_0x8b7a49(0x145),'children':_0x8b7a49(0x162),'diagnostic':'Biểu\x20đồ\x20sunburst\x20cần\x20ít\x20nhất\x20một\x20trường\x20phân\x20cấp\x20và\x20một\x20trường\x20giá\x20trị\x20số.'},'gauge':{'label':_0x8b7a49(0x148),'value':'Giá\x20trị','emptyDiagnostic':_0x8b7a49(0x163),'mappingDiagnostic':'Biểu\x20đồ\x20đồng\x20hồ\x20cần\x20một\x20trường\x20nhãn\x20và\x20đúng\x20một\x20trường\x20giá\x20trị.','configDiagnostic':_0x8b7a49(0x14a)},'chord':{'emptyDiagnostic':'Biểu\x20đồ\x20dây\x20cung\x20cần\x20ít\x20nhất\x20một\x20quan\x20hệ\x20có\x20trọng\x20số\x20dương\x20giữa\x20hai\x20nút\x20khác\x20nhau.','mappingDiagnostic':_0x8b7a49(0x165),'configDiagnostic':_0x8b7a49(0x154),'source':_0x8b7a49(0x157),'target':_0x8b7a49(0x168),'value':_0x8b7a49(0x151),'count':_0x8b7a49(0x155),'associatedValue':'Giá\x20trị\x20liên\x20kết'},'chartField':{'missingCategoryFields':'Biểu\x20đồ\x20này\x20cần\x20thêm\x20trường\x20nhãn.','missingSeriesFields':_0x8b7a49(0x14e),'invalidFieldIndex':_0x8b7a49(0x15a),'invalidValueFieldType':'Trường\x20giá\x20trị\x20đã\x20chọn\x20không\x20chứa\x20dữ\x20liệu\x20số.','invalidDataStructure':'Các\x20trường\x20đã\x20chọn\x20không\x20tạo\x20thành\x20cấu\x20trúc\x20dữ\x20liệu\x20hợp\x20lệ\x20cho\x20biểu\x20đồ\x20này.','unsupportedChartType':_0x8b7a49(0x14d)}}};function _0x64df(){const _0x360ded=['Biểu\x20đồ\x20đồng\x20hồ\x20cần\x20ít\x20nhất\x20một\x20giá\x20trị\x20số\x20hữu\x20hạn.','Giá\x20trị\x20âm','Biểu\x20đồ\x20dây\x20cung\x20cần\x20các\x20trường\x20Nguồn\x20và\x20Đích\x20khác\x20nhau\x20cùng\x20một\x20trường\x20Giá\x20trị\x20khác\x20biệt\x20không\x20bắt\x20buộc.','2961908njVmfM','Biểu\x20đồ\x20Sankey\x20không\x20thể\x20chứa\x20dữ\x20liệu\x20vòng\x20lặp','Mục\x20tiêu','Loạt\x20{0}','Biểu\x20đồ\x20cây\x20cần\x20ít\x20nhất\x20một\x20trường\x20phân\x20cấp\x20và\x20một\x20trường\x20giá\x20trị\x20số.','Tần\x20suất','(Trống)','839663icTdCI','Thành\x20phần','Giá\x20trị\x20riêng','Trường\x20phân\x20cấp','Biểu\x20đồ\x20bong\x20bóng\x20yêu\x20cầu\x20ít\x20nhất\x202\x20cột:\x20trục\x20X,\x20trục\x20Y','Nhãn','Giá\x20thấp\x20nhất','Cấu\x20hình\x20biểu\x20đồ\x20đồng\x20hồ\x20không\x20hợp\x20lệ.\x20Hãy\x20kiểm\x20tra\x20thang\x20đo,\x20phạm\x20vi,\x20tỷ\x20lệ\x20và\x20kích\x20thước.','Tỷ\x20lệ\x20tích\x20lũy','Danh\x20mục','Loại\x20biểu\x20đồ\x20này\x20không\x20có\x20chính\x20sách\x20sử\x20dụng\x20trường.','Biểu\x20đồ\x20này\x20cần\x20thêm\x20trường\x20giá\x20trị\x20số.','245WqTfjz','61420hOWGPJ','Giá\x20trị','Phần\x20tư\x20thứ\x20ba','475070TsJKnj','Cấu\x20hình\x20biểu\x20đồ\x20dây\x20cung\x20không\x20hợp\x20lệ.\x20Hãy\x20kiểm\x20tra\x20góc,\x20bán\x20kính,\x20độ\x20mờ\x20và\x20kích\x20thước.','Số\x20lượng\x20mối\x20quan\x20hệ','9BbpGGL','Nguồn','Nguồn\x20dữ\x20liệu\x20cho\x20biểu\x20đồ\x20quan\x20hệ\x20là\x20ma\x20trận\x20đồng\x20từ\x20với\x20cột\x20loại\x20bổ\x20sung\x20ở\x20cột\x20thứ\x20hai','Trường\x20giá\x20trị','Một\x20trường\x20biểu\x20đồ\x20đã\x20chọn\x20không\x20còn\x20khả\x20dụng.','Không\x20có\x20dữ\x20liệu\x20để\x20hiển\x20thị.','Tổng\x20phụ','147006nrHfst','22251aFklpb','Hệ\x20thống\x20phân\x20cấp','234THlCAw','4300864mbgmbZ','Phần\x20tử\x20con'];_0x64df=function(){return _0x360ded;};return _0x64df();}export{e as default};
|
package/lib/locale/zh-CN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0xc776d2=_0x3bf2;(function(_0x2ace13,_0x4cf9d3){const _0x59f091=_0x3bf2,_0x4d78a7=_0x2ace13();while(!![]){try{const _0x211d27=parseInt(_0x59f091(0x191))/0x1+parseInt(_0x59f091(0x187))/0x2+parseInt(_0x59f091(0x17d))/0x3+-parseInt(_0x59f091(0x173))/0x4*(-parseInt(_0x59f091(0x170))/0x5)+parseInt(_0x59f091(0x175))/0x6*(parseInt(_0x59f091(0x17c))/0x7)+parseInt(_0x59f091(0x18e))/0x8+-parseInt(_0x59f091(0x181))/0x9*(parseInt(_0x59f091(0x188))/0xa);if(_0x211d27===_0x4cf9d3)break;else _0x4d78a7['push'](_0x4d78a7['shift']());}catch(_0x3e2496){_0x4d78a7['push'](_0x4d78a7['shift']());}}}(_0x1b52,0x68a12));function _0x3bf2(_0x5727da,_0x34aed9){_0x5727da=_0x5727da-0x16e;const _0x1b5209=_0x1b52();let _0x3bf212=_0x1b5209[_0x5727da];return _0x3bf212;}const e={'sheets-chart':{'seriesDefaultName':_0xc776d2(0x183),'categoryDefaultName':_0xc776d2(0x172),'blank':'(空)','msg':{'emptyTips':'请先添加系列开始数据可视化','sankeyCircularTips':_0xc776d2(0x189)},'bubble':{'emptyTips':_0xc776d2(0x171)},'relation':{'emptyTips':_0xc776d2(0x17b)},'cloud':{'word':'词语','frequency':'频率'},'waterfall':{'positive':'正值','negative':'负值','subtotal':'小计'},'pareto':{'lineName':_0xc776d2(0x190)},'boxplot':{'min':_0xc776d2(0x176),'q1':'第一四分位数','median':_0xc776d2(0x18b),'q3':_0xc776d2(0x16e),'max':'最大值'},'candlestick':{'series':_0xc776d2(0x180),'category':'类别','open':'开盘','high':'最高','low':'最低','close':'收盘'},'histogram':{'frequency':'频数'},'pie':{'aggregateOther':'其他','aggregateMembers':_0xc776d2(0x18a)},'treemap':{'hierarchy':_0xc776d2(0x18c),'value':_0xc776d2(0x17f),'ownValue':_0xc776d2(0x174),'children':'子项','diagnostic':'矩形树图至少需要一个层级字段和一个数值字段。'},'sunburst':{'hierarchy':'层级','value':'数值','ownValue':_0xc776d2(0x174),'children':'子项','diagnostic':_0xc776d2(0x18d)},'gauge':{'label':'标签','value':'数值','emptyDiagnostic':_0xc776d2(0x16f),'mappingDiagnostic':_0xc776d2(0x177),'configDiagnostic':_0xc776d2(0x186)},'chord':{'emptyDiagnostic':_0xc776d2(0x18f),'mappingDiagnostic':_0xc776d2(0x178),'configDiagnostic':_0xc776d2(0x17a),'source':'来源','target':'目标','value':'数值','count':'关系计数','associatedValue':'关联值'},'chartField':{'missingCategoryFields':_0xc776d2(0x185),'missingSeriesFields':_0xc776d2(0x182),'invalidFieldIndex':_0xc776d2(0x179),'invalidValueFieldType':'所选值字段不包含数值数据。','invalidDataStructure':_0xc776d2(0x17e),'unsupportedChartType':_0xc776d2(0x184)}}};export{e as default};function _0x1b52(){const _0x59d1da=['1308vwzXzo','自身值','18tvXZgH','最小值','仪表图需要一个标签字段且只能有一个数值字段。','弦图需要不同的来源字段和目标字段,并可选一个与二者不同的数值字段。','所选图表字段已不可用。','弦图配置无效,请检查角度、半径、不透明度和尺寸。','关系图数据源为额外添加类型列在第二列的共词矩阵','1672937aiGUgH','1833699jyxezd','所选字段无法构成此图表所需的有效数据结构。','数值字段','OHLC\x20系列','272574DSFzaS','此图表需要更多数值字段。','系列\x20{0}','此图表类型没有字段使用规则。','此图表需要更多标签字段。','仪表图配置无效,请检查刻度范围、分段区间、比例和尺寸。','1565308AakKLS','760GnvDLe','桑基图不能包含循环数据','成员数','中位数','层级字段','旭日图至少需要一个层级字段和一个数值字段。','101176qglJAl','弦图至少需要两个不同节点之间的一条正权重关系。','累积占比','429230HDbhEj','第三四分位数','仪表图至少需要一个有限数值。','2715iiRypF','气泡图至少需要2列,X轴、Y轴。','类别\x20{0}'];_0x1b52=function(){return _0x59d1da;};return _0x1b52();}
|
package/lib/locale/zh-HK.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x5f51c3=_0x4d2c;(function(_0x200a93,_0x18d13f){const _0x1d4ffa=_0x4d2c,_0x4075ac=_0x200a93();while(!![]){try{const _0x140232=parseInt(_0x1d4ffa(0x213))/0x1+parseInt(_0x1d4ffa(0x206))/0x2+-parseInt(_0x1d4ffa(0x1ff))/0x3*(parseInt(_0x1d4ffa(0x1fd))/0x4)+parseInt(_0x1d4ffa(0x20e))/0x5*(-parseInt(_0x1d4ffa(0x207))/0x6)+-parseInt(_0x1d4ffa(0x214))/0x7*(-parseInt(_0x1d4ffa(0x216))/0x8)+parseInt(_0x1d4ffa(0x1f3))/0x9*(-parseInt(_0x1d4ffa(0x219))/0xa)+-parseInt(_0x1d4ffa(0x209))/0xb;if(_0x140232===_0x18d13f)break;else _0x4075ac['push'](_0x4075ac['shift']());}catch(_0x13bf7c){_0x4075ac['push'](_0x4075ac['shift']());}}}(_0xc421,0x39411));const e={'sheets-chart':{'seriesDefaultName':_0x5f51c3(0x1fb),'categoryDefaultName':_0x5f51c3(0x1f7),'blank':'(空)','msg':{'emptyTips':'請先添加系列開始數據可視化','sankeyCircularTips':_0x5f51c3(0x218)},'bubble':{'emptyTips':_0x5f51c3(0x1f5)},'relation':{'emptyTips':'關係圖資料來源為額外新增類型欄在第二欄的共詞矩陣'},'cloud':{'word':'詞','frequency':'頻率'},'waterfall':{'positive':'正值','negative':'負值','subtotal':'小計'},'pareto':{'lineName':_0x5f51c3(0x203)},'boxplot':{'min':_0x5f51c3(0x215),'q1':_0x5f51c3(0x200),'median':_0x5f51c3(0x1fc),'q3':_0x5f51c3(0x212),'max':'最大值'},'candlestick':{'series':_0x5f51c3(0x20b),'category':'類別','open':'開盤價','high':_0x5f51c3(0x211),'low':_0x5f51c3(0x1f6),'close':_0x5f51c3(0x205)},'histogram':{'frequency':'頻數'},'pie':{'aggregateOther':'其他','aggregateMembers':'成員'},'treemap':{'hierarchy':_0x5f51c3(0x204),'value':_0x5f51c3(0x20c),'ownValue':_0x5f51c3(0x20d),'children':'子項','diagnostic':_0x5f51c3(0x1fe)},'sunburst':{'hierarchy':'階層','value':'數值','ownValue':'自身值','children':'子項','diagnostic':_0x5f51c3(0x201)},'gauge':{'label':'標籤','value':'數值','emptyDiagnostic':_0x5f51c3(0x20a),'mappingDiagnostic':_0x5f51c3(0x1f9),'configDiagnostic':_0x5f51c3(0x1f2)},'chord':{'emptyDiagnostic':'弦圖至少需要兩個不同節點之間的一條正權重關係。','mappingDiagnostic':_0x5f51c3(0x210),'configDiagnostic':_0x5f51c3(0x202),'source':'來源','target':'目標','value':'數值','count':'關係數','associatedValue':'關聯值'},'chartField':{'missingCategoryFields':_0x5f51c3(0x1f4),'missingSeriesFields':_0x5f51c3(0x1f8),'invalidFieldIndex':_0x5f51c3(0x208),'invalidValueFieldType':_0x5f51c3(0x217),'invalidDataStructure':_0x5f51c3(0x20f),'unsupportedChartType':_0x5f51c3(0x1fa)}}};export{e as default};function _0x4d2c(_0x242cd3,_0x2cf513){_0x242cd3=_0x242cd3-0x1f2;const _0xc421ee=_0xc421();let _0x4d2c93=_0xc421ee[_0x242cd3];return _0x4d2c93;}function _0xc421(){const _0x5de5be=['累積占比','階層欄位','收盤價','697228SDNYFV','624xHLNOw','所選圖表欄位已無法使用。','944471ZNZunk','儀表圖至少需要一個有限數值。','OHLC\x20數列','數值欄位','自身值','12500szpJSU','所選欄位無法構成此圖表所需的有效資料結構。','弦圖需要不同的來源與目標欄位,並可選擇一個與兩者不同的數值欄位。','最高價','第三四分位數','263129WXQckG','7JaAYgy','最小值','1193208whkhOS','所選數值欄位不包含數值資料。','桑基圖不能包含循環數據','240680SzwMpK','儀表圖設定無效,請檢查刻度範圍、分段區間、比例和尺寸。','45RVbGJK','此圖表需要更多標籤欄位。','氣泡圖至少需要2欄,X軸、Y軸。','最低價','類別\x20{0}','此圖表需要更多數值欄位。','儀表圖需要一個標籤欄位,而且只能有一個數值欄位。','此圖表類型沒有欄位使用規則。','系列\x20{0}','中位數','4720eNdTQe','矩形樹圖至少需要一個階層欄位和一個數值欄位。','153IgcnZS','第一四分位數','旭日圖至少需要一個階層欄位和一個數值欄位。','弦圖設定無效,請檢查角度、半徑、不透明度和尺寸。'];_0xc421=function(){return _0x5de5be;};return _0xc421();}
|
package/lib/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x440f4f=_0x1fa9;function _0x1fa9(_0x5e08a6,_0x530da2){_0x5e08a6=_0x5e08a6-0x70;const _0x1b98cb=_0x1b98();let _0x1fa928=_0x1b98cb[_0x5e08a6];return _0x1fa928;}(function(_0x5013fd,_0x176722){const _0xd447e1=_0x1fa9,_0x3783a6=_0x5013fd();while(!![]){try{const _0x434a35=parseInt(_0xd447e1(0x8c))/0x1+-parseInt(_0xd447e1(0x8f))/0x2+parseInt(_0xd447e1(0x72))/0x3*(-parseInt(_0xd447e1(0x75))/0x4)+-parseInt(_0xd447e1(0x79))/0x5*(parseInt(_0xd447e1(0x80))/0x6)+parseInt(_0xd447e1(0x82))/0x7+-parseInt(_0xd447e1(0x7a))/0x8*(-parseInt(_0xd447e1(0x86))/0x9)+parseInt(_0xd447e1(0x81))/0xa;if(_0x434a35===_0x176722)break;else _0x3783a6['push'](_0x3783a6['shift']());}catch(_0x4d2d37){_0x3783a6['push'](_0x3783a6['shift']());}}}(_0x1b98,0xef1fe));const e={'sheets-chart':{'seriesDefaultName':'系列\x20{0}','categoryDefaultName':_0x440f4f(0x7b),'blank':_0x440f4f(0x84),'msg':{'emptyTips':_0x440f4f(0x78),'sankeyCircularTips':_0x440f4f(0x73)},'bubble':{'emptyTips':_0x440f4f(0x7d)},'relation':{'emptyTips':_0x440f4f(0x89)},'cloud':{'word':'詞','frequency':'頻率'},'waterfall':{'positive':'正值','negative':'負值','subtotal':'小計'},'pareto':{'lineName':'累積占比'},'boxplot':{'min':'最小值','q1':_0x440f4f(0x7e),'median':_0x440f4f(0x71),'q3':_0x440f4f(0x76),'max':'最大值'},'candlestick':{'series':_0x440f4f(0x93),'category':'類別','open':_0x440f4f(0x7f),'high':'最高價','low':_0x440f4f(0x87),'close':_0x440f4f(0x8d)},'histogram':{'frequency':'頻數'},'pie':{'aggregateOther':'其他','aggregateMembers':'成員'},'treemap':{'hierarchy':_0x440f4f(0x90),'value':_0x440f4f(0x88),'ownValue':_0x440f4f(0x77),'children':'子項','diagnostic':_0x440f4f(0x85)},'sunburst':{'hierarchy':'階層','value':'數值','ownValue':_0x440f4f(0x77),'children':'子項','diagnostic':_0x440f4f(0x83)},'gauge':{'label':'標籤','value':'數值','emptyDiagnostic':_0x440f4f(0x91),'mappingDiagnostic':_0x440f4f(0x8b),'configDiagnostic':_0x440f4f(0x7c)},'chord':{'emptyDiagnostic':'弦圖至少需要兩個不同節點之間的一條正權重關係。','mappingDiagnostic':'弦圖需要不同的來源與目標欄位,並可選擇一個與兩者不同的數值欄位。','configDiagnostic':_0x440f4f(0x94),'source':'來源','target':'目標','value':'數值','count':_0x440f4f(0x70),'associatedValue':_0x440f4f(0x96)},'chartField':{'missingCategoryFields':'這個圖表需要更多標籤欄位。','missingSeriesFields':_0x440f4f(0x8a),'invalidFieldIndex':_0x440f4f(0x74),'invalidValueFieldType':_0x440f4f(0x92),'invalidDataStructure':_0x440f4f(0x95),'unsupportedChartType':_0x440f4f(0x8e)}}};export{e as default};function _0x1b98(){const _0x534fed=['4816638MsiQpq','15752500tWYIto','8929837lgbRRU','旭日圖至少需要一個階層欄位和一個數值欄位。','(空)','矩形樹圖至少需要一個階層欄位和一個數值欄位。','6921AVUAsf','最低價','數值欄位','關係圖資料來源為額外新增類型欄在第二欄的共詞矩陣','這個圖表需要更多數值欄位。','儀表圖需要一個標籤欄位,而且只能有一個數值欄位。','422648ZuNiqd','收盤價','這個圖表類型沒有欄位使用規則。','1439272EzFfnA','階層欄位','儀表圖至少需要一個有限數值。','選取的數值欄位不包含數值資料。','OHLC\x20數列','弦圖設定無效,請檢查角度、半徑、不透明度和尺寸。','選取的欄位無法構成這個圖表所需的有效資料結構。','關聯值','關係數','中位數','4726182pFuBkL','桑基圖不能包含循環數據','選取的圖表欄位已無法使用。','4CMASeR','第三四分位數','自身值','請先添加系列開始數據可視化','10oJsDDZ','16712IVByjZ','類別\x20{0}','儀表圖設定無效,請檢查刻度範圍、分段區間、比例和尺寸。','氣泡圖至少需要2欄,X軸、Y軸。','第一四分位數','開盤價'];_0x1b98=function(){return _0x534fed;};return _0x1b98();}
|
package/lib/types/chart-builder/{sheet-chart-builder-adapter.d.ts → sheet-chart-config-adapter.d.ts}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { ChartPendingConfig, IChartBuilderAdapter, IChartData, IChartDescription,
|
|
2
|
-
import type { Injector } from '@univerjs/core';
|
|
1
|
+
import type { ChartPendingConfig, IChartBuilderAdapter, IChartCreateConfig, IChartData, IChartDescription, IChartLiveAdapter, IUniverDataSet } from '@univerjs-pro/engine-chart';
|
|
2
|
+
import type { ArrangeTypeEnum, Injector } from '@univerjs/core';
|
|
3
3
|
import type { ISheetChartDescriptionExtension } from './sheet-chart-description';
|
|
4
|
-
import type { ChartSourceSpec, IChartLayoutPatch } from './types';
|
|
4
|
+
import type { ChartSourceSpec, IChartLayoutPatch, ISheetChartInfo } from './types';
|
|
5
5
|
/** Sheet-owned changes committed alongside engine chart configuration. */
|
|
6
6
|
export interface ISheetChartHostPatch {
|
|
7
7
|
source?: ChartSourceSpec;
|
|
8
8
|
layout?: IChartLayoutPatch;
|
|
9
9
|
}
|
|
10
10
|
/** Persistence seam required by a Sheet chart builder. */
|
|
11
|
-
export interface
|
|
11
|
+
export interface ISheetChartConfigAdapter extends IChartBuilderAdapter<ISheetChartDescriptionExtension> {
|
|
12
12
|
commitHost(patch: ISheetChartHostPatch): void;
|
|
13
13
|
resolveData(config: ChartPendingConfig, source?: ChartSourceSpec): IChartData;
|
|
14
14
|
resolveSource(source: ChartSourceSpec): {
|
|
@@ -17,25 +17,34 @@ export interface ISheetChartBuilderAdapter extends IChartBuilderAdapter<ISheetCh
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
/** Stable Sheet identity and services used by the builder adapter. */
|
|
20
|
-
export interface
|
|
20
|
+
export interface ISheetChartConfigAdapterContext {
|
|
21
21
|
unitId: string;
|
|
22
22
|
subUnitId: string;
|
|
23
23
|
chartId: string;
|
|
24
24
|
injector: Injector;
|
|
25
25
|
}
|
|
26
26
|
/** Commits Sheet chart changes using raw identity and package-owned commands. */
|
|
27
|
-
export declare class
|
|
27
|
+
export declare class SheetChartConfigAdapter implements ISheetChartConfigAdapter, IChartLiveAdapter<ChartSourceSpec, ISheetChartInfo> {
|
|
28
28
|
private readonly _context;
|
|
29
29
|
private readonly _injector;
|
|
30
|
-
constructor(_context:
|
|
30
|
+
constructor(_context: ISheetChartConfigAdapterContext);
|
|
31
31
|
describe(config?: ChartPendingConfig, dataSet?: IUniverDataSet): IChartDescription & ISheetChartDescriptionExtension;
|
|
32
|
+
getInfo(): ISheetChartInfo;
|
|
32
33
|
commit(configChange: ChartPendingConfig): void;
|
|
34
|
+
update(info: ISheetChartInfo): Promise<void>;
|
|
35
|
+
commitChanges(source: ChartSourceSpec, config: IChartCreateConfig, layout: IChartLayoutPatch): Promise<void>;
|
|
36
|
+
private _replaceConfig;
|
|
37
|
+
setDataSource(source: ChartSourceSpec): void;
|
|
38
|
+
setAbsolutePosition(x: number, y: number): void;
|
|
39
|
+
setSize(width: number, height: number): void;
|
|
40
|
+
arrange(type: ArrangeTypeEnum): void;
|
|
41
|
+
setZOrder(zOrder: number): void;
|
|
33
42
|
resolveData(configChange: ChartPendingConfig, source?: ChartSourceSpec): IChartData;
|
|
34
43
|
resolveSource(source: ChartSourceSpec): {
|
|
35
44
|
dataSet: IUniverDataSet;
|
|
36
45
|
isRowDirection: boolean;
|
|
37
46
|
};
|
|
38
47
|
commitHost(patch: ISheetChartHostPatch): void;
|
|
39
|
-
|
|
48
|
+
remove(): Promise<boolean>;
|
|
40
49
|
private _resolveSourceRange;
|
|
41
50
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChartTypeString, IChartCreateConfig, IChartDescription as IEngineChartDescription } from '@univerjs-pro/engine-chart';
|
|
1
|
+
import type { ChartTypeString, IChartCreateConfig, IChartInfo, IChartDescription as IEngineChartDescription } from '@univerjs-pro/engine-chart';
|
|
2
2
|
import type { IRange } from '@univerjs/core';
|
|
3
3
|
export declare enum ChartSourceOrientation {
|
|
4
4
|
Auto = "auto",
|
|
@@ -83,6 +83,10 @@ export interface IChartCreateSpec extends IChartCreateConfig {
|
|
|
83
83
|
};
|
|
84
84
|
size?: IChartSizeSpec;
|
|
85
85
|
}
|
|
86
|
+
/** Detached Sheet Chart information produced by the Facade builder. */
|
|
87
|
+
export interface ISheetChartInfo extends IChartInfo<ChartSourceSpec> {
|
|
88
|
+
anchor?: ChartAnchorSpec;
|
|
89
|
+
}
|
|
86
90
|
export declare enum ChartDiagnosticCode {
|
|
87
91
|
InvalidRange = "INVALID_RANGE",
|
|
88
92
|
SingleCellSource = "SINGLE_CELL_SOURCE",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IUniverDataSetCategorySpan } from '@univerjs-pro/engine-chart';
|
|
2
|
+
import type { IRange } from '@univerjs/core';
|
|
3
|
+
export interface IProjectSheetCategorySpansOptions {
|
|
4
|
+
mergeRanges: readonly IRange[];
|
|
5
|
+
worksheetRows: readonly number[];
|
|
6
|
+
worksheetColumns: readonly number[];
|
|
7
|
+
transpose: boolean;
|
|
8
|
+
fieldIndexOffset?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function projectSheetCategorySpans(options: IProjectSheetCategorySpansOptions): IUniverDataSetCategorySpan[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import type { Observable } from 'rxjs';
|
|
3
|
-
import type { IChartSourceMultiRangeItem, ISheetChartSourceSingleRange, ISheetChartSourceSnapshot, IUniverDataSet
|
|
4
|
-
import { ChartDataSource
|
|
3
|
+
import type { IChartSourceMultiRangeItem, ISheetChartSourceSingleRange, ISheetChartSourceSnapshot, IUniverDataSet } from '../models/types';
|
|
4
|
+
import { ChartDataSource } from '@univerjs-pro/engine-chart';
|
|
5
5
|
/**
|
|
6
6
|
* @extends ChartDataSourceBase
|
|
7
7
|
* @description
|
|
@@ -21,6 +21,7 @@ export declare class ChartDataSourceSingle extends ChartDataSource {
|
|
|
21
21
|
watchRange(): void;
|
|
22
22
|
convertDataSet(sourceInfo?: ISheetChartSourceSingleRange): IUniverDataSet;
|
|
23
23
|
getDataSet(): IUniverDataSet;
|
|
24
|
+
getDimensionCount(): number;
|
|
24
25
|
refresh(): void;
|
|
25
26
|
private _emit;
|
|
26
27
|
}
|
|
@@ -36,18 +37,9 @@ export declare class ChartDataSourceMulti extends ChartDataSource {
|
|
|
36
37
|
setRangeInfo(rangeInfo: ISheetChartSourceSingleRange | IChartSourceMultiRangeItem[]): void;
|
|
37
38
|
updateRangeInfo(): void;
|
|
38
39
|
watchRange(): void;
|
|
39
|
-
convertDataSet(rangeInfos?: IChartSourceMultiRangeItem[]):
|
|
40
|
-
dimensions: never[];
|
|
41
|
-
source: never[];
|
|
42
|
-
sourceType?: undefined;
|
|
43
|
-
sourceLabels?: undefined;
|
|
44
|
-
} | {
|
|
45
|
-
dimensions: string[];
|
|
46
|
-
source: OptionDataValue[][];
|
|
47
|
-
sourceType: ChartSourceDataTypeEnum[][];
|
|
48
|
-
sourceLabels: string[][];
|
|
49
|
-
};
|
|
40
|
+
convertDataSet(rangeInfos?: IChartSourceMultiRangeItem[]): IUniverDataSet;
|
|
50
41
|
getDataSet(): IUniverDataSet;
|
|
42
|
+
getDimensionCount(): number;
|
|
51
43
|
refresh(): void;
|
|
52
44
|
private _emit;
|
|
53
45
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IChartSnapshot, IUniverDataSet } from '@univerjs-pro/engine-chart';
|
|
2
|
+
import { ChartTypeBits } from '@univerjs-pro/engine-chart';
|
|
3
|
+
export interface IResolveInitialChartContextOptions {
|
|
4
|
+
chartType: ChartTypeBits;
|
|
5
|
+
context?: NonNullable<IChartSnapshot['context']>;
|
|
6
|
+
}
|
|
7
|
+
export declare function resolveInitialChartContext(dataSet: IUniverDataSet, options: IResolveInitialChartContextOptions): NonNullable<IChartSnapshot['context']>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ICellData, IDocumentData, IRange, Nullable, ObjectMatrix, Styles, Worksheet } from '@univerjs/core';
|
|
2
2
|
import type { IChartSourceMultiRangeItem, ISheetChartSourceSingleRange, OptionDataValue } from '../models/types';
|
|
3
3
|
import { ChartSourceDataTypeEnum } from '@univerjs-pro/engine-chart';
|
|
4
|
+
import { numfmt } from '@univerjs/core';
|
|
5
|
+
type ChartSourcePatternInfoRecord = Record<string, ReturnType<typeof numfmt.getFormatInfo>>;
|
|
4
6
|
export interface IChartSourceCellEntry {
|
|
5
7
|
value: OptionDataValue;
|
|
6
8
|
label: string;
|
|
@@ -8,7 +10,8 @@ export interface IChartSourceCellEntry {
|
|
|
8
10
|
}
|
|
9
11
|
export declare const getStringFromDataStream: (data: IDocumentData) => string;
|
|
10
12
|
export declare function convertArrayLikeRangeInfoToMatrix(sourceRange: IRange, sheet: Worksheet, index: number, matrix: ObjectMatrix<OptionDataValue>, sourceTypeMatrix: ObjectMatrix<ChartSourceDataTypeEnum>, sourceLabelsMatrix: ObjectMatrix<string>, styles: Styles): void;
|
|
11
|
-
export declare function
|
|
13
|
+
export declare function getCellSourceEntry(worksheet: Worksheet, row: number, column: number, styles: Styles, patternInfoRecord: ChartSourcePatternInfoRecord): IChartSourceCellEntry;
|
|
14
|
+
export declare function convertCellDataToSourceEntry(cellData: Nullable<ICellData>, styles: Styles, patternInfoRecord: ChartSourcePatternInfoRecord, sourceCellData?: Nullable<ICellData>): IChartSourceCellEntry;
|
|
12
15
|
/**
|
|
13
16
|
* @description this function is used to change the single range info to multi range info, we will split the single range to two range, one is the dimension range, the other is the value range
|
|
14
17
|
* @param {ISheetChartSourceSingleRange} rangeInfo the single range info
|
|
@@ -21,3 +24,4 @@ export declare function changeSingleRangeInfoToMultiRangeInfo(rangeInfo: ISheetC
|
|
|
21
24
|
* @returns {boolean} return the multi range info can switch orient or not
|
|
22
25
|
*/
|
|
23
26
|
export declare function isMultiRangeCanSwitchOrient(rangeInfo: IChartSourceMultiRangeItem[]): boolean;
|
|
27
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IChartContext } from '@univerjs-pro/engine-chart';
|
|
2
|
-
export type IChartPersistedContext = Pick<IChartContext, 'categoryIndexes' | 'seriesIndexes' | 'histogram'>;
|
|
2
|
+
export type IChartPersistedContext = Pick<IChartContext, 'categoryIndexes' | 'multiLevelCategoryAxis' | 'seriesIndexes' | 'useDateAxis' | 'histogram'>;
|
|
3
3
|
export declare function replacePersistedChartContext(current: IChartContext, persisted: IChartPersistedContext): IChartContext;
|
|
@@ -4,7 +4,6 @@ export declare const BUILD_TIMESTAMP: number;
|
|
|
4
4
|
export declare const DefaultLimitedTypes: string[];
|
|
5
5
|
export declare const DefaultAllTypes: string[];
|
|
6
6
|
export declare const DefaultInValidTypes: string[];
|
|
7
|
-
export declare const setProperty: (data: Record<string, any>, propertyPath: string, value: any) => void;
|
|
8
7
|
/**
|
|
9
8
|
* Set graphic element to data.
|
|
10
9
|
* because we use graphic element to draw watermark title, so we need to set it to data.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IChartHostRect } from '@univerjs-pro/engine-chart';
|
|
1
2
|
export declare const SHEETS_CHART_PLUGIN_CONFIG_KEY = "sheets-chart.config";
|
|
2
3
|
export declare const configSymbol: unique symbol;
|
|
3
4
|
export declare enum ChartRenderMode {
|
|
@@ -6,5 +7,6 @@ export declare enum ChartRenderMode {
|
|
|
6
7
|
}
|
|
7
8
|
export interface IUniverSheetsChartConfig {
|
|
8
9
|
chartRenderMode?: ChartRenderMode;
|
|
10
|
+
defaultChartSize?: IChartHostRect;
|
|
9
11
|
}
|
|
10
12
|
export declare const defaultPluginConfig: IUniverSheetsChartConfig;
|
|
@@ -2,8 +2,35 @@ import { ChartSourceOrientation } from '@univerjs-pro/sheets-chart';
|
|
|
2
2
|
import { FEnum } from '@univerjs/core/facade';
|
|
3
3
|
/** @ignore */
|
|
4
4
|
export interface IFSheetsChartEnumMixin {
|
|
5
|
+
/**
|
|
6
|
+
* Controls how a Sheet range is interpreted as Chart series.
|
|
7
|
+
*
|
|
8
|
+
* - `Auto` lets Sheet Chart infer the orientation from the selected range.
|
|
9
|
+
* - `Row`, `Rows`, and `RowsAsSeries` are equivalent: each row is treated as a series.
|
|
10
|
+
* - `Column`, `Columns`, and `ColumnsAsSeries` are equivalent: each column is treated as a series.
|
|
11
|
+
*
|
|
12
|
+
* Pass a value through `orientation` when calling a Sheet Chart builder's
|
|
13
|
+
* `setSource()` method or a live Sheet Chart's `setDataSource()` method.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
18
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
19
|
+
*
|
|
20
|
+
* const chartInfo = fWorksheet
|
|
21
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Column)
|
|
22
|
+
* .setSource({
|
|
23
|
+
* range: 'A1:D8',
|
|
24
|
+
* orientation: univerAPI.Enum.ChartSourceOrientation.Columns,
|
|
25
|
+
* })
|
|
26
|
+
* .build();
|
|
27
|
+
*
|
|
28
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
5
31
|
ChartSourceOrientation: typeof ChartSourceOrientation;
|
|
6
32
|
}
|
|
33
|
+
/** @ignore */
|
|
7
34
|
export declare class FSheetsChartEnumMixin extends FEnum implements IFSheetsChartEnumMixin {
|
|
8
35
|
get ChartSourceOrientation(): typeof ChartSourceOrientation;
|
|
9
36
|
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { ChartTypeString } from '@univerjs-pro/engine-chart';
|
|
2
|
+
import type { HostComposedChartBuilder, IChartBuilderTypeMap } from '@univerjs-pro/engine-chart/facade';
|
|
3
|
+
import type { ChartAnchorSpec, ChartSourceSpec, ISheetChartInfo } from '@univerjs-pro/sheets-chart';
|
|
4
|
+
import { FWorksheet } from '@univerjs/sheets/facade';
|
|
5
|
+
import { FSheetChart } from './f-chart';
|
|
6
|
+
/** Sheet-only methods composed onto every Sheet Chart Builder. */
|
|
7
|
+
export interface ISheetChartMethods {
|
|
8
|
+
/**
|
|
9
|
+
* Sets the cell anchor used when inserting the Chart.
|
|
10
|
+
* @param {ChartAnchorSpec} anchor A1 notation or a zero-based row/column anchor with optional offsets.
|
|
11
|
+
* @returns {this} This Builder for chaining.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
15
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
16
|
+
*
|
|
17
|
+
* const chartInfo = fWorksheet
|
|
18
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Column)
|
|
19
|
+
* .setSource({
|
|
20
|
+
* range: 'A1:D8',
|
|
21
|
+
* orientation: univerAPI.Enum.ChartSourceOrientation.Columns,
|
|
22
|
+
* })
|
|
23
|
+
* .setPosition({
|
|
24
|
+
* row: 1,
|
|
25
|
+
* column: 5,
|
|
26
|
+
* rowOffset: 10,
|
|
27
|
+
* columnOffset: 20,
|
|
28
|
+
* })
|
|
29
|
+
* .setSize(640, 360)
|
|
30
|
+
* .setTitle('Quarterly sales')
|
|
31
|
+
* .build();
|
|
32
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
setPosition(anchor: ChartAnchorSpec): this;
|
|
36
|
+
}
|
|
37
|
+
/** A type-specific Chart Builder composed with Sheet-only insertion methods. */
|
|
38
|
+
export type FSheetChartBuilderOf<T extends ChartTypeString> = HostComposedChartBuilder<IChartBuilderTypeMap<ChartSourceSpec, ChartSourceSpec, ISheetChartInfo>[T], ISheetChartMethods>;
|
|
39
|
+
/** @ignore */
|
|
40
|
+
export interface IFWorksheetChartMixin {
|
|
41
|
+
/**
|
|
42
|
+
* Creates a detached, type-specific Chart builder for this worksheet.
|
|
43
|
+
*
|
|
44
|
+
* @param {ChartTypeString} type The Chart type to create.
|
|
45
|
+
* @returns {FSheetChartBuilderOf<T>} A detached builder that produces insertable Sheet Chart information.
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
49
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
50
|
+
*
|
|
51
|
+
* const chartInfo = fWorksheet
|
|
52
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Column)
|
|
53
|
+
* .setSource({
|
|
54
|
+
* range: 'A1:D8',
|
|
55
|
+
* orientation: univerAPI.Enum.ChartSourceOrientation.Columns,
|
|
56
|
+
* })
|
|
57
|
+
* .setPosition('F2')
|
|
58
|
+
* .setSize(640, 360)
|
|
59
|
+
* .setTitle('Quarterly sales')
|
|
60
|
+
* .build();
|
|
61
|
+
*
|
|
62
|
+
* const fChart = await fWorksheet.insertChart(chartInfo);
|
|
63
|
+
* console.log(fChart.getId());
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
newChart<T extends ChartTypeString>(type: T): FSheetChartBuilderOf<T>;
|
|
67
|
+
/**
|
|
68
|
+
* Inserts a Chart into this worksheet from detached Chart information.
|
|
69
|
+
*
|
|
70
|
+
* @param {ISheetChartInfo} info The Chart configuration, Sheet data source, and optional placement produced by a Chart builder.
|
|
71
|
+
* @returns {Promise<FSheetChart>} A live facade for the inserted Sheet Chart.
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
75
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
76
|
+
*
|
|
77
|
+
* const chartInfo = fWorksheet
|
|
78
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Pie)
|
|
79
|
+
* .setSource('A1:B8')
|
|
80
|
+
* .setPosition('D2')
|
|
81
|
+
* .setSize(480, 320)
|
|
82
|
+
* .setDoughnutHole(0.4)
|
|
83
|
+
* .build();
|
|
84
|
+
*
|
|
85
|
+
* const fChart = await fWorksheet.insertChart(chartInfo);
|
|
86
|
+
* fChart.setPosition('E3');
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
insertChart(info: ISheetChartInfo): Promise<FSheetChart>;
|
|
90
|
+
/**
|
|
91
|
+
* Returns a Chart on this worksheet by its stable Chart identifier.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} chartId The identifier returned by {@link FSheetChart.getId}.
|
|
94
|
+
* @returns {FSheetChart | null} A live Sheet Chart facade, or `null` if the Chart does not exist on this worksheet.
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
98
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
99
|
+
*
|
|
100
|
+
* const firstChart = fWorksheet.getCharts()[0];
|
|
101
|
+
* const fChart = firstChart ? fWorksheet.getChart(firstChart.getId()) : null;
|
|
102
|
+
* console.log(fChart?.getInfo());
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
getChart(chartId: string): FSheetChart | null;
|
|
106
|
+
/**
|
|
107
|
+
* Returns all Charts on this worksheet.
|
|
108
|
+
*
|
|
109
|
+
* @returns {FSheetChart[]} Live Sheet Chart facades in the worksheet's model order.
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
113
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
114
|
+
*
|
|
115
|
+
* const fCharts = fWorksheet.getCharts();
|
|
116
|
+
* fCharts.forEach((fChart) => {
|
|
117
|
+
* console.log(fChart.getId(), fChart.getInfo());
|
|
118
|
+
* });
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
getCharts(): FSheetChart[];
|
|
122
|
+
}
|
|
123
|
+
/** @ignore */
|
|
124
|
+
export declare class FWorksheetChartMixin extends FWorksheet implements IFWorksheetChartMixin {
|
|
125
|
+
newChart<T extends ChartTypeString>(type: T): FSheetChartBuilderOf<T>;
|
|
126
|
+
insertChart(info: ISheetChartInfo): Promise<FSheetChart>;
|
|
127
|
+
getChart(chartId: string): FSheetChart | null;
|
|
128
|
+
getCharts(): FSheetChart[];
|
|
129
|
+
private _chartSourceContext;
|
|
130
|
+
}
|
|
131
|
+
declare module '@univerjs/sheets/facade' {
|
|
132
|
+
interface FWorksheet extends IFWorksheetChartMixin {
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './f-worksheet
|
|
1
|
+
import './f-worksheet';
|
|
2
2
|
import './f-enum';
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
3
|
+
export { FSheetChart } from './f-chart';
|
|
4
|
+
export type { FSheetChartBuilderOf, ISheetChartMethods } from './f-worksheet';
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export type { ISheetChartBuilderAdapter, ISheetChartHostPatch, } from './chart-builder/sheet-chart-builder-adapter';
|
|
4
|
-
export { toSheetChartCreateSpec } from './chart-builder/sheet-chart-create-spec';
|
|
1
|
+
export { SheetChartConfigAdapter } from './chart-builder/sheet-chart-config-adapter';
|
|
2
|
+
export type { ISheetChartConfigAdapter, ISheetChartHostPatch, } from './chart-builder/sheet-chart-config-adapter';
|
|
5
3
|
export type { ISheetChartDescriptionExtension } from './chart-builder/sheet-chart-description';
|
|
6
4
|
export { resolveInitialChartPosition } from './chart-builder/sheet-chart-layout';
|
|
7
5
|
export { resolveSourceSeries, resolveSourceSpec } from './chart-builder/sheet-chart-source';
|
|
8
6
|
export type { ISheetChartSourceContext, } from './chart-builder/sheet-chart-source';
|
|
9
7
|
export { ChartDiagnosticSeverity, ChartSourceKind, ChartSourceOrientation, } from './chart-builder/types';
|
|
10
|
-
export type { ChartAnchorSpec, ChartSourceSpec, IChartCreateSpec, IChartDiagnostic, } from './chart-builder/types';
|
|
8
|
+
export type { ChartAnchorSpec, ChartSourceSpec, IChartCreateSpec, IChartDiagnostic, ISheetChartInfo, } from './chart-builder/types';
|
|
11
9
|
export { ChartUpdateConfigCommand, ReplaceSheetChartConfig } from './commands/commands/sheets-chart-update-config.command';
|
|
12
10
|
export type { IChartUpdateConfigCommandParams } from './commands/commands/sheets-chart-update-config.command';
|
|
13
11
|
export { ChartUpdateSourceCommand } from './commands/commands/sheets-chart-update-source.command';
|
|
@@ -20,7 +18,7 @@ export { ChartUpdateConfigMutation } from './commands/mutations/sheets-chart-upd
|
|
|
20
18
|
export type { IChartUpdateConfigMutationParams } from './commands/mutations/sheets-chart-update-config.mutation';
|
|
21
19
|
export { InsertSheetsChartMutation, RemoveSheetsChartMutation, toInsertChartMutationSource, } from './commands/mutations/sheets-chart.mutation';
|
|
22
20
|
export type { IInsertSheetsChartMutationParams, IRemoveSheetsChartMutationParams, } from './commands/mutations/sheets-chart.mutation';
|
|
23
|
-
export { getAllowedChartTypes,
|
|
21
|
+
export { getAllowedChartTypes, } from './common/util';
|
|
24
22
|
export { ChartRenderMode, SHEETS_CHART_PLUGIN_CONFIG_KEY, } from './config/config';
|
|
25
23
|
export type { IUniverSheetsChartConfig } from './config/config';
|
|
26
24
|
export type { IChartSourceMultiRangeItem, IChartSourceRangeItem, ISheetChartDataSource, ISheetChartSourceSingleRange, ISheetChartSourceSnapshot, } from './models/types';
|
|
@@ -23,6 +23,7 @@ export declare class ChartModelService extends Disposable {
|
|
|
23
23
|
createChartModel(id: string, options: IChartModelInit<ISheetChartDataSource>, isNew?: boolean): ChartModel<ISheetChartDataSource>;
|
|
24
24
|
removeChartModel(id: string): void;
|
|
25
25
|
generateChartModelContext(id: string, initializeSelection?: boolean): IChartContext | undefined;
|
|
26
|
+
reconcileChartModelContext(id: string): IChartContext | undefined;
|
|
26
27
|
generateChartModelContextForDataSource(id: string, dataSource: ISheetChartDataSource): IChartContext | undefined;
|
|
27
28
|
dispose(): void;
|
|
28
29
|
}
|
|
@@ -32,6 +32,9 @@ export declare class SheetsChartService extends Disposable {
|
|
|
32
32
|
orient: DataOrientation;
|
|
33
33
|
chartType: ChartTypeBits;
|
|
34
34
|
};
|
|
35
|
+
private _getPrimaryChartSuggestion;
|
|
36
|
+
private _hasSeries;
|
|
37
|
+
private _getSuggestionForOrientation;
|
|
35
38
|
private _normalizeInitialRangeInfo;
|
|
36
39
|
private _hasNonNumberCellInSingleRow;
|
|
37
40
|
ensureChartModelCollection(unitId: string, subUnitId: string): Set<string>;
|
|
@@ -39,6 +42,7 @@ export declare class SheetsChartService extends Disposable {
|
|
|
39
42
|
setChartDataSource(id: string, dataSource: ISheetChartDataSource): void;
|
|
40
43
|
replaceChartDataSource(id: string, rangeInfo: ISheetChartSourceRanges): boolean;
|
|
41
44
|
generateChartModelContextForSource(id: string, rangeInfo: ISheetChartSourceRanges): import("@univerjs-pro/engine-chart").IChartContext | undefined;
|
|
45
|
+
resolveInitialChartContextForSource(rangeInfo: ISheetChartSourceRanges, chartType: ChartTypeBits, context?: NonNullable<IChartSnapshot['context']>): NonNullable<IChartSnapshot['context']>;
|
|
42
46
|
refreshChartSource(): void;
|
|
43
47
|
createChartModel(unitId: string, subUnitId: string, options: ISheetChartModelOptions, isNew?: boolean): ChartModel<ISheetChartDataSource>;
|
|
44
48
|
removeChartModel(id: string): void;
|