@object-ui/plugin-charts 3.3.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +24 -0
- package/dist/{AdvancedChartImpl-JDjuxIZW.js → AdvancedChartImpl-DxaZtNlE.js} +17 -12
- package/dist/{BarChart-Bvt5Se8Q.js → BarChart-BQS4sYHd.js} +1 -1
- package/dist/{ChartImpl-CQj8Kris.js → ChartImpl-BaXisyXJ.js} +2 -2
- package/dist/index.js +2 -2
- package/dist/index.umd.cjs +2 -2
- package/dist/{jsx-runtime-C8d0IhUE.js → jsx-runtime-Caia9pQX.js} +1 -1
- package/package.json +32 -9
- package/.turbo/turbo-build.log +0 -26
- package/examples/chart-examples.ts +0 -54
- package/src/AdvancedChartImpl.tsx +0 -323
- package/src/ChartContainerImpl.tsx +0 -353
- package/src/ChartImpl.tsx +0 -91
- package/src/ChartRenderer.tsx +0 -112
- package/src/ObjectChart.stories.tsx +0 -104
- package/src/ObjectChart.tsx +0 -298
- package/src/__tests__/ObjectChart.aggregation.test.ts +0 -166
- package/src/__tests__/ObjectChart.dataFetch.test.tsx +0 -303
- package/src/__tests__/ObjectChart.labelResolution.test.ts +0 -329
- package/src/index.test.ts +0 -136
- package/src/index.tsx +0 -172
- package/src/types.ts +0 -68
- package/tsconfig.json +0 -17
- package/vite.config.ts +0 -62
- package/vitest.config.ts +0 -13
- package/vitest.setup.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @object-ui/plugin-charts
|
|
2
2
|
|
|
3
|
+
## 3.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [b429568]
|
|
8
|
+
- @object-ui/components@3.3.1
|
|
9
|
+
- @object-ui/types@3.3.1
|
|
10
|
+
- @object-ui/core@3.3.1
|
|
11
|
+
- @object-ui/react@3.3.1
|
|
12
|
+
|
|
3
13
|
## 3.3.0
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -119,3 +119,27 @@ By using lazy loading, the main application bundle stays lean:
|
|
|
119
119
|
- With lazy loading: +0.19 KB on initial load, +541 KB only when chart is rendered
|
|
120
120
|
|
|
121
121
|
This results in significantly faster initial page loads for applications that don't use charts on every page.
|
|
122
|
+
|
|
123
|
+
<!-- release-metadata:v3.3.0 -->
|
|
124
|
+
|
|
125
|
+
## Compatibility
|
|
126
|
+
|
|
127
|
+
- **React:** 18.x or 19.x
|
|
128
|
+
- **Node.js:** ≥ 18
|
|
129
|
+
- **TypeScript:** ≥ 5.0 (strict mode)
|
|
130
|
+
- **`@objectstack/spec`:** ^3.3.0
|
|
131
|
+
- **`@objectstack/client`:** ^3.3.0
|
|
132
|
+
- **Tailwind CSS:** ≥ 3.4 (for packages with UI)
|
|
133
|
+
|
|
134
|
+
## Links
|
|
135
|
+
|
|
136
|
+
- 📚 [Documentation](https://www.objectui.org/docs/plugins/plugin-charts)
|
|
137
|
+
- 📦 [npm package](https://www.npmjs.com/package/@object-ui/plugin-charts)
|
|
138
|
+
- 📝 [Changelog](./CHANGELOG.md)
|
|
139
|
+
- 🐛 [Report an issue](https://github.com/objectstack-ai/objectui/issues)
|
|
140
|
+
- 🤝 [Contributing Guide](https://github.com/objectstack-ai/objectui/blob/main/CONTRIBUTING.md)
|
|
141
|
+
- 🗺️ [Roadmap](https://github.com/objectstack-ai/objectui/blob/main/ROADMAP.md)
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
MIT — see [LICENSE](./LICENSE).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as e, n as t, t as n } from "./jsx-runtime-
|
|
2
|
-
import { $ as r, $t as i, A as a, An as o, At as s, B as c, Bn as l, Bt as u, C as d, Cn as f, Ct as p, D as m, Dn as h, Dt as g, E as _, En as v, Et as y, F as b, Fn as x, Ft as S, G as C, Gn as w, Gt as T, H as E, Hn as D, Ht as O, I as ee, In as k, It as te, J as ne, Jt as re, K as ie, Kn as A, Kt as ae, L as oe, Ln as se, Lt as ce, M as le, Mn as ue, Mt as de, N as fe, Nn as j, Nt as pe, O as me, On as he, Ot as ge, P as _e, Pn as ve, Pt as ye, Q as be, Qt as xe, R as Se, Rn as Ce, Rt as we, S as Te, Sn as M, St as Ee, T as De, Tn as Oe, Tt as ke, U as Ae, Un as je, Ut as Me, V as Ne, Vn as N, Vt as Pe, W as Fe, Wn as P, Wt as Ie, X as Le, Xt as Re, Y as ze, Yt as Be, Z as F, Zt as I, _ as Ve, _n as L, _t as He, a as Ue, an as We, at as Ge, b as Ke, bn as R, bt as qe, c as Je, cn as Ye, ct as Xe, d as Ze, dn as Qe, dt as $e, en as et, et as tt, f as nt, fn as rt, ft as it, g as at, gn as z, gt as ot, h as st, hn as ct, ht as lt, i as ut, in as dt, it as ft, j as pt, jn as mt, jt as ht, k as gt, kn as _t, kt as vt, l as yt, ln as bt, lt as xt, m as St, mn as Ct, mt as wt, n as Tt, nn as Et, nt as Dt, o as Ot, on as kt, ot as At, p as jt, pn as Mt, pt as Nt, q as Pt, qt as Ft, r as It, rn as B, rt as Lt, s as Rt, sn as zt, st as Bt, t as Vt, tn as Ht, tt as Ut, u as Wt, un as Gt, ut as Kt, v as qt, vn as Jt, vt as Yt, w as Xt, wn as Zt, wt as Qt, x as $t, xn as en, xt as tn, y as nn, yn as rn, yt as an, z as on, zn as sn, zt as cn } from "./BarChart-
|
|
1
|
+
import { a as e, n as t, t as n } from "./jsx-runtime-Caia9pQX.js";
|
|
2
|
+
import { $ as r, $t as i, A as a, An as o, At as s, B as c, Bn as l, Bt as u, C as d, Cn as f, Ct as p, D as m, Dn as h, Dt as g, E as _, En as v, Et as y, F as b, Fn as x, Ft as S, G as C, Gn as w, Gt as T, H as E, Hn as D, Ht as O, I as ee, In as k, It as te, J as ne, Jt as re, K as ie, Kn as A, Kt as ae, L as oe, Ln as se, Lt as ce, M as le, Mn as ue, Mt as de, N as fe, Nn as j, Nt as pe, O as me, On as he, Ot as ge, P as _e, Pn as ve, Pt as ye, Q as be, Qt as xe, R as Se, Rn as Ce, Rt as we, S as Te, Sn as M, St as Ee, T as De, Tn as Oe, Tt as ke, U as Ae, Un as je, Ut as Me, V as Ne, Vn as N, Vt as Pe, W as Fe, Wn as P, Wt as Ie, X as Le, Xt as Re, Y as ze, Yt as Be, Z as F, Zt as I, _ as Ve, _n as L, _t as He, a as Ue, an as We, at as Ge, b as Ke, bn as R, bt as qe, c as Je, cn as Ye, ct as Xe, d as Ze, dn as Qe, dt as $e, en as et, et as tt, f as nt, fn as rt, ft as it, g as at, gn as z, gt as ot, h as st, hn as ct, ht as lt, i as ut, in as dt, it as ft, j as pt, jn as mt, jt as ht, k as gt, kn as _t, kt as vt, l as yt, ln as bt, lt as xt, m as St, mn as Ct, mt as wt, n as Tt, nn as Et, nt as Dt, o as Ot, on as kt, ot as At, p as jt, pn as Mt, pt as Nt, q as Pt, qt as Ft, r as It, rn as B, rt as Lt, s as Rt, sn as zt, st as Bt, t as Vt, tn as Ht, tt as Ut, u as Wt, un as Gt, ut as Kt, v as qt, vn as Jt, vt as Yt, w as Xt, wn as Zt, wt as Qt, x as $t, xn as en, xt as tn, y as nn, yn as rn, yt as an, z as on, zn as sn, zt as cn } from "./BarChart-BQS4sYHd.js";
|
|
3
3
|
import * as V from "react";
|
|
4
4
|
import { Component as ln, PureComponent as un, cloneElement as dn, forwardRef as fn, isValidElement as pn, useCallback as H, useEffect as mn, useLayoutEffect as hn, useMemo as U, useRef as W, useState as gn } from "react";
|
|
5
5
|
//#region ../../node_modules/.pnpm/recharts@3.8.1_@types+react@19.2.14_react-dom@19.2.5_react@19.2.5__react-is@18.3.1_react@19.2.5_redux@5.0.1/node_modules/recharts/es6/shape/Polygon.js
|
|
@@ -3948,23 +3948,28 @@ function Gc({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
3948
3948
|
}
|
|
3949
3949
|
}
|
|
3950
3950
|
}),
|
|
3951
|
-
i.map((t) => {
|
|
3952
|
-
let
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3951
|
+
i.map((t, r) => {
|
|
3952
|
+
let a = d(), s = Wc(n[t.dataKey]?.color || a[r % a.length] || Hc);
|
|
3953
|
+
if (e === "bar") {
|
|
3954
|
+
let e = i.length === 1 && o.length > 1;
|
|
3955
|
+
return /* @__PURE__ */ (0, Q.jsx)(nt, {
|
|
3956
|
+
dataKey: t.dataKey,
|
|
3957
|
+
fill: s,
|
|
3958
|
+
radius: 4,
|
|
3959
|
+
children: e && o.map((e, t) => /* @__PURE__ */ (0, Q.jsx)(ne, { fill: Wc(a[t % a.length]) }, `cell-${t}`))
|
|
3960
|
+
}, t.dataKey);
|
|
3961
|
+
}
|
|
3962
|
+
return e === "line" ? /* @__PURE__ */ (0, Q.jsx)(Io, {
|
|
3958
3963
|
type: "monotone",
|
|
3959
3964
|
dataKey: t.dataKey,
|
|
3960
|
-
stroke:
|
|
3965
|
+
stroke: s,
|
|
3961
3966
|
strokeWidth: 2,
|
|
3962
3967
|
dot: !1
|
|
3963
3968
|
}, t.dataKey) : e === "area" ? /* @__PURE__ */ (0, Q.jsx)(ys, {
|
|
3964
3969
|
type: "monotone",
|
|
3965
3970
|
dataKey: t.dataKey,
|
|
3966
|
-
fill:
|
|
3967
|
-
stroke:
|
|
3971
|
+
fill: s,
|
|
3972
|
+
stroke: s,
|
|
3968
3973
|
fillOpacity: .4
|
|
3969
3974
|
}, t.dataKey) : null;
|
|
3970
3975
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, i as t, n, r } from "./jsx-runtime-
|
|
1
|
+
import { a as e, i as t, n, r } from "./jsx-runtime-Caia9pQX.js";
|
|
2
2
|
import * as i from "react";
|
|
3
3
|
import { Children as a, PureComponent as o, cloneElement as s, createContext as c, createElement as l, forwardRef as u, isValidElement as d, memo as f, useCallback as p, useContext as m, useEffect as h, useImperativeHandle as g, useLayoutEffect as _, useMemo as v, useRef as y, useState as b } from "react";
|
|
4
4
|
import { createPortal as x } from "react-dom";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./jsx-runtime-
|
|
2
|
-
import { Y as t, cn as n, d as r, f as i, t as a, tn as o, u as s, v as c } from "./BarChart-
|
|
1
|
+
import { t as e } from "./jsx-runtime-Caia9pQX.js";
|
|
2
|
+
import { Y as t, cn as n, d as r, f as i, t as a, tn as o, u as s, v as c } from "./BarChart-BQS4sYHd.js";
|
|
3
3
|
//#region src/ChartImpl.tsx
|
|
4
4
|
var l = e();
|
|
5
5
|
function u({ data: e = [], dataKey: u = "value", xAxisKey: d = "name", height: f = 400, className: p = "", color: m = "hsl(var(--primary))" }) {
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as e } from "./jsx-runtime-
|
|
1
|
+
import { t as e } from "./jsx-runtime-Caia9pQX.js";
|
|
2
2
|
import { ComponentRegistry as t, extractRecords as n } from "@object-ui/core";
|
|
3
3
|
import r, { Suspense as i, createContext as a, createElement as o, forwardRef as s, useCallback as c, useContext as l, useEffect as u, useState as d } from "react";
|
|
4
4
|
import { Skeleton as f } from "@object-ui/components";
|
|
5
5
|
import { SchemaRendererContext as p, useDataScope as m } from "@object-ui/react";
|
|
6
6
|
//#region src/ChartRenderer.tsx
|
|
7
|
-
var h = e(), g = r.lazy(() => import("./ChartImpl-
|
|
7
|
+
var h = e(), g = r.lazy(() => import("./ChartImpl-BaXisyXJ.js")), _ = r.lazy(() => import("./AdvancedChartImpl-DxaZtNlE.js")), v = ({ schema: e }) => /* @__PURE__ */ (0, h.jsx)(i, {
|
|
8
8
|
fallback: /* @__PURE__ */ (0, h.jsx)(f, { className: "w-full h-48 sm:h-64 md:h-80 lg:h-[400px]" }),
|
|
9
9
|
children: /* @__PURE__ */ (0, h.jsx)(g, {
|
|
10
10
|
data: e.data,
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@object-ui/core`),require(`react`),require(`@object-ui/components`),require(`react-dom`),require(`@object-ui/react`)):typeof define==`function`&&define.amd?define([`exports`,`@object-ui/core`,`react`,`@object-ui/components`,`react-dom`,`@object-ui/react`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginCharts={},e.ObjectUICore,e.React,e.ObjectUIComponents,e.ReactDOM,e.ObjectUIReact))})(this,function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=Object.create,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,f=(e,t)=>()=>(e&&(t=e(e=0)),t),p=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),m=(e,t)=>{let n={};for(var r in e)s(n,r,{get:e[r],enumerable:!0});return t||s(n,Symbol.toStringTag,{value:`Module`}),n},h=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=l(t),a=0,o=i.length,u;a<o;a++)u=i[a],!d.call(e,u)&&u!==n&&s(e,u,{get:(e=>t[e]).bind(null,u),enumerable:!(r=c(t,u))||r.enumerable});return e},g=(e,t,n)=>(n=e==null?{}:o(u(e)),h(t||!e||!e.__esModule?s(n,`default`,{value:e,enumerable:!0}):n,e));let _=g(n,1);n=g(n);var v=p((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),y=p((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===O?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(typeof e.tag==`number`&&console.error(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var n=e.render;return e=e.displayName,e||=(e=n.displayName||n.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return n=e.displayName||null,n===null?t(e.type)||`Memo`:n;case E:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function n(e){return``+e}function r(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,i=typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`;return r.call(t,`The provided key is an unsupported type %s. This value must be coerced to a string before using it here.`,i),n(e)}}function i(e){if(e===_)return`<>`;if(typeof e==`object`&&e&&e.$$typeof===E)return`<...>`;try{var n=t(e);return n?`<`+n+`>`:`<...>`}catch{return`<...>`}}function a(){var e=k.A;return e===null?null:e.getOwner()}function o(){return Error(`react-stack-top-frame`)}function s(e){if(ee.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function c(e,t){function n(){j||(j=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,`key`,{get:n,configurable:!0})}function l(){var e=t(this.type);return ne[e]||(ne[e]=!0,console.error(`Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.`)),e=this.props.ref,e===void 0?null:e}function u(e,t,n,r,i,a){var o=n.ref;return e={$$typeof:h,type:e,key:t,props:n,_owner:r},(o===void 0?null:o)===null?Object.defineProperty(e,`ref`,{enumerable:!1,value:null}):Object.defineProperty(e,`ref`,{enumerable:!1,get:l}),e._store={},Object.defineProperty(e._store,`validated`,{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,`_debugInfo`,{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,`_debugStack`,{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(e,`_debugTask`,{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function d(e,n,i,o,l,d){var p=n.children;if(p!==void 0)if(o)if(te(p)){for(o=0;o<p.length;o++)f(p[o]);Object.freeze&&Object.freeze(p)}else console.error(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`);else f(p);if(ee.call(n,`key`)){p=t(e);var m=Object.keys(n).filter(function(e){return e!==`key`});o=0<m.length?`{key: someKey, `+m.join(`: ..., `)+`: ...}`:`{key: someKey}`,ie[p+o]||(m=0<m.length?`{`+m.join(`: ..., `)+`: ...}`:`{}`,console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@object-ui/core`),require(`react`),require(`@object-ui/components`),require(`react-dom`),require(`@object-ui/react`)):typeof define==`function`&&define.amd?define([`exports`,`@object-ui/core`,`react`,`@object-ui/components`,`react-dom`,`@object-ui/react`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginCharts={},e.ObjectUICore,e.React,e.ObjectUIComponents,e.ReactDOM,e.ObjectUIReact))})(this,function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=Object.create,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,f=(e,t)=>()=>(e&&(t=e(e=0)),t),p=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),m=(e,t)=>{let n={};for(var r in e)s(n,r,{get:e[r],enumerable:!0});return t||s(n,Symbol.toStringTag,{value:`Module`}),n},h=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=l(t),a=0,o=i.length,u;a<o;a++)u=i[a],!d.call(e,u)&&u!==n&&s(e,u,{get:(e=>t[e]).bind(null,u),enumerable:!(r=c(t,u))||r.enumerable});return e},g=(e,t,n)=>(n=e==null?{}:o(u(e)),h(t||!e||!e.__esModule?s(n,`default`,{value:e,enumerable:!0}):n,e));let _=g(n,1);n=g(n);var v=p((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),y=p((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===O?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(typeof e.tag==`number`&&console.error(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var n=e.render;return e=e.displayName,e||=(e=n.displayName||n.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return n=e.displayName||null,n===null?t(e.type)||`Memo`:n;case E:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function n(e){return``+e}function r(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,i=typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`;return r.call(t,`The provided key is an unsupported type %s. This value must be coerced to a string before using it here.`,i),n(e)}}function i(e){if(e===_)return`<>`;if(typeof e==`object`&&e&&e.$$typeof===E)return`<...>`;try{var n=t(e);return n?`<`+n+`>`:`<...>`}catch{return`<...>`}}function a(){var e=k.A;return e===null?null:e.getOwner()}function o(){return Error(`react-stack-top-frame`)}function s(e){if(ee.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function c(e,t){function n(){j||(j=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,`key`,{get:n,configurable:!0})}function l(){var e=t(this.type);return ne[e]||(ne[e]=!0,console.error(`Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.`)),e=this.props.ref,e===void 0?null:e}function u(e,t,n,r,i,a){var o=n.ref;return e={$$typeof:h,type:e,key:t,props:n,_owner:r},(o===void 0?null:o)===null?Object.defineProperty(e,`ref`,{enumerable:!1,value:null}):Object.defineProperty(e,`ref`,{enumerable:!1,get:l}),e._store={},Object.defineProperty(e._store,`validated`,{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,`_debugInfo`,{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,`_debugStack`,{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(e,`_debugTask`,{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function d(e,n,i,o,l,d){var p=n.children;if(p!==void 0)if(o)if(te(p)){for(o=0;o<p.length;o++)f(p[o]);Object.freeze&&Object.freeze(p)}else console.error(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`);else f(p);if(ee.call(n,`key`)){p=t(e);var m=Object.keys(n).filter(function(e){return e!==`key`});o=0<m.length?`{key: someKey, `+m.join(`: ..., `)+`: ...}`:`{key: someKey}`,ie[p+o]||(m=0<m.length?`{`+m.join(`: ..., `)+`: ...}`:`{}`,console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
@@ -58,4 +58,4 @@ ${n.map(([e,n])=>{let r=n.theme?.[t]||n.color;return r?` --color-${e}: ${r};`:n
|
|
|
58
58
|
`)}
|
|
59
59
|
}
|
|
60
60
|
`).join(`
|
|
61
|
-
`)}}):null},$Y=Mj,eX=jf})),nX=m({default:()=>rX});function rX({chartType:e=`bar`,data:t=[],config:n={},xAxisKey:r=`name`,series:i=[],className:a=``}){let o=Array.isArray(t)?t:[],[s,c]=_.useState(!1);_.useEffect(()=>{let e=()=>c(window.innerWidth<640);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let l={bar:ZJ,line:JJ,area:IY,pie:xY,donut:xY,radar:AY,scatter:NY,combo:ZJ}[e]||ZJ,u=_.useMemo(()=>o.some(e=>String(e[r]||``).length>5),[o,r]),d=()=>[`hsl(var(--chart-1))`,`hsl(var(--chart-2))`,`hsl(var(--chart-3))`,`hsl(var(--chart-4))`,`hsl(var(--chart-5))`];if(e===`pie`||e===`donut`){let t=e===`donut`?60:0;return(0,$.jsx)(WY,{config:n,className:a,children:(0,$.jsxs)(xY,{children:[(0,$.jsx)($Y,{cursor:!1,content:(0,$.jsx)(GY,{hideLabel:!0})}),(0,$.jsx)(uR,{data:o,dataKey:i[0]?.dataKey||`value`,nameKey:r||`name`,innerRadius:t,strokeWidth:5,paddingAngle:2,outerRadius:80,children:o.map((e,t)=>{let i=n[e[r]]?.color;if(!i){let e=d();i=e[t%e.length]}return(0,$.jsx)(Ij,{fill:oX(i)},`cell-${t}`)})}),(0,$.jsx)(eX,{content:(0,$.jsx)(KY,{nameKey:r}),...s&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}})]})})}return e===`radar`?(0,$.jsx)(WY,{config:n,className:a,children:(0,$.jsxs)(AY,{data:o,children:[(0,$.jsx)(HP,{}),(0,$.jsx)(RF,{dataKey:r}),(0,$.jsx)(mF,{}),(0,$.jsx)($Y,{content:(0,$.jsx)(GY,{})}),(0,$.jsx)(eX,{content:(0,$.jsx)(KY,{}),...s&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map(e=>{let t=oX(n[e.dataKey]?.color||iX);return(0,$.jsx)(Wz,{dataKey:e.dataKey,stroke:t,fill:t,fillOpacity:.6},e.dataKey)})]})}):e===`scatter`?(0,$.jsx)(WY,{config:n,className:a,children:(0,$.jsxs)(NY,{children:[(0,$.jsx)(GV,{vertical:!1}),(0,$.jsx)(yK,{type:`number`,dataKey:r,name:String(n[r]?.label||r),tickLine:!1,axisLine:!1,interval:s?Math.ceil(o.length/5):0}),(0,$.jsx)(IK,{type:`number`,dataKey:i[0]?.dataKey||`value`,name:String(n[i[0]?.dataKey]?.label||i[0]?.dataKey),tickLine:!1,axisLine:!1}),(0,$.jsx)(zK,{type:`number`,range:[60,400]}),(0,$.jsx)($Y,{content:(0,$.jsx)(GY,{})}),(0,$.jsx)(eX,{content:(0,$.jsx)(KY,{}),...s&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map((e,t)=>{let r=d(),i=oX(n[e.dataKey]?.color||r[t%r.length]);return(0,$.jsx)(YG,{name:n[e.dataKey]?.label||e.dataKey,data:o,fill:i},e.dataKey)})]})}):e===`combo`?(0,$.jsx)(WY,{config:n,className:a,children:(0,$.jsxs)(ZJ,{data:o,children:[(0,$.jsx)(GV,{vertical:!1}),(0,$.jsx)(yK,{dataKey:r,tickLine:!1,tickMargin:10,axisLine:!1,interval:s?Math.ceil(o.length/5):0,tickFormatter:e=>!e||typeof e!=`string`?e:s&&e.length>8?e.slice(0,8)+`…`:e,...!s&&u&&{angle:-35,textAnchor:`end`,height:60}}),(0,$.jsx)(IK,{yAxisId:`left`,tickLine:!1,axisLine:!1}),(0,$.jsx)(IK,{yAxisId:`right`,orientation:`right`,tickLine:!1,axisLine:!1}),(0,$.jsx)($Y,{content:(0,$.jsx)(GY,{})}),(0,$.jsx)(eX,{content:(0,$.jsx)(KY,{}),...s&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map((e,t)=>{let r=oX(n[e.dataKey]?.color||iX),i=e.chartType||(t===0?`bar`:`line`),a=i===`bar`?`left`:`right`;return i===`line`?(0,$.jsx)(nU,{yAxisId:a,type:`monotone`,dataKey:e.dataKey,stroke:r,strokeWidth:2,dot:!1},e.dataKey):i===`area`?(0,$.jsx)(qU,{yAxisId:a,type:`monotone`,dataKey:e.dataKey,fill:r,stroke:r,fillOpacity:.4},e.dataKey):(0,$.jsx)(sG,{yAxisId:a,dataKey:e.dataKey,fill:r,radius:4},e.dataKey)})]})}):(0,$.jsx)(WY,{config:n,className:a,children:(0,$.jsxs)(l,{data:o,children:[(0,$.jsx)(GV,{vertical:!1}),(0,$.jsx)(yK,{dataKey:r,tickLine:!1,tickMargin:10,axisLine:!1,interval:s?Math.ceil(o.length/5):0,tickFormatter:e=>!e||typeof e!=`string`?e:s&&e.length>8?e.slice(0,8)+`…`:e,...!s&&u&&{angle:-35,textAnchor:`end`,height:60}}),(0,$.jsx)($Y,{content:(0,$.jsx)(GY,{})}),(0,$.jsx)(eX,{content:(0,$.jsx)(KY,{}),...s&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map(t=>{let r=oX(n[t.dataKey]?.color||iX);return e===`bar`?(0,$.jsx)(sG,{dataKey:t.dataKey,fill:r,radius:4},t.dataKey):e===`line`?(0,$.jsx)(nU,{type:`monotone`,dataKey:t.dataKey,stroke:r,strokeWidth:2,dot:!1},t.dataKey):e===`area`?(0,$.jsx)(qU,{type:`monotone`,dataKey:t.dataKey,fill:r,stroke:r,fillOpacity:.4},t.dataKey):null})]})})}var $,iX,aX,oX,sX=f((()=>{RY(),tX(),$=b(),iX=`hsl(var(--primary))`,aX={slate:`#64748b`,gray:`#6b7280`,zinc:`#71717a`,neutral:`#737373`,stone:`#78716c`,red:`#ef4444`,orange:`#f97316`,amber:`#f59e0b`,yellow:`#eab308`,lime:`#84cc16`,green:`#22c55e`,emerald:`#10b981`,teal:`#14b8a6`,cyan:`#06b6d4`,sky:`#0ea5e9`,blue:`#3b82f6`,indigo:`#6366f1`,violet:`#8b5cf6`,purple:`#a855f7`,fuchsia:`#d946ef`,pink:`#ec4899`,rose:`#f43f5e`},oX=e=>aX[e]||e})),cX=b(),lX=_.default.lazy(()=>Promise.resolve().then(()=>(HY(),zY))),uX=_.default.lazy(()=>Promise.resolve().then(()=>(sX(),nX))),dX=({schema:e})=>(0,cX.jsx)(_.Suspense,{fallback:(0,cX.jsx)(r.Skeleton,{className:`w-full h-48 sm:h-64 md:h-80 lg:h-[400px]`}),children:(0,cX.jsx)(lX,{data:e.data,dataKey:e.dataKey,xAxisKey:e.xAxisKey,height:e.height,className:e.className,color:e.color})}),fX=({schema:e})=>{let t=_.default.useMemo(()=>{let t=e.series,n=e.xAxisKey,r=e.config;if(n||(e.index?n=e.index:e.category&&(n=e.category)),t||(e.categories?t=e.categories.map(e=>({dataKey:e})):e.value&&(t=[{dataKey:e.value}])),!r&&t){let n=e.colors||[`hsl(var(--chart-1))`,`hsl(var(--chart-2))`,`hsl(var(--chart-3))`],i={};t.forEach((e,t)=>{i[e.dataKey]={label:e.dataKey,color:n[t%n.length]}}),r=i}return{chartType:e.chartType,data:Array.isArray(e.data)?e.data:[],config:r,xAxisKey:n,series:t,className:e.className}},[e]);return(0,cX.jsx)(_.Suspense,{fallback:(0,cX.jsx)(r.Skeleton,{className:`w-full h-48 sm:h-64 md:h-80 lg:h-[400px]`}),children:(0,cX.jsx)(uX,{chartType:t.chartType,data:t.data,config:t.config,xAxisKey:t.xAxisKey,series:t.series,className:t.className})})},pX=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),mX=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),hX=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),gX=e=>{let t=hX(e);return t.charAt(0).toUpperCase()+t.slice(1)},_X={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},vX=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},yX=(0,n.createContext)({}),bX=()=>(0,n.useContext)(yX),xX=(0,n.forwardRef)(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:i,className:a=``,children:o,iconNode:s,...c},l)=>{let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=bX()??{},h=i??f?Number(r??d)*24/Number(t??u):r??d;return(0,n.createElement)(`svg`,{ref:l,..._X,width:t??u??_X.width,height:t??u??_X.height,stroke:e??p,strokeWidth:h,className:pX(`lucide`,m,a),...!o&&!vX(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(o)?o:[o]])}),SX=((e,t)=>{let r=(0,n.forwardRef)(({className:r,...i},a)=>(0,n.createElement)(xX,{ref:a,iconNode:t,className:pX(`lucide-${mX(gX(e))}`,`lucide-${e}`,r),...i}));return r.displayName=gX(e),r})(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]);function CX(e){return e.replace(/[_-]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function wX(e,t){let{field:n,function:r,groupBy:i}=t,a={};for(let t of e){let e=String(t[i]??`Unknown`);a[e]||(a[e]=[]),a[e].push(t)}return Object.entries(a).map(([e,t])=>{let a=t.map(e=>Number(e[n])||0),o;switch(r){case`count`:o=t.length;break;case`avg`:o=a.length>0?a.reduce((e,t)=>e+t,0)/a.length:0;break;case`min`:o=a.length>0?Math.min(...a):0;break;case`max`:o=a.length>0?Math.max(...a):0;break;default:o=a.reduce((e,t)=>e+t,0);break}return{[i]:e,[n]:o}})}async function TX(e,n,r,i){if(!e.length||!n)return e;let a=r?.fields?.[n];if(!a)return e.map(e=>({...e,[n]:CX(String(e[n]??``))}));let o=a.type;if(o===`select`||o===`picklist`||o===`dropdown`){let t=a.options||[];if(t.length===0)return e.map(e=>({...e,[n]:CX(String(e[n]??``))}));let r={};for(let e of t)typeof e==`string`?r[e]=e:e&&typeof e==`object`&&(r[String(e.value)]=e.label||String(e.value));return e.map(e=>{let t=String(e[n]??``);return{...e,[n]:r[t]||CX(t)}})}if(o===`lookup`||o===`master_detail`){let r=a.reference_to||a.reference;if(!r||!i||typeof i.find!=`function`)return e;let o=[...new Set(e.map(e=>e[n]).filter(e=>e!=null))];if(o.length===0)return e;let s=a.id_field||`id`;try{let c=(0,t.extractRecords)(await i.find(r,{$filter:{[s]:{$in:o}},$top:o.length})),l=a.reference_field||a.display_field||`name`,u={};for(let e of c){let t=String(e[s]??e.id??e._id??``),n=e[l]||e.name||e.label||e.title||t;t&&(u[t]=String(n))}return e.map(e=>{let t=String(e[n]??``);return{...e,[n]:u[t]||t}})}catch(t){return console.warn(`[ObjectChart] Failed to resolve lookup labels:`,t),e}}return e.map(e=>({...e,[n]:CX(String(e[n]??``))}))}var EX=e=>{let{schema:n}=e,r=(0,_.useContext)(a.SchemaRendererContext),i=e.dataSource||r?.dataSource,o=(0,a.useDataScope)(n.bind),[s,c]=(0,_.useState)([]),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(null),p=(0,_.useCallback)(async(e,r)=>{if(!(!e||!n.objectName)){r.current&&(u(!0),f(null));try{let i;if(n.aggregate&&typeof e.aggregate==`function`){let t=await e.aggregate(n.objectName,{field:n.aggregate.field,function:n.aggregate.function,groupBy:n.aggregate.groupBy,filter:n.filter});i=Array.isArray(t)?t:[]}else if(typeof e.find==`function`)i=(0,t.extractRecords)(await e.find(n.objectName,{$filter:n.filter})),n.aggregate&&i.length>0&&(i=wX(i,n.aggregate));else return;let a=n.aggregate?.groupBy||n.xAxisKey;if(a&&typeof e.getObjectSchema==`function`)try{let t=await e.getObjectSchema(n.objectName);i=await TX(i,a,t,e)}catch{}r.current&&c(i)}catch(e){console.error(`[ObjectChart] Fetch error:`,e),r.current&&f(e instanceof Error?e.message:`Failed to load chart data`)}finally{r.current&&u(!1)}}},[n.objectName,n.aggregate,n.filter,n.xAxisKey]);(0,_.useEffect)(()=>{let e={current:!0};return n.objectName&&!o&&!n.data&&p(i,e),()=>{e.current=!1}},[n.objectName,i,o,n.data,n.filter,n.aggregate,p]);let m=o||n.data||s,h=Array.isArray(m)?m:[],g={...n,data:h};return l&&h.length===0?(0,cX.jsx)(`div`,{className:`flex items-center justify-center text-muted-foreground text-sm p-4 `+(n.className||``),"data-testid":`chart-loading`,children:`Loading chart data…`}):d?(0,cX.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 p-4 `+(n.className||``),"data-testid":`chart-error`,role:`alert`,children:[(0,cX.jsx)(SX,{className:`h-6 w-6 text-destructive opacity-60`}),(0,cX.jsx)(`p`,{className:`text-xs text-destructive font-medium`,children:`Failed to load chart data`}),(0,cX.jsx)(`p`,{className:`text-xs text-muted-foreground max-w-xs text-center`,children:d})]}):!i&&n.objectName&&h.length===0?(0,cX.jsxs)(`div`,{className:`flex items-center justify-center text-muted-foreground text-sm p-4 `+(n.className||``),"data-testid":`chart-no-datasource`,children:[`No data source available for “`,n.objectName,`”`]}):(0,cX.jsx)(fX,{...e,schema:g})};t.ComponentRegistry.register(`object-chart`,EX,{namespace:`plugin-charts`,label:`Object Chart`,category:`view`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`data`,type:`array`,label:`Data`,description:`Optional static data`},{name:`filter`,type:`array`,label:`Filter`},{name:`aggregate`,type:`object`,label:`Aggregate`,description:`Aggregation config: { field, function, groupBy }`}]});var DX={"bar-chart":dX,chart:fX};t.ComponentRegistry.register(`bar-chart`,dX,{namespace:`plugin-charts`,label:`Bar Chart`,category:`plugin`,inputs:[{name:`data`,type:`array`,label:`Data`,required:!0},{name:`dataKey`,type:`string`,label:`Data Key`,defaultValue:`value`},{name:`xAxisKey`,type:`string`,label:`X-Axis Key`,defaultValue:`name`},{name:`height`,type:`number`,label:`Height`,defaultValue:400},{name:`color`,type:`color`,label:`Color`,defaultValue:`#8884d8`}],defaultProps:{data:[{name:`Jan`,value:400},{name:`Feb`,value:300},{name:`Mar`,value:600},{name:`Apr`,value:800},{name:`May`,value:500}],dataKey:`value`,xAxisKey:`name`,height:400,color:`#8884d8`}}),t.ComponentRegistry.register(`chart`,EX,{namespace:`view`,category:`view`,label:`Chart`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`type`,type:`string`,label:`Chart Type`},{name:`categoryField`,type:`string`,label:`Category Field`},{name:`valueField`,type:`string`,label:`Value Field`}]}),t.ComponentRegistry.register(`chart`,fX,{namespace:`plugin-charts`,label:`Chart`,category:`plugin`,inputs:[{name:`chartType`,type:`enum`,label:`Chart Type`,enum:[{label:`Bar`,value:`bar`},{label:`Line`,value:`line`},{label:`Area`,value:`area`},{label:`Pie`,value:`pie`},{label:`Donut`,value:`donut`},{label:`Radar`,value:`radar`},{label:`Scatter`,value:`scatter`}],defaultValue:`bar`},{name:`data`,type:`code`,label:`Data (JSON)`,required:!0},{name:`config`,type:`code`,label:`Config (JSON)`},{name:`xAxisKey`,type:`string`,label:`X Axis Key`,defaultValue:`name`},{name:`series`,type:`code`,label:`Series (JSON Array)`,required:!0},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{chartType:`bar`,data:[{name:`Jan`,sales:400,revenue:240},{name:`Feb`,sales:300,revenue:139},{name:`Mar`,sales:600,revenue:380},{name:`Apr`,sales:800,revenue:430},{name:`May`,sales:500,revenue:220}],config:{sales:{label:`Sales`,color:`#8884d8`},revenue:{label:`Revenue`,color:`#82ca9d`}},xAxisKey:`name`,series:[{dataKey:`sales`},{dataKey:`revenue`}]}}),t.ComponentRegistry.register(`chart:bar`,fX,{namespace:`plugin-charts`,label:`Bar Chart (Alias)`,category:`plugin`,defaultProps:{chartType:`bar`}}),t.ComponentRegistry.register(`pie-chart`,fX,{namespace:`plugin-charts`,label:`Pie Chart`,category:`plugin`,defaultProps:{chartType:`pie`}}),t.ComponentRegistry.register(`donut-chart`,fX,{namespace:`plugin-charts`,label:`Donut Chart`,category:`plugin`,defaultProps:{chartType:`donut`}}),t.ComponentRegistry.register(`radar-chart`,fX,{namespace:`plugin-charts`,label:`Radar Chart`,category:`plugin`,defaultProps:{chartType:`radar`}}),t.ComponentRegistry.register(`scatter-chart`,fX,{namespace:`plugin-charts`,label:`Scatter Chart`,category:`plugin`,defaultProps:{chartType:`scatter`}}),e.ChartBarRenderer=dX,e.ChartRenderer=fX,e.ObjectChart=EX,e.chartComponents=DX});
|
|
61
|
+
`)}}):null},$Y=Mj,eX=jf})),nX=m({default:()=>rX});function rX({chartType:e=`bar`,data:t=[],config:n={},xAxisKey:r=`name`,series:i=[],className:a=``}){let o=Array.isArray(t)?t:[],[s,c]=_.useState(!1);_.useEffect(()=>{let e=()=>c(window.innerWidth<640);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let l={bar:ZJ,line:JJ,area:IY,pie:xY,donut:xY,radar:AY,scatter:NY,combo:ZJ}[e]||ZJ,u=_.useMemo(()=>o.some(e=>String(e[r]||``).length>5),[o,r]),d=()=>[`hsl(var(--chart-1))`,`hsl(var(--chart-2))`,`hsl(var(--chart-3))`,`hsl(var(--chart-4))`,`hsl(var(--chart-5))`];if(e===`pie`||e===`donut`){let t=e===`donut`?60:0;return(0,$.jsx)(WY,{config:n,className:a,children:(0,$.jsxs)(xY,{children:[(0,$.jsx)($Y,{cursor:!1,content:(0,$.jsx)(GY,{hideLabel:!0})}),(0,$.jsx)(uR,{data:o,dataKey:i[0]?.dataKey||`value`,nameKey:r||`name`,innerRadius:t,strokeWidth:5,paddingAngle:2,outerRadius:80,children:o.map((e,t)=>{let i=n[e[r]]?.color;if(!i){let e=d();i=e[t%e.length]}return(0,$.jsx)(Ij,{fill:oX(i)},`cell-${t}`)})}),(0,$.jsx)(eX,{content:(0,$.jsx)(KY,{nameKey:r}),...s&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}})]})})}return e===`radar`?(0,$.jsx)(WY,{config:n,className:a,children:(0,$.jsxs)(AY,{data:o,children:[(0,$.jsx)(HP,{}),(0,$.jsx)(RF,{dataKey:r}),(0,$.jsx)(mF,{}),(0,$.jsx)($Y,{content:(0,$.jsx)(GY,{})}),(0,$.jsx)(eX,{content:(0,$.jsx)(KY,{}),...s&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map(e=>{let t=oX(n[e.dataKey]?.color||iX);return(0,$.jsx)(Wz,{dataKey:e.dataKey,stroke:t,fill:t,fillOpacity:.6},e.dataKey)})]})}):e===`scatter`?(0,$.jsx)(WY,{config:n,className:a,children:(0,$.jsxs)(NY,{children:[(0,$.jsx)(GV,{vertical:!1}),(0,$.jsx)(yK,{type:`number`,dataKey:r,name:String(n[r]?.label||r),tickLine:!1,axisLine:!1,interval:s?Math.ceil(o.length/5):0}),(0,$.jsx)(IK,{type:`number`,dataKey:i[0]?.dataKey||`value`,name:String(n[i[0]?.dataKey]?.label||i[0]?.dataKey),tickLine:!1,axisLine:!1}),(0,$.jsx)(zK,{type:`number`,range:[60,400]}),(0,$.jsx)($Y,{content:(0,$.jsx)(GY,{})}),(0,$.jsx)(eX,{content:(0,$.jsx)(KY,{}),...s&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map((e,t)=>{let r=d(),i=oX(n[e.dataKey]?.color||r[t%r.length]);return(0,$.jsx)(YG,{name:n[e.dataKey]?.label||e.dataKey,data:o,fill:i},e.dataKey)})]})}):e===`combo`?(0,$.jsx)(WY,{config:n,className:a,children:(0,$.jsxs)(ZJ,{data:o,children:[(0,$.jsx)(GV,{vertical:!1}),(0,$.jsx)(yK,{dataKey:r,tickLine:!1,tickMargin:10,axisLine:!1,interval:s?Math.ceil(o.length/5):0,tickFormatter:e=>!e||typeof e!=`string`?e:s&&e.length>8?e.slice(0,8)+`…`:e,...!s&&u&&{angle:-35,textAnchor:`end`,height:60}}),(0,$.jsx)(IK,{yAxisId:`left`,tickLine:!1,axisLine:!1}),(0,$.jsx)(IK,{yAxisId:`right`,orientation:`right`,tickLine:!1,axisLine:!1}),(0,$.jsx)($Y,{content:(0,$.jsx)(GY,{})}),(0,$.jsx)(eX,{content:(0,$.jsx)(KY,{}),...s&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map((e,t)=>{let r=oX(n[e.dataKey]?.color||iX),i=e.chartType||(t===0?`bar`:`line`),a=i===`bar`?`left`:`right`;return i===`line`?(0,$.jsx)(nU,{yAxisId:a,type:`monotone`,dataKey:e.dataKey,stroke:r,strokeWidth:2,dot:!1},e.dataKey):i===`area`?(0,$.jsx)(qU,{yAxisId:a,type:`monotone`,dataKey:e.dataKey,fill:r,stroke:r,fillOpacity:.4},e.dataKey):(0,$.jsx)(sG,{yAxisId:a,dataKey:e.dataKey,fill:r,radius:4},e.dataKey)})]})}):(0,$.jsx)(WY,{config:n,className:a,children:(0,$.jsxs)(l,{data:o,children:[(0,$.jsx)(GV,{vertical:!1}),(0,$.jsx)(yK,{dataKey:r,tickLine:!1,tickMargin:10,axisLine:!1,interval:s?Math.ceil(o.length/5):0,tickFormatter:e=>!e||typeof e!=`string`?e:s&&e.length>8?e.slice(0,8)+`…`:e,...!s&&u&&{angle:-35,textAnchor:`end`,height:60}}),(0,$.jsx)($Y,{content:(0,$.jsx)(GY,{})}),(0,$.jsx)(eX,{content:(0,$.jsx)(KY,{}),...s&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map((t,r)=>{let a=d(),s=oX(n[t.dataKey]?.color||a[r%a.length]||iX);if(e===`bar`){let e=i.length===1&&o.length>1;return(0,$.jsx)(sG,{dataKey:t.dataKey,fill:s,radius:4,children:e&&o.map((e,t)=>(0,$.jsx)(Ij,{fill:oX(a[t%a.length])},`cell-${t}`))},t.dataKey)}return e===`line`?(0,$.jsx)(nU,{type:`monotone`,dataKey:t.dataKey,stroke:s,strokeWidth:2,dot:!1},t.dataKey):e===`area`?(0,$.jsx)(qU,{type:`monotone`,dataKey:t.dataKey,fill:s,stroke:s,fillOpacity:.4},t.dataKey):null})]})})}var $,iX,aX,oX,sX=f((()=>{RY(),tX(),$=b(),iX=`hsl(var(--primary))`,aX={slate:`#64748b`,gray:`#6b7280`,zinc:`#71717a`,neutral:`#737373`,stone:`#78716c`,red:`#ef4444`,orange:`#f97316`,amber:`#f59e0b`,yellow:`#eab308`,lime:`#84cc16`,green:`#22c55e`,emerald:`#10b981`,teal:`#14b8a6`,cyan:`#06b6d4`,sky:`#0ea5e9`,blue:`#3b82f6`,indigo:`#6366f1`,violet:`#8b5cf6`,purple:`#a855f7`,fuchsia:`#d946ef`,pink:`#ec4899`,rose:`#f43f5e`},oX=e=>aX[e]||e})),cX=b(),lX=_.default.lazy(()=>Promise.resolve().then(()=>(HY(),zY))),uX=_.default.lazy(()=>Promise.resolve().then(()=>(sX(),nX))),dX=({schema:e})=>(0,cX.jsx)(_.Suspense,{fallback:(0,cX.jsx)(r.Skeleton,{className:`w-full h-48 sm:h-64 md:h-80 lg:h-[400px]`}),children:(0,cX.jsx)(lX,{data:e.data,dataKey:e.dataKey,xAxisKey:e.xAxisKey,height:e.height,className:e.className,color:e.color})}),fX=({schema:e})=>{let t=_.default.useMemo(()=>{let t=e.series,n=e.xAxisKey,r=e.config;if(n||(e.index?n=e.index:e.category&&(n=e.category)),t||(e.categories?t=e.categories.map(e=>({dataKey:e})):e.value&&(t=[{dataKey:e.value}])),!r&&t){let n=e.colors||[`hsl(var(--chart-1))`,`hsl(var(--chart-2))`,`hsl(var(--chart-3))`],i={};t.forEach((e,t)=>{i[e.dataKey]={label:e.dataKey,color:n[t%n.length]}}),r=i}return{chartType:e.chartType,data:Array.isArray(e.data)?e.data:[],config:r,xAxisKey:n,series:t,className:e.className}},[e]);return(0,cX.jsx)(_.Suspense,{fallback:(0,cX.jsx)(r.Skeleton,{className:`w-full h-48 sm:h-64 md:h-80 lg:h-[400px]`}),children:(0,cX.jsx)(uX,{chartType:t.chartType,data:t.data,config:t.config,xAxisKey:t.xAxisKey,series:t.series,className:t.className})})},pX=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),mX=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),hX=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),gX=e=>{let t=hX(e);return t.charAt(0).toUpperCase()+t.slice(1)},_X={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},vX=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},yX=(0,n.createContext)({}),bX=()=>(0,n.useContext)(yX),xX=(0,n.forwardRef)(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:i,className:a=``,children:o,iconNode:s,...c},l)=>{let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=bX()??{},h=i??f?Number(r??d)*24/Number(t??u):r??d;return(0,n.createElement)(`svg`,{ref:l,..._X,width:t??u??_X.width,height:t??u??_X.height,stroke:e??p,strokeWidth:h,className:pX(`lucide`,m,a),...!o&&!vX(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(o)?o:[o]])}),SX=((e,t)=>{let r=(0,n.forwardRef)(({className:r,...i},a)=>(0,n.createElement)(xX,{ref:a,iconNode:t,className:pX(`lucide-${mX(gX(e))}`,`lucide-${e}`,r),...i}));return r.displayName=gX(e),r})(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]);function CX(e){return e.replace(/[_-]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function wX(e,t){let{field:n,function:r,groupBy:i}=t,a={};for(let t of e){let e=String(t[i]??`Unknown`);a[e]||(a[e]=[]),a[e].push(t)}return Object.entries(a).map(([e,t])=>{let a=t.map(e=>Number(e[n])||0),o;switch(r){case`count`:o=t.length;break;case`avg`:o=a.length>0?a.reduce((e,t)=>e+t,0)/a.length:0;break;case`min`:o=a.length>0?Math.min(...a):0;break;case`max`:o=a.length>0?Math.max(...a):0;break;default:o=a.reduce((e,t)=>e+t,0);break}return{[i]:e,[n]:o}})}async function TX(e,n,r,i){if(!e.length||!n)return e;let a=r?.fields?.[n];if(!a)return e.map(e=>({...e,[n]:CX(String(e[n]??``))}));let o=a.type;if(o===`select`||o===`picklist`||o===`dropdown`){let t=a.options||[];if(t.length===0)return e.map(e=>({...e,[n]:CX(String(e[n]??``))}));let r={};for(let e of t)typeof e==`string`?r[e]=e:e&&typeof e==`object`&&(r[String(e.value)]=e.label||String(e.value));return e.map(e=>{let t=String(e[n]??``);return{...e,[n]:r[t]||CX(t)}})}if(o===`lookup`||o===`master_detail`){let r=a.reference_to||a.reference;if(!r||!i||typeof i.find!=`function`)return e;let o=[...new Set(e.map(e=>e[n]).filter(e=>e!=null))];if(o.length===0)return e;let s=a.id_field||`id`;try{let c=(0,t.extractRecords)(await i.find(r,{$filter:{[s]:{$in:o}},$top:o.length})),l=a.reference_field||a.display_field||`name`,u={};for(let e of c){let t=String(e[s]??e.id??e._id??``),n=e[l]||e.name||e.label||e.title||t;t&&(u[t]=String(n))}return e.map(e=>{let t=String(e[n]??``);return{...e,[n]:u[t]||t}})}catch(t){return console.warn(`[ObjectChart] Failed to resolve lookup labels:`,t),e}}return e.map(e=>({...e,[n]:CX(String(e[n]??``))}))}var EX=e=>{let{schema:n}=e,r=(0,_.useContext)(a.SchemaRendererContext),i=e.dataSource||r?.dataSource,o=(0,a.useDataScope)(n.bind),[s,c]=(0,_.useState)([]),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(null),p=(0,_.useCallback)(async(e,r)=>{if(!(!e||!n.objectName)){r.current&&(u(!0),f(null));try{let i;if(n.aggregate&&typeof e.aggregate==`function`){let t=await e.aggregate(n.objectName,{field:n.aggregate.field,function:n.aggregate.function,groupBy:n.aggregate.groupBy,filter:n.filter});i=Array.isArray(t)?t:[]}else if(typeof e.find==`function`)i=(0,t.extractRecords)(await e.find(n.objectName,{$filter:n.filter})),n.aggregate&&i.length>0&&(i=wX(i,n.aggregate));else return;let a=n.aggregate?.groupBy||n.xAxisKey;if(a&&typeof e.getObjectSchema==`function`)try{let t=await e.getObjectSchema(n.objectName);i=await TX(i,a,t,e)}catch{}r.current&&c(i)}catch(e){console.error(`[ObjectChart] Fetch error:`,e),r.current&&f(e instanceof Error?e.message:`Failed to load chart data`)}finally{r.current&&u(!1)}}},[n.objectName,n.aggregate,n.filter,n.xAxisKey]);(0,_.useEffect)(()=>{let e={current:!0};return n.objectName&&!o&&!n.data&&p(i,e),()=>{e.current=!1}},[n.objectName,i,o,n.data,n.filter,n.aggregate,p]);let m=o||n.data||s,h=Array.isArray(m)?m:[],g={...n,data:h};return l&&h.length===0?(0,cX.jsx)(`div`,{className:`flex items-center justify-center text-muted-foreground text-sm p-4 `+(n.className||``),"data-testid":`chart-loading`,children:`Loading chart data…`}):d?(0,cX.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 p-4 `+(n.className||``),"data-testid":`chart-error`,role:`alert`,children:[(0,cX.jsx)(SX,{className:`h-6 w-6 text-destructive opacity-60`}),(0,cX.jsx)(`p`,{className:`text-xs text-destructive font-medium`,children:`Failed to load chart data`}),(0,cX.jsx)(`p`,{className:`text-xs text-muted-foreground max-w-xs text-center`,children:d})]}):!i&&n.objectName&&h.length===0?(0,cX.jsxs)(`div`,{className:`flex items-center justify-center text-muted-foreground text-sm p-4 `+(n.className||``),"data-testid":`chart-no-datasource`,children:[`No data source available for “`,n.objectName,`”`]}):(0,cX.jsx)(fX,{...e,schema:g})};t.ComponentRegistry.register(`object-chart`,EX,{namespace:`plugin-charts`,label:`Object Chart`,category:`view`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`data`,type:`array`,label:`Data`,description:`Optional static data`},{name:`filter`,type:`array`,label:`Filter`},{name:`aggregate`,type:`object`,label:`Aggregate`,description:`Aggregation config: { field, function, groupBy }`}]});var DX={"bar-chart":dX,chart:fX};t.ComponentRegistry.register(`bar-chart`,dX,{namespace:`plugin-charts`,label:`Bar Chart`,category:`plugin`,inputs:[{name:`data`,type:`array`,label:`Data`,required:!0},{name:`dataKey`,type:`string`,label:`Data Key`,defaultValue:`value`},{name:`xAxisKey`,type:`string`,label:`X-Axis Key`,defaultValue:`name`},{name:`height`,type:`number`,label:`Height`,defaultValue:400},{name:`color`,type:`color`,label:`Color`,defaultValue:`#8884d8`}],defaultProps:{data:[{name:`Jan`,value:400},{name:`Feb`,value:300},{name:`Mar`,value:600},{name:`Apr`,value:800},{name:`May`,value:500}],dataKey:`value`,xAxisKey:`name`,height:400,color:`#8884d8`}}),t.ComponentRegistry.register(`chart`,EX,{namespace:`view`,category:`view`,label:`Chart`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`type`,type:`string`,label:`Chart Type`},{name:`categoryField`,type:`string`,label:`Category Field`},{name:`valueField`,type:`string`,label:`Value Field`}]}),t.ComponentRegistry.register(`chart`,fX,{namespace:`plugin-charts`,label:`Chart`,category:`plugin`,inputs:[{name:`chartType`,type:`enum`,label:`Chart Type`,enum:[{label:`Bar`,value:`bar`},{label:`Line`,value:`line`},{label:`Area`,value:`area`},{label:`Pie`,value:`pie`},{label:`Donut`,value:`donut`},{label:`Radar`,value:`radar`},{label:`Scatter`,value:`scatter`}],defaultValue:`bar`},{name:`data`,type:`code`,label:`Data (JSON)`,required:!0},{name:`config`,type:`code`,label:`Config (JSON)`},{name:`xAxisKey`,type:`string`,label:`X Axis Key`,defaultValue:`name`},{name:`series`,type:`code`,label:`Series (JSON Array)`,required:!0},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{chartType:`bar`,data:[{name:`Jan`,sales:400,revenue:240},{name:`Feb`,sales:300,revenue:139},{name:`Mar`,sales:600,revenue:380},{name:`Apr`,sales:800,revenue:430},{name:`May`,sales:500,revenue:220}],config:{sales:{label:`Sales`,color:`#8884d8`},revenue:{label:`Revenue`,color:`#82ca9d`}},xAxisKey:`name`,series:[{dataKey:`sales`},{dataKey:`revenue`}]}}),t.ComponentRegistry.register(`chart:bar`,fX,{namespace:`plugin-charts`,label:`Bar Chart (Alias)`,category:`plugin`,defaultProps:{chartType:`bar`}}),t.ComponentRegistry.register(`pie-chart`,fX,{namespace:`plugin-charts`,label:`Pie Chart`,category:`plugin`,defaultProps:{chartType:`pie`}}),t.ComponentRegistry.register(`donut-chart`,fX,{namespace:`plugin-charts`,label:`Donut Chart`,category:`plugin`,defaultProps:{chartType:`donut`}}),t.ComponentRegistry.register(`radar-chart`,fX,{namespace:`plugin-charts`,label:`Radar Chart`,category:`plugin`,defaultProps:{chartType:`radar`}}),t.ComponentRegistry.register(`scatter-chart`,fX,{namespace:`plugin-charts`,label:`Scatter Chart`,category:`plugin`,defaultProps:{chartType:`scatter`}}),e.ChartBarRenderer=dX,e.ChartRenderer=fX,e.ObjectChart=EX,e.chartComponents=DX});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region \0rolldown/runtime.js
|
|
2
|
-
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), s = (e, n) => {
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
|
|
3
3
|
let r = {};
|
|
4
4
|
for (var i in e) t(r, i, {
|
|
5
5
|
get: e[i],
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/plugin-charts",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Chart components plugin for Object UI, powered by Recharts",
|
|
7
|
-
"homepage": "https://www.objectui.org",
|
|
7
|
+
"homepage": "https://www.objectui.org/docs/plugins/plugin-charts",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/objectstack-ai/objectui.git",
|
|
10
|
+
"url": "git+https://github.com/objectstack-ai/objectui.git",
|
|
11
11
|
"directory": "packages/plugin-charts"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"lucide-react": "^1.8.0",
|
|
28
28
|
"recharts": "^3.8.1",
|
|
29
|
-
"@object-ui/components": "3.3.
|
|
30
|
-
"@object-ui/core": "3.3.
|
|
31
|
-
"@object-ui/react": "3.3.
|
|
32
|
-
"@object-ui/types": "3.3.
|
|
29
|
+
"@object-ui/components": "3.3.1",
|
|
30
|
+
"@object-ui/core": "3.3.1",
|
|
31
|
+
"@object-ui/react": "3.3.1",
|
|
32
|
+
"@object-ui/types": "3.3.1"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -39,10 +39,33 @@
|
|
|
39
39
|
"@types/react": "19.2.14",
|
|
40
40
|
"@types/react-dom": "19.2.3",
|
|
41
41
|
"@vitejs/plugin-react": "^6.0.1",
|
|
42
|
-
"typescript": "^6.0.
|
|
43
|
-
"vite": "^8.0.
|
|
42
|
+
"typescript": "^6.0.3",
|
|
43
|
+
"vite": "^8.0.9",
|
|
44
44
|
"vite-plugin-dts": "^4.5.4"
|
|
45
45
|
},
|
|
46
|
+
"keywords": [
|
|
47
|
+
"objectui",
|
|
48
|
+
"sdui",
|
|
49
|
+
"schema-driven-ui",
|
|
50
|
+
"react",
|
|
51
|
+
"tailwind",
|
|
52
|
+
"shadcn",
|
|
53
|
+
"objectstack",
|
|
54
|
+
"plugin",
|
|
55
|
+
"charts",
|
|
56
|
+
"recharts",
|
|
57
|
+
"visualization"
|
|
58
|
+
],
|
|
59
|
+
"author": "ObjectStack Team <team@objectstack.ai>",
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
},
|
|
63
|
+
"files": [
|
|
64
|
+
"dist",
|
|
65
|
+
"README.md",
|
|
66
|
+
"CHANGELOG.md",
|
|
67
|
+
"LICENSE"
|
|
68
|
+
],
|
|
46
69
|
"scripts": {
|
|
47
70
|
"build": "vite build",
|
|
48
71
|
"test": "vitest run",
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @object-ui/plugin-charts@3.3.0 build /home/runner/work/objectui/objectui/packages/plugin-charts
|
|
3
|
-
> vite build
|
|
4
|
-
|
|
5
|
-
[36mvite v8.0.8 [32mbuilding client environment for production...[36m[39m
|
|
6
|
-
[2K
|
|
7
|
-
rendering chunks...
|
|
8
|
-
[32m
|
|
9
|
-
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
10
|
-
[32m[36m[vite:dts][32m Declaration files built in 28227ms.
|
|
11
|
-
[39m
|
|
12
|
-
computing gzip size...
|
|
13
|
-
dist/ChartImpl-CQj8Kris.js 3.70 kB │ gzip: 1.16 kB
|
|
14
|
-
dist/jsx-runtime-C8d0IhUE.js 8.60 kB │ gzip: 3.13 kB
|
|
15
|
-
dist/index.js 13.00 kB │ gzip: 4.17 kB
|
|
16
|
-
dist/AdvancedChartImpl-JDjuxIZW.js 121.02 kB │ gzip: 25.09 kB
|
|
17
|
-
dist/BarChart-Bvt5Se8Q.js 536.16 kB │ gzip: 131.24 kB
|
|
18
|
-
|
|
19
|
-
[33m[33m[PLUGIN_TIMINGS] Warning:[0m Your build spent significant time in plugin `vite:dts`. See https://rolldown.rs/options/checks#plugintimings for more details.
|
|
20
|
-
[39m
|
|
21
|
-
[2K
|
|
22
|
-
rendering chunks...
|
|
23
|
-
computing gzip size...
|
|
24
|
-
dist/index.umd.cjs 505.43 kB │ gzip: 145.32 kB
|
|
25
|
-
|
|
26
|
-
[32m✓ built in 36.73s[39m
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Example: Using all new chart types
|
|
11
|
-
*
|
|
12
|
-
* This example demonstrates the new Pie, Donut, Radar, and Scatter chart types
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export const pieChartExample = {
|
|
16
|
-
type: 'pie-chart',
|
|
17
|
-
data: [
|
|
18
|
-
{ name: 'Chrome', value: 65 },
|
|
19
|
-
{ name: 'Firefox', value: 20 },
|
|
20
|
-
{ name: 'Safari', value: 10 },
|
|
21
|
-
{ name: 'Edge', value: 5 },
|
|
22
|
-
],
|
|
23
|
-
xAxisKey: 'name',
|
|
24
|
-
series: [{ dataKey: 'value' }],
|
|
25
|
-
config: {
|
|
26
|
-
Chrome: { label: 'Chrome', color: 'hsl(var(--chart-1))' },
|
|
27
|
-
Firefox: { label: 'Firefox', color: 'hsl(var(--chart-2))' },
|
|
28
|
-
Safari: { label: 'Safari', color: 'hsl(var(--chart-3))' },
|
|
29
|
-
Edge: { label: 'Edge', color: 'hsl(var(--chart-4))' },
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const donutChartExample = {
|
|
34
|
-
type: 'donut-chart',
|
|
35
|
-
data: [
|
|
36
|
-
{ category: 'Electronics', revenue: 45000 },
|
|
37
|
-
{ category: 'Clothing', revenue: 32000 },
|
|
38
|
-
{ category: 'Food', revenue: 28000 },
|
|
39
|
-
{ category: 'Books', revenue: 15000 },
|
|
40
|
-
],
|
|
41
|
-
xAxisKey: 'category',
|
|
42
|
-
series: [{ dataKey: 'revenue' }]
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const radarChartExample = {
|
|
46
|
-
type: 'radar-chart',
|
|
47
|
-
data: [
|
|
48
|
-
{ skill: 'React', score: 90 },
|
|
49
|
-
{ skill: 'TypeScript', score: 85 },
|
|
50
|
-
{ skill: 'Node.js', score: 80 }
|
|
51
|
-
],
|
|
52
|
-
xAxisKey: 'skill',
|
|
53
|
-
series: [{ dataKey: 'score' }]
|
|
54
|
-
};
|