pristine-charts 0.1.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/README.md +154 -0
- package/dist/area-chart/index.cjs +1736 -0
- package/dist/area-chart/index.cjs.map +1 -0
- package/dist/area-chart/index.d.cts +75 -0
- package/dist/area-chart/index.d.ts +75 -0
- package/dist/area-chart/index.js +1730 -0
- package/dist/area-chart/index.js.map +1 -0
- package/dist/bar-chart/index.cjs +1808 -0
- package/dist/bar-chart/index.cjs.map +1 -0
- package/dist/bar-chart/index.d.cts +72 -0
- package/dist/bar-chart/index.d.ts +72 -0
- package/dist/bar-chart/index.js +1802 -0
- package/dist/bar-chart/index.js.map +1 -0
- package/dist/box-plot/index.cjs +1858 -0
- package/dist/box-plot/index.cjs.map +1 -0
- package/dist/box-plot/index.d.cts +58 -0
- package/dist/box-plot/index.d.ts +58 -0
- package/dist/box-plot/index.js +1852 -0
- package/dist/box-plot/index.js.map +1 -0
- package/dist/bullet-chart/index.cjs +1707 -0
- package/dist/bullet-chart/index.cjs.map +1 -0
- package/dist/bullet-chart/index.d.cts +68 -0
- package/dist/bullet-chart/index.d.ts +68 -0
- package/dist/bullet-chart/index.js +1701 -0
- package/dist/bullet-chart/index.js.map +1 -0
- package/dist/histogram-chart/index.cjs +1876 -0
- package/dist/histogram-chart/index.cjs.map +1 -0
- package/dist/histogram-chart/index.d.cts +76 -0
- package/dist/histogram-chart/index.d.ts +76 -0
- package/dist/histogram-chart/index.js +1870 -0
- package/dist/histogram-chart/index.js.map +1 -0
- package/dist/index.cjs +6940 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +6860 -0
- package/dist/index.js.map +1 -0
- package/dist/kpi-card/index.cjs +1315 -0
- package/dist/kpi-card/index.cjs.map +1 -0
- package/dist/kpi-card/index.d.cts +79 -0
- package/dist/kpi-card/index.d.ts +79 -0
- package/dist/kpi-card/index.js +1304 -0
- package/dist/kpi-card/index.js.map +1 -0
- package/dist/line-chart/index.cjs +1742 -0
- package/dist/line-chart/index.cjs.map +1 -0
- package/dist/line-chart/index.d.cts +54 -0
- package/dist/line-chart/index.d.ts +54 -0
- package/dist/line-chart/index.js +1736 -0
- package/dist/line-chart/index.js.map +1 -0
- package/dist/linearSeries-BQL4Ud3w.d.cts +14 -0
- package/dist/linearSeries-BQL4Ud3w.d.ts +14 -0
- package/dist/pie-donut-chart/index.cjs +1663 -0
- package/dist/pie-donut-chart/index.cjs.map +1 -0
- package/dist/pie-donut-chart/index.d.cts +83 -0
- package/dist/pie-donut-chart/index.d.ts +83 -0
- package/dist/pie-donut-chart/index.js +1655 -0
- package/dist/pie-donut-chart/index.js.map +1 -0
- package/dist/progress-bar/index.cjs +1336 -0
- package/dist/progress-bar/index.cjs.map +1 -0
- package/dist/progress-bar/index.d.cts +54 -0
- package/dist/progress-bar/index.d.ts +54 -0
- package/dist/progress-bar/index.js +1329 -0
- package/dist/progress-bar/index.js.map +1 -0
- package/dist/ranked-list/index.cjs +1584 -0
- package/dist/ranked-list/index.cjs.map +1 -0
- package/dist/ranked-list/index.d.cts +70 -0
- package/dist/ranked-list/index.d.ts +70 -0
- package/dist/ranked-list/index.js +1576 -0
- package/dist/ranked-list/index.js.map +1 -0
- package/dist/result-C2epnG6V.d.cts +33 -0
- package/dist/result-C2epnG6V.d.ts +33 -0
- package/dist/scatter-plot/index.cjs +1618 -0
- package/dist/scatter-plot/index.cjs.map +1 -0
- package/dist/scatter-plot/index.d.cts +55 -0
- package/dist/scatter-plot/index.d.ts +55 -0
- package/dist/scatter-plot/index.js +1612 -0
- package/dist/scatter-plot/index.js.map +1 -0
- package/dist/sparkline/index.cjs +1456 -0
- package/dist/sparkline/index.cjs.map +1 -0
- package/dist/sparkline/index.d.cts +47 -0
- package/dist/sparkline/index.d.ts +47 -0
- package/dist/sparkline/index.js +1451 -0
- package/dist/sparkline/index.js.map +1 -0
- package/package.json +126 -0
package/README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# pristine-charts
|
|
2
|
+
|
|
3
|
+
`pristine-charts` gives you clean, minimal statistical charts with a sensible structure behind them.
|
|
4
|
+
|
|
5
|
+
## What’s in the repo
|
|
6
|
+
|
|
7
|
+
- A public npm package for React consumers
|
|
8
|
+
- Deep import paths for each chart
|
|
9
|
+
- A Vite demo app for local development
|
|
10
|
+
- Vitest coverage for chart rendering and domain logic
|
|
11
|
+
- TypeScript declarations in the published package
|
|
12
|
+
|
|
13
|
+
## Supported charts
|
|
14
|
+
|
|
15
|
+
- Area chart
|
|
16
|
+
- Bar chart
|
|
17
|
+
- Box plot
|
|
18
|
+
- Bullet chart
|
|
19
|
+
- Histogram chart
|
|
20
|
+
- KPI card
|
|
21
|
+
- Line chart
|
|
22
|
+
- Pie / donut chart
|
|
23
|
+
- Progress bar
|
|
24
|
+
- Ranked list
|
|
25
|
+
- Scatter plot
|
|
26
|
+
- Sparkline
|
|
27
|
+
|
|
28
|
+
## Package shape
|
|
29
|
+
|
|
30
|
+
- ESM and CJS builds are published from `dist/`
|
|
31
|
+
- Type declarations ship alongside the runtime bundles
|
|
32
|
+
- `react` and `react-dom` are peer dependencies
|
|
33
|
+
- `sideEffects: false` helps bundlers drop unused chart entry points
|
|
34
|
+
- Each chart can be imported from the root package or from its own subpath
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
pnpm install
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Run locally
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
pnpm dev
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Scripts
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
pnpm lint
|
|
52
|
+
pnpm typecheck
|
|
53
|
+
pnpm test
|
|
54
|
+
pnpm build:lib
|
|
55
|
+
pnpm build:site
|
|
56
|
+
pnpm build
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Library usage
|
|
60
|
+
|
|
61
|
+
Use the root export when convenience matters, or a deep import when you want the smallest bundle.
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
import { BarChart } from 'pristine-charts'
|
|
65
|
+
|
|
66
|
+
export function Example() {
|
|
67
|
+
return (
|
|
68
|
+
<BarChart
|
|
69
|
+
data={[
|
|
70
|
+
{ category: 'North', value: 32 },
|
|
71
|
+
{ category: 'South', value: -14 },
|
|
72
|
+
]}
|
|
73
|
+
/>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import { BarChart } from 'pristine-charts/bar-chart'
|
|
80
|
+
import { HistogramChart } from 'pristine-charts/histogram-chart'
|
|
81
|
+
import { KPICard } from 'pristine-charts/kpi-card'
|
|
82
|
+
import { LineChart } from 'pristine-charts/line-chart'
|
|
83
|
+
import { AreaChart } from 'pristine-charts/area-chart'
|
|
84
|
+
import { ScatterPlot } from 'pristine-charts/scatter-plot'
|
|
85
|
+
import { Sparkline } from 'pristine-charts/sparkline'
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Public API
|
|
89
|
+
|
|
90
|
+
### Chart components
|
|
91
|
+
|
|
92
|
+
These are the primary components intended for direct use:
|
|
93
|
+
|
|
94
|
+
- `AreaChart`
|
|
95
|
+
- `BarChart`
|
|
96
|
+
- `BoxPlot`
|
|
97
|
+
- `BulletChart`
|
|
98
|
+
- `HistogramChart`
|
|
99
|
+
- `KPICard`
|
|
100
|
+
- `LineChart`
|
|
101
|
+
- `PieDonutChart`
|
|
102
|
+
- `ProgressBar`
|
|
103
|
+
- `RankedList`
|
|
104
|
+
- `ScatterPlot`
|
|
105
|
+
- `Sparkline`
|
|
106
|
+
|
|
107
|
+
### Helpers and types
|
|
108
|
+
|
|
109
|
+
The root package also exports chart-specific compute, validate, format, and type helpers for people who want to work with the domain layer rather than the components themselves.
|
|
110
|
+
|
|
111
|
+
### Internal building blocks
|
|
112
|
+
|
|
113
|
+
Folders like `chart-error`, `demo`, `icons`, `shared`, and the per-chart `components/` directories are part of the codebase, but they are implementation details rather than the main public surface.
|
|
114
|
+
|
|
115
|
+
## Build outputs
|
|
116
|
+
|
|
117
|
+
- `pnpm build:lib` writes the npm package artifacts to `dist/`
|
|
118
|
+
- `pnpm build:site` writes the demo site to `site-dist/`
|
|
119
|
+
- `pnpm build` runs both
|
|
120
|
+
|
|
121
|
+
## Publishing
|
|
122
|
+
|
|
123
|
+
- The GitHub Actions workflow in `.github/workflows/release.yml` deploys the site from `main`
|
|
124
|
+
- The same workflow publishes to npm from `v*` tags
|
|
125
|
+
- npm publishing expects an `NPM_TOKEN` secret in GitHub
|
|
126
|
+
|
|
127
|
+
## Project structure
|
|
128
|
+
|
|
129
|
+
```txt
|
|
130
|
+
src/
|
|
131
|
+
area-chart/ # area chart component, domain, and types
|
|
132
|
+
bar-chart/ # bar chart component, domain, and types
|
|
133
|
+
box-plot/ # box plot component, domain, and types
|
|
134
|
+
bullet-chart/ # bullet chart component, domain, and types
|
|
135
|
+
chart-error/ # reusable chart error component
|
|
136
|
+
histogram-chart/ # histogram component, domain, and types
|
|
137
|
+
kpi-card/ # KPI card component, domain, and types
|
|
138
|
+
line-chart/ # line chart component, domain, and types
|
|
139
|
+
pie-donut-chart/ # pie and donut chart component, domain, and types
|
|
140
|
+
progress-bar/ # progress bar component, domain, and types
|
|
141
|
+
ranked-list/ # ranked list component, domain, and types
|
|
142
|
+
scatter-plot/ # scatter plot component, domain, and types
|
|
143
|
+
sparkline/ # sparkline component, domain, and types
|
|
144
|
+
shared/ # reusable helpers
|
|
145
|
+
styles/ # demo styling
|
|
146
|
+
demo/ # demo-page components
|
|
147
|
+
App.tsx # demo app shell
|
|
148
|
+
main.tsx # demo app entry point
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Notes
|
|
152
|
+
|
|
153
|
+
- The package is meant to be used as a library, not as a single bundled app
|
|
154
|
+
- The demo site has its own build output so it can be deployed separately without touching the npm package
|