@nocobase/plugin-data-visualization 2.1.0-beta.25 → 2.1.0-beta.26

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.
Files changed (39) hide show
  1. package/client-v2.d.ts +2 -0
  2. package/client-v2.js +1 -0
  3. package/dist/client-v2/174.75072e326b5a4f8a.js +10 -0
  4. package/dist/client-v2/176.0b68fc9582cfe5a3.js +10 -0
  5. package/dist/client-v2/214.6dda3ffed1dca904.js +10 -0
  6. package/dist/client-v2/542.d15b6fa2a7d6a4e3.js +10 -0
  7. package/dist/client-v2/680.c3725300a5f4414b.js +10 -0
  8. package/dist/client-v2/chart/ChartGroup.d.ts +44 -0
  9. package/dist/client-v2/chart/configs.d.ts +290 -0
  10. package/dist/client-v2/chart/index.d.ts +11 -0
  11. package/dist/client-v2/chart/types.d.ts +103 -0
  12. package/dist/client-v2/flow/components/CodeEditor.d.ts +22 -0
  13. package/dist/client-v2/flow/models/Chart.d.ts +18 -0
  14. package/dist/client-v2/flow/models/ChartBlockModel.d.ts +78 -0
  15. package/dist/client-v2/flow/models/ChartOptionsBuilder.d.ts +23 -0
  16. package/dist/client-v2/flow/models/ChartOptionsBuilder.service.d.ts +58 -0
  17. package/dist/client-v2/flow/models/ChartOptionsEditor.d.ts +16 -0
  18. package/dist/client-v2/flow/models/ChartOptionsPanel.d.ts +11 -0
  19. package/dist/client-v2/flow/models/ConfigPanel.d.ts +10 -0
  20. package/dist/client-v2/flow/models/ECharts.d.ts +20 -0
  21. package/dist/client-v2/flow/models/EventsEditor.d.ts +11 -0
  22. package/dist/client-v2/flow/models/EventsPanel.d.ts +10 -0
  23. package/dist/client-v2/flow/models/QueryBuilder.d.ts +13 -0
  24. package/dist/client-v2/flow/models/QueryBuilder.service.d.ts +20 -0
  25. package/dist/client-v2/flow/models/QueryPanel.d.ts +10 -0
  26. package/dist/client-v2/flow/models/ResultPanel.d.ts +10 -0
  27. package/dist/client-v2/flow/models/SQLEditor.d.ts +10 -0
  28. package/dist/client-v2/flow/models/config-store.d.ts +20 -0
  29. package/dist/client-v2/flow/resources/ChartResource.d.ts +37 -0
  30. package/dist/client-v2/flow/utils.d.ts +50 -0
  31. package/dist/client-v2/hooks/index.d.ts +9 -0
  32. package/dist/client-v2/hooks/useSetChartSize.d.ts +20 -0
  33. package/dist/client-v2/index.d.ts +12 -0
  34. package/dist/client-v2/index.js +10 -0
  35. package/dist/client-v2/locale.d.ts +14 -0
  36. package/dist/client-v2/plugin.d.ts +23 -0
  37. package/dist/externalVersion.js +13 -12
  38. package/dist/node_modules/koa-compose/package.json +1 -1
  39. package/package.json +3 -2
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export type QueryBuilderRef = {
11
+ validate: () => Promise<any>;
12
+ };
13
+ export declare const QueryBuilder: React.ForwardRefExoticComponent<React.RefAttributes<QueryBuilderRef>>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare function getFieldOptions(dm: any, compile: (v: any) => string, collectionPath?: string[]): any;
10
+ export declare function aliasOf(val: any): string;
11
+ export declare function buildOrderFieldOptions(fieldOptions?: any[], dimensionsValue?: any[], measuresValue?: any[]): any[];
12
+ export declare function getFormatterOptionsByField(dm: any, collectionPath: string[] | undefined, dimField: any): {
13
+ label: string;
14
+ value: string;
15
+ }[];
16
+ export declare function getCollectionOptions(dm: any, compile: (v: any) => string): any;
17
+ export declare function validateQuery(query: Record<string, any>): {
18
+ success: boolean;
19
+ message: string;
20
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export declare const QueryPanel: React.FC;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export declare const ResultPanel: React.FC;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export declare const SQLEditor: React.ForwardRefExoticComponent<Omit<Partial<any>, "ref"> & React.RefAttributes<unknown>>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ interface ConfigState {
10
+ results: {
11
+ [uid: string]: {
12
+ result: any;
13
+ error?: string;
14
+ };
15
+ };
16
+ setResult: (uid: string, result: any) => void;
17
+ setError?: (uid: string, error: string) => void;
18
+ }
19
+ export declare const configStore: ConfigState;
20
+ export {};
@@ -0,0 +1,37 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { BaseRecordResource } from '@nocobase/flow-engine';
10
+ export declare class ChartResource<TData = any> extends BaseRecordResource<TData> {
11
+ resourceName: string;
12
+ private refreshTimer;
13
+ protected request: {
14
+ url: string;
15
+ method: string;
16
+ params: Record<string, any>;
17
+ data: Record<string, any>;
18
+ headers: Record<string, any>;
19
+ };
20
+ setQueryParams(query: Record<string, any>, mark?: string): this;
21
+ setFilter(filter: Record<string, any>): this;
22
+ parseQuery(query: Record<string, any>): {
23
+ mode: any;
24
+ sql: any;
25
+ dataSource: any;
26
+ collection: any;
27
+ measures: any;
28
+ dimensions: any;
29
+ filter: any;
30
+ orders: any;
31
+ limit: any;
32
+ offset: any;
33
+ contextParams: any;
34
+ };
35
+ run(): Promise<any>;
36
+ refresh(): Promise<void>;
37
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare function convertDatasetFormats(data: Record<string, any>[]): {
10
+ objects: any[];
11
+ rows: any[];
12
+ columns: any[];
13
+ dimensions?: undefined;
14
+ } | {
15
+ dimensions: string[];
16
+ objects: Record<string, any>[];
17
+ rows: string[][];
18
+ columns: any[][];
19
+ };
20
+ /**
21
+ * Normalize ECharts option for dataset-based pie charts.
22
+ * Fixes `{c}` showing `[object Object]` when `dataset.source` is an array of objects by rewriting `{c}` to `{@<valueField>}`.
23
+ */
24
+ export declare function normalizeEChartsOption(option: any): any;
25
+ export declare const formatters: {
26
+ datetime: {
27
+ label: string;
28
+ value: string;
29
+ }[];
30
+ date: {
31
+ label: string;
32
+ value: string;
33
+ }[];
34
+ time: {
35
+ label: string;
36
+ value: string;
37
+ }[];
38
+ };
39
+ export declare function sleep(ms: number): Promise<void>;
40
+ export declare function appendColon(label: string, lang?: string): string;
41
+ export declare const isDebugEnabled: () => boolean;
42
+ export declare const debugLog: (...args: any[]) => void;
43
+ export declare const useCompile: () => (source: any, scope?: {}) => any;
44
+ export declare const parseField: (field: string | string[]) => {
45
+ target: string;
46
+ name: string;
47
+ alias: string;
48
+ };
49
+ export declare const removeUnparsableFilter: (filter: any) => any;
50
+ export declare const isEmptyFilterObject: (filter: any) => boolean;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export * from './useSetChartSize';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /// <reference types="react" />
10
+ export declare const useSetChartSize: (size?: {
11
+ type?: 'fixed' | 'ratio';
12
+ ratio?: {
13
+ width: number;
14
+ height: number;
15
+ };
16
+ fixed?: number;
17
+ }, fixedHeight?: number) => {
18
+ chartRef: import("react").MutableRefObject<HTMLDivElement>;
19
+ chartHeight: number;
20
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export { default } from './plugin';
10
+ export * from './plugin';
11
+ export * from './chart';
12
+ export * from './hooks';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@nocobase/client-v2"),require("dayjs"),require("@formily/reactive"),require("react"),require("antd"),require("@formily/react"),require("@nocobase/flow-engine"),require("@ant-design/icons"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-data-visualization",["react-i18next","@nocobase/client-v2","dayjs","@formily/reactive","react","antd","@formily/react","@nocobase/flow-engine","@ant-design/icons","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-data-visualization"]=t(require("react-i18next"),require("@nocobase/client-v2"),require("dayjs"),require("@formily/reactive"),require("react"),require("antd"),require("@formily/react"),require("@nocobase/flow-engine"),require("@ant-design/icons"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-data-visualization"]=t(e["react-i18next"],e["@nocobase/client-v2"],e.dayjs,e["@formily/reactive"],e.react,e.antd,e["@formily/react"],e["@nocobase/flow-engine"],e["@ant-design/icons"],e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,r,n,o,i,a,u,l,c,f){return function(){"use strict";var s,p,y,d={9667:function(e,t,r){r.d(t,{Gm:function(){return d},VS:function(){return d}});var n=r(3485),o=r(5230),i=r(7663);function a(e,t,r,n,o,i,a){try{var u=e[i](a),l=u.value}catch(e){r(e);return}u.done?t(l):Promise.resolve(l).then(n,o)}function u(e,t,r){return(u=p()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&f(o,r.prototype),o}).apply(null,arguments)}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,c(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),f(r,e)})(e)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}var y=function(e,t,r){var n,i,a,u=(null==e||null==(n=e.uiSchema)?void 0:n.enum)||(null==e||null==(a=e.options)||null==(i=a.uiSchema)?void 0:i.enum),l=function(e,t){if(Array.isArray(t))return t.map(function(t){return l(e,t)});var n=e.find(function(e){var r;return e.value===((null==t||null==(r=t.toString)?void 0:r.call(t))||t)});return o.Schema.compile((null==n?void 0:n.label)||t,{t:(null==r?void 0:r.t)||function(e){return e}})};return u&&Array.isArray(u)?l(u,t):t},d=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=c(t),l(e=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,p()?Reflect.construct(t,r||[],c(this).constructor):t.apply(this,r)),"charts",new i.EK),l(e,"fieldInterfaceConfigs",{select:{valueFormatter:y},multipleSelect:{valueFormatter:y},radioGroup:{valueFormatter:y},checkboxGroup:{valueFormatter:y}}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&f(n,e),t=[{key:"registerFieldInterfaceConfig",value:function(e,t){this.fieldInterfaceConfigs[e]=t}},{key:"load",value:function(){var e;return(e=function(){return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){return this.flowEngine.registerModelLoaders({ChartBlockModel:{loader:function(){return Promise.all([r.e("174"),r.e("542")]).then(r.bind(r,2149))}}}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){a(i,n,o,u,l,"next",e)}function l(e){a(i,n,o,u,l,"throw",e)}u(void 0)})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(n.prototype,t),n}(s(n.Plugin));t.Ay=d},7663:function(e,t,r){r.d(t,{t1:function(){return O},uy:function(){return d},Dl:function(){return s},Tp:function(){return y},xD:function(){return p},EK:function(){return f}});var n=r(3485),o=r(9667);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||c(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}}var f=function(){var e;function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");a(this,"charts",new Map)}return e=[{key:"addGroup",value:function(e,t){if(this.charts.has(e))throw Error('[data-visualization] Chart group "'.concat(e,'" already exists'));this.charts.set(e,t)}},{key:"add",value:function(e,t){var r=this.charts.get(e);if(r){var n,o,i=Array.isArray(t)?t:[t];this.charts.set(e,(n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){a(e,t,r[t])})}return e}({},r),o=o={charts:l(r.charts).concat(l(i))},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n))}}},{key:"getChartTypes",value:function(){return Array.from(this.charts.entries()).sort(function(e,t){var r=u(e,2)[1],n=u(t,2)[1];return(r.sort||0)-(n.sort||0)}).map(function(e){var t=u(e,2),r=t[0],n=t[1];return{label:n.title,value:r,children:n.charts.map(function(e){return{key:"".concat(r,".").concat(e.name),label:e.title,value:e.name}})}})}},{key:"getCharts",value:function(){var e={};return this.charts.forEach(function(t,r){t.charts.forEach(function(t){e["".concat(r,".").concat(t.name)]=t})}),e}},{key:"getChart",value:function(e){if(e)return this.getCharts()[e]}},{key:"getDefaultChartType",value:function(){var e,t=this.getChartTypes()[0],r=null==t||null==(e=t.children)?void 0:e[0];return t&&r?"".concat(t.value,".").concat(r.value):void 0}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}(),s=function(){return(0,n.usePlugin)(o.Ay).charts.getChartTypes()},p=function(){return(0,n.usePlugin)(o.Ay).charts.getDefaultChartType()},y=function(){return(0,n.usePlugin)(o.Ay).charts.getCharts()},d=function(e){return(0,n.usePlugin)(o.Ay).charts.getChart(e)},b=r(9155),v=r(8376),m=r(9488);function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var g={field:function(e){var t=e.name,r=e.title,n=e.required,o=e.defaultValue,i=e.description;return h({},t,{title:(0,m.vV)(r),type:"string","x-decorator":"FormItem","x-component":"Select","x-reactions":"{{ useChartFields }}",required:n,description:i,default:o})},input:function(e){var t=e.name,r=e.title,n=e.required,o=e.defaultValue,i=e.description;return h({},t,{title:(0,m.vV)(r),type:"string","x-decorator":"FormItem","x-component":"Input",required:n,default:o,description:i})},boolean:function(e){var t=e.name,r=e.title,n=e.defaultValue,o=e.description;return h({},t,{"x-content":(0,m.vV)(r),type:"boolean","x-decorator":"FormItem","x-component":"Checkbox",default:void 0!==n&&n,description:o})},select:function(e){var t=e.name,r=e.title,n=e.required,o=e.defaultValue,i=e.options,a=e.description;return h({},t,{title:(0,m.vV)(r),type:"string","x-decorator":"FormItem","x-component":"Select",required:n,default:o,description:a,enum:i})},radio:function(e){var t=e.name,r=e.title,n=e.defaultValue,o=e.options,i=e.description,a=e.componentProps;return h({},t,{title:(0,m.vV)(r),type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){h(e,t,r[t])})}return e}({},a),default:n,description:i,enum:o})},percent:function(e){return h({},e.name,{title:e.title,type:"number","x-decorator":"FormItem","x-component":"InputNumber",default:e.defaultValue,description:e.description,"x-component-props":{suffix:"%"}})},xField:{configType:"field",name:"xField",title:"xField",required:!0},yField:{configType:"field",name:"yField",title:"yField",required:!0},seriesField:{configType:"field",name:"seriesField",title:"seriesField"},colorField:{configType:"field",name:"colorField",title:"colorField",required:!0},isStack:{configType:"boolean",name:"isStack",title:"isStack"},smooth:{configType:"boolean",name:"smooth",title:"smooth"},isPercent:{configType:"boolean",name:"isPercent",title:"isPercent"},isGroup:{configType:"boolean",name:"isGroup",title:"isGroup"},size:function(){return{size:{title:(0,m.vV)("Size"),type:"object","x-decorator":"FormItem","x-component":"Space",properties:{type:{"x-component":"Select","x-component-props":{allowClear:!1},default:"ratio",enum:[{label:(0,m.vV)("Aspect ratio"),value:"ratio"},{label:(0,m.vV)("Fixed height"),value:"fixed"}]},fixed:{type:"number","x-component":"InputNumber","x-component-props":{min:0,addonAfter:"px"},"x-reactions":[{dependencies:[".type"],fulfill:{state:{visible:"{{$deps[0] === 'fixed'}}"}}}]},ratio:{type:"object","x-component":"Space","x-reactions":[{dependencies:[".type"],fulfill:{state:{visible:"{{$deps[0] === 'ratio'}}"}}}],properties:{width:{type:"number","x-component":"InputNumber","x-component-props":{placeholder:(0,m.vV)("Width"),min:1}},colon:{type:"void","x-component":"Text","x-component-props":{children:":"}},height:{type:"number","x-component":"InputNumber","x-component-props":{placeholder:(0,m.vV)("Height"),min:1}}}}}}}}};function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var O=function(){var e;function t(e){var r=e.name,n=e.title,o=e.enableAdvancedConfig,i=e.Component,a=e.config;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");Y(this,"name",void 0),Y(this,"title",void 0),Y(this,"enableAdvancedConfig",!1),Y(this,"Component",void 0),Y(this,"config",void 0),Y(this,"configTypes",new Map),this.name=r,this.title=n,this.Component=(0,b.memo)(i,function(e,t){return JSON.stringify(e)===JSON.stringify(t)}),this.config=a,this.enableAdvancedConfig=o||!1,this.addConfigTypes(g)}return e=[{key:"schema",get:function(){var e=this;return this.config?{type:"object",properties:this.config.reduce(function(t,r){var n={};if("string"==typeof r&&(r=e.configTypes.get(r)),"function"==typeof r)n=r();else if(r.configType){var o=e.configTypes.get(r.configType);n=(null==o?void 0:o(r))||{}}else n=r;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){Y(e,t,r[t])})}return e}({},t,n)},{})}:{}}},{key:"addConfigTypes",value:function(e){var t=this;Object.entries(e).forEach(function(e){var r=function(e){if(Array.isArray(e))return e}(e)||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw r}}return o}}(e)||function(e){if(e){if("string"==typeof e)return w(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return w(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=r[0],o=r[1];t.configTypes.set(n,o)})}},{key:"infer",value:function(e,t){var r=t.measures,n=t.dimensions,o=[],i=function(e,t){if(t.alias)return e.find(function(e){return e.value===t.alias});var r=(0,v.cn)(t.field).alias;return e.find(function(e){return e.value===r})};if((null==r?void 0:r.length)&&(a=i(e,r[0]),o=r.map(function(t){return i(e,t)})),n){if(1===n.length)f=i(e,n[0]);else if(n.length>1){n.forEach(function(t,r){var n=i(e,t);["date","time","datetime"].includes(null==n?void 0:n.type)&&(f=n,c=r)}),c=c||0;var a,u,l,c,f=f||i(e,n[c]),s=n.filter(function(e,t){return t!==c}).map(function(t){return i(e,t)});1===s.length?(u=s[0],l=s[0]):s.length>1&&(l=s[0],u=s[1])}}return{xField:f,yField:a,seriesField:u,colorField:l,yFields:o}}},{key:"getProps",value:function(e){return e}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}()},8376:function(e,t,r){r.d(t,{A5:function(){return w},JR:function(){return p},Nj:function(){return Y},OK:function(){return b},_A:function(){return s},_J:function(){return y},cY:function(){return m},cn:function(){return g},lu:function(){return h},yy:function(){return d}});var n=r(5230),o=r(9155),i=r.n(o),a=r(9488);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||f(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function f(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}}function s(e){if(!Array.isArray(e)||0===e.length)return{objects:[],rows:[],columns:[]};var t=Object.keys(e[0]),r=t[0],n=t.slice(1),o=[t];e.forEach(function(e){o.push(t.map(function(t){return e[t]}))});var i=[e.map(function(e){return e[r]})];return n.forEach(function(t){i.push(e.map(function(e){return e[t]}))}),{dimensions:t,objects:e,rows:o,columns:i}}function p(e){if(!e)return e;var t,r,n,o=e.dataset,i=Array.isArray(o)?null==(t=o[0])?void 0:t.source:null==o?void 0:o.source,a=e.series,u=Array.isArray(a)?a:a?[a]:[];if(!Array.isArray(i)||0===i.length)return e;var l=i[0];if(!l||(void 0===l?"undefined":c(l))!=="object"||Array.isArray(l))return e;var f=u.filter(function(e){return(null==e?void 0:e.type)==="pie"});if(0===f.length)return e;var s=null==(n=f[0])||null==(r=n.encode)?void 0:r.value,p=Array.isArray(s)?s[0]:s;if(("string"!=typeof p||!p)&&Object.prototype.hasOwnProperty.call(l,"value")&&(p="value"),"string"!=typeof p||!p)return e;var y=function(e){return e.includes("{c}")?e.replace(/\{c\}/g,"{@"+p+"}"):e};return f.forEach(function(e){(null==e?void 0:e.label)&&"string"==typeof e.label.formatter&&(e.label.formatter=y(e.label.formatter)),(null==e?void 0:e.tooltip)&&"string"==typeof e.tooltip.formatter&&(e.tooltip.formatter=y(e.tooltip.formatter))}),e.tooltip&&"string"==typeof e.tooltip.formatter&&(e.tooltip.formatter=y(e.tooltip.formatter)),e}var y={datetime:[{label:(0,a.MZ)("YYYY"),value:"YYYY"},{label:(0,a.MZ)("MM"),value:"MM"},{label:(0,a.MZ)("DD"),value:"DD"},{label:(0,a.MZ)("HH:mm"),value:"HH:mm"},{label:(0,a.MZ)("YYYY-MM"),value:"YYYY-MM"},{label:(0,a.MZ)("YYYY-MM-DD"),value:"YYYY-MM-DD"},{label:(0,a.MZ)("YYYY-MM-DD HH:mm"),value:"YYYY-MM-DD HH:mm"},{label:(0,a.MZ)("YYYY-MM-DD HH:mm:ss"),value:"YYYY-MM-DD HH:mm:ss"},{label:(0,a.MZ)("MM/DD/YYYY"),value:"MM/DD/YYYY"},{label:(0,a.MZ)("MM/DD/YYYY HH:mm"),value:"MM/DD/YYYY HH:mm"},{label:(0,a.MZ)("MM/DD/YYYY HH:mm:ss"),value:"MM/DD/YYYY HH:mm:ss"}],date:[{label:(0,a.MZ)("YYYY"),value:"YYYY"},{label:(0,a.MZ)("MM"),value:"MM"},{label:(0,a.MZ)("DD"),value:"DD"},{label:(0,a.MZ)("YYYY-MM"),value:"YYYY-MM"},{label:(0,a.MZ)("YYYY-MM-DD"),value:"YYYY-MM-DD"},{label:(0,a.MZ)("MM/DD/YYYY"),value:"MM/DD/YYYY"}],time:[{label:(0,a.MZ)("HH"),value:"HH"},{label:(0,a.MZ)("HH:mm"),value:"HH:mm"},{label:(0,a.MZ)("HH:mm:ss"),value:"HH:mm:ss"}]};function d(e){return new Promise(function(t){setTimeout(t,e)})}function b(e,t){if("string"!=typeof e)return"";var r=e.trim();if(!r)return"";var n=r.replace(RegExp("[::]\\s*$","u"),""),o="string"==typeof t&&/^zh([-_]|$)/i.test(t);return"".concat(n).concat(o?":":":")}var v=function(){if("u"<typeof window)return!1;try{var e,t=new URLSearchParams(window.location.search||"").get("_debug");if("true"===t||"1"===t)return!0;var r=null==(e=window.localStorage)?void 0:e.getItem("nocobase.debug");if("true"===r||"1"===r)return!0}catch(e){}return!1},m=function(){for(var e,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];v()&&(e=console).log.apply(e,function(e){if(Array.isArray(e))return u(e)}(r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||f(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())},h=function(){var e=(0,a.kj)();return i().useCallback(function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.Schema.compile(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({t:e},r))},[e])},g=function(e){var t,r,n;return Array.isArray(e)?1===e.length?r=e[0]:e.length>1&&(t=(n=l(e,2))[0],r=n[1]):r=e,{target:t,name:r,alias:t?"".concat(t,".").concat(r):r}},w=function(e){if((void 0===e?"undefined":c(e))==="object"&&null!==e){if(Array.isArray(e)){var t=e.map(function(e){return w(e)}).filter(Boolean);return t.length>0?t:null}var r={},n=!0,o=!1,i=void 0;try{for(var a,u=Object.entries(e)[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var f=l(a.value,2),s=f[0],p=f[1];if("string"!=typeof s||0!==s.trim().length){var y=w(p);null==y||(void 0===y?"undefined":c(y))==="object"&&(Array.isArray(y)&&0===y.length||0===Object.keys(y).length)||(r[s]=y)}}}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return Object.keys(r).length>0?r:null}return"string"==typeof e&&e.startsWith("{{$nFilter.")&&e.endsWith("}}")?null:e},Y=function(e){return!e||(Array.isArray(e)?0===e.length:!!((void 0===e?"undefined":c(e))==="object"&&(0===Object.keys(e).length||Array.isArray(e.$and)&&0===e.$and.length||Array.isArray(e.$or)&&0===e.$or.length))||!1)}},9488:function(e,t,r){r.d(t,{MZ:function(){return a},kj:function(){return u},vV:function(){return l}});var n=r(7694),o=r(5953),i="@nocobase/plugin-data-visualization";function a(e){return(0,n.tExpr)(e,{ns:[i,"client"]})}function u(){return(0,o.useTranslation)([i,"client"],{nsMode:"fallback"})[0]}function l(e){return"{{t(".concat(JSON.stringify(e),", { ns: ['").concat(i,"', 'client'], nsMode: 'fallback' })}}")}},7375:function(e){e.exports=l},5230:function(e){e.exports=a},7992:function(e){e.exports=n},3485:function(e){e.exports=t},7694:function(e){e.exports=u},7768:function(e){e.exports=c},2059:function(e){e.exports=i},9185:function(e){e.exports=r},6773:function(e){e.exports=f},9155:function(e){e.exports=o},5953:function(t){t.exports=e}},b={};function v(e){var t=b[e];if(void 0!==t)return t.exports;var r=b[e]={id:e,loaded:!1,exports:{}};return d[e](r,r.exports,v),r.loaded=!0,r.exports}v.m=d,v.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return v.d(t,{a:t}),t},v.d=function(e,t){for(var r in t)v.o(t,r)&&!v.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},v.f={},v.e=function(e){return Promise.all(Object.keys(v.f).reduce(function(t,r){return v.f[r](e,t),t},[]))},v.u=function(e){return""+e+"."+({174:"75072e326b5a4f8a",176:"0b68fc9582cfe5a3",214:"6dda3ffed1dca904",542:"d15b6fa2a7d6a4e3",680:"c3725300a5f4414b"})[e]+".js"},v.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),v.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},m={},v.l=function(e,t,r,n){if(m[e])return void m[e].push(t);if(void 0!==r)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var l=a[u];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="@nocobase/plugin-data-visualization:"+r){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,v.nc&&o.setAttribute("nonce",v.nc),o.setAttribute("data-rspack","@nocobase/plugin-data-visualization:"+r),o.src=e),m[e]=[t];var c=function(t,r){o.onerror=o.onload=null,clearTimeout(f);var n=m[e];if(delete m[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(function(e){return e(r)}),t)return t(r)},f=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},v.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},v.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},v.g.importScripts&&(h=v.g.location+"");var m,h,g=v.g.document;if(!h&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(h=g.currentScript.src),!h)){var w=g.getElementsByTagName("script");if(w.length)for(var Y=w.length-1;Y>-1&&(!h||!/^http(s?):/.test(h));)h=w[Y--].src}if(!h)throw Error("Automatic publicPath is not supported in this browser");v.p=h.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s={889:0},v.f.j=function(e,t){var r=v.o(s,e)?s[e]:void 0;if(0!==r)if(r)t.push(r[2]);else{var n=new Promise(function(t,n){r=s[e]=[t,n]});t.push(r[2]=n);var o=v.p+v.u(e),i=Error();v.l(o,function(t){if(v.o(s,e)&&(0!==(r=s[e])&&(s[e]=void 0),r)){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",i.name="ChunkLoadError",i.type=n,i.request=o,r[1](i)}},"chunk-"+e,e)}},p=function(e,t){var r,n,o=t[0],i=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==s[e]})){for(r in i)v.o(i,r)&&(v.m[r]=i[r]);a&&a(v)}for(e&&e(t);u<o.length;u++)n=o[u],v.o(s,n)&&s[n]&&s[n][0](),s[n]=0},(y=self.webpackChunk_nocobase_plugin_data_visualization=self.webpackChunk_nocobase_plugin_data_visualization||[]).forEach(p.bind(null,0)),y.push=p.bind(null,y.push.bind(y));var O={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-data-visualization/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var n=window.location.pathname||"/",o=n.indexOf("/v2/");e=o>=0?n.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-data-visualization/dist/client-v2/"}v.p=e}(),!function(){v.r(O),v.d(O,{default:function(){return e.Ay},PluginDataVisualizationClient:function(){return e.VS},useCharts:function(){return t.Tp},useChartTypes:function(){return t.Dl},useDefaultChartType:function(){return t.xD},ChartGroup:function(){return t.EK},Chart:function(){return t.t1},useChart:function(){return t.uy},useSetChartSize:function(){return o},PluginDataVisualiztionClient:function(){return e.Gm}});var e=v(9667),t=v(7663),r=v(9155);function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var o=function(){var e,t,o,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,u=function(e){if(Array.isArray(e))return e}(e=(0,r.useState)(a||i.fixed||0))||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw r}}return o}}(e)||function(e){if(e){if("string"==typeof e)return n(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return n(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l=u[0],c=u[1],f=(0,r.useRef)(null);return(0,r.useEffect)(function(){var e,t,r=f.current;if(r&&!a&&"fixed"!==i.type){var n="ratio"===i.type&&(null==(e=i.ratio)?void 0:e.width)&&(null==(t=i.ratio)?void 0:t.height)?i.ratio.height/i.ratio.width:0,o=new ResizeObserver(function(e){e.forEach(function(e){c(n?e.contentRect.width*n:Math.max(e.contentRect.height,400))})});return o.observe(r),function(){return o.disconnect()}}},[a,null==(t=i.ratio)?void 0:t.height,null==(o=i.ratio)?void 0:o.width,i.type]),{chartRef:f,chartHeight:a||l||i.fixed||400}}}(),O}()});
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const NAMESPACE = "@nocobase/plugin-data-visualization";
10
+ export declare function tExpr(key: string): string;
11
+ export declare function useChartsTranslation(): import("react-i18next").UseTranslationResponse<("@nocobase/plugin-data-visualization" | "client")[], undefined>;
12
+ export declare function useT(): import("react-i18next").TFunction<("@nocobase/plugin-data-visualization" | "client")[], undefined>;
13
+ export declare function tStr(key: string): string;
14
+ export declare function lang(key: string): string;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { Plugin } from '@nocobase/client-v2';
10
+ import { ChartGroup } from './chart';
11
+ type FieldInterfaceConfig = {
12
+ valueFormatter: (field: any, value: any, context?: any) => any;
13
+ };
14
+ export declare class PluginDataVisualizationClient extends Plugin {
15
+ charts: ChartGroup;
16
+ fieldInterfaceConfigs: {
17
+ [fieldInterface: string]: FieldInterfaceConfig;
18
+ };
19
+ registerFieldInterfaceConfig(key: string, config: FieldInterfaceConfig): void;
20
+ load(): Promise<void>;
21
+ }
22
+ export { PluginDataVisualizationClient as PluginDataVisualiztionClient };
23
+ export default PluginDataVisualizationClient;
@@ -8,18 +8,19 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-beta.25",
11
+ "@nocobase/client": "2.1.0-beta.26",
12
12
  "@formily/react": "2.3.7",
13
- "@nocobase/plugin-ai": "2.1.0-beta.25",
14
- "@nocobase/flow-engine": "2.1.0-beta.25",
13
+ "@nocobase/plugin-ai": "2.1.0-beta.26",
14
+ "@nocobase/flow-engine": "2.1.0-beta.26",
15
15
  "react-i18next": "11.18.6",
16
16
  "dayjs": "1.11.13",
17
17
  "@formily/shared": "2.3.7",
18
18
  "lodash": "4.18.1",
19
- "@nocobase/cache": "2.1.0-beta.25",
20
- "@nocobase/server": "2.1.0-beta.25",
21
- "@nocobase/test": "2.1.0-beta.25",
22
- "@nocobase/utils": "2.1.0-beta.25",
19
+ "@nocobase/client-v2": "2.1.0-beta.26",
20
+ "@nocobase/cache": "2.1.0-beta.26",
21
+ "@nocobase/server": "2.1.0-beta.26",
22
+ "@nocobase/test": "2.1.0-beta.26",
23
+ "@nocobase/utils": "2.1.0-beta.26",
23
24
  "react": "18.2.0",
24
25
  "@emotion/css": "11.13.0",
25
26
  "@ant-design/icons": "5.6.1",
@@ -27,10 +28,10 @@ module.exports = {
27
28
  "antd": "5.24.2",
28
29
  "@formily/antd-v5": "1.2.3",
29
30
  "@formily/core": "2.3.7",
30
- "@nocobase/actions": "2.1.0-beta.25",
31
- "@nocobase/acl": "2.1.0-beta.25",
32
- "@nocobase/plugin-acl": "2.1.0-beta.25",
33
- "@nocobase/plugin-flow-engine": "2.1.0-beta.25",
34
- "@nocobase/database": "2.1.0-beta.25",
31
+ "@nocobase/actions": "2.1.0-beta.26",
32
+ "@nocobase/acl": "2.1.0-beta.26",
33
+ "@nocobase/plugin-acl": "2.1.0-beta.26",
34
+ "@nocobase/plugin-flow-engine": "2.1.0-beta.26",
35
+ "@nocobase/database": "2.1.0-beta.26",
35
36
  "@formily/reactive": "2.3.7"
36
37
  };
@@ -1 +1 @@
1
- {"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2026-05-06T11:09:11.223Z"}
1
+ {"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2026-05-07T16:22:58.749Z"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-data-visualization",
3
- "version": "2.1.0-beta.25",
3
+ "version": "2.1.0-beta.26",
4
4
  "displayName": "Data visualization",
5
5
  "displayName.ru-RU": "Визуализация данных",
6
6
  "displayName.zh-CN": "数据可视化",
@@ -39,6 +39,7 @@
39
39
  "@nocobase/actions": "2.x",
40
40
  "@nocobase/cache": "2.x",
41
41
  "@nocobase/client": "2.x",
42
+ "@nocobase/client-v2": "2.x",
42
43
  "@nocobase/database": "2.x",
43
44
  "@nocobase/plugin-acl": "2.x",
44
45
  "@nocobase/plugin-ai": "2.x",
@@ -48,7 +49,7 @@
48
49
  "@nocobase/test": "2.x",
49
50
  "@nocobase/utils": "2.x"
50
51
  },
51
- "gitHead": "824f8b8200e9fe086135768934d3ef427b212446",
52
+ "gitHead": "b17e1a72057813fa27d8435bf0f2af67ea4b059f",
52
53
  "keywords": [
53
54
  "Blocks"
54
55
  ],