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.
Files changed (3) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +143 -67
  3. 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
- value={1234}
92
- label="Total Sales"
93
- trend={12.5}
94
- format="currency"
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={[10, 25, 15, 40, 30, 55, 45]}
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
- value={75}
105
- min={0}
106
- max={100}
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
- ### Core Widgets
118
- - **KPI** - Display key metrics with trends and formatting
119
- - **Gauge** - Circular or semi-circular gauge charts
120
- - **Progress** - Linear progress bars with variants
121
- - **Sparkline** - Minimal inline charts
122
-
123
- ### Line & Area Charts
124
- - **LineChart** - Single or multi-line charts
125
- - **AreaChart** - Filled area charts
126
- - **MultiLineSparkline** - Compact multi-line visualization
127
-
128
- ### Bar Charts
129
- - **BarChart** - Vertical bar charts
130
- - **HorizontalBarChart** - Horizontal bar charts
131
- - **StackedBarChart** - Stacked bar visualization
132
- - **GroupedBarChart** - Side-by-side bars
133
- - **WaterfallChart** - Cumulative change visualization
134
-
135
- ### Distribution & Comparison
136
- - **PieChart** - Pie and donut charts
137
- - **FunnelChart** - Conversion funnel visualization
138
- - **Histogram** - Distribution frequency charts
139
- - **BoxPlot** - Statistical box and whisker plots
140
-
141
- ### Scientific & Advanced
142
- - **ScatterPlot** - X-Y scatter charts with optional bubbles
143
- - **BubbleChart** - Multi-dimensional bubble visualization
144
- - **Heatmap** - Grid-based heat intensity maps
145
- - **RadarChart** - Multi-axis spider charts
146
- - **CandlestickChart** - Financial OHLC charts
147
-
148
- ### Hierarchical & Flow
149
- - **Treemap** - Hierarchical rectangle visualization
150
- - **SunburstChart** - Radial hierarchical charts
151
- - **SankeyDiagram** - Flow and relationship visualization
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
- value={1234}
213
- label="Revenue"
214
- trend={12.5} // Percentage change
215
- format="currency" // 'number' | 'currency' | 'percentage'
216
- currency="USD" // Currency code for formatting
217
- precision={2} // Decimal places
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={[10, 25, 15, 40, 30]}
227
- labels={['Jan', 'Feb', 'Mar', 'Apr', 'May']}
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
- value={75}
241
- min={0}
242
- max={100}
312
+ data={{
313
+ value: 75,
314
+ max: 100,
315
+ label: "Progress",
316
+ unit: "%",
317
+ }}
243
318
  width={200}
244
319
  height={200}
245
- variant="semi" // 'full' | 'semi'
320
+ startAngle={-120} // Start angle in degrees
321
+ endAngle={120} // End angle in degrees
246
322
  showValue={true}
247
- unit="%"
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](./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](./examples/expo-template/) for a full-featured demo app showcasing all chart types.
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
- To run the example:
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
- ```bash
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.2",
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",