@rudra-studio/rudra-charts 1.0.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/README.md +7 -0
- package/components/AnimatedLineChart/index.d.ts +29 -0
- package/components/AnimatedLineChart/index.js +109 -0
- package/components/BubbleChart/index.d.ts +24 -0
- package/components/BubbleChart/index.js +126 -0
- package/components/CandleStickChart/index.d.ts +24 -0
- package/components/CandleStickChart/index.js +116 -0
- package/components/DonutChart/index.d.ts +19 -0
- package/components/DonutChart/index.js +77 -0
- package/components/FunnelChart/index.d.ts +22 -0
- package/components/FunnelChart/index.js +105 -0
- package/components/GaugeChart/index.d.ts +25 -0
- package/components/GaugeChart/index.js +85 -0
- package/components/HeatMap/index.d.ts +24 -0
- package/components/HeatMap/index.js +146 -0
- package/components/Histogram/index.d.ts +20 -0
- package/components/Histogram/index.js +158 -0
- package/components/HorizontalBarChart/index.d.ts +22 -0
- package/components/HorizontalBarChart/index.js +82 -0
- package/components/HundredPercentBarChart/index.d.ts +21 -0
- package/components/HundredPercentBarChart/index.js +96 -0
- package/components/MultiLineChart/index.d.ts +21 -0
- package/components/MultiLineChart/index.js +128 -0
- package/components/PipelineChart/index.d.ts +26 -0
- package/components/PipelineChart/index.js +174 -0
- package/components/ScatterPlot/index.d.ts +23 -0
- package/components/ScatterPlot/index.js +118 -0
- package/components/SpiderChart/index.d.ts +27 -0
- package/components/SpiderChart/index.js +169 -0
- package/components/StackedArea/index.d.ts +22 -0
- package/components/StackedArea/index.js +101 -0
- package/components/StackedBarChart/index.d.ts +21 -0
- package/components/StackedBarChart/index.js +96 -0
- package/components/TreeMap/index.d.ts +19 -0
- package/components/TreeMap/index.js +137 -0
- package/components/VerticalBarChart/index.d.ts +21 -0
- package/components/VerticalBarChart/index.js +97 -0
- package/components/WaterfallChart/index.d.ts +26 -0
- package/components/WaterfallChart/index.js +147 -0
- package/index.d.ts +38 -0
- package/index.js +23 -0
- package/package.json +46 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { useEffect as e, useRef as t, useState as n } from "react";
|
|
2
|
+
import * as r from "d3";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/VerticalBarChart/index.tsx
|
|
5
|
+
var a = ({ data: a = [
|
|
6
|
+
{
|
|
7
|
+
id: "1",
|
|
8
|
+
category: "Jan",
|
|
9
|
+
value: 420
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "2",
|
|
13
|
+
category: "Feb",
|
|
14
|
+
value: 580
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: "3",
|
|
18
|
+
category: "Mar",
|
|
19
|
+
value: 310
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "4",
|
|
23
|
+
category: "Apr",
|
|
24
|
+
value: 850
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "5",
|
|
28
|
+
category: "May",
|
|
29
|
+
value: 650
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "6",
|
|
33
|
+
category: "Jun",
|
|
34
|
+
value: 940
|
|
35
|
+
}
|
|
36
|
+
], themeColors: o = [
|
|
37
|
+
"#3b82f6",
|
|
38
|
+
"#10b981",
|
|
39
|
+
"#f59e0b",
|
|
40
|
+
"#ef4444",
|
|
41
|
+
"#8b5cf6",
|
|
42
|
+
"#06b6d4"
|
|
43
|
+
], showValues: s = !0, marginTop: c = 40, marginBottom: l = 40, marginLeft: u = 50, marginRight: d = 20, className: f = "" }) => {
|
|
44
|
+
let p = t(null), m = t(null), [h, g] = n({
|
|
45
|
+
width: 0,
|
|
46
|
+
height: 350
|
|
47
|
+
});
|
|
48
|
+
return e(() => {
|
|
49
|
+
let e = p.current;
|
|
50
|
+
if (!e) return;
|
|
51
|
+
let t = new ResizeObserver((e) => {
|
|
52
|
+
e[0] && g({
|
|
53
|
+
width: e[0].contentRect.width,
|
|
54
|
+
height: e[0].contentRect.height || 350
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
return t.observe(e), () => t.unobserve(e);
|
|
58
|
+
}, []), e(() => {
|
|
59
|
+
if (!m.current || h.width === 0 || a.length === 0) return;
|
|
60
|
+
let { width: e, height: t } = h, n = r.select(m.current), i = a.map((e) => e.category), f = r.max(a, (e) => e.value) || 100, p = r.scaleBand().domain(i).range([u, e - d]).padding(.25), g = r.scaleLinear().domain([0, f * 1.1]).nice().range([t - l, c]), _ = r.scaleOrdinal().domain(i).range(o);
|
|
61
|
+
n.select(".x-axis").empty() && (n.append("g").attr("class", "axis x-axis"), n.append("g").attr("class", "axis y-axis")), n.select(".x-axis").attr("transform", `translate(0,${t - l})`).transition().duration(500).call(r.axisBottom(p).tickSizeOuter(0)).attr("font-size", "12px").attr("font-family", "ui-sans-serif, system-ui").attr("color", "#64748b").call((e) => e.select(".domain").remove()), n.select(".y-axis").attr("transform", `translate(${u},0)`).transition().duration(500).call(r.axisLeft(g).ticks(5).tickSize(-(e - u - d))).attr("font-size", "12px").attr("font-family", "ui-sans-serif, system-ui").attr("color", "#64748b").call((e) => e.select(".domain").remove()).call((e) => e.selectAll(".tick line").attr("stroke-opacity", .1).attr("stroke-dasharray", "4,4"));
|
|
62
|
+
let v = n.select(".bars-group");
|
|
63
|
+
v.empty() && (v = n.append("g").attr("class", "bars-group"));
|
|
64
|
+
let y = v.selectAll(".bar").data(a, (e) => e.id);
|
|
65
|
+
y.exit().transition().duration(300).attr("y", g(0)).attr("height", 0).remove();
|
|
66
|
+
let b = y.enter().append("rect").attr("class", "bar").attr("x", (e) => p(e.category) || 0).attr("width", p.bandwidth()).attr("y", g(0)).attr("height", 0).attr("fill", (e) => _(e.category)).attr("rx", 4).attr("ry", 4).style("cursor", "pointer");
|
|
67
|
+
b.transition().duration(700).delay((e, t) => t * 50).ease(r.easeCubicOut).attr("y", (e) => g(e.value)).attr("height", (e) => g(0) - g(e.value)), y.transition().duration(750).ease(r.easeCubicOut).attr("x", (e) => p(e.category) || 0).attr("width", p.bandwidth()).attr("y", (e) => g(e.value)).attr("height", (e) => g(0) - g(e.value)).attr("fill", (e) => _(e.category)), b.merge(y).on("mouseenter", function() {
|
|
68
|
+
v.selectAll(".bar").transition().duration(200).attr("opacity", .4), r.select(this).transition().duration(200).attr("opacity", 1).attr("filter", "brightness(1.1)");
|
|
69
|
+
}).on("mouseleave", function() {
|
|
70
|
+
v.selectAll(".bar").transition().duration(200).attr("opacity", 1).attr("filter", "none");
|
|
71
|
+
});
|
|
72
|
+
let x = n.select(".labels-group");
|
|
73
|
+
x.empty() && (x = n.append("g").attr("class", "labels-group"));
|
|
74
|
+
let S = x.selectAll(".value-label").data(s ? a : [], (e) => e.id);
|
|
75
|
+
S.exit().transition().duration(300).attr("y", g(0)).style("opacity", 0).remove(), S.enter().append("text").attr("class", "value-label").attr("x", (e) => (p(e.category) || 0) + p.bandwidth() / 2).attr("y", g(0)).attr("text-anchor", "middle").attr("font-size", "12px").attr("font-weight", "600").attr("font-family", "ui-sans-serif, system-ui").attr("fill", "#475569").style("opacity", 0).style("pointer-events", "none").text((e) => e.value.toLocaleString()).transition().duration(700).delay((e, t) => t * 50).ease(r.easeCubicOut).attr("y", (e) => g(e.value) - 8).style("opacity", 1), S.transition().duration(750).ease(r.easeCubicOut).attr("x", (e) => (p(e.category) || 0) + p.bandwidth() / 2).attr("y", (e) => g(e.value) - 8).text((e) => e.value.toLocaleString());
|
|
76
|
+
}, [
|
|
77
|
+
a,
|
|
78
|
+
h,
|
|
79
|
+
o,
|
|
80
|
+
s,
|
|
81
|
+
c,
|
|
82
|
+
l,
|
|
83
|
+
u,
|
|
84
|
+
d
|
|
85
|
+
]), /* @__PURE__ */ i("div", {
|
|
86
|
+
ref: p,
|
|
87
|
+
className: `w-full min-h-[350px] h-full relative ${f}`,
|
|
88
|
+
children: /* @__PURE__ */ i("svg", {
|
|
89
|
+
ref: m,
|
|
90
|
+
width: "100%",
|
|
91
|
+
height: "100%",
|
|
92
|
+
className: "block absolute inset-0 overflow-visible"
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
//#endregion
|
|
97
|
+
export { a as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface WaterfallDataPoint {
|
|
3
|
+
id: string | number;
|
|
4
|
+
label: string;
|
|
5
|
+
value: number;
|
|
6
|
+
isTotal?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface AnimatedWaterfallChartProps {
|
|
9
|
+
/** The sequence of positive and negative changes. */
|
|
10
|
+
data?: WaterfallDataPoint[];
|
|
11
|
+
/** Color for positive values (default: Emerald Green) */
|
|
12
|
+
colorPositive?: string;
|
|
13
|
+
/** Color for negative values (default: Red) */
|
|
14
|
+
colorNegative?: string;
|
|
15
|
+
/** Color for total/anchor columns (default: Blue) */
|
|
16
|
+
colorTotal?: string;
|
|
17
|
+
/** Draw thin connector lines between the steps */
|
|
18
|
+
showConnectorLines?: boolean;
|
|
19
|
+
marginTop?: number;
|
|
20
|
+
marginBottom?: number;
|
|
21
|
+
marginLeft?: number;
|
|
22
|
+
marginRight?: number;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const AnimatedWaterfallChart: React.FC<AnimatedWaterfallChartProps>;
|
|
26
|
+
export default AnimatedWaterfallChart;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { useEffect as e, useRef as t, useState as n } from "react";
|
|
2
|
+
import * as r from "d3";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/WaterfallChart/index.tsx
|
|
5
|
+
var a = ({ data: a = [
|
|
6
|
+
{
|
|
7
|
+
id: 1,
|
|
8
|
+
label: "Gross Revenue",
|
|
9
|
+
value: 125e3,
|
|
10
|
+
isTotal: !0
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 2,
|
|
14
|
+
label: "Cost of Goods",
|
|
15
|
+
value: -45e3
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: 3,
|
|
19
|
+
label: "Gross Margin",
|
|
20
|
+
value: 0,
|
|
21
|
+
isTotal: !0
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 4,
|
|
25
|
+
label: "Marketing",
|
|
26
|
+
value: -15e3
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 5,
|
|
30
|
+
label: "Sales",
|
|
31
|
+
value: -22e3
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 6,
|
|
35
|
+
label: "Investments",
|
|
36
|
+
value: 8e3
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 7,
|
|
40
|
+
label: "Taxes",
|
|
41
|
+
value: -9e3
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 8,
|
|
45
|
+
label: "Net Profit",
|
|
46
|
+
value: 0,
|
|
47
|
+
isTotal: !0
|
|
48
|
+
}
|
|
49
|
+
], colorPositive: o = "#10b981", colorNegative: s = "#ef4444", colorTotal: c = "#3b82f6", showConnectorLines: l = !0, marginTop: u = 40, marginBottom: d = 40, marginLeft: f = 60, marginRight: p = 20, className: m = "" }) => {
|
|
50
|
+
let h = t(null), g = t(null), [_, v] = n({
|
|
51
|
+
width: 0,
|
|
52
|
+
height: 350
|
|
53
|
+
});
|
|
54
|
+
return e(() => {
|
|
55
|
+
let e = h.current;
|
|
56
|
+
if (!e) return;
|
|
57
|
+
let t = new ResizeObserver((e) => {
|
|
58
|
+
e[0] && v({
|
|
59
|
+
width: e[0].contentRect.width,
|
|
60
|
+
height: e[0].contentRect.height || 350
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
return t.observe(e), () => t.unobserve(e);
|
|
64
|
+
}, []), e(() => {
|
|
65
|
+
if (!g.current || _.width === 0 || a.length === 0) return;
|
|
66
|
+
let { width: e, height: t } = _, n = r.select(g.current), i = 0, m = a.map((e) => {
|
|
67
|
+
if (e.isTotal) {
|
|
68
|
+
let t = e.value !== 0 && i === 0 ? e.value : i;
|
|
69
|
+
return i = t, {
|
|
70
|
+
...e,
|
|
71
|
+
start: 0,
|
|
72
|
+
end: t,
|
|
73
|
+
color: c,
|
|
74
|
+
displayValue: t
|
|
75
|
+
};
|
|
76
|
+
} else {
|
|
77
|
+
let t = i;
|
|
78
|
+
i += e.value;
|
|
79
|
+
let n = i;
|
|
80
|
+
return {
|
|
81
|
+
...e,
|
|
82
|
+
start: t,
|
|
83
|
+
end: n,
|
|
84
|
+
color: e.value >= 0 ? o : s,
|
|
85
|
+
displayValue: e.value
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}), h = r.scaleBand().domain(m.map((e) => e.label)).range([f, e - p]).padding(.2), v = Math.min(0, r.min(m, (e) => Math.min(e.start, e.end)) || 0), y = Math.max(0, r.max(m, (e) => Math.max(e.start, e.end)) || 0), b = r.scaleLinear().domain([v, y * 1.1]).nice().range([t - d, u]);
|
|
89
|
+
n.select(".x-axis").empty() && (n.append("g").attr("class", "axis x-axis"), n.append("g").attr("class", "axis y-axis"));
|
|
90
|
+
let x = b(0);
|
|
91
|
+
n.select(".x-axis").attr("transform", `translate(0,${t - d})`).transition().duration(500).call(r.axisBottom(h).tickSizeOuter(0)).attr("font-size", "11px").attr("font-family", "ui-sans-serif, system-ui").attr("color", "#64748b").call((e) => e.select(".domain").remove());
|
|
92
|
+
let S = n.select(".zero-line");
|
|
93
|
+
if (S.empty() && (S = n.append("line").attr("class", "zero-line")), S.transition().duration(500).attr("x1", f).attr("x2", e - p).attr("y1", x).attr("y2", x).attr("stroke", "#94a3b8").attr("stroke-width", 1.5), n.select(".y-axis").attr("transform", `translate(${f},0)`).transition().duration(500).call(r.axisLeft(b).ticks(6).tickFormat(r.format("~s")).tickSize(-(e - f - p))).attr("font-size", "12px").attr("font-family", "ui-sans-serif, system-ui").attr("color", "#64748b").call((e) => e.select(".domain").remove()).call((e) => e.selectAll(".tick line").attr("stroke-opacity", .1).attr("stroke-dasharray", "4,4")), l) {
|
|
94
|
+
let e = n.select(".connectors-group");
|
|
95
|
+
e.empty() && (e = n.append("g").attr("class", "connectors-group"));
|
|
96
|
+
let t = m.slice(0, -1).map((e, t) => ({
|
|
97
|
+
id: e.id,
|
|
98
|
+
y: b(e.end),
|
|
99
|
+
x1: (h(e.label) || 0) + h.bandwidth() / 2,
|
|
100
|
+
x2: (h(m[t + 1].label) || 0) + h.bandwidth() / 2
|
|
101
|
+
})), r = e.selectAll(".connector").data(t, (e) => e.id);
|
|
102
|
+
r.exit().remove(), r.enter().append("line").attr("class", "connector").attr("stroke", "#cbd5e1").attr("stroke-width", 1.5).attr("stroke-dasharray", "2,2").merge(r).transition().duration(750).attr("x1", (e) => e.x1).attr("x2", (e) => e.x2).attr("y1", (e) => e.y).attr("y2", (e) => e.y);
|
|
103
|
+
}
|
|
104
|
+
let C = n.select(".bars-group");
|
|
105
|
+
C.empty() && (C = n.append("g").attr("class", "bars-group"));
|
|
106
|
+
let w = C.selectAll(".bar").data(m, (e) => e.id);
|
|
107
|
+
w.exit().transition().duration(300).attr("height", 0).remove();
|
|
108
|
+
let T = w.enter().append("rect").attr("class", "bar").attr("x", (e) => h(e.label) || 0).attr("width", h.bandwidth()).attr("y", (e) => b(e.start)).attr("height", 0).attr("fill", (e) => e.color).attr("rx", 2).style("cursor", "pointer");
|
|
109
|
+
T.transition().duration(500).delay((e, t) => t * 150).ease(r.easeCubicOut).attr("y", (e) => Math.min(b(e.start), b(e.end))).attr("height", (e) => Math.abs(b(e.start) - b(e.end))), w.transition().duration(750).ease(r.easeCubicOut).attr("x", (e) => h(e.label) || 0).attr("width", h.bandwidth()).attr("y", (e) => Math.min(b(e.start), b(e.end))).attr("height", (e) => Math.abs(b(e.start) - b(e.end))).attr("fill", (e) => e.color);
|
|
110
|
+
let E = n.select(".labels-group");
|
|
111
|
+
E.empty() && (E = n.append("g").attr("class", "labels-group"));
|
|
112
|
+
let D = E.selectAll(".value-label").data(m, (e) => e.id);
|
|
113
|
+
D.exit().remove(), D.enter().append("text").attr("class", "value-label").attr("x", (e) => (h(e.label) || 0) + h.bandwidth() / 2).attr("y", (e) => b(e.start)).attr("text-anchor", "middle").attr("font-size", "11px").attr("font-weight", "600").attr("font-family", "ui-sans-serif, system-ui").attr("fill", (e) => e.color).style("opacity", 0).text((e) => (e.displayValue > 0 && !e.isTotal ? "+" : "") + r.format("~s")(e.displayValue)).transition().duration(500).delay((e, t) => t * 150 + 200).attr("y", (e) => {
|
|
114
|
+
let t = Math.min(b(e.start), b(e.end));
|
|
115
|
+
return e.end < e.start ? t + Math.abs(b(e.start) - b(e.end)) + 14 : t - 6;
|
|
116
|
+
}).style("opacity", 1), D.transition().duration(750).attr("x", (e) => (h(e.label) || 0) + h.bandwidth() / 2).attr("y", (e) => {
|
|
117
|
+
let t = Math.min(b(e.start), b(e.end));
|
|
118
|
+
return e.end < e.start ? t + Math.abs(b(e.start) - b(e.end)) + 14 : t - 6;
|
|
119
|
+
}).text((e) => (e.displayValue > 0 && !e.isTotal ? "+" : "") + r.format("~s")(e.displayValue)), T.merge(w).on("mouseenter", function() {
|
|
120
|
+
C.selectAll(".bar").transition().duration(200).attr("opacity", .4), r.select(this).transition().duration(200).attr("opacity", 1).attr("filter", "brightness(1.1)");
|
|
121
|
+
}).on("mouseleave", function() {
|
|
122
|
+
C.selectAll(".bar").transition().duration(200).attr("opacity", 1).attr("filter", "none");
|
|
123
|
+
});
|
|
124
|
+
}, [
|
|
125
|
+
a,
|
|
126
|
+
_,
|
|
127
|
+
o,
|
|
128
|
+
s,
|
|
129
|
+
c,
|
|
130
|
+
l,
|
|
131
|
+
u,
|
|
132
|
+
d,
|
|
133
|
+
f,
|
|
134
|
+
p
|
|
135
|
+
]), /* @__PURE__ */ i("div", {
|
|
136
|
+
ref: h,
|
|
137
|
+
className: `w-full min-h-[350px] h-full relative ${m}`,
|
|
138
|
+
children: /* @__PURE__ */ i("svg", {
|
|
139
|
+
ref: g,
|
|
140
|
+
width: "100%",
|
|
141
|
+
height: "100%",
|
|
142
|
+
className: "block absolute inset-0 overflow-visible"
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
//#endregion
|
|
147
|
+
export { a as default };
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type { AnimatedLineChartProps, LineDataPoint, LineSeries } from './components/AnimatedLineChart';
|
|
2
|
+
export { default as AnimatedLineChart } from './components/AnimatedLineChart';
|
|
3
|
+
export type { AnimatedBubbleChartProps, BubbleDataPoint } from './components/BubbleChart';
|
|
4
|
+
export { default as AnimatedBubbleChart } from './components/BubbleChart';
|
|
5
|
+
export type { AnimatedCandlestickChartProps, CandlestickDataPoint } from './components/CandleStickChart';
|
|
6
|
+
export { default as AnimatedCandlestickChart } from './components/CandleStickChart';
|
|
7
|
+
export type { AnimatedDonutChartProps, PieDataPoint } from './components/DonutChart';
|
|
8
|
+
export { default as AnimatedDonutChart } from './components/DonutChart';
|
|
9
|
+
export type { AnimatedFunnelChartProps, FunnelDataPoint } from './components/FunnelChart';
|
|
10
|
+
export { default as AnimatedFunnelChart } from './components/FunnelChart';
|
|
11
|
+
export type { AnimatedGaugeChartProps, GaugeZone } from './components/GaugeChart';
|
|
12
|
+
export { default as AnimatedGaugeChart } from './components/GaugeChart';
|
|
13
|
+
export type { AnimatedHeatmapProps, HeatmapDataPoint } from './components/HeatMap';
|
|
14
|
+
export { default as AnimatedHeatmap } from './components/HeatMap';
|
|
15
|
+
export type { AnimatedHistogramProps, HistogramDataPoint } from './components/Histogram';
|
|
16
|
+
export { default as AnimatedHistogram } from './components/Histogram';
|
|
17
|
+
export type { AnimatedHorizontalBarChartProps, HorizontalChartData } from './components/HorizontalBarChart';
|
|
18
|
+
export { default as AnimatedHorizontalBarChart } from './components/HorizontalBarChart';
|
|
19
|
+
export type { AnimatedHundredPercentBarChartProps, HundredPercentDataPoint } from './components/HundredPercentBarChart';
|
|
20
|
+
export { default as AnimatedHundredPercentBarChart } from './components/HundredPercentBarChart';
|
|
21
|
+
export type { AnimatedMultiLineChartProps, MultiLineDataPoint } from './components/MultiLineChart';
|
|
22
|
+
export { default as AnimatedMultiLineChart } from './components/MultiLineChart';
|
|
23
|
+
export type { AnimatedWorkflowChartProps, WorkflowLink, WorkflowNode, WorkflowStatus } from './components/PipelineChart';
|
|
24
|
+
export { default as AnimatedWorkflowChart } from './components/PipelineChart';
|
|
25
|
+
export type { AnimatedScatterPlotProps, ScatterDataPoint } from './components/ScatterPlot';
|
|
26
|
+
export { default as AnimatedScatterPlot } from './components/ScatterPlot';
|
|
27
|
+
export type { AnimatedRadarChartProps, RadarAxis, RadarDataPoint } from './components/SpiderChart';
|
|
28
|
+
export { default as AnimatedRadarChart } from './components/SpiderChart';
|
|
29
|
+
export type { AnimatedStackedAreaChartProps, StackedAreaDataPoint } from './components/StackedArea';
|
|
30
|
+
export { default as AnimatedStackedAreaChart } from './components/StackedArea';
|
|
31
|
+
export type { AnimatedStackedBarChartProps, StackedBarDataPoint } from './components/StackedBarChart';
|
|
32
|
+
export { default as AnimatedStackedBarChart } from './components/StackedBarChart';
|
|
33
|
+
export type { AnimatedTreemapProps, TreemapDataNode } from './components/TreeMap';
|
|
34
|
+
export { default as AnimatedTreemap } from './components/TreeMap';
|
|
35
|
+
export type { AnimatedVerticalBarChartProps, ColumnDataPoint } from './components/VerticalBarChart';
|
|
36
|
+
export { default as AnimatedVerticalBarChart } from './components/VerticalBarChart';
|
|
37
|
+
export type { AnimatedWaterfallChartProps, WaterfallDataPoint } from './components/WaterfallChart';
|
|
38
|
+
export { default as AnimatedWaterfallChart } from './components/WaterfallChart';
|
package/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import e from "./components/AnimatedLineChart/index.js";
|
|
3
|
+
import t from "./components/BubbleChart/index.js";
|
|
4
|
+
import n from "./components/CandleStickChart/index.js";
|
|
5
|
+
import r from "./components/DonutChart/index.js";
|
|
6
|
+
import i from "./components/FunnelChart/index.js";
|
|
7
|
+
import a from "./components/GaugeChart/index.js";
|
|
8
|
+
import o from "./components/HeatMap/index.js";
|
|
9
|
+
import s from "./components/Histogram/index.js";
|
|
10
|
+
import c from "./components/HorizontalBarChart/index.js";
|
|
11
|
+
import l from "./components/HundredPercentBarChart/index.js";
|
|
12
|
+
import u from "./components/MultiLineChart/index.js";
|
|
13
|
+
import d from "./components/PipelineChart/index.js";
|
|
14
|
+
import f from "./components/ScatterPlot/index.js";
|
|
15
|
+
import p from "./components/SpiderChart/index.js";
|
|
16
|
+
import m from "./components/StackedArea/index.js";
|
|
17
|
+
import h from "./components/StackedBarChart/index.js";
|
|
18
|
+
import g from "./components/TreeMap/index.js";
|
|
19
|
+
import _ from "./components/VerticalBarChart/index.js";
|
|
20
|
+
import v from "./components/WaterfallChart/index.js";
|
|
21
|
+
export { t as AnimatedBubbleChart, n as AnimatedCandlestickChart, r as AnimatedDonutChart, i as AnimatedFunnelChart, a as AnimatedGaugeChart, o as AnimatedHeatmap, s as AnimatedHistogram, c as AnimatedHorizontalBarChart, l as AnimatedHundredPercentBarChart, e as AnimatedLineChart, u as AnimatedMultiLineChart, p as AnimatedRadarChart, f as AnimatedScatterPlot, m as AnimatedStackedAreaChart, h as AnimatedStackedBarChart, g as AnimatedTreemap, _ as AnimatedVerticalBarChart, v as AnimatedWaterfallChart, d as AnimatedWorkflowChart };
|
|
22
|
+
|
|
23
|
+
try{if(typeof document!=="undefined"){const e=document.createElement("style");e.textContent="*,:before,:after{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content:\"\"}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder{opacity:1;color:#9ca3af}textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (width>=640px){.container{max-width:640px}}@media (width>=768px){.container{max-width:768px}}@media (width>=1024px){.container{max-width:1024px}}@media (width>=1280px){.container{max-width:1280px}}@media (width>=1536px){.container{max-width:1536px}}.visible{visibility:visible}.invisible{visibility:hidden}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.block{display:block}.grid{display:grid}.hidden{display:none}.h-full{height:100%}.min-h-\\[300px\\]{min-height:300px}.min-h-\\[350px\\]{min-height:350px}.min-h-\\[400px\\]{min-height:400px}.w-full{width:100%}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-slate-200{--tw-border-opacity:1;border-color:rgb(226 232 240/var(--tw-border-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.uppercase{text-transform:uppercase}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.drop-shadow{--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}";const target = window.__RUDRA_SHADOW_ROOT__ || document.head; target.appendChild(e);}}catch(err){}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dependencies": {
|
|
3
|
+
"@react-three/fiber": "9.6.1",
|
|
4
|
+
"d3": "7",
|
|
5
|
+
"gsap": "3.12.2",
|
|
6
|
+
"lucide-react": "^1.8.0",
|
|
7
|
+
"motion": "12.0.0",
|
|
8
|
+
"tailwindcss": "3.4.4",
|
|
9
|
+
"three": "0.184.0"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"autoprefixer": "^10.4.0",
|
|
13
|
+
"postcss": "^8.4.0",
|
|
14
|
+
"sass": "^1.72.0",
|
|
15
|
+
"tailwindcss": "^3.4.0"
|
|
16
|
+
},
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./index.js",
|
|
20
|
+
"require": "./index.js",
|
|
21
|
+
"types": "./index.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./*": {
|
|
24
|
+
"import": "./*.js",
|
|
25
|
+
"require": "./*.js",
|
|
26
|
+
"types": "./*.d.ts"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"jsdelivr": "./index.umd.js",
|
|
30
|
+
"main": "./index.js",
|
|
31
|
+
"name": "@rudra-studio/rudra-charts",
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": "^19.0.0",
|
|
34
|
+
"react-dom": "^19.0.0",
|
|
35
|
+
"tailwindcss": ">=3.0.0"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"test": "echo 'Skipping unit tests for now...' && exit 0"
|
|
42
|
+
},
|
|
43
|
+
"types": "./index.d.ts",
|
|
44
|
+
"unpkg": "./index.umd.js",
|
|
45
|
+
"version": "1.0.1"
|
|
46
|
+
}
|