@univerjs-pro/engine-chart 1.0.2 → 1.0.3
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/index.d.ts +8 -6
- package/lib/types/models/chart-host/resource/chart-resource-repository.d.ts +14 -37
- package/lib/types/models/chart-host/static/chart-host-data-source-binding.d.ts +13 -0
- package/lib/types/models/chart-host/static/chart-inline-data-source-binding.d.ts +17 -0
- package/lib/types/models/chart-host/static/chart-projected-data-source.d.ts +18 -0
- package/lib/types/models/chart-host/static/chart-resource-runtime.service.d.ts +10 -8
- package/lib/types/source/chart-data-source-status.d.ts +10 -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 +5 -6
- package/lib/types/models/chart-host/resource/chart-data-source-runtime.service.d.ts +0 -60
- package/lib/types/models/chart-host/resource/resource-ref-chart-data-source.adapter.d.ts +0 -22
- package/lib/types/models/chart-host/resource/resource-ref-chart-data-source.provider.d.ts +0 -14
- package/lib/types/models/chart-host/static/chart-resource-data-source-runtime.d.ts +0 -32
package/lib/locale/zh-CN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x5b97(){const _0x3f8fd7=['OHLC\x20系列','第三四分位数','49SWMqYV','545066nVyAXu','34352813birjfD','旭日图至少需要一个层级字段和一个数值字段。','自身值','弦图至少需要两个不同节点之间的一条正权重关系。','第一四分位数','3ULnfAc','桑基图不能包含循环数据','HLC\x20系列','最大值','仪表图配置无效,请检查刻度范围、分段区间、比例和尺寸。','最小值','累积占比','10hfChhU','6aozsyb','1783435JMWfLF','关系计数','系列\x20{0}','关联值','仪表图需要一个标签字段且只能有一个数值字段。','弦图需要不同的来源字段和目标字段,并可选一个与二者不同的数值字段。','1304532GZNHah','中位数','矩形树图至少需要一个层级字段和一个数值字段。','(空)','2118789xWmcKi','4361901gbXvlT','关系图数据源为额外添加类型列在第二列的共词矩阵','仪表图至少需要一个有限数值。','2149336XGBeau'];_0x5b97=function(){return _0x3f8fd7;};return _0x5b97();}const _0x15fbcf=_0x3a03;(function(_0x4e903a,_0x25861c){const _0x5e559e=_0x3a03,_0x1b1fea=_0x4e903a();while(!![]){try{const _0x12e63b=parseInt(_0x5e559e(0x94))/0x1*(-parseInt(_0x5e559e(0x8e))/0x2)+parseInt(_0x5e559e(0xa8))/0x3+-parseInt(_0x5e559e(0xa3))/0x4+-parseInt(_0x5e559e(0x9d))/0x5*(parseInt(_0x5e559e(0x9c))/0x6)+-parseInt(_0x5e559e(0x8d))/0x7*(parseInt(_0x5e559e(0x8a))/0x8)+-parseInt(_0x5e559e(0xa7))/0x9+-parseInt(_0x5e559e(0x9b))/0xa*(-parseInt(_0x5e559e(0x8f))/0xb);if(_0x12e63b===_0x25861c)break;else _0x1b1fea['push'](_0x1b1fea['shift']());}catch(_0x427a06){_0x1b1fea['push'](_0x1b1fea['shift']());}}}(_0x5b97,0xea7b9));const e={'engine-chart':{'invalidSourceHeader':'图表数据源标题配置无效。','seriesDefaultName':_0x15fbcf(0x9f),'blank':_0x15fbcf(0xa6),'boxplotMin':_0x15fbcf(0x99),'boxplotQ1':_0x15fbcf(0x93),'boxplotMedian':_0x15fbcf(0xa4),'boxplotQ3':_0x15fbcf(0x8c),'boxplotMax':_0x15fbcf(0x97),'bubbleEmptyTips':'气泡图至少需要2列,X轴、Y轴。','cloudWord':'词语','cloudFrequency':'频率','msgEmptyTips':'请先添加系列开始数据可视化','msgSankeyCircularTips':_0x15fbcf(0x95),'paretoLineName':_0x15fbcf(0x9a),'pieAggregateOther':'其他','pieAggregateMembers':'成员数','relationEmptyTips':_0x15fbcf(0xa9),'waterfallPositive':'正值','waterfallNegative':'负值','waterfallSubtotal':'小计','candlestickSeries':_0x15fbcf(0x8b),'candlestickHlcSeries':_0x15fbcf(0x96),'candlestickCategory':'类别','candlestickDate':'日期','candlestickOpen':'开盘','candlestickHigh':'最高','candlestickLow':'最低','candlestickClose':'收盘','histogramFrequency':'频数','treemapEmptyTips':_0x15fbcf(0xa5),'treemapOwnValue':_0x15fbcf(0x91),'treemapChildren':'子项','sunburstEmptyTips':_0x15fbcf(0x90),'sunburstOwnValue':_0x15fbcf(0x91),'sunburstChildren':'子项','gaugeEmptyTips':_0x15fbcf(0x89),'gaugeInvalidMapping':_0x15fbcf(0xa1),'gaugeInvalidConfig':_0x15fbcf(0x98),'chordEmptyTips':_0x15fbcf(0x92),'chordInvalidMapping':_0x15fbcf(0xa2),'chordInvalidConfig':'弦图配置无效,请检查角度、半径、不透明度和尺寸。','chordCount':_0x15fbcf(0x9e),'chordAssociatedValue':_0x15fbcf(0xa0)}};function _0x3a03(_0x4daf02,_0x39eb72){_0x4daf02=_0x4daf02-0x89;const _0x5b9775=_0x5b97();let _0x3a031d=_0x5b9775[_0x4daf02];return _0x3a031d;}export{e as default};
|
package/lib/locale/zh-HK.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const _0x5d9d7a=_0x2185;function _0x2185(_0x3ecb96,_0x2f5f22){_0x3ecb96=_0x3ecb96-0x116;const _0x476c03=_0x476c();let _0x21850f=_0x476c03[_0x3ecb96];return _0x21850f;}(function(_0x3d1407,_0x13cdc9){const _0x1a6241=_0x2185,_0x18db9f=_0x3d1407();while(!![]){try{const _0x149d5d=-parseInt(_0x1a6241(0x118))/0x1+-parseInt(_0x1a6241(0x128))/0x2+-parseInt(_0x1a6241(0x120))/0x3+-parseInt(_0x1a6241(0x132))/0x4+-parseInt(_0x1a6241(0x11e))/0x5+-parseInt(_0x1a6241(0x130))/0x6+parseInt(_0x1a6241(0x119))/0x7*(parseInt(_0x1a6241(0x131))/0x8);if(_0x149d5d===_0x13cdc9)break;else _0x18db9f['push'](_0x18db9f['shift']());}catch(_0x17bfdc){_0x18db9f['push'](_0x18db9f['shift']());}}}(_0x476c,0x443bd));function _0x476c(){const _0x575aa8=['2102466HxvxsL','16eNUPnV','682048rCLxSa','弦圖需要不同的來源與目標欄位,並可選擇一個與兩者不同的數值欄位。','桑基圖不能包含循環數據','(空)','儀表圖至少需要一個有限數值。','關係數','最大值','510879qtPOZd','6791596YnZFnj','最低價','儀表圖需要一個標籤欄位,而且只能有一個數值欄位。','中位數','關聯值','829910coxFTd','系列\x20{0}','109950OotjGS','儀表圖設定無效,請檢查刻度範圍、分段區間、比例和尺寸。','矩形樹圖至少需要一個階層欄位和一個數值欄位。','弦圖設定無效,請檢查角度、半徑、不透明度和尺寸。','請先添加系列開始數據可視化','開盤價','氣泡圖至少需要2欄,X軸、Y軸。','最高價','853074lxEzEA','收盤價','最小值','圖表資料來源標題設定無效。','弦圖至少需要兩個不同節點之間的一條正權重關係。','OHLC\x20數列','自身值','第一四分位數'];_0x476c=function(){return _0x575aa8;};return _0x476c();}const e={'engine-chart':{'invalidSourceHeader':_0x5d9d7a(0x12b),'seriesDefaultName':_0x5d9d7a(0x11f),'blank':_0x5d9d7a(0x135),'boxplotMin':_0x5d9d7a(0x12a),'boxplotQ1':_0x5d9d7a(0x12f),'boxplotMedian':_0x5d9d7a(0x11c),'boxplotQ3':'第三四分位數','boxplotMax':_0x5d9d7a(0x117),'bubbleEmptyTips':_0x5d9d7a(0x126),'cloudWord':'詞','cloudFrequency':'頻率','msgEmptyTips':_0x5d9d7a(0x124),'msgSankeyCircularTips':_0x5d9d7a(0x134),'paretoLineName':'累積占比','pieAggregateOther':'其他','pieAggregateMembers':'成員','relationEmptyTips':'關係圖資料來源為額外新增類型欄在第二欄的共詞矩陣','waterfallPositive':'正值','waterfallNegative':'負值','waterfallSubtotal':'小計','candlestickSeries':_0x5d9d7a(0x12d),'candlestickHlcSeries':'HLC\x20數列','candlestickCategory':'類別','candlestickDate':'日期','candlestickOpen':_0x5d9d7a(0x125),'candlestickHigh':_0x5d9d7a(0x127),'candlestickLow':_0x5d9d7a(0x11a),'candlestickClose':_0x5d9d7a(0x129),'histogramFrequency':'頻數','treemapEmptyTips':_0x5d9d7a(0x122),'treemapOwnValue':_0x5d9d7a(0x12e),'treemapChildren':'子項','sunburstEmptyTips':'旭日圖至少需要一個階層欄位和一個數值欄位。','sunburstOwnValue':_0x5d9d7a(0x12e),'sunburstChildren':'子項','gaugeEmptyTips':_0x5d9d7a(0x136),'gaugeInvalidMapping':_0x5d9d7a(0x11b),'gaugeInvalidConfig':_0x5d9d7a(0x121),'chordEmptyTips':_0x5d9d7a(0x12c),'chordInvalidMapping':_0x5d9d7a(0x133),'chordInvalidConfig':_0x5d9d7a(0x123),'chordCount':_0x5d9d7a(0x116),'chordAssociatedValue':_0x5d9d7a(0x11d)}};export{e as default};
|
package/lib/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x2f2d(){const _0x1e98ed=['收盤價','3721122GXfHEy','3794104ZYqVdf','最高價','12QowlgU','第一四分位數','關係圖資料來源為額外新增類型欄在第二欄的共詞矩陣','最大值','開盤價','關聯值','30RUuYJy','68498243GxBQrl','弦圖至少需要兩個不同節點之間的一條正權重關係。','(空)','17930840LxrGVW','請先添加系列開始數據可視化','中位數','OHLC\x20數列','桑基圖不能包含循環數據','儀表圖至少需要一個有限數值。','HLC\x20數列','矩形樹圖至少需要一個階層欄位和一個數值欄位。','自身值','儀表圖需要一個標籤欄位,而且只能有一個數值欄位。','13JSawLt','819216YxGJXf','2213897ogsyuv','5nDrOlC','153kTUaDm','累積占比','關係數','氣泡圖至少需要2欄,X軸、Y軸。','230340MBfJyu','最小值','旭日圖至少需要一個階層欄位和一個數值欄位。'];_0x2f2d=function(){return _0x1e98ed;};return _0x2f2d();}function _0x87f3(_0x311407,_0x423cd6){_0x311407=_0x311407-0x14b;const _0x2f2d25=_0x2f2d();let _0x87f3f4=_0x2f2d25[_0x311407];return _0x87f3f4;}const _0x5c85f3=_0x87f3;(function(_0x3abbd3,_0x33d4a1){const _0x3eae52=_0x87f3,_0x36d118=_0x3abbd3();while(!![]){try{const _0x3a04ef=parseInt(_0x3eae52(0x151))/0x1*(-parseInt(_0x3eae52(0x159))/0x2)+-parseInt(_0x3eae52(0x15d))/0x3+-parseInt(_0x3eae52(0x15e))/0x4*(parseInt(_0x3eae52(0x154))/0x5)+parseInt(_0x3eae52(0x166))/0x6*(-parseInt(_0x3eae52(0x153))/0x7)+-parseInt(_0x3eae52(0x152))/0x8*(-parseInt(_0x3eae52(0x155))/0x9)+-parseInt(_0x3eae52(0x16a))/0xa+parseInt(_0x3eae52(0x167))/0xb*(parseInt(_0x3eae52(0x160))/0xc);if(_0x3a04ef===_0x33d4a1)break;else _0x36d118['push'](_0x36d118['shift']());}catch(_0x1118a4){_0x36d118['push'](_0x36d118['shift']());}}}(_0x2f2d,0xdd886));const e={'engine-chart':{'invalidSourceHeader':'圖表資料來源標題設定無效。','seriesDefaultName':'系列\x20{0}','blank':_0x5c85f3(0x169),'boxplotMin':_0x5c85f3(0x15a),'boxplotQ1':_0x5c85f3(0x161),'boxplotMedian':_0x5c85f3(0x16c),'boxplotQ3':'第三四分位數','boxplotMax':_0x5c85f3(0x163),'bubbleEmptyTips':_0x5c85f3(0x158),'cloudWord':'詞','cloudFrequency':'頻率','msgEmptyTips':_0x5c85f3(0x16b),'msgSankeyCircularTips':_0x5c85f3(0x14b),'paretoLineName':_0x5c85f3(0x156),'pieAggregateOther':'其他','pieAggregateMembers':'成員','relationEmptyTips':_0x5c85f3(0x162),'waterfallPositive':'正值','waterfallNegative':'負值','waterfallSubtotal':'小計','candlestickSeries':_0x5c85f3(0x16d),'candlestickHlcSeries':_0x5c85f3(0x14d),'candlestickCategory':'類別','candlestickDate':'日期','candlestickOpen':_0x5c85f3(0x164),'candlestickHigh':_0x5c85f3(0x15f),'candlestickLow':'最低價','candlestickClose':_0x5c85f3(0x15c),'histogramFrequency':'頻數','treemapEmptyTips':_0x5c85f3(0x14e),'treemapOwnValue':_0x5c85f3(0x14f),'treemapChildren':'子項','sunburstEmptyTips':_0x5c85f3(0x15b),'sunburstOwnValue':'自身值','sunburstChildren':'子項','gaugeEmptyTips':_0x5c85f3(0x14c),'gaugeInvalidMapping':_0x5c85f3(0x150),'gaugeInvalidConfig':'儀表圖設定無效,請檢查刻度範圍、分段區間、比例和尺寸。','chordEmptyTips':_0x5c85f3(0x168),'chordInvalidMapping':'弦圖需要不同的來源與目標欄位,並可選擇一個與兩者不同的數值欄位。','chordInvalidConfig':'弦圖設定無效,請檢查角度、半徑、不透明度和尺寸。','chordCount':_0x5c85f3(0x157),'chordAssociatedValue':_0x5c85f3(0x165)}};export{e as default};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -74,15 +74,15 @@ export { chartConfigInterpreter } from './models/chart-host/config/chart-config-
|
|
|
74
74
|
export type { IChartConfigUpdate } from './models/chart-host/config/chart-config-interpreter';
|
|
75
75
|
export { chartImageSourceToDataUrl, DataUrlImageChartHost, ImageChartHost, } from './models/chart-host/image-chart-host';
|
|
76
76
|
export { OffscreenChartHost } from './models/chart-host/offscreen-chart-host';
|
|
77
|
-
export {
|
|
78
|
-
export type {
|
|
79
|
-
export { CHART_RESOURCE_VERSION, ChartResourceRepository, isInlineChartDataSource, isReferencedChartDataSource, } from './models/chart-host/resource/chart-resource-repository';
|
|
80
|
-
export type { IChartDataSourceInput, IChartResource, IChartResourceContext, IChartResourceDataSource, IChartResourceSnapshot, IChartResourceState, ICreateChartDataSourceOptions, ICreateChartSnapshotOptions, IInlineChartDataSource, IReferencedChartDataSource, IUpdateChartSnapshotPatch, } from './models/chart-host/resource/chart-resource-repository';
|
|
77
|
+
export { ChartResourceRepository, isInlineChartDataSource, } from './models/chart-host/resource/chart-resource-repository';
|
|
78
|
+
export type { IChartDataSourceDescriptor, IChartResource, IChartResourceContext, IChartResourceSnapshot, IChartResourceState, ICreateChartDataSourceOptions, ICreateChartSnapshotOptions, IInlineChartDataSource, IUpdateChartSnapshotPatch, } from './models/chart-host/resource/chart-resource-repository';
|
|
81
79
|
export { serializeChartResource } from './models/chart-host/resource/chart-resource-serializer';
|
|
82
80
|
export { parseInlineChartTable, } from './models/chart-host/resource/inline-chart-table';
|
|
83
81
|
export type { ChartDataSourceValue } from './models/chart-host/resource/inline-chart-table';
|
|
84
|
-
export {
|
|
85
|
-
export
|
|
82
|
+
export type { IChartHostDataSourceBinding } from './models/chart-host/static/chart-host-data-source-binding';
|
|
83
|
+
export { ChartInlineDataSourceBinding } from './models/chart-host/static/chart-inline-data-source-binding';
|
|
84
|
+
export { ChartProjectedDataSource } from './models/chart-host/static/chart-projected-data-source';
|
|
85
|
+
export type { IChartResourceSourceProjection } from './models/chart-host/static/chart-projected-data-source';
|
|
86
86
|
export { ChartResourceRuntimeService } from './models/chart-host/static/chart-resource-runtime.service';
|
|
87
87
|
export type { IChartModelBinding } from './models/chart-host/static/chart-resource-runtime.service';
|
|
88
88
|
export { createChartRuntime, refreshChartRuntime, } from './models/chart-host/static/chart-runtime';
|
|
@@ -130,6 +130,8 @@ export { UniverChartPlugin } from './plugin';
|
|
|
130
130
|
export { toChartDataItem } from './source/chart-data-item';
|
|
131
131
|
export { createChartDataSetProjector } from './source/chart-data-set-projector';
|
|
132
132
|
export type { IChartDataSetProjector, IChartSourceItem, IChartSourceTable, ICreateChartDataSetProjectorOptions, } from './source/chart-data-set-projector';
|
|
133
|
+
export { ChartDataSourceRuntimeStatus } from './source/chart-data-source-status';
|
|
134
|
+
export type { IChartDataSourceStatus } from './source/chart-data-source-status';
|
|
133
135
|
export { ChartDataSource } from './source/chart-source';
|
|
134
136
|
export { ChartSourceHeaderTitleType } from './source/chart-source-header';
|
|
135
137
|
export type { IChartSourceHeader, IChartSourceHeaderTitle } from './source/chart-source-header';
|
|
@@ -4,39 +4,17 @@ import type { ChartTypeBits } from '../../../enum';
|
|
|
4
4
|
import type { IChartSourceHeader } from '../../../source/chart-source-header';
|
|
5
5
|
import type { ChartStyle, IChartContext } from '../../../types';
|
|
6
6
|
import type { ChartDataSourceValue } from './inline-chart-table';
|
|
7
|
-
import type { IResourceRefChartDataSourceReference } from './resource-ref-chart-data-source.adapter';
|
|
8
7
|
import { Disposable } from '@univerjs/core';
|
|
9
|
-
export
|
|
10
|
-
export interface IInlineChartDataSource<TCell extends ChartDataSourceValue = ChartDataSourceValue> {
|
|
8
|
+
export interface IChartDataSourceDescriptor {
|
|
11
9
|
id: string;
|
|
12
10
|
name?: string;
|
|
13
|
-
values: TCell[][];
|
|
14
11
|
}
|
|
15
|
-
export interface
|
|
12
|
+
export interface IInlineChartDataSource<TCell extends ChartDataSourceValue = ChartDataSourceValue> {
|
|
16
13
|
id: string;
|
|
17
14
|
name?: string;
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
export type IChartResourceDataSource = IInlineChartDataSource | IReferencedChartDataSource;
|
|
21
|
-
export type IChartDataSourceInput = {
|
|
22
|
-
values: ChartDataSourceValue[][];
|
|
23
|
-
source?: never;
|
|
24
|
-
} | {
|
|
25
|
-
source: IResourceRefChartDataSourceReference;
|
|
26
|
-
values?: never;
|
|
27
|
-
};
|
|
28
|
-
interface IChartDataSourceCandidate {
|
|
29
|
-
values?: ChartDataSourceValue[][];
|
|
30
|
-
source?: IResourceRefChartDataSourceReference;
|
|
15
|
+
values: TCell[][];
|
|
31
16
|
}
|
|
32
|
-
export declare function isInlineChartDataSource
|
|
33
|
-
values: ChartDataSourceValue[][];
|
|
34
|
-
source?: never;
|
|
35
|
-
};
|
|
36
|
-
export declare function isReferencedChartDataSource<T extends IChartDataSourceCandidate>(dataSource: T | null | undefined): dataSource is T & {
|
|
37
|
-
source: IResourceRefChartDataSourceReference;
|
|
38
|
-
values?: never;
|
|
39
|
-
};
|
|
17
|
+
export declare function isInlineChartDataSource(dataSource: unknown): dataSource is IInlineChartDataSource;
|
|
40
18
|
export interface IChartResourceContext {
|
|
41
19
|
/** Authored sources persist an explicit projection; only snapshot decoding supplies historical defaults. */
|
|
42
20
|
header?: IChartSourceHeader;
|
|
@@ -60,12 +38,11 @@ export interface IChartResourceSnapshot<TContext = IChartResourceContext, TState
|
|
|
60
38
|
state?: TState;
|
|
61
39
|
dataAggregation?: IChartDataAggregation;
|
|
62
40
|
}
|
|
63
|
-
export interface IChartResource<TDataSource extends
|
|
64
|
-
version: typeof CHART_RESOURCE_VERSION;
|
|
41
|
+
export interface IChartResource<TDataSource extends IChartDataSourceDescriptor = IChartDataSourceDescriptor, TChart extends IChartResourceSnapshot<unknown, unknown> = IChartResourceSnapshot> {
|
|
65
42
|
dataSources: Record<string, TDataSource>;
|
|
66
43
|
charts: Record<string, TChart>;
|
|
67
44
|
}
|
|
68
|
-
export type ICreateChartDataSourceOptions<TDataSource extends
|
|
45
|
+
export type ICreateChartDataSourceOptions<TDataSource extends IChartDataSourceDescriptor = IChartDataSourceDescriptor> = TDataSource extends IChartDataSourceDescriptor ? Omit<TDataSource, 'id'> & {
|
|
69
46
|
id?: string;
|
|
70
47
|
} : never;
|
|
71
48
|
export type ICreateChartSnapshotOptions<TChart extends IChartResourceSnapshot<unknown, unknown>> = Omit<TChart, 'id'> & {
|
|
@@ -107,14 +84,17 @@ export type IChartResourceChangeEvent = {
|
|
|
107
84
|
kind: typeof ChartResourceChangeKind.UnitUnloaded;
|
|
108
85
|
unitId: string;
|
|
109
86
|
};
|
|
110
|
-
export declare class ChartResourceRepository<TDataSource extends
|
|
87
|
+
export declare abstract class ChartResourceRepository<TDataSource extends IChartDataSourceDescriptor = IChartDataSourceDescriptor, TChart extends IChartResourceSnapshot<unknown, unknown> = IChartResourceSnapshot, TResource extends IChartResource<TDataSource, TChart> = IChartResource<TDataSource, TChart>> extends Disposable {
|
|
111
88
|
private readonly _resources;
|
|
112
89
|
private readonly _dataSourceRemoved$;
|
|
113
90
|
private readonly _resourceChanged$;
|
|
114
91
|
readonly dataSourceRemoved$: Observable<IChartDataSourceRemovedEvent>;
|
|
115
92
|
readonly resourceChanged$: Observable<IChartResourceChangeEvent>;
|
|
116
|
-
/**
|
|
117
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Returns a cloned context with a validated, normalized Header before command recording.
|
|
95
|
+
* Supplied values enable dimension-bound checks; omitted values validate Header structure only.
|
|
96
|
+
*/
|
|
97
|
+
prepareChartContext(context: IChartResourceContext | undefined, values?: ChartDataSourceValue[][]): IChartResourceContext;
|
|
118
98
|
ensureUnitResource(unitId: string): TResource;
|
|
119
99
|
loadUnit(unitId: string, resource: unknown): TResource;
|
|
120
100
|
unloadUnit(unitId: string): void;
|
|
@@ -124,7 +104,6 @@ export declare class ChartResourceRepository<TDataSource extends IChartResourceD
|
|
|
124
104
|
getChart(unitId: string, chartId: string): TChart | undefined;
|
|
125
105
|
createDataSource(unitId: string, options: ICreateChartDataSourceOptions<TDataSource>): TDataSource;
|
|
126
106
|
setDataSource(unitId: string, dataSource: TDataSource): TDataSource;
|
|
127
|
-
updateDataSource(unitId: string, dataSourceId: string, values: ChartDataSourceValue[][], patch?: Partial<Pick<TDataSource, 'name'>>): TDataSource | undefined;
|
|
128
107
|
removeDataSource(unitId: string, dataSourceId: string): boolean;
|
|
129
108
|
createChart(unitId: string, options: ICreateChartSnapshotOptions<TChart>): TChart;
|
|
130
109
|
setChart(unitId: string, chart: TChart): TChart;
|
|
@@ -139,11 +118,9 @@ export declare class ChartResourceRepository<TDataSource extends IChartResourceD
|
|
|
139
118
|
cleanupOrphanedResources(unitId: string): void;
|
|
140
119
|
dispose(): void;
|
|
141
120
|
private _decodeResource;
|
|
142
|
-
|
|
121
|
+
protected abstract _decodeDataSource(dataSourceId: string, candidate: unknown): TDataSource;
|
|
143
122
|
private _cloneDataSource;
|
|
123
|
+
protected _invalidDataSource(dataSourceId: string): Error;
|
|
144
124
|
private _isResourceEnvelope;
|
|
145
|
-
private _isValues;
|
|
146
|
-
private _normalizeReference;
|
|
147
|
-
private _invalidDataSource;
|
|
148
125
|
}
|
|
149
126
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IDisposable } from '@univerjs/core';
|
|
2
|
+
import type { Observable } from 'rxjs';
|
|
3
|
+
import type { IChartDataSourceStatus } from '../../../source/chart-data-source-status';
|
|
4
|
+
import type { IChartDataSource } from '../../../types';
|
|
5
|
+
import type { IChartResourceSourceProjection } from './chart-projected-data-source';
|
|
6
|
+
export interface IChartHostDataSourceBinding extends IDisposable {
|
|
7
|
+
readonly dataSource: IChartDataSource;
|
|
8
|
+
readonly state$: Observable<IChartDataSourceStatus>;
|
|
9
|
+
readonly state: IChartDataSourceStatus;
|
|
10
|
+
refresh?(): Promise<void>;
|
|
11
|
+
setProjection(projection: IChartResourceSourceProjection): void;
|
|
12
|
+
markUnavailable(error: unknown): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IChartDataSourceStatus } from '../../../source/chart-data-source-status';
|
|
2
|
+
import type { ChartDataSourceValue } from '../resource/inline-chart-table';
|
|
3
|
+
import type { IChartHostDataSourceBinding } from './chart-host-data-source-binding';
|
|
4
|
+
import type { IChartResourceSourceProjection } from './chart-projected-data-source';
|
|
5
|
+
import { Disposable } from '@univerjs/core';
|
|
6
|
+
import { ChartProjectedDataSource } from './chart-projected-data-source';
|
|
7
|
+
export declare class ChartInlineDataSourceBinding extends Disposable implements IChartHostDataSourceBinding {
|
|
8
|
+
readonly dataSource: ChartProjectedDataSource;
|
|
9
|
+
private readonly _state$;
|
|
10
|
+
readonly state$: import("rxjs").Observable<IChartDataSourceStatus>;
|
|
11
|
+
constructor(values: ReadonlyArray<ReadonlyArray<ChartDataSourceValue>>, projection: IChartResourceSourceProjection);
|
|
12
|
+
get state(): IChartDataSourceStatus;
|
|
13
|
+
update(values: ReadonlyArray<ReadonlyArray<ChartDataSourceValue>>, projection: IChartResourceSourceProjection): void;
|
|
14
|
+
setProjection(projection: IChartResourceSourceProjection): void;
|
|
15
|
+
markUnavailable(error: unknown): void;
|
|
16
|
+
dispose(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IChartResourceContext } from '../resource/chart-resource-repository';
|
|
2
|
+
import type { ChartDataSourceValue } from '../resource/inline-chart-table';
|
|
3
|
+
import { ChartDataSource } from '../../../source/chart-source';
|
|
4
|
+
export interface IChartResourceSourceProjection {
|
|
5
|
+
header?: IChartResourceContext['header'];
|
|
6
|
+
isRowDirection: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class ChartProjectedDataSource extends ChartDataSource {
|
|
9
|
+
private _sourceProjection;
|
|
10
|
+
private _rawValues?;
|
|
11
|
+
private _diagnostics;
|
|
12
|
+
private _sourceProjectionDisposed;
|
|
13
|
+
constructor(_sourceProjection: IChartResourceSourceProjection);
|
|
14
|
+
get diagnostics(): readonly unknown[];
|
|
15
|
+
setValues(values: ReadonlyArray<ReadonlyArray<ChartDataSourceValue>>, projection?: IChartResourceSourceProjection): void;
|
|
16
|
+
setProjection(projection: IChartResourceSourceProjection): void;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Injector } from '@univerjs/core';
|
|
2
2
|
import type { Observable } from 'rxjs';
|
|
3
|
+
import type { IChartDataSourceStatus } from '../../../source/chart-data-source-status';
|
|
3
4
|
import type { IChartContext } from '../../../types';
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
5
|
+
import type { ChartResourceRepository, IChartDataSourceDescriptor, IChartResource, IChartResourceContext, IChartResourceSnapshot } from '../resource/chart-resource-repository';
|
|
6
|
+
import type { IChartHostDataSourceBinding } from './chart-host-data-source-binding';
|
|
7
|
+
import type { IChartResourceSourceProjection } from './chart-projected-data-source';
|
|
6
8
|
import { Disposable } from '@univerjs/core';
|
|
7
9
|
import { ChartModel } from '../../chart-model/chart-model';
|
|
8
10
|
export interface IChartModelBinding {
|
|
@@ -11,10 +13,9 @@ export interface IChartModelBinding {
|
|
|
11
13
|
dataSourceId: string;
|
|
12
14
|
model: ChartModel;
|
|
13
15
|
}
|
|
14
|
-
export declare class ChartResourceRuntimeService<TDataSource extends
|
|
16
|
+
export declare abstract class ChartResourceRuntimeService<TDataSource extends IChartDataSourceDescriptor, TChart extends IChartResourceSnapshot<IChartResourceContext, unknown>, TResource extends IChartResource<TDataSource, TChart>, TRuntime extends IChartModelBinding = IChartModelBinding> extends Disposable {
|
|
15
17
|
private readonly _resourceRepository;
|
|
16
18
|
private readonly _injector;
|
|
17
|
-
private readonly _dataSourceRuntimeService;
|
|
18
19
|
private readonly _activeRuntimeModel$;
|
|
19
20
|
readonly activeRuntimeModel$: Observable<TRuntime | null>;
|
|
20
21
|
get activeRuntimeModel(): TRuntime | null;
|
|
@@ -27,11 +28,11 @@ export declare class ChartResourceRuntimeService<TDataSource extends IChartResou
|
|
|
27
28
|
readonly chartModelAdded$: Observable<TRuntime>;
|
|
28
29
|
private readonly _chartModelRemoved$;
|
|
29
30
|
readonly chartModelRemoved$: Observable<TRuntime>;
|
|
30
|
-
constructor(_resourceRepository: ChartResourceRepository<TDataSource, TChart, TResource>, _injector: Injector
|
|
31
|
+
constructor(_resourceRepository: ChartResourceRepository<TDataSource, TChart, TResource>, _injector: Injector);
|
|
31
32
|
ensureChartModel(unitId: string, chartId: string): TRuntime | undefined;
|
|
32
33
|
getChartModel(unitId: string, chartId: string): TRuntime | undefined;
|
|
33
|
-
getDataSourceRuntimeState$(unitId: string, chartId: string): Observable<
|
|
34
|
-
getDataSourceRuntimeState(unitId: string, chartId: string):
|
|
34
|
+
getDataSourceRuntimeState$(unitId: string, chartId: string): Observable<IChartDataSourceStatus> | undefined;
|
|
35
|
+
getDataSourceRuntimeState(unitId: string, chartId: string): IChartDataSourceStatus | undefined;
|
|
35
36
|
refreshChartDataSource(unitId: string, chartId: string): Promise<void>;
|
|
36
37
|
setActiveChartRuntime(runtime: TRuntime | null): void;
|
|
37
38
|
setActiveChartModel(chartModel: ChartModel | null): void;
|
|
@@ -44,7 +45,8 @@ export declare class ChartResourceRuntimeService<TDataSource extends IChartResou
|
|
|
44
45
|
dispose(): void;
|
|
45
46
|
protected _createStoredRuntime(runtime: IChartModelBinding): TRuntime;
|
|
46
47
|
protected _beforeRuntimeRefresh(_runtime: TRuntime): void;
|
|
47
|
-
|
|
48
|
+
protected abstract _createDataSourceBinding(unitId: string, descriptor: TDataSource, projection: IChartResourceSourceProjection): IChartHostDataSourceBinding;
|
|
49
|
+
protected abstract _updateDataSourceBinding(binding: IChartHostDataSourceBinding, previous: TDataSource, next: TDataSource, projection: IChartResourceSourceProjection): boolean;
|
|
48
50
|
private _createSourceProjection;
|
|
49
51
|
private _handleResourceChange;
|
|
50
52
|
private _setBinding;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum ChartDataSourceRuntimeStatus {
|
|
2
|
+
LOADING = "loading",
|
|
3
|
+
READY = "ready",
|
|
4
|
+
UNAVAILABLE = "unavailable",
|
|
5
|
+
REFRESH_ERROR = "refresh-error"
|
|
6
|
+
}
|
|
7
|
+
export interface IChartDataSourceStatus {
|
|
8
|
+
status: ChartDataSourceRuntimeStatus;
|
|
9
|
+
error?: unknown;
|
|
10
|
+
}
|