@economic/taco 2.57.0-charts.3 → 2.57.0-charts.5
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/taco.cjs +12 -11
- package/dist/taco.cjs.map +1 -1
- package/dist/taco.css +36 -23
- package/dist/taco.js +12 -11
- package/dist/taco.js.map +1 -1
- package/package.json +2 -2
package/dist/taco.cjs
CHANGED
@@ -82775,7 +82775,7 @@ function getAxisProps(scale2, tickFormatter, dataKey, width) {
|
|
82775
82775
|
width: width ?? 55
|
82776
82776
|
};
|
82777
82777
|
}
|
82778
|
-
function
|
82778
|
+
function ChartWrapper(props) {
|
82779
82779
|
const { onSetWidth: handleSetWidth, ...attributes } = props;
|
82780
82780
|
const ref = React.useRef(null);
|
82781
82781
|
React.useLayoutEffect(() => {
|
@@ -82784,7 +82784,7 @@ function ChartContainer(props) {
|
|
82784
82784
|
handleSetWidth(rect.width);
|
82785
82785
|
}
|
82786
82786
|
}, [ref]);
|
82787
|
-
const className = clsx("flex justify-center
|
82787
|
+
const className = clsx("flex justify-center m-auto", attributes.className);
|
82788
82788
|
return /* @__PURE__ */ React.createElement("div", { ...attributes, className, ref }, /* @__PURE__ */ React.createElement(ResponsiveContainer, null, props.children));
|
82789
82789
|
}
|
82790
82790
|
function Tooltip(props) {
|
@@ -83063,9 +83063,9 @@ function AreaChart(props) {
|
|
83063
83063
|
yAxisTickFormatter,
|
83064
83064
|
...attributes
|
83065
83065
|
} = props;
|
83066
|
-
const className = clsx("relative aspect-video", { "
|
83066
|
+
const className = clsx("relative aspect-video", { "pb-6": showLegend }, customClassName);
|
83067
83067
|
const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart(children);
|
83068
|
-
return /* @__PURE__ */ React.createElement("div", { className, "data-taco": "chart-wrapper" }, /* @__PURE__ */ React.createElement(
|
83068
|
+
return /* @__PURE__ */ React.createElement("div", { className, "data-taco": "chart-wrapper" }, /* @__PURE__ */ React.createElement(ChartWrapper, { ...attributes, className: "h-full w-full", "data-taco": "chart-area" }, /* @__PURE__ */ React.createElement(
|
83069
83069
|
AreaChart$1,
|
83070
83070
|
{
|
83071
83071
|
data,
|
@@ -83094,7 +83094,7 @@ function AreaChart(props) {
|
|
83094
83094
|
key: shape.dataKey,
|
83095
83095
|
...shape,
|
83096
83096
|
dot: showDots ? shape.dot : false,
|
83097
|
-
fillOpacity: 0.
|
83097
|
+
fillOpacity: 0.4,
|
83098
83098
|
stackId: stacked ? "stack" : void 0,
|
83099
83099
|
type
|
83100
83100
|
}
|
@@ -83125,9 +83125,9 @@ function BarChart(props) {
|
|
83125
83125
|
yAxisWidth,
|
83126
83126
|
...attributes
|
83127
83127
|
} = props;
|
83128
|
-
const className = clsx("relative aspect-video", { "
|
83128
|
+
const className = clsx("relative aspect-video", { "pb-6": showLegend }, customClassName);
|
83129
83129
|
const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart(children);
|
83130
|
-
return /* @__PURE__ */ React.createElement("div", { className, "data-taco": "chart-wrapper" }, /* @__PURE__ */ React.createElement(
|
83130
|
+
return /* @__PURE__ */ React.createElement("div", { className, "data-taco": "chart-wrapper" }, /* @__PURE__ */ React.createElement(ChartWrapper, { ...attributes, className: "h-full w-full", "data-taco": "chart-bar" }, /* @__PURE__ */ React.createElement(
|
83131
83131
|
BarChart$1,
|
83132
83132
|
{
|
83133
83133
|
data,
|
@@ -83163,6 +83163,7 @@ function BarChart(props) {
|
|
83163
83163
|
yAxisWidth
|
83164
83164
|
),
|
83165
83165
|
hide: !showYAxis,
|
83166
|
+
minTickGap: isHorizontal ? 1 : 5,
|
83166
83167
|
type: isHorizontal ? "category" : void 0
|
83167
83168
|
}
|
83168
83169
|
),
|
@@ -83262,7 +83263,7 @@ function DonutChart(props) {
|
|
83262
83263
|
unit: unit2,
|
83263
83264
|
style: { top: radius / 2 - 2, width: radius + DONUT_WIDTH$1 }
|
83264
83265
|
}
|
83265
|
-
) : null, /* @__PURE__ */ React.createElement(
|
83266
|
+
) : null, /* @__PURE__ */ React.createElement(ChartWrapper, { ...attributes, className, "data-taco": "chart-donut", onSetWidth: setRadius }, /* @__PURE__ */ React.createElement(PieChart$1, null, /* @__PURE__ */ React.createElement(Tooltip$1, { content: /* @__PURE__ */ React.createElement(Tooltip, { title: tooltipTitle }) }), /* @__PURE__ */ React.createElement(Pie, { ...pieProps, innerRadius: radius - DONUT_WIDTH$1 }))), showLegend ? /* @__PURE__ */ React.createElement(Legend$1, { items, hoverIndex: activeIndex, onHover: setActiveIndex, onToggle: toggleItem }) : null);
|
83266
83267
|
}
|
83267
83268
|
function Segment$2(_) {
|
83268
83269
|
return null;
|
@@ -83487,9 +83488,9 @@ function LineChart(props) {
|
|
83487
83488
|
yAxisTickFormatter,
|
83488
83489
|
...attributes
|
83489
83490
|
} = props;
|
83490
|
-
const className = clsx("relative aspect-video", { "
|
83491
|
+
const className = clsx("relative aspect-video", { "pb-6": showLegend }, customClassName);
|
83491
83492
|
const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart(children);
|
83492
|
-
return /* @__PURE__ */ React.createElement("div", { className, "data-taco": "chart-wrapper" }, /* @__PURE__ */ React.createElement(
|
83493
|
+
return /* @__PURE__ */ React.createElement("div", { className, "data-taco": "chart-wrapper" }, /* @__PURE__ */ React.createElement(ChartWrapper, { ...attributes, className: "h-full w-full", "data-taco": "chart-line" }, /* @__PURE__ */ React.createElement(
|
83493
83494
|
LineChart$1,
|
83494
83495
|
{
|
83495
83496
|
data,
|
@@ -83525,7 +83526,7 @@ function PieChart(props) {
|
|
83525
83526
|
unit: unit2
|
83526
83527
|
});
|
83527
83528
|
const className = clsx("aspect-square", attributes.className);
|
83528
|
-
return /* @__PURE__ */ React.createElement("div", { className: "relative", "data-taco": "chart-wrapper" }, /* @__PURE__ */ React.createElement(
|
83529
|
+
return /* @__PURE__ */ React.createElement("div", { className: "relative", "data-taco": "chart-wrapper" }, /* @__PURE__ */ React.createElement(ChartWrapper, { ...attributes, className, "data-taco": "chart-pie", onSetWidth: setRadius }, /* @__PURE__ */ React.createElement(PieChart$1, null, /* @__PURE__ */ React.createElement(Tooltip$1, { content: /* @__PURE__ */ React.createElement(Tooltip, { title: tooltipTitle }) }), /* @__PURE__ */ React.createElement(Pie, { ...pieProps, label: showLabels ? /* @__PURE__ */ React.createElement(Label, null) : void 0 }))), showLegend ? /* @__PURE__ */ React.createElement(Legend$1, { items, hoverIndex: activeIndex, onHover: setActiveIndex, onToggle: toggleItem }) : null);
|
83529
83530
|
}
|
83530
83531
|
function Segment(_) {
|
83531
83532
|
return null;
|