@chartts/core 0.1.0 → 0.1.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 +82 -0
- package/dist/chunk-KOHWMGRF.js +356 -0
- package/dist/chunk-KOHWMGRF.js.map +1 -0
- package/dist/chunk-PLGZ4REQ.cjs +360 -0
- package/dist/chunk-PLGZ4REQ.cjs.map +1 -0
- package/dist/geo.cjs +5 -5
- package/dist/geo.d.cts +1 -1
- package/dist/geo.d.ts +1 -1
- package/dist/geo.js +2 -2
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{world-regions-cMulhqDW.d.cts → world-regions-D-TCHPZP.d.cts} +0 -12
- package/dist/{world-regions-Cfvxpbx0.d.ts → world-regions-DjMvYgFu.d.ts} +0 -12
- package/package.json +14 -4
- package/dist/chunk-JO6U4YR4.js +0 -355
- package/dist/chunk-JO6U4YR4.js.map +0 -1
- package/dist/chunk-MLD5ZIDO.cjs +0 -359
- package/dist/chunk-MLD5ZIDO.cjs.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# @chartts/core
|
|
2
|
+
|
|
3
|
+
Beautiful charts. Tiny bundle. Every framework.
|
|
4
|
+
|
|
5
|
+
SVG-first charting library with Tailwind support, under 15kb gzipped. 27 chart types with a flat, declarative API.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @chartts/core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { createChart, lineChartType } from "@chartts/core"
|
|
17
|
+
|
|
18
|
+
const chart = createChart(lineChartType, {
|
|
19
|
+
data: {
|
|
20
|
+
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
|
|
21
|
+
series: [{ name: "Revenue", values: [4200, 5800, 7100, 6400, 8200, 9600] }]
|
|
22
|
+
},
|
|
23
|
+
width: 600,
|
|
24
|
+
height: 300,
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
document.getElementById("chart").innerHTML = chart.toSVG()
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Server-side rendering
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { renderToString, lineChartType } from "@chartts/core"
|
|
34
|
+
|
|
35
|
+
const svg = renderToString(lineChartType, data, { width: 600, height: 300 })
|
|
36
|
+
// Returns an SVG string you can embed anywhere
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Chart types
|
|
40
|
+
|
|
41
|
+
Line, bar, area, pie, donut, scatter, bubble, radar, candlestick, waterfall, funnel, gauge, sparkline, heatmap, treemap, boxplot, histogram, polar, radial bar, lollipop, bullet, dumbbell, calendar, combo, sankey, stacked bar, horizontal bar.
|
|
42
|
+
|
|
43
|
+
Tree-shakeable. Import only what you use:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { lineChartType } from "@chartts/core/line"
|
|
47
|
+
import { barChartType } from "@chartts/core/bar"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Tailwind integration
|
|
51
|
+
|
|
52
|
+
Charts render as real SVG DOM elements. Style with CSS variables:
|
|
53
|
+
|
|
54
|
+
```css
|
|
55
|
+
:root {
|
|
56
|
+
--chartts-grid: rgba(0 0 0 / 0.06);
|
|
57
|
+
--chartts-axis: rgba(0 0 0 / 0.15);
|
|
58
|
+
--chartts-text-muted: #64748b;
|
|
59
|
+
--chartts-bg: #ffffff;
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Framework packages
|
|
64
|
+
|
|
65
|
+
For React, Vue, Svelte, and Solid, use the dedicated packages:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm install @chartts/react # React
|
|
69
|
+
npm install @chartts/vue # Vue
|
|
70
|
+
npm install @chartts/svelte # Svelte
|
|
71
|
+
npm install @chartts/solid # Solid
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Links
|
|
75
|
+
|
|
76
|
+
- [Documentation](https://chartts.com/docs)
|
|
77
|
+
- [Examples](https://chartts.com/examples)
|
|
78
|
+
- [GitHub](https://github.com/chartts/chartts)
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
MIT
|