wimui 0.24.4 → 0.26.0
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/dist/components/_internal/ChartDataTable.cjs +2 -0
- package/dist/components/_internal/ChartDataTable.d.ts +43 -0
- package/dist/components/_internal/ChartDataTable.js +20 -0
- package/dist/components/_internal/chart-data-table.module.cjs +2 -0
- package/dist/components/_internal/chart-data-table.module.js +5 -0
- package/dist/components/_internal/chartTableData.cjs +0 -0
- package/dist/components/_internal/chartTableData.d.ts +53 -0
- package/dist/components/_internal/chartTableData.js +0 -0
- package/dist/components/ai/AgentStatus/agent-status.module.cjs +1 -1
- package/dist/components/ai/AgentStatus/agent-status.module.js +3 -3
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.cjs +1 -1
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.js +2 -2
- package/dist/components/ai/InteractiveGraph/interactive-graph.module.cjs +1 -1
- package/dist/components/ai/InteractiveGraph/interactive-graph.module.js +1 -1
- package/dist/components/charts/AreaChart/AreaChart.cjs +1 -1
- package/dist/components/charts/AreaChart/AreaChart.d.ts +7 -1
- package/dist/components/charts/AreaChart/AreaChart.js +85 -68
- package/dist/components/charts/BarChart/BarChart.cjs +1 -1
- package/dist/components/charts/BarChart/BarChart.d.ts +7 -1
- package/dist/components/charts/BarChart/BarChart.js +90 -73
- package/dist/components/charts/FunnelChart/FunnelChart.cjs +1 -1
- package/dist/components/charts/FunnelChart/FunnelChart.d.ts +7 -1
- package/dist/components/charts/FunnelChart/FunnelChart.js +60 -43
- package/dist/components/charts/GanttChart/gantt-chart.module.cjs +1 -1
- package/dist/components/charts/GanttChart/gantt-chart.module.js +1 -1
- package/dist/components/charts/GaugeChart/GaugeChart.cjs +1 -1
- package/dist/components/charts/GaugeChart/GaugeChart.d.ts +7 -1
- package/dist/components/charts/GaugeChart/GaugeChart.js +6 -4
- package/dist/components/charts/Heatmap/Heatmap.cjs +1 -1
- package/dist/components/charts/Heatmap/Heatmap.d.ts +7 -1
- package/dist/components/charts/Heatmap/Heatmap.js +101 -87
- package/dist/components/charts/LineChart/LineChart.cjs +1 -1
- package/dist/components/charts/LineChart/LineChart.d.ts +7 -1
- package/dist/components/charts/LineChart/LineChart.js +87 -70
- package/dist/components/charts/PieChart/PieChart.cjs +1 -1
- package/dist/components/charts/PieChart/PieChart.d.ts +7 -1
- package/dist/components/charts/PieChart/PieChart.js +65 -45
- package/dist/components/charts/RadarChart/RadarChart.cjs +1 -1
- package/dist/components/charts/RadarChart/RadarChart.d.ts +7 -1
- package/dist/components/charts/RadarChart/RadarChart.js +73 -56
- package/dist/components/charts/ScatterChart/ScatterChart.cjs +1 -1
- package/dist/components/charts/ScatterChart/ScatterChart.d.ts +7 -1
- package/dist/components/charts/ScatterChart/ScatterChart.js +85 -68
- package/dist/components/charts/Sparkline/Sparkline.cjs +1 -1
- package/dist/components/charts/Sparkline/Sparkline.js +52 -54
- package/dist/components/charts/Treemap/Treemap.cjs +1 -1
- package/dist/components/charts/Treemap/Treemap.d.ts +7 -1
- package/dist/components/charts/Treemap/Treemap.js +75 -61
- package/dist/components/data-display/CalendarHeatmap/calendar-heatmap.module.cjs +1 -1
- package/dist/components/data-display/CalendarHeatmap/calendar-heatmap.module.js +1 -1
- package/dist/components/data-display/Kanban/kanban.module.cjs +1 -1
- package/dist/components/data-display/Kanban/kanban.module.js +1 -1
- package/dist/components/data-display/NodeGraph/node-graph.module.cjs +1 -1
- package/dist/components/data-display/NodeGraph/node-graph.module.js +1 -1
- package/dist/components/feedback/Alert/alert.module.cjs +1 -1
- package/dist/components/feedback/Alert/alert.module.js +5 -5
- package/dist/components/feedback/ProgressRing/ProgressRing.d.ts +6 -1
- package/dist/components/feedback/Toast/toast.module.cjs +1 -1
- package/dist/components/feedback/Toast/toast.module.js +11 -11
- package/dist/components/form/FieldTemplate/field-template.module.cjs +1 -1
- package/dist/components/form/FieldTemplate/field-template.module.js +1 -1
- package/dist/components/helpers.cjs +1 -1
- package/dist/components/helpers.d.ts +18 -0
- package/dist/components/helpers.js +4 -1
- package/dist/components/layout/Footer/Footer.cjs +1 -1
- package/dist/components/layout/Footer/Footer.d.ts +15 -0
- package/dist/components/layout/Footer/Footer.js +15 -12
- package/dist/components/media/Gallery/gallery.module.cjs +1 -1
- package/dist/components/media/Gallery/gallery.module.js +11 -11
- package/dist/components/navigation/KeyboardShortcuts/KeyboardShortcuts.cjs +1 -1
- package/dist/components/navigation/KeyboardShortcuts/KeyboardShortcuts.d.ts +22 -0
- package/dist/components/navigation/KeyboardShortcuts/KeyboardShortcuts.js +31 -28
- package/dist/components/navigation/SpeedDial/SpeedDial.d.ts +24 -2
- package/dist/i18n/generated/keys.d.ts +1 -1
- package/dist/llms-full.txt +104 -11
- package/dist/llms.txt +1 -1
- package/dist/locales/en/common.json +1 -49
- package/dist/locales/en/form.json +1 -20
- package/dist/locales/ja/common.json +1 -49
- package/dist/locales/ja/form.json +1 -20
- package/dist/locales/pt/common.json +1 -49
- package/dist/locales/pt/form.json +1 -20
- package/dist/robots.txt +5 -0
- package/dist/styles.css +2 -2
- package/dist/types/generated-tokens.d.ts +1 -1
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +3 -3
- package/package.json +35 -21
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("./pie-chart.module.cjs");let
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("../../_internal/ChartDataTable.cjs"),i=require("../../_internal/chartTableData.cjs"),a=require("./pie-chart.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime"),c=require("recharts");var l=({data:e,height:o=300,width:l=`100%`,title:u,donut:d=!1,animated:f=!1,"aria-label":p})=>{let m=p??u,h=i.pairTable(e,`name`,`value`);return(0,s.jsxs)(`div`,{className:`wim-pie-chart ${a.default.root}`,style:{width:l},role:m?`figure`:void 0,"aria-label":m,children:[u&&(0,s.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:u}),(0,s.jsx)(`div`,{className:a.default.container,style:{height:o},"aria-hidden":`true`,children:(0,s.jsx)(c.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,s.jsxs)(c.PieChart,{...n.CHART_HIDDEN_A11Y_PROPS,children:[(0,s.jsx)(c.Pie,{rootTabIndex:-1,data:e,cx:`50%`,cy:`50%`,labelLine:!1,innerRadius:d?`60%`:0,outerRadius:`80%`,paddingAngle:0,dataKey:`value`,isAnimationActive:f,children:e.map((e,t)=>(0,s.jsx)(c.Cell,{fill:n.CHART_COLORS[t%n.CHART_COLORS.length],stroke:`var(--wim-color-surface)`,strokeWidth:2},`cell-${t}`))}),(0,s.jsx)(c.Tooltip,{contentStyle:n.CHART_THEME.tooltip.contentStyle}),(0,s.jsx)(c.Legend,{verticalAlign:`top`,height:36,...n.CHART_THEME.legend})]})})}),(0,s.jsx)(r.ChartDataTable,{caption:m,columns:h.columns,rows:h.rows})]})};exports.PieChart=l;
|
|
@@ -31,5 +31,11 @@ export type PieChartProps = {
|
|
|
31
31
|
* @default false
|
|
32
32
|
*/
|
|
33
33
|
animated?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Accessible name for the chart. Defaults to `title` when omitted; pass this
|
|
36
|
+
* when the chart has no visible title, or when the title is not descriptive
|
|
37
|
+
* enough on its own.
|
|
38
|
+
*/
|
|
39
|
+
"aria-label"?: string;
|
|
34
40
|
};
|
|
35
|
-
export declare const PieChart: ({ data, height, width, title, donut, animated, }: PieChartProps) => React.JSX.Element;
|
|
41
|
+
export declare const PieChart: ({ data, height, width, title, donut, animated, "aria-label": ariaLabel, }: PieChartProps) => React.JSX.Element;
|
|
@@ -1,51 +1,71 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Title as e } from "../../typography/Title/Title.js";
|
|
3
|
-
import { CHART_COLORS as t,
|
|
4
|
-
import
|
|
3
|
+
import { CHART_COLORS as t, CHART_HIDDEN_A11Y_PROPS as n, CHART_THEME as r } from "../../helpers.js";
|
|
4
|
+
import { ChartDataTable as i } from "../../_internal/ChartDataTable.js";
|
|
5
|
+
import { pairTable as a } from "../../_internal/chartTableData.js";
|
|
6
|
+
import o from "./pie-chart.module.js";
|
|
5
7
|
import "react";
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { Cell as
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
import { Cell as l, Legend as u, Pie as d, PieChart as f, ResponsiveContainer as p, Tooltip as m } from "recharts";
|
|
8
10
|
//#region src/components/charts/PieChart/PieChart.tsx
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
children:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
11
|
+
var h = ({ data: h, height: g = 300, width: _ = "100%", title: v, donut: y = !1, animated: b = !1, "aria-label": x }) => {
|
|
12
|
+
let S = x ?? v, C = a(h, "name", "value");
|
|
13
|
+
return /* @__PURE__ */ c("div", {
|
|
14
|
+
className: `wim-pie-chart ${o.root}`,
|
|
15
|
+
style: { width: _ },
|
|
16
|
+
role: S ? "figure" : void 0,
|
|
17
|
+
"aria-label": S,
|
|
18
|
+
children: [
|
|
19
|
+
v && /* @__PURE__ */ s(e, {
|
|
20
|
+
tag: "h3",
|
|
21
|
+
size: "md",
|
|
22
|
+
style: { marginBottom: "var(--wim-spacing-md)" },
|
|
23
|
+
children: v
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ s("div", {
|
|
26
|
+
className: o.container,
|
|
27
|
+
style: { height: g },
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
children: /* @__PURE__ */ s(p, {
|
|
30
|
+
width: "100%",
|
|
31
|
+
height: "100%",
|
|
32
|
+
children: /* @__PURE__ */ c(f, {
|
|
33
|
+
...n,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ s(d, {
|
|
36
|
+
rootTabIndex: -1,
|
|
37
|
+
data: h,
|
|
38
|
+
cx: "50%",
|
|
39
|
+
cy: "50%",
|
|
40
|
+
labelLine: !1,
|
|
41
|
+
innerRadius: y ? "60%" : 0,
|
|
42
|
+
outerRadius: "80%",
|
|
43
|
+
paddingAngle: 0,
|
|
44
|
+
dataKey: "value",
|
|
45
|
+
isAnimationActive: b,
|
|
46
|
+
children: h.map((e, n) => /* @__PURE__ */ s(l, {
|
|
47
|
+
fill: t[n % t.length],
|
|
48
|
+
stroke: "var(--wim-color-surface)",
|
|
49
|
+
strokeWidth: 2
|
|
50
|
+
}, `cell-${n}`))
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ s(m, { contentStyle: r.tooltip.contentStyle }),
|
|
53
|
+
/* @__PURE__ */ s(u, {
|
|
54
|
+
verticalAlign: "top",
|
|
55
|
+
height: 36,
|
|
56
|
+
...r.legend
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
})
|
|
45
60
|
})
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ s(i, {
|
|
63
|
+
caption: S,
|
|
64
|
+
columns: C.columns,
|
|
65
|
+
rows: C.rows
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
50
70
|
//#endregion
|
|
51
|
-
export {
|
|
71
|
+
export { h as PieChart };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("./radar-chart.module.cjs");let
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("../../_internal/ChartDataTable.cjs"),i=require("../../_internal/chartTableData.cjs"),a=require("./radar-chart.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime"),c=require("recharts");var l=({data:e,keys:o,indexKey:l,height:u=300,width:d=`100%`,title:f,animated:p=!1,"aria-label":m})=>{let h=m??f,g=i.seriesTable(e,l,o);return(0,s.jsxs)(`div`,{className:`wim-radar-chart ${a.default.root}`,style:{width:d},role:h?`figure`:void 0,"aria-label":h,children:[f&&(0,s.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:f}),(0,s.jsx)(`div`,{className:a.default.container,style:{height:u},"aria-hidden":`true`,children:(0,s.jsx)(c.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,s.jsxs)(c.RadarChart,{...n.CHART_HIDDEN_A11Y_PROPS,cx:`50%`,cy:`50%`,outerRadius:`80%`,data:e,children:[(0,s.jsx)(c.PolarGrid,{stroke:n.CHART_THEME.grid.stroke}),(0,s.jsx)(c.PolarAngleAxis,{dataKey:l,...n.CHART_THEME.axis}),(0,s.jsx)(c.PolarRadiusAxis,{tick:!1,axisLine:!1}),(0,s.jsx)(c.Tooltip,{contentStyle:n.CHART_THEME.tooltip.contentStyle,cursor:n.CHART_THEME.tooltip.cursor}),(0,s.jsx)(c.Legend,{verticalAlign:`top`,height:36,...n.CHART_THEME.legend}),o.map((e,t)=>(0,s.jsx)(c.Radar,{name:e,dataKey:e,stroke:n.CHART_COLORS[t%n.CHART_COLORS.length],fill:n.CHART_COLORS[t%n.CHART_COLORS.length],strokeWidth:2,fillOpacity:.18,isAnimationActive:p},e))]})})}),(0,s.jsx)(r.ChartDataTable,{caption:h,columns:g.columns,rows:g.rows})]})};exports.RadarChart=l;
|
|
@@ -32,5 +32,11 @@ export type RadarChartProps = {
|
|
|
32
32
|
* @default false
|
|
33
33
|
*/
|
|
34
34
|
animated?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Accessible name for the chart. Defaults to `title` when omitted; pass this
|
|
37
|
+
* when the chart has no visible title, or when the title is not descriptive
|
|
38
|
+
* enough on its own.
|
|
39
|
+
*/
|
|
40
|
+
"aria-label"?: string;
|
|
35
41
|
};
|
|
36
|
-
export declare const RadarChart: ({ data, keys, indexKey, height, width, title, animated, }: RadarChartProps) => React.JSX.Element;
|
|
42
|
+
export declare const RadarChart: ({ data, keys, indexKey, height, width, title, animated, "aria-label": ariaLabel, }: RadarChartProps) => React.JSX.Element;
|
|
@@ -1,62 +1,79 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Title as e } from "../../typography/Title/Title.js";
|
|
3
|
-
import { CHART_COLORS as t,
|
|
4
|
-
import
|
|
3
|
+
import { CHART_COLORS as t, CHART_HIDDEN_A11Y_PROPS as n, CHART_THEME as r } from "../../helpers.js";
|
|
4
|
+
import { ChartDataTable as i } from "../../_internal/ChartDataTable.js";
|
|
5
|
+
import { seriesTable as a } from "../../_internal/chartTableData.js";
|
|
6
|
+
import o from "./radar-chart.module.js";
|
|
5
7
|
import "react";
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { Legend as
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
import { Legend as l, PolarAngleAxis as u, PolarGrid as d, PolarRadiusAxis as f, Radar as p, RadarChart as m, ResponsiveContainer as h, Tooltip as g } from "recharts";
|
|
8
10
|
//#region src/components/charts/RadarChart/RadarChart.tsx
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
children:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
11
|
+
var _ = ({ data: _, keys: v, indexKey: y, height: b = 300, width: x = "100%", title: S, animated: C = !1, "aria-label": w }) => {
|
|
12
|
+
let T = w ?? S, E = a(_, y, v);
|
|
13
|
+
return /* @__PURE__ */ c("div", {
|
|
14
|
+
className: `wim-radar-chart ${o.root}`,
|
|
15
|
+
style: { width: x },
|
|
16
|
+
role: T ? "figure" : void 0,
|
|
17
|
+
"aria-label": T,
|
|
18
|
+
children: [
|
|
19
|
+
S && /* @__PURE__ */ s(e, {
|
|
20
|
+
tag: "h3",
|
|
21
|
+
size: "md",
|
|
22
|
+
style: { marginBottom: "var(--wim-spacing-md)" },
|
|
23
|
+
children: S
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ s("div", {
|
|
26
|
+
className: o.container,
|
|
27
|
+
style: { height: b },
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
children: /* @__PURE__ */ s(h, {
|
|
30
|
+
width: "100%",
|
|
31
|
+
height: "100%",
|
|
32
|
+
children: /* @__PURE__ */ c(m, {
|
|
33
|
+
...n,
|
|
34
|
+
cx: "50%",
|
|
35
|
+
cy: "50%",
|
|
36
|
+
outerRadius: "80%",
|
|
37
|
+
data: _,
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ s(d, { stroke: r.grid.stroke }),
|
|
40
|
+
/* @__PURE__ */ s(u, {
|
|
41
|
+
dataKey: y,
|
|
42
|
+
...r.axis
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ s(f, {
|
|
45
|
+
tick: !1,
|
|
46
|
+
axisLine: !1
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ s(g, {
|
|
49
|
+
contentStyle: r.tooltip.contentStyle,
|
|
50
|
+
cursor: r.tooltip.cursor
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ s(l, {
|
|
53
|
+
verticalAlign: "top",
|
|
54
|
+
height: 36,
|
|
55
|
+
...r.legend
|
|
56
|
+
}),
|
|
57
|
+
v.map((e, n) => /* @__PURE__ */ s(p, {
|
|
58
|
+
name: e,
|
|
59
|
+
dataKey: e,
|
|
60
|
+
stroke: t[n % t.length],
|
|
61
|
+
fill: t[n % t.length],
|
|
62
|
+
strokeWidth: 2,
|
|
63
|
+
fillOpacity: .18,
|
|
64
|
+
isAnimationActive: C
|
|
65
|
+
}, e))
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ s(i, {
|
|
71
|
+
caption: T,
|
|
72
|
+
columns: E.columns,
|
|
73
|
+
rows: E.rows
|
|
57
74
|
})
|
|
58
|
-
|
|
59
|
-
})
|
|
60
|
-
}
|
|
75
|
+
]
|
|
76
|
+
});
|
|
77
|
+
};
|
|
61
78
|
//#endregion
|
|
62
|
-
export {
|
|
79
|
+
export { _ as RadarChart };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("./scatter-chart.module.cjs");let
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("../../_internal/ChartDataTable.cjs"),i=require("../../_internal/chartTableData.cjs"),a=require("./scatter-chart.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime"),c=require("recharts");var l=({data:e,xAxisName:o=`X`,yAxisName:l=`Y`,xDomain:u=[`auto`,`auto`],yDomain:d=[`auto`,`auto`],height:f=300,width:p=`100%`,title:m,animated:h=!1,"aria-label":g})=>{let _=g??m,v=i.pointTable(e,o,l,`Z`);return(0,s.jsxs)(`div`,{className:`wim-scatter-chart ${a.default.root}`,style:{width:p},role:_?`figure`:void 0,"aria-label":_,children:[m&&(0,s.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:m}),(0,s.jsx)(`div`,{className:a.default.container,style:{height:f},"aria-hidden":`true`,children:(0,s.jsx)(c.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,s.jsxs)(c.ScatterChart,{...n.CHART_HIDDEN_A11Y_PROPS,margin:{top:20,right:20,bottom:20,left:0},children:[(0,s.jsx)(c.CartesianGrid,{...n.CHART_THEME.grid}),(0,s.jsx)(c.XAxis,{type:`number`,dataKey:`x`,name:o,unit:``,domain:u,...n.CHART_THEME.axis}),(0,s.jsx)(c.YAxis,{type:`number`,dataKey:`y`,name:l,unit:``,domain:d,width:44,...n.CHART_THEME.axis}),(0,s.jsx)(c.ZAxis,{type:`number`,dataKey:`z`,range:[60,400]}),(0,s.jsx)(c.Tooltip,{cursor:n.CHART_THEME.tooltip.cursor,contentStyle:n.CHART_THEME.tooltip.contentStyle}),(0,s.jsx)(c.Legend,{verticalAlign:`top`,height:36,...n.CHART_THEME.legend}),(0,s.jsx)(c.Scatter,{name:`Data Points`,data:e,fill:n.CHART_COLORS[0],isAnimationActive:h})]})})}),(0,s.jsx)(r.ChartDataTable,{caption:_,columns:v.columns,rows:v.rows})]})};exports.ScatterChart=l;
|
|
@@ -49,5 +49,11 @@ export type ScatterChartProps = {
|
|
|
49
49
|
* @default false
|
|
50
50
|
*/
|
|
51
51
|
animated?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Accessible name for the chart. Defaults to `title` when omitted; pass this
|
|
54
|
+
* when the chart has no visible title, or when the title is not descriptive
|
|
55
|
+
* enough on its own.
|
|
56
|
+
*/
|
|
57
|
+
"aria-label"?: string;
|
|
52
58
|
};
|
|
53
|
-
export declare const ScatterChart: ({ data, xAxisName, yAxisName, xDomain, yDomain, height, width, title, animated, }: ScatterChartProps) => React.JSX.Element;
|
|
59
|
+
export declare const ScatterChart: ({ data, xAxisName, yAxisName, xDomain, yDomain, height, width, title, animated, "aria-label": ariaLabel, }: ScatterChartProps) => React.JSX.Element;
|
|
@@ -1,75 +1,92 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Title as e } from "../../typography/Title/Title.js";
|
|
3
|
-
import { CHART_COLORS as t,
|
|
4
|
-
import
|
|
3
|
+
import { CHART_COLORS as t, CHART_HIDDEN_A11Y_PROPS as n, CHART_THEME as r } from "../../helpers.js";
|
|
4
|
+
import { ChartDataTable as i } from "../../_internal/ChartDataTable.js";
|
|
5
|
+
import { pointTable as a } from "../../_internal/chartTableData.js";
|
|
6
|
+
import o from "./scatter-chart.module.js";
|
|
5
7
|
import "react";
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { CartesianGrid as
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
import { CartesianGrid as l, Legend as u, ResponsiveContainer as d, Scatter as f, ScatterChart as p, Tooltip as m, XAxis as h, YAxis as g, ZAxis as _ } from "recharts";
|
|
8
10
|
//#region src/components/charts/ScatterChart/ScatterChart.tsx
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
children:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
11
|
+
var v = ({ data: v, xAxisName: y = "X", yAxisName: b = "Y", xDomain: x = ["auto", "auto"], yDomain: S = ["auto", "auto"], height: C = 300, width: w = "100%", title: T, animated: E = !1, "aria-label": D }) => {
|
|
12
|
+
let O = D ?? T, k = a(v, y, b, "Z");
|
|
13
|
+
return /* @__PURE__ */ c("div", {
|
|
14
|
+
className: `wim-scatter-chart ${o.root}`,
|
|
15
|
+
style: { width: w },
|
|
16
|
+
role: O ? "figure" : void 0,
|
|
17
|
+
"aria-label": O,
|
|
18
|
+
children: [
|
|
19
|
+
T && /* @__PURE__ */ s(e, {
|
|
20
|
+
tag: "h3",
|
|
21
|
+
size: "md",
|
|
22
|
+
style: { marginBottom: "var(--wim-spacing-md)" },
|
|
23
|
+
children: T
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ s("div", {
|
|
26
|
+
className: o.container,
|
|
27
|
+
style: { height: C },
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
children: /* @__PURE__ */ s(d, {
|
|
30
|
+
width: "100%",
|
|
31
|
+
height: "100%",
|
|
32
|
+
children: /* @__PURE__ */ c(p, {
|
|
33
|
+
...n,
|
|
34
|
+
margin: {
|
|
35
|
+
top: 20,
|
|
36
|
+
right: 20,
|
|
37
|
+
bottom: 20,
|
|
38
|
+
left: 0
|
|
39
|
+
},
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ s(l, { ...r.grid }),
|
|
42
|
+
/* @__PURE__ */ s(h, {
|
|
43
|
+
type: "number",
|
|
44
|
+
dataKey: "x",
|
|
45
|
+
name: y,
|
|
46
|
+
unit: "",
|
|
47
|
+
domain: x,
|
|
48
|
+
...r.axis
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ s(g, {
|
|
51
|
+
type: "number",
|
|
52
|
+
dataKey: "y",
|
|
53
|
+
name: b,
|
|
54
|
+
unit: "",
|
|
55
|
+
domain: S,
|
|
56
|
+
width: 44,
|
|
57
|
+
...r.axis
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ s(_, {
|
|
60
|
+
type: "number",
|
|
61
|
+
dataKey: "z",
|
|
62
|
+
range: [60, 400]
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ s(m, {
|
|
65
|
+
cursor: r.tooltip.cursor,
|
|
66
|
+
contentStyle: r.tooltip.contentStyle
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ s(u, {
|
|
69
|
+
verticalAlign: "top",
|
|
70
|
+
height: 36,
|
|
71
|
+
...r.legend
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ s(f, {
|
|
74
|
+
name: "Data Points",
|
|
75
|
+
data: v,
|
|
76
|
+
fill: t[0],
|
|
77
|
+
isAnimationActive: E
|
|
78
|
+
})
|
|
79
|
+
]
|
|
68
80
|
})
|
|
69
|
-
|
|
81
|
+
})
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ s(i, {
|
|
84
|
+
caption: O,
|
|
85
|
+
columns: k.columns,
|
|
86
|
+
rows: k.rows
|
|
70
87
|
})
|
|
71
|
-
|
|
72
|
-
})
|
|
73
|
-
}
|
|
88
|
+
]
|
|
89
|
+
});
|
|
90
|
+
};
|
|
74
91
|
//#endregion
|
|
75
|
-
export {
|
|
92
|
+
export { v as ScatterChart };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./sparkline.module.cjs");let
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../helpers.cjs"),n=require("./sparkline.module.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("classnames");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("recharts");var s=`var(--wim-color-chart-primary)`,c=({data:e,type:r=`line`,width:c=`100%`,height:l=24,color:u=s,strokeWidth:d=2,showLastDot:f=!1,min:p,max:m,ariaLabel:h,className:g})=>{let _=e.map((e,t)=>({index:t,value:e})),v=[p??`auto`,m??`auto`],y=e.length-1,b=typeof window<`u`&&!!window.__VRT__,x=typeof c==`number`?c:null,S=l??24,C=e=>{let{cx:t,cy:n,index:r}=e;return!f||r!==y||t==null||n==null?(0,a.jsx)(`g`,{},r):(0,a.jsx)(`circle`,{cx:t,cy:n,r:d+1,fill:u},r)},w=b&&x!==null?{width:x,height:S}:{},T=()=>r===`bar`?(0,a.jsxs)(o.BarChart,{...w,...t.CHART_HIDDEN_A11Y_PROPS,data:_,margin:{top:2,right:2,bottom:2,left:2},children:[(0,a.jsx)(o.YAxis,{hide:!0,domain:v}),(0,a.jsx)(o.Bar,{dataKey:`value`,fill:u,radius:[2,2,0,0],isAnimationActive:!1})]}):r===`area`?(0,a.jsxs)(o.AreaChart,{...w,...t.CHART_HIDDEN_A11Y_PROPS,data:_,margin:{top:2,right:2,bottom:2,left:2},children:[(0,a.jsx)(o.YAxis,{hide:!0,domain:v}),(0,a.jsx)(o.Area,{type:`monotone`,dataKey:`value`,stroke:u,strokeWidth:d,fill:u,fillOpacity:.15,dot:f?C:!1,isAnimationActive:!1})]}):(0,a.jsxs)(o.LineChart,{...w,...t.CHART_HIDDEN_A11Y_PROPS,data:_,margin:{top:2,right:2,bottom:2,left:2},children:[(0,a.jsx)(o.YAxis,{hide:!0,domain:v}),(0,a.jsx)(o.Line,{type:`monotone`,dataKey:`value`,stroke:u,strokeWidth:d,dot:f?C:!1,isAnimationActive:!1})]});return(0,a.jsx)(`div`,{className:(0,i.default)(`wim-sparkline`,n.default.root,g),style:{width:c,height:l},role:h?`img`:void 0,"aria-label":h,"aria-hidden":h?void 0:!0,children:b&&x!==null?T():(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,children:T()})})};c.displayName=`Sparkline`,exports.Sparkline=c;
|