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.
Files changed (84) hide show
  1. package/README.md +154 -0
  2. package/dist/area-chart/index.cjs +1736 -0
  3. package/dist/area-chart/index.cjs.map +1 -0
  4. package/dist/area-chart/index.d.cts +75 -0
  5. package/dist/area-chart/index.d.ts +75 -0
  6. package/dist/area-chart/index.js +1730 -0
  7. package/dist/area-chart/index.js.map +1 -0
  8. package/dist/bar-chart/index.cjs +1808 -0
  9. package/dist/bar-chart/index.cjs.map +1 -0
  10. package/dist/bar-chart/index.d.cts +72 -0
  11. package/dist/bar-chart/index.d.ts +72 -0
  12. package/dist/bar-chart/index.js +1802 -0
  13. package/dist/bar-chart/index.js.map +1 -0
  14. package/dist/box-plot/index.cjs +1858 -0
  15. package/dist/box-plot/index.cjs.map +1 -0
  16. package/dist/box-plot/index.d.cts +58 -0
  17. package/dist/box-plot/index.d.ts +58 -0
  18. package/dist/box-plot/index.js +1852 -0
  19. package/dist/box-plot/index.js.map +1 -0
  20. package/dist/bullet-chart/index.cjs +1707 -0
  21. package/dist/bullet-chart/index.cjs.map +1 -0
  22. package/dist/bullet-chart/index.d.cts +68 -0
  23. package/dist/bullet-chart/index.d.ts +68 -0
  24. package/dist/bullet-chart/index.js +1701 -0
  25. package/dist/bullet-chart/index.js.map +1 -0
  26. package/dist/histogram-chart/index.cjs +1876 -0
  27. package/dist/histogram-chart/index.cjs.map +1 -0
  28. package/dist/histogram-chart/index.d.cts +76 -0
  29. package/dist/histogram-chart/index.d.ts +76 -0
  30. package/dist/histogram-chart/index.js +1870 -0
  31. package/dist/histogram-chart/index.js.map +1 -0
  32. package/dist/index.cjs +6940 -0
  33. package/dist/index.cjs.map +1 -0
  34. package/dist/index.d.cts +19 -0
  35. package/dist/index.d.ts +19 -0
  36. package/dist/index.js +6860 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/kpi-card/index.cjs +1315 -0
  39. package/dist/kpi-card/index.cjs.map +1 -0
  40. package/dist/kpi-card/index.d.cts +79 -0
  41. package/dist/kpi-card/index.d.ts +79 -0
  42. package/dist/kpi-card/index.js +1304 -0
  43. package/dist/kpi-card/index.js.map +1 -0
  44. package/dist/line-chart/index.cjs +1742 -0
  45. package/dist/line-chart/index.cjs.map +1 -0
  46. package/dist/line-chart/index.d.cts +54 -0
  47. package/dist/line-chart/index.d.ts +54 -0
  48. package/dist/line-chart/index.js +1736 -0
  49. package/dist/line-chart/index.js.map +1 -0
  50. package/dist/linearSeries-BQL4Ud3w.d.cts +14 -0
  51. package/dist/linearSeries-BQL4Ud3w.d.ts +14 -0
  52. package/dist/pie-donut-chart/index.cjs +1663 -0
  53. package/dist/pie-donut-chart/index.cjs.map +1 -0
  54. package/dist/pie-donut-chart/index.d.cts +83 -0
  55. package/dist/pie-donut-chart/index.d.ts +83 -0
  56. package/dist/pie-donut-chart/index.js +1655 -0
  57. package/dist/pie-donut-chart/index.js.map +1 -0
  58. package/dist/progress-bar/index.cjs +1336 -0
  59. package/dist/progress-bar/index.cjs.map +1 -0
  60. package/dist/progress-bar/index.d.cts +54 -0
  61. package/dist/progress-bar/index.d.ts +54 -0
  62. package/dist/progress-bar/index.js +1329 -0
  63. package/dist/progress-bar/index.js.map +1 -0
  64. package/dist/ranked-list/index.cjs +1584 -0
  65. package/dist/ranked-list/index.cjs.map +1 -0
  66. package/dist/ranked-list/index.d.cts +70 -0
  67. package/dist/ranked-list/index.d.ts +70 -0
  68. package/dist/ranked-list/index.js +1576 -0
  69. package/dist/ranked-list/index.js.map +1 -0
  70. package/dist/result-C2epnG6V.d.cts +33 -0
  71. package/dist/result-C2epnG6V.d.ts +33 -0
  72. package/dist/scatter-plot/index.cjs +1618 -0
  73. package/dist/scatter-plot/index.cjs.map +1 -0
  74. package/dist/scatter-plot/index.d.cts +55 -0
  75. package/dist/scatter-plot/index.d.ts +55 -0
  76. package/dist/scatter-plot/index.js +1612 -0
  77. package/dist/scatter-plot/index.js.map +1 -0
  78. package/dist/sparkline/index.cjs +1456 -0
  79. package/dist/sparkline/index.cjs.map +1 -0
  80. package/dist/sparkline/index.d.cts +47 -0
  81. package/dist/sparkline/index.d.ts +47 -0
  82. package/dist/sparkline/index.js +1451 -0
  83. package/dist/sparkline/index.js.map +1 -0
  84. 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