@modelform/react-native 0.7.0 → 0.9.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 +7 -1
- package/dist/{chunk-YUXA7I4J.js → chunk-FBZDJWT2.js} +431 -315
- package/dist/{chunk-BW6HKFAB.mjs → chunk-KOCUG6GH.mjs} +430 -314
- package/dist/core/index.js +6 -2
- package/dist/core/index.mjs +5 -1
- package/dist/core/inputs.d.ts +6 -1
- package/dist/core/local.d.ts +20 -4
- package/dist/core/manifest.d.ts +4 -1
- package/dist/core/schema.d.ts +8 -1
- package/dist/index.js +159 -155
- package/dist/index.mjs +5 -1
- package/package.json +1 -1
- package/schema/dashboard.schema.json +12 -1
package/README.md
CHANGED
|
@@ -8,7 +8,8 @@ same format. One JSON model describes both what an app records and how it charts
|
|
|
8
8
|
template variables and repeats. Layouts reflow into a single column on phones.
|
|
9
9
|
- **Forms:** a form is a dashboard whose panels are `input-*` types (number, slider, select, toggle, rating, text,
|
|
10
10
|
counter, duration). Entries go to an `EntryStore` you provide, and dashboards chart them through the local
|
|
11
|
-
datasource.
|
|
11
|
+
datasource. A document can say what it is with `"kind": "form"` or `"kind": "dashboard"`; without it, one with
|
|
12
|
+
inputs counts as a form.
|
|
12
13
|
- **Datasources:** a local one over recorded entries, and a Grafana one that runs panel queries through a Grafana
|
|
13
14
|
instance's HTTP API. You can also implement your own.
|
|
14
15
|
- **Configs:** a manifest format for whole apps (tabs, forms and dashboards), with JSON Schemas, validation that
|
|
@@ -49,8 +50,13 @@ export function Weight() {
|
|
|
49
50
|
```json
|
|
50
51
|
{ "refId": "A", "metric": "weight" }
|
|
51
52
|
{ "refId": "A", "metric": "water", "aggregate": "sum", "bucket": "1d" }
|
|
53
|
+
{ "refId": "A", "metric": "sets-weight", "aggregate": "max", "bucket": "1w", "groupBy": { "field": "sets-exercise" } }
|
|
54
|
+
{ "refId": "A", "metric": "meal-calories", "aggregate": "sum", "bucket": "save" }
|
|
52
55
|
```
|
|
53
56
|
|
|
57
|
+
`groupBy: { "field": metric }` makes one series per value of another input saved alongside (in an `input-group`,
|
|
58
|
+
the same item's), and `bucket: "save"` one point per Save.
|
|
59
|
+
|
|
54
60
|
To chart a Grafana instance instead, use `new GrafanaDataSource(new GrafanaClient({ url, token }))` with a
|
|
55
61
|
service-account token. Grafana runs the queries, so any of its datasources works.
|
|
56
62
|
|