react-native-metrify 0.1.0-alpha.2 → 0.1.0-alpha.4
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/CHANGELOG.md +8 -0
- package/README.md +143 -67
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.1.0-alpha.4] - 2026-01-22
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Corrected documentation examples to match actual API implementation
|
|
9
|
+
- Fixed KPI, Gauge, LineChart, BarChart, PieChart, AreaChart, Sparkline, and Progress widget examples
|
|
10
|
+
- All widget examples now correctly show `data={{}}` prop pattern instead of flat props
|
|
11
|
+
- Removed invalid `expo-template` reference from package.json scripts
|
|
12
|
+
|
|
5
13
|
## [0.1.0] - 2026-01-21
|
|
6
14
|
|
|
7
15
|
### Added
|
package/README.md
CHANGED
|
@@ -88,24 +88,48 @@ export default function Dashboard() {
|
|
|
88
88
|
return (
|
|
89
89
|
<View>
|
|
90
90
|
<KPI
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
data={{
|
|
92
|
+
value: 1234,
|
|
93
|
+
label: 'Total Sales',
|
|
94
|
+
delta: 12.5,
|
|
95
|
+
trend: 'up',
|
|
96
|
+
format: 'currency',
|
|
97
|
+
currency: 'USD',
|
|
98
|
+
}}
|
|
99
|
+
width={300}
|
|
100
|
+
height={120}
|
|
95
101
|
/>
|
|
96
102
|
|
|
97
103
|
<LineChart
|
|
98
|
-
data={
|
|
104
|
+
data={{
|
|
105
|
+
series: [{
|
|
106
|
+
data: [
|
|
107
|
+
{ x: 0, y: 10 },
|
|
108
|
+
{ x: 1, y: 25 },
|
|
109
|
+
{ x: 2, y: 15 },
|
|
110
|
+
{ x: 3, y: 40 },
|
|
111
|
+
{ x: 4, y: 30 },
|
|
112
|
+
{ x: 5, y: 55 },
|
|
113
|
+
{ x: 6, y: 45 },
|
|
114
|
+
],
|
|
115
|
+
color: '#007AFF',
|
|
116
|
+
}],
|
|
117
|
+
}}
|
|
99
118
|
width={300}
|
|
100
119
|
height={200}
|
|
101
120
|
/>
|
|
102
121
|
|
|
103
122
|
<Gauge
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
123
|
+
data={{
|
|
124
|
+
value: 75,
|
|
125
|
+
max: 100,
|
|
126
|
+
label: 'Progress',
|
|
127
|
+
unit: '%',
|
|
128
|
+
}}
|
|
107
129
|
width={200}
|
|
108
130
|
height={200}
|
|
131
|
+
startAngle={-120}
|
|
132
|
+
endAngle={120}
|
|
109
133
|
/>
|
|
110
134
|
</View>
|
|
111
135
|
);
|
|
@@ -114,41 +138,77 @@ export default function Dashboard() {
|
|
|
114
138
|
|
|
115
139
|
## 📊 Available Charts
|
|
116
140
|
|
|
117
|
-
###
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
141
|
+
### Widget Showcase
|
|
142
|
+
|
|
143
|
+
<table>
|
|
144
|
+
<tr>
|
|
145
|
+
<td align="center" width="50%">
|
|
146
|
+
<img src="https://raw.githubusercontent.com/chvvkrishnakumar/react-native-metrify/main/docs/images/widgets/core-widgets.png" width="400" alt="Core Widgets"/><br/>
|
|
147
|
+
<b>Core Widgets</b><br/>
|
|
148
|
+
<sub>KPI • Gauge • Progress • Sparkline</sub>
|
|
149
|
+
</td>
|
|
150
|
+
<td align="center" width="50%">
|
|
151
|
+
<img src="https://raw.githubusercontent.com/chvvkrishnakumar/react-native-metrify/main/docs/images/widgets/line-area-charts.png" width="400" alt="Line & Area Charts"/><br/>
|
|
152
|
+
<b>Line & Area Charts</b><br/>
|
|
153
|
+
<sub>LineChart • AreaChart • MultiLineSparkline</sub>
|
|
154
|
+
</td>
|
|
155
|
+
</tr>
|
|
156
|
+
<tr>
|
|
157
|
+
<td align="center" width="50%">
|
|
158
|
+
<img src="https://raw.githubusercontent.com/chvvkrishnakumar/react-native-metrify/main/docs/images/widgets/bar-charts.png" width="400" alt="Bar Charts"/><br/>
|
|
159
|
+
<b>Bar Charts</b><br/>
|
|
160
|
+
<sub>BarChart • HorizontalBarChart • StackedBarChart</sub>
|
|
161
|
+
</td>
|
|
162
|
+
<td align="center" width="50%">
|
|
163
|
+
<img src="https://raw.githubusercontent.com/chvvkrishnakumar/react-native-metrify/main/docs/images/widgets/bar-charts-2.png" width="400" alt="More Bar Charts"/><br/>
|
|
164
|
+
<b>More Bar Charts</b><br/>
|
|
165
|
+
<sub>GroupedBarChart • Histogram • WaterfallChart</sub>
|
|
166
|
+
</td>
|
|
167
|
+
</tr>
|
|
168
|
+
<tr>
|
|
169
|
+
<td align="center" width="50%">
|
|
170
|
+
<img src="https://raw.githubusercontent.com/chvvkrishnakumar/react-native-metrify/main/docs/images/widgets/distribution-charts.png" width="400" alt="Distribution Charts"/><br/>
|
|
171
|
+
<b>Distribution Charts</b><br/>
|
|
172
|
+
<sub>PieChart • FunnelChart</sub>
|
|
173
|
+
</td>
|
|
174
|
+
<td align="center" width="50%">
|
|
175
|
+
<img src="https://raw.githubusercontent.com/chvvkrishnakumar/react-native-metrify/main/docs/images/widgets/scientific-charts.png" width="400" alt="Scientific Charts"/><br/>
|
|
176
|
+
<b>Scientific Charts</b><br/>
|
|
177
|
+
<sub>ScatterPlot • BubbleChart • Heatmap</sub>
|
|
178
|
+
</td>
|
|
179
|
+
</tr>
|
|
180
|
+
<tr>
|
|
181
|
+
<td align="center" width="50%">
|
|
182
|
+
<img src="https://raw.githubusercontent.com/chvvkrishnakumar/react-native-metrify/main/docs/images/widgets/advanced-charts.png" width="400" alt="Advanced Charts"/><br/>
|
|
183
|
+
<b>Advanced Charts</b><br/>
|
|
184
|
+
<sub>RadarChart • CandlestickChart</sub>
|
|
185
|
+
</td>
|
|
186
|
+
<td align="center" width="50%">
|
|
187
|
+
<img src="https://raw.githubusercontent.com/chvvkrishnakumar/react-native-metrify/main/docs/images/widgets/treemap-sunburst-chart.png" width="400" alt="Hierarchical Charts"/><br/>
|
|
188
|
+
<b>Hierarchical Charts</b><br/>
|
|
189
|
+
<sub>Treemap • SunburstChart</sub>
|
|
190
|
+
</td>
|
|
191
|
+
</tr>
|
|
192
|
+
<tr>
|
|
193
|
+
<td align="center" colspan="2">
|
|
194
|
+
<img src="https://raw.githubusercontent.com/chvvkrishnakumar/react-native-metrify/main/docs/images/widgets/sankey-diagram.png" width="400" alt="Flow Diagram"/><br/>
|
|
195
|
+
<b>Flow Diagram</b><br/>
|
|
196
|
+
<sub>SankeyDiagram</sub>
|
|
197
|
+
</td>
|
|
198
|
+
</tr>
|
|
199
|
+
</table>
|
|
200
|
+
|
|
201
|
+
### All Chart Types
|
|
202
|
+
|
|
203
|
+
**Bar Charts:** BarChart, HorizontalBarChart, StackedBarChart, GroupedBarChart, WaterfallChart, Histogram
|
|
204
|
+
|
|
205
|
+
**Line & Area:** LineChart, AreaChart, MultiLineSparkline
|
|
206
|
+
|
|
207
|
+
**Distribution:** PieChart, FunnelChart, BoxPlot
|
|
208
|
+
|
|
209
|
+
**Scientific:** ScatterPlot, BubbleChart, Heatmap, RadarChart, CandlestickChart
|
|
210
|
+
|
|
211
|
+
**Hierarchical:** Treemap, SunburstChart, SankeyDiagram
|
|
152
212
|
|
|
153
213
|
## 🎨 Theming
|
|
154
214
|
|
|
@@ -209,12 +269,14 @@ interface BaseWidgetProps {
|
|
|
209
269
|
|
|
210
270
|
```tsx
|
|
211
271
|
<KPI
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
272
|
+
data={{
|
|
273
|
+
value: 1234,
|
|
274
|
+
label: "Revenue",
|
|
275
|
+
trend: 12.5, // Percentage change
|
|
276
|
+
format: "currency", // 'number' | 'currency' | 'percentage'
|
|
277
|
+
currency: "USD", // Currency code for formatting
|
|
278
|
+
precision: 2, // Decimal places
|
|
279
|
+
}}
|
|
218
280
|
width={200}
|
|
219
281
|
/>
|
|
220
282
|
```
|
|
@@ -223,13 +285,23 @@ interface BaseWidgetProps {
|
|
|
223
285
|
|
|
224
286
|
```tsx
|
|
225
287
|
<LineChart
|
|
226
|
-
data={
|
|
227
|
-
|
|
288
|
+
data={{
|
|
289
|
+
series: [
|
|
290
|
+
{
|
|
291
|
+
data: [
|
|
292
|
+
{ x: 0, y: 10 },
|
|
293
|
+
{ x: 1, y: 25 },
|
|
294
|
+
{ x: 2, y: 15 },
|
|
295
|
+
{ x: 3, y: 40 },
|
|
296
|
+
{ x: 4, y: 30 },
|
|
297
|
+
],
|
|
298
|
+
color: "#007AFF",
|
|
299
|
+
label: "Sales",
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
}}
|
|
228
303
|
width={300}
|
|
229
304
|
height={200}
|
|
230
|
-
curved={true} // Use curved lines
|
|
231
|
-
showGrid={true} // Show background grid
|
|
232
|
-
showPoints={true} // Show data points
|
|
233
305
|
/>
|
|
234
306
|
```
|
|
235
307
|
|
|
@@ -237,14 +309,18 @@ interface BaseWidgetProps {
|
|
|
237
309
|
|
|
238
310
|
```tsx
|
|
239
311
|
<Gauge
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
312
|
+
data={{
|
|
313
|
+
value: 75,
|
|
314
|
+
max: 100,
|
|
315
|
+
label: "Progress",
|
|
316
|
+
unit: "%",
|
|
317
|
+
}}
|
|
243
318
|
width={200}
|
|
244
319
|
height={200}
|
|
245
|
-
|
|
320
|
+
startAngle={-120} // Start angle in degrees
|
|
321
|
+
endAngle={120} // End angle in degrees
|
|
246
322
|
showValue={true}
|
|
247
|
-
|
|
323
|
+
showLabel={true}
|
|
248
324
|
/>
|
|
249
325
|
```
|
|
250
326
|
|
|
@@ -311,21 +387,21 @@ MIT © [Krishna Kumar](https://github.com/chvvkrishnakumar)
|
|
|
311
387
|
## 🔗 Links
|
|
312
388
|
|
|
313
389
|
- [Documentation](https://github.com/chvvkrishnakumar/react-native-metrify#readme)
|
|
314
|
-
- [Examples](
|
|
390
|
+
- [Examples](https://github.com/chvvkrishnakumar/react-native-metrify/tree/main/examples/basic-demo)
|
|
315
391
|
- [Changelog](./CHANGELOG.md)
|
|
316
392
|
- [Issues](https://github.com/chvvkrishnakumar/react-native-metrify/issues)
|
|
317
393
|
|
|
318
394
|
## 💡 Examples
|
|
319
395
|
|
|
320
|
-
Check out the [examples directory](
|
|
396
|
+
Check out the [examples directory](https://github.com/chvvkrishnakumar/react-native-metrify/tree/main/examples/basic-demo) for complete working examples:
|
|
321
397
|
|
|
322
|
-
|
|
398
|
+
- **AllWidgetsDashboard.tsx** - All 24 widgets in one scrollable file
|
|
399
|
+
- **KPIExample.tsx** - 7 KPI variations
|
|
400
|
+
- **GaugeExample.tsx** - 6 Gauge variations
|
|
401
|
+
- **DashboardExample.tsx** - Real-world dashboard
|
|
402
|
+
- **API_REFERENCE.md** - Complete type reference
|
|
323
403
|
|
|
324
|
-
|
|
325
|
-
cd examples/expo-template
|
|
326
|
-
npm install
|
|
327
|
-
npm start
|
|
328
|
-
```
|
|
404
|
+
Copy any example directly into your app and start using it!
|
|
329
405
|
|
|
330
406
|
---
|
|
331
407
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-metrify",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.4",
|
|
4
4
|
"description": "Mobile-first SVG chart library for React Native, Expo, and React Native Web",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
"clean": "rm -rf dist",
|
|
27
27
|
"prepublishOnly": "npm run clean && npm run build",
|
|
28
28
|
"dev": "tsc --project tsconfig.build.json --watch",
|
|
29
|
-
"pack:test": "npm pack --dry-run"
|
|
30
|
-
"example": "cd examples/expo-template && npm start"
|
|
29
|
+
"pack:test": "npm pack --dry-run"
|
|
31
30
|
},
|
|
32
31
|
"keywords": [
|
|
33
32
|
"react-native",
|