Skip to content

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 ​

PropertyTypeMeaning
name requirednamesnake_case, never renamed once released
pattern ^[a-z][a-z0-9_]{0,62}$
label requiredlabelA label in Bahasa Indonesia (required) and optionally English.
label.id requiredstring
label.enstring
descriptionlabelA label in Bahasa Indonesia (required) and optionally English.
description.id requiredstring
description.enstring
periodslist of integerPeriod choices in days.
default [7,30,90]
default_periodinteger
default 30, min 1
roleslist of nameRoles that can open it. Omit for everyone with read access to its models.
widgets requiredlist of object
at least 1
widgets[].name requirednamesnake_case, never renamed once released
pattern ^[a-z][a-z0-9_]{0,62}$
widgets[].labellabelA label in Bahasa Indonesia (required) and optionally English.
widgets[].label.id requiredstring
widgets[].label.enstring
widgets[].descriptionlabelA label in Bahasa Indonesia (required) and optionally English.
widgets[].description.id requiredstring
widgets[].description.enstring
widgets[].type requirednumber · chart · listnumber: one aggregated value; chart: values grouped by a field; list: the first rows of a filtered, sorted list
widgets[].model requirednameModel 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[].filterCELCEL over one record; only matching records count. Same dialect as rules.
widgets[].periodnameDate field the dashboard period (7/30/90 days) applies to. Omit to ignore the period.
pattern ^[a-z][a-z0-9_]{0,62}$
widgets[].aggregatecount · sum · avg · min · max
default "count"
widgets[].fieldnameNumeric field to aggregate (needed for sum, avg, min, max).
pattern ^[a-z][a-z0-9_]{0,62}$
widgets[].chartbar · line · donut · funnelChart type (type: chart).
widgets[].group_bynameselect, link, check or date field (type: chart).
pattern ^[a-z][a-z0-9_]{0,62}$
widgets[].grainday · week · monthBucket size when group_by is a date field.
widgets[].sortstringField to sort by; prefix with - for descending. For charts, 'value' or '-value' sorts groups by their aggregate.
pattern ^-?[a-z][a-z0-9_]*$
widgets[].limitinteger
min 1, max 50
widgets[].columnslist of nameFields shown in a list widget.
at least 1, at most 6
widgets[].spanintegerWidth on the 12-column grid.
default 3, min 1, max 12
widgets[].good_whenup · downWhich direction of change is good (number widgets).
default "up"
widgets[].compactbooleanShow money as Rp 12,5 jt instead of the full amount.
widgets[].ifCELShow the widget only when true, e.g. app_installed('sales').
cachestringReuse computed widgets for this long (needs system.cache).
pattern ^[0-9]+(s|m|h)$

widget ​

PropertyTypeMeaning
name requirednamesnake_case, never renamed once released
pattern ^[a-z][a-z0-9_]{0,62}$
labellabelA label in Bahasa Indonesia (required) and optionally English.
label.id requiredstring
label.enstring
descriptionlabelA label in Bahasa Indonesia (required) and optionally English.
description.id requiredstring
description.enstring
type requirednumber · chart · listnumber: one aggregated value; chart: values grouped by a field; list: the first rows of a filtered, sorted list
model requirednameModel 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}$
filterCELCEL over one record; only matching records count. Same dialect as rules.
periodnameDate field the dashboard period (7/30/90 days) applies to. Omit to ignore the period.
pattern ^[a-z][a-z0-9_]{0,62}$
aggregatecount · sum · avg · min · max
default "count"
fieldnameNumeric field to aggregate (needed for sum, avg, min, max).
pattern ^[a-z][a-z0-9_]{0,62}$
chartbar · line · donut · funnelChart type (type: chart).
group_bynameselect, link, check or date field (type: chart).
pattern ^[a-z][a-z0-9_]{0,62}$
grainday · week · monthBucket size when group_by is a date field.
sortstringField to sort by; prefix with - for descending. For charts, 'value' or '-value' sorts groups by their aggregate.
pattern ^-?[a-z][a-z0-9_]*$
limitinteger
min 1, max 50
columnslist of nameFields shown in a list widget.
at least 1, at most 6
spanintegerWidth on the 12-column grid.
default 3, min 1, max 12
good_whenup · downWhich direction of change is good (number widgets).
default "up"
compactbooleanShow money as Rp 12,5 jt instead of the full amount.
ifCELShow 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_owner

Generated from the schema by website/scripts/gen-reference.mjs. Edit the schema, not this page.

Rangka OS is source-available under the Elastic License 2.0 (ELv2). Free to self-host.