dashboard.rk
A dashboard file: apps/<app>/dashboards/<name>.rk. Widgets are computed by the engine from records; nothing is stored.
Lives in apps/<app>/dashboards/<name>.rk · Schema dashboard.json (source) · first line: # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/dashboard.json
Properties
| Property | Type | Meaning |
|---|---|---|
name required | name | snake_case, never renamed once released pattern ^[a-z][a-z0-9_]{0,62}$ |
label required | label | A label in Bahasa Indonesia (required) and optionally English. |
label.id required | string | |
label.en | string | |
description | label | A label in Bahasa Indonesia (required) and optionally English. |
description.id required | string | |
description.en | string | |
periods | list of integer | Period choices in days. default [7,30,90] |
default_period | integer | default 30, min 1 |
roles | list of name | Roles that can open it. Omit for everyone with read access to its models. |
widgets required | list of object | at least 1 |
widgets[].name required | name | snake_case, never renamed once released pattern ^[a-z][a-z0-9_]{0,62}$ |
widgets[].label | label | A label in Bahasa Indonesia (required) and optionally English. |
widgets[].label.id required | string | |
widgets[].label.en | string | |
widgets[].description | label | A label in Bahasa Indonesia (required) and optionally English. |
widgets[].description.id required | string | |
widgets[].description.en | string | |
widgets[].type required | number · chart · list | number: one aggregated value; chart: values grouped by a field; list: the first rows of a filtered, sorted list |
widgets[].model required | name | Model to read. Must be in this app or an app it requires (optional apps: guard with app_installed()). pattern ^[a-z][a-z0-9_]{0,62}$ |
widgets[].filter | CEL | CEL over one record; only matching records count. Same dialect as rules. |
widgets[].period | name | Date field the dashboard period (7/30/90 days) applies to. Omit to ignore the period. pattern ^[a-z][a-z0-9_]{0,62}$ |
widgets[].aggregate | count · sum · avg · min · max | default "count" |
widgets[].field | name | Numeric field to aggregate (needed for sum, avg, min, max). pattern ^[a-z][a-z0-9_]{0,62}$ |
widgets[].chart | bar · line · donut · funnel | Chart type (type: chart). |
widgets[].group_by | name | select, link, check or date field (type: chart). pattern ^[a-z][a-z0-9_]{0,62}$ |
widgets[].grain | day · week · month | Bucket size when group_by is a date field. |
widgets[].sort | string | Field to sort by; prefix with - for descending. For charts, 'value' or '-value' sorts groups by their aggregate. pattern ^-?[a-z][a-z0-9_]*$ |
widgets[].limit | integer | min 1, max 50 |
widgets[].columns | list of name | Fields shown in a list widget. at least 1, at most 6 |
widgets[].span | integer | Width on the 12-column grid. default 3, min 1, max 12 |
widgets[].good_when | up · down | Which direction of change is good (number widgets). default "up" |
widgets[].compact | boolean | Show money as Rp 12,5 jt instead of the full amount. |
widgets[].if | CEL | Show the widget only when true, e.g. app_installed('sales'). |
cache | string | Reuse computed widgets for this long (needs system.cache). pattern ^[0-9]+(s|m|h)$ |
widget
| Property | Type | Meaning |
|---|---|---|
name required | name | snake_case, never renamed once released pattern ^[a-z][a-z0-9_]{0,62}$ |
label | label | A label in Bahasa Indonesia (required) and optionally English. |
label.id required | string | |
label.en | string | |
description | label | A label in Bahasa Indonesia (required) and optionally English. |
description.id required | string | |
description.en | string | |
type required | number · chart · list | number: one aggregated value; chart: values grouped by a field; list: the first rows of a filtered, sorted list |
model required | name | Model to read. Must be in this app or an app it requires (optional apps: guard with app_installed()). pattern ^[a-z][a-z0-9_]{0,62}$ |
filter | CEL | CEL over one record; only matching records count. Same dialect as rules. |
period | name | Date field the dashboard period (7/30/90 days) applies to. Omit to ignore the period. pattern ^[a-z][a-z0-9_]{0,62}$ |
aggregate | count · sum · avg · min · max | default "count" |
field | name | Numeric field to aggregate (needed for sum, avg, min, max). pattern ^[a-z][a-z0-9_]{0,62}$ |
chart | bar · line · donut · funnel | Chart type (type: chart). |
group_by | name | select, link, check or date field (type: chart). pattern ^[a-z][a-z0-9_]{0,62}$ |
grain | day · week · month | Bucket size when group_by is a date field. |
sort | string | Field to sort by; prefix with - for descending. For charts, 'value' or '-value' sorts groups by their aggregate. pattern ^-?[a-z][a-z0-9_]*$ |
limit | integer | min 1, max 50 |
columns | list of name | Fields shown in a list widget. at least 1, at most 6 |
span | integer | Width on the 12-column grid. default 3, min 1, max 12 |
good_when | up · down | Which direction of change is good (number widgets). default "up" |
compact | boolean | Show money as Rp 12,5 jt instead of the full amount. |
if | CEL | Show the widget only when true, e.g. app_installed('sales'). |
Example
From rangka-apps/apps/crm/dashboards/crm_overview.rk (first 60 lines):
yaml
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/dashboard.json
name: crm_overview
label: {id: Ringkasan CRM, en: CRM overview}
default_period: 30
cache: 5m
widgets:
- name: pipeline
type: number
label: {id: Nilai pipeline}
model: deal
aggregate: sum
field: value
filter: stage != 'won' && stage != 'lost'
compact: true
span: 3
- name: weighted
type: number
label: {id: Pipeline tertimbang}
description: {id: Nilai × peluang menang}
model: deal
aggregate: sum
field: weighted_value
filter: stage != 'won' && stage != 'lost'
compact: true
span: 3
- name: won
type: number
label: {id: Nilai menang}
model: deal
aggregate: sum
field: value
filter: stage == 'won'
period: expected_close
compact: true
span: 3
- name: new_leads
type: number
label: {id: Lead belum dihubungi}
model: lead
filter: status == 'new'
good_when: down
span: 3
- name: by_stage
type: chart
chart: funnel
label: {id: Pipeline per tahap}
model: deal
group_by: stage
aggregate: sum
field: value
filter: stage != 'lost'
span: 6
- name: lead_sources
type: chart
chart: donut
label: {id: Sumber lead}
model: lead
group_by: source
span: 6
- name: by_ownerGenerated from the schema by website/scripts/gen-reference.mjs. Edit the schema, not this page.