robobyte-front-builder 1.0.26 → 1.0.27
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/LICENSE +65 -0
- package/README.md +57 -0
- package/docs/ReportViewer.md +581 -0
- package/docs/fetchReportData.md +379 -0
- package/docs/printLayout.md +405 -0
- package/package.json +29 -1
- package/training/00-index.md +168 -0
- package/training/01-input.md +144 -0
- package/training/02-checkbox.md +107 -0
- package/training/03-dropdown.md +135 -0
- package/training/04-datepicker.md +139 -0
- package/training/05-radio.md +123 -0
- package/training/06-number.md +133 -0
- package/training/07-textarea.md +114 -0
- package/training/08-richtext.md +112 -0
- package/training/09-tag.md +110 -0
- package/training/10-time.md +107 -0
- package/training/11-toggle.md +108 -0
- package/training/12-signature.md +107 -0
- package/training/13-autocomplete.md +134 -0
- package/training/14-button.md +168 -0
- package/training/15-label.md +138 -0
- package/training/16-header.md +128 -0
- package/training/17-divider.md +96 -0
- package/training/18-image.md +105 -0
- package/training/19-link.md +108 -0
- package/training/20-banner.md +122 -0
- package/training/21-progress-circle.md +101 -0
- package/training/22-progress-line.md +93 -0
- package/training/23-menu.md +139 -0
- package/training/24-popover.md +114 -0
- package/training/25-layout.md +116 -0
- package/training/26-layout-cell.md +143 -0
- package/training/27-card.md +87 -0
- package/training/28-wizard.md +126 -0
- package/training/29-wizard-step.md +92 -0
- package/training/30-repeater.md +123 -0
- package/training/31-dialog.md +131 -0
- package/training/32-breadcrumb.md +121 -0
- package/training/33-dataGrid.md +129 -0
- package/training/34-dataTableViewer.md +115 -0
- package/training/35-reportViewer.md +673 -0
- package/training/36-viewRenderer.md +110 -0
- package/training/37-treeView.md +170 -0
- package/training/38-kpi-metric.md +148 -0
- package/training/39-kpi-trend.md +105 -0
- package/training/40-kpi-badge.md +112 -0
- package/training/41-kpi-statusDot.md +118 -0
- package/training/42-kpi-iconBox.md +114 -0
- package/training/43-kpi-gauge.md +143 -0
- package/training/44-kpi-bulletChart.md +126 -0
- package/training/45-kpi-colorScale.md +143 -0
- package/training/46-kpi-rating.md +125 -0
- package/training/47-kpi-countdown.md +151 -0
- package/training/48-fetchReportData.md +276 -0
- package/training/49-printLayout.md +215 -0
- package/training/examples/01-login-form.json +176 -0
- package/training/examples/02-contact-form.json +141 -0
- package/training/examples/03-kpi-cards-row.json +123 -0
- package/training/examples/04-settings-toggles.json +153 -0
- package/training/examples/05-user-profile-card.json +136 -0
- package/training/examples/06-date-range-filter.json +108 -0
- package/training/examples/07-search-bar-results.json +130 -0
- package/training/examples/08-notification-settings.json +131 -0
- package/training/examples/09-employee-profile-form.json +259 -0
- package/training/examples/10-invoice-form.json +241 -0
- package/training/examples/11-dashboard-overview.json +251 -0
- package/training/examples/12-registration-wizard.json +154 -0
- package/training/examples/13-product-catalog.json +168 -0
- package/training/examples/14-data-table-with-filters.json +180 -0
- package/training/examples/15-tabbed-profile.json +92 -0
- package/training/examples/16-kpi-full-row.json +203 -0
- package/training/examples/17-tree-detail-view.json +139 -0
- package/training/examples/18-employee-management.json +233 -0
- package/training/examples/19-sales-dashboard.json +272 -0
- package/training/examples/20-checkout-wizard.json +225 -0
- package/training/examples/21-analytics-page.json +222 -0
- package/training/examples/22-hr-onboarding.json +222 -0
- package/training/examples/23-document-browser.json +241 -0
- package/training/examples/24-order-management.json +290 -0
- package/training/examples/25-crm-contact-page.json +272 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Component: kpi-statusDot
|
|
2
|
+
|
|
3
|
+
A small colored circle indicating status. Thresholds map values to dot colors. Optionally shows a pulse animation and a label.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
### Data
|
|
10
|
+
| Prop | Type | Options / Notes |
|
|
11
|
+
|------|------|-----------------|
|
|
12
|
+
| `valueKey` | expression | Data key or expression for the status value. E.g. `"serverStatus"` → `data.serverStatus`. |
|
|
13
|
+
| `label` | expression | Static label displayed alongside the dot. Leave blank for dot-only. |
|
|
14
|
+
|
|
15
|
+
### Appearance
|
|
16
|
+
| Prop | Type | Options / Notes |
|
|
17
|
+
|------|------|-----------------|
|
|
18
|
+
| `size` | expression | Dot diameter in px, e.g. `"12"`, `"16"`. |
|
|
19
|
+
| `pulse` | boolean | `true` adds a pulsing glow animation (useful for "live" status indicators). |
|
|
20
|
+
| `showLabel` | boolean | Shows the `label` text alongside the dot. |
|
|
21
|
+
| `labelPosition` | select | `right` · `left` · `above` · `below` — Position of the label relative to the dot. |
|
|
22
|
+
| `align` | select | `left` · `center` · `right` |
|
|
23
|
+
|
|
24
|
+
### Thresholds
|
|
25
|
+
| Prop | Type | Notes |
|
|
26
|
+
|------|------|-------|
|
|
27
|
+
| `thresholds` | thresholds-editor | Rules mapping values to dot colors. E.g. `"== online"` → `success.main`, `"== offline"` → `error.main`. |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Props — Style Tab
|
|
32
|
+
|
|
33
|
+
No dedicated style tab.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Props — Actions Tab
|
|
38
|
+
|
|
39
|
+
No actions.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Use Cases
|
|
44
|
+
|
|
45
|
+
**When to use:**
|
|
46
|
+
- Server/service status indicators (online/offline).
|
|
47
|
+
- Connection health: active, degraded, down.
|
|
48
|
+
- User presence: available, busy, away.
|
|
49
|
+
- Any binary or categorical status that maps to a color.
|
|
50
|
+
- Combined with text labels to show status inline.
|
|
51
|
+
|
|
52
|
+
**When NOT to use:**
|
|
53
|
+
- Complex status with multiple text states → use `kpi-badge`.
|
|
54
|
+
- Numeric progress → use `kpi-gauge`.
|
|
55
|
+
- Full status line with detailed info → use `kpi-badge` with `filled` variant.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Schema Examples
|
|
60
|
+
|
|
61
|
+
### Server status dot with pulse
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"type": "kpi-statusDot",
|
|
65
|
+
"props": {
|
|
66
|
+
"valueKey": "data.server.status",
|
|
67
|
+
"label": "API Status",
|
|
68
|
+
"showLabel": true,
|
|
69
|
+
"labelPosition": "right",
|
|
70
|
+
"size": "12",
|
|
71
|
+
"pulse": true,
|
|
72
|
+
"align": "left",
|
|
73
|
+
"thresholds": [
|
|
74
|
+
{ "operator": "==", "value": "online", "color": "success.main" },
|
|
75
|
+
{ "operator": "==", "value": "degraded", "color": "warning.main" },
|
|
76
|
+
{ "operator": "==", "value": "offline", "color": "error.main" }
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### User presence indicator (dot only)
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"type": "kpi-statusDot",
|
|
86
|
+
"props": {
|
|
87
|
+
"valueKey": "data.user.presence",
|
|
88
|
+
"size": "10",
|
|
89
|
+
"pulse": false,
|
|
90
|
+
"showLabel": false,
|
|
91
|
+
"thresholds": [
|
|
92
|
+
{ "operator": "==", "value": "available", "color": "#4caf50" },
|
|
93
|
+
{ "operator": "==", "value": "busy", "color": "#f44336" },
|
|
94
|
+
{ "operator": "==", "value": "away", "color": "#ff9800" }
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Label above dot
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"type": "kpi-statusDot",
|
|
104
|
+
"props": {
|
|
105
|
+
"valueKey": "data.paymentStatus",
|
|
106
|
+
"label": "Payment",
|
|
107
|
+
"showLabel": true,
|
|
108
|
+
"labelPosition": "above",
|
|
109
|
+
"size": "14",
|
|
110
|
+
"align": "center",
|
|
111
|
+
"thresholds": [
|
|
112
|
+
{ "operator": "==", "value": "paid", "color": "success.main" },
|
|
113
|
+
{ "operator": "==", "value": "overdue", "color": "error.main" },
|
|
114
|
+
{ "operator": "==", "value": "pending", "color": "warning.main" }
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Component: kpi-iconBox
|
|
2
|
+
|
|
3
|
+
A boxed icon widget. Useful as a visual accent in KPI cards or to show category/status with a large icon. Color driven by thresholds.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
### Data
|
|
10
|
+
| Prop | Type | Options / Notes |
|
|
11
|
+
|------|------|-----------------|
|
|
12
|
+
| `valueKey` | expression | Optional. Data key for threshold-based color changes. The icon itself stays fixed; only bg/color changes. E.g. `"errorCount"` → threshold `"> 0"` turns icon red. |
|
|
13
|
+
|
|
14
|
+
### Appearance
|
|
15
|
+
| Prop | Type | Options / Notes |
|
|
16
|
+
|------|------|-----------------|
|
|
17
|
+
| `icon` | expression | MUI icon name to display, e.g. `"StarOutlined"`, `"TrendingUpOutlined"`, `"PeopleOutlined"`. |
|
|
18
|
+
| `size` | expression | Box container size in px, e.g. `"48"`, `"64"`. |
|
|
19
|
+
| `iconSize` | expression | Icon size in px (smaller than box size), e.g. `"28"`. |
|
|
20
|
+
| `borderRadius` | expression | Box corner radius, e.g. `"8px"`, `"50%"` for circle. |
|
|
21
|
+
| `iconColor` | expression | Icon color override. Overrides threshold color. E.g. `"#ffffff"`. |
|
|
22
|
+
| `bgColor` | expression | Background color override. Overrides threshold bg. |
|
|
23
|
+
| `shadow` | boolean | Adds a colored glow shadow matching the icon color. |
|
|
24
|
+
| `align` | select | `left` · `center` · `right` |
|
|
25
|
+
|
|
26
|
+
### Thresholds
|
|
27
|
+
| Prop | Type | Notes |
|
|
28
|
+
|------|------|-------|
|
|
29
|
+
| `thresholds` | thresholds-editor | Rules mapping `valueKey` to icon color + background. E.g. `"> 0"` → error color. |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Props — Style Tab
|
|
34
|
+
|
|
35
|
+
No dedicated style tab.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Props — Actions Tab
|
|
40
|
+
|
|
41
|
+
No actions.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Use Cases
|
|
46
|
+
|
|
47
|
+
**When to use:**
|
|
48
|
+
- Visual accent in metric cards (large icon above/beside the metric value).
|
|
49
|
+
- Category icons in navigation or summary panels.
|
|
50
|
+
- Status visualization: a large warning icon when an alert is active.
|
|
51
|
+
- Decorative icons in empty states or onboarding screens.
|
|
52
|
+
|
|
53
|
+
**When NOT to use:**
|
|
54
|
+
- Small inline icons → use prefix/suffix on `label` or `header`.
|
|
55
|
+
- Interactive icon buttons → use `button` with `iconButton: true`.
|
|
56
|
+
- Charts → use chart KPI components.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Schema Examples
|
|
61
|
+
|
|
62
|
+
### Static icon box (revenue card accent)
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"type": "kpi-iconBox",
|
|
66
|
+
"props": {
|
|
67
|
+
"icon": "AttachMoneyOutlined",
|
|
68
|
+
"size": "52",
|
|
69
|
+
"iconSize": "30",
|
|
70
|
+
"borderRadius": "12px",
|
|
71
|
+
"bgColor": "#e3f2fd",
|
|
72
|
+
"iconColor": "#1976d2",
|
|
73
|
+
"shadow": false,
|
|
74
|
+
"align": "center"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Threshold-driven alert icon
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"type": "kpi-iconBox",
|
|
83
|
+
"props": {
|
|
84
|
+
"valueKey": "data.errorCount",
|
|
85
|
+
"icon": "ErrorOutlineOutlined",
|
|
86
|
+
"size": "48",
|
|
87
|
+
"iconSize": "28",
|
|
88
|
+
"borderRadius": "50%",
|
|
89
|
+
"shadow": true,
|
|
90
|
+
"align": "center",
|
|
91
|
+
"thresholds": [
|
|
92
|
+
{ "operator": "==", "value": 0, "color": "success.main", "bg": "#e8f5e9" },
|
|
93
|
+
{ "operator": ">", "value": 0, "color": "error.main", "bg": "#ffebee" }
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Circle icon box
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"type": "kpi-iconBox",
|
|
103
|
+
"props": {
|
|
104
|
+
"icon": "PeopleOutlined",
|
|
105
|
+
"size": "60",
|
|
106
|
+
"iconSize": "32",
|
|
107
|
+
"borderRadius": "50%",
|
|
108
|
+
"bgColor": "#f3e5f5",
|
|
109
|
+
"iconColor": "#7b1fa2",
|
|
110
|
+
"shadow": true,
|
|
111
|
+
"align": "left"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Component: kpi-gauge
|
|
2
|
+
|
|
3
|
+
A semicircular SVG gauge chart for displaying a value between a min and max. Supports needle mode, value label, threshold coloring, and sub-label.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
### Data
|
|
10
|
+
| Prop | Type | Options / Notes |
|
|
11
|
+
|------|------|-----------------|
|
|
12
|
+
| `valueKey` | expression | Data key or expression for the numeric value. E.g. `"cpuUsage"` → `data.cpuUsage`. |
|
|
13
|
+
| `min` | expression | Minimum value of the gauge scale. E.g. `0`. |
|
|
14
|
+
| `max` | expression | Maximum value of the gauge scale. E.g. `100`. |
|
|
15
|
+
| `label` | expression | Label shown inside or below the gauge. |
|
|
16
|
+
| `sublabel` | expression | Secondary label shown below the main label. |
|
|
17
|
+
|
|
18
|
+
### Format
|
|
19
|
+
| Prop | Type | Options / Notes |
|
|
20
|
+
|------|------|-----------------|
|
|
21
|
+
| `format` | select | `number` · `currency` · `percent` · `compact` · `bytes` · `duration` |
|
|
22
|
+
| `decimals` | expression | Decimal places for displayed value. |
|
|
23
|
+
| `prefix` | expression | Text before the value. |
|
|
24
|
+
| `suffix` | expression | Text after the value, e.g. `"°C"`, `"%"`. |
|
|
25
|
+
|
|
26
|
+
### Appearance
|
|
27
|
+
| Prop | Type | Options / Notes |
|
|
28
|
+
|------|------|-----------------|
|
|
29
|
+
| `size` | expression | Gauge SVG width in px, e.g. `"180"`. Height auto-scales. |
|
|
30
|
+
| `strokeWidth` | expression | Arc stroke width in px, e.g. `"12"`. |
|
|
31
|
+
| `color` | expression | Arc color when no threshold applies. E.g. `"primary.main"`. |
|
|
32
|
+
| `trackColor` | expression | Background arc color, e.g. `"#e0e0e0"`. |
|
|
33
|
+
| `showValue` | boolean | Shows the numeric value inside the gauge. |
|
|
34
|
+
| `showMinMax` | boolean | Shows min/max labels at the arc ends. |
|
|
35
|
+
| `needleMode` | boolean | Renders a needle pointer instead of a filled arc. |
|
|
36
|
+
|
|
37
|
+
### Label Style
|
|
38
|
+
| Prop | Type | Options / Notes |
|
|
39
|
+
|------|------|-----------------|
|
|
40
|
+
| `labelFontSize` | expression | Font size of the center label. |
|
|
41
|
+
| `labelFontWeight` | select | `normal` · `300` · `400` · `500` · `600` · `700` · `800` |
|
|
42
|
+
| `labelColor` | expression | Label text color. |
|
|
43
|
+
|
|
44
|
+
### Sub-label Style
|
|
45
|
+
| Prop | Type | Options / Notes |
|
|
46
|
+
|------|------|-----------------|
|
|
47
|
+
| `sublabelFontSize` | expression | Sub-label font size. |
|
|
48
|
+
| `sublabelFontWeight` | select | `300` · `400` · `500` · `600` · `700` · `800` |
|
|
49
|
+
| `sublabelColor` | expression | Sub-label text color. |
|
|
50
|
+
|
|
51
|
+
### Thresholds
|
|
52
|
+
| Prop | Type | Notes |
|
|
53
|
+
|------|------|-------|
|
|
54
|
+
| `thresholds` | thresholds-editor | Maps value ranges to arc colors. E.g. `< 50` → `success.main`, `< 75` → `warning.main`, `>= 75` → `error.main`. |
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Use Cases
|
|
59
|
+
|
|
60
|
+
**When to use:**
|
|
61
|
+
- CPU/memory usage visualization (0–100%).
|
|
62
|
+
- Temperature, pressure, speed gauges.
|
|
63
|
+
- Score or health indicator.
|
|
64
|
+
- Any value between a known min and max that benefits from a visual dial.
|
|
65
|
+
|
|
66
|
+
**When NOT to use:**
|
|
67
|
+
- Simple numeric value → use `kpi-metric`.
|
|
68
|
+
- Progress toward a goal with a target line → use `kpi-bullet`.
|
|
69
|
+
- Horizontal progress → use `progress-line` or `kpi-bullet`.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Schema Examples
|
|
74
|
+
|
|
75
|
+
### CPU usage gauge
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"type": "kpi-gauge",
|
|
79
|
+
"props": {
|
|
80
|
+
"valueKey": "data.cpuUsage",
|
|
81
|
+
"min": 0,
|
|
82
|
+
"max": 100,
|
|
83
|
+
"label": "CPU Usage",
|
|
84
|
+
"format": "number",
|
|
85
|
+
"suffix": "%",
|
|
86
|
+
"size": "180",
|
|
87
|
+
"strokeWidth": "14",
|
|
88
|
+
"showValue": true,
|
|
89
|
+
"showMinMax": true,
|
|
90
|
+
"trackColor": "#e0e0e0",
|
|
91
|
+
"thresholds": [
|
|
92
|
+
{ "operator": "<", "value": 60, "color": "#4caf50" },
|
|
93
|
+
{ "operator": "<", "value": 80, "color": "#ff9800" },
|
|
94
|
+
{ "operator": ">=", "value": 80, "color": "#f44336" }
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Temperature gauge with needle
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"type": "kpi-gauge",
|
|
104
|
+
"props": {
|
|
105
|
+
"valueKey": "data.temperature",
|
|
106
|
+
"min": 0,
|
|
107
|
+
"max": 50,
|
|
108
|
+
"label": "Temperature",
|
|
109
|
+
"sublabel": "°Celsius",
|
|
110
|
+
"format": "number",
|
|
111
|
+
"decimals": 1,
|
|
112
|
+
"size": "200",
|
|
113
|
+
"strokeWidth": "10",
|
|
114
|
+
"needleMode": true,
|
|
115
|
+
"showValue": true,
|
|
116
|
+
"color": "primary.main",
|
|
117
|
+
"trackColor": "#f5f5f5"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Satisfaction score
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"type": "kpi-gauge",
|
|
126
|
+
"props": {
|
|
127
|
+
"valueKey": "data.npsScore",
|
|
128
|
+
"min": 0,
|
|
129
|
+
"max": 10,
|
|
130
|
+
"label": "NPS Score",
|
|
131
|
+
"format": "number",
|
|
132
|
+
"decimals": 1,
|
|
133
|
+
"size": "160",
|
|
134
|
+
"strokeWidth": "12",
|
|
135
|
+
"showValue": true,
|
|
136
|
+
"thresholds": [
|
|
137
|
+
{ "operator": "<", "value": 7, "color": "error.main" },
|
|
138
|
+
{ "operator": "<", "value": 9, "color": "warning.main" },
|
|
139
|
+
{ "operator": ">=", "value": 9, "color": "success.main" }
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Component: kpi-bulletChart
|
|
2
|
+
|
|
3
|
+
A horizontal bullet chart showing an actual value vs a target, with an optional "good range" band. Based on Stephen Few's bullet graph design.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
### Data
|
|
10
|
+
| Prop | Type | Options / Notes |
|
|
11
|
+
|------|------|-----------------|
|
|
12
|
+
| `valueKey` | expression | Data key for the actual (performance) value. E.g. `"revenue"`. |
|
|
13
|
+
| `targetKey` | expression | Data key for the target/benchmark value. E.g. `"revenueTarget"`. |
|
|
14
|
+
| `min` | expression | Scale minimum, e.g. `0`. |
|
|
15
|
+
| `max` | expression | Scale maximum, e.g. `150000`. |
|
|
16
|
+
| `label` | expression | Label shown to the left of the bar. |
|
|
17
|
+
| `sublabel` | expression | Secondary label below the main label. |
|
|
18
|
+
|
|
19
|
+
### Format
|
|
20
|
+
| Prop | Type | Options / Notes |
|
|
21
|
+
|------|------|-----------------|
|
|
22
|
+
| `format` | select | `number` · `currency` · `percent` · `compact` |
|
|
23
|
+
| `prefix` | expression | Text/symbol before values. |
|
|
24
|
+
| `suffix` | expression | Text/symbol after values. |
|
|
25
|
+
|
|
26
|
+
### Appearance
|
|
27
|
+
| Prop | Type | Options / Notes |
|
|
28
|
+
|------|------|-----------------|
|
|
29
|
+
| `height` | expression | Bar height in px, e.g. `"20"`, `"28"`. |
|
|
30
|
+
| `colorSchema` | color-schema | Color palette for the actual bar. Overridden by threshold colors when they match. |
|
|
31
|
+
| `actualColor` | expression | Explicit color for the actual value bar. Overrides color schema base color. |
|
|
32
|
+
| `targetColor` | expression | Color of the target marker line, e.g. `"#333333"`. |
|
|
33
|
+
| `trackColor` | expression | Background track color. Default: MUI `action.hover`. |
|
|
34
|
+
| `goodColor` | expression | Color of the "good range" band. |
|
|
35
|
+
| `goodFrom` | expression | Start of the good range (value or data expression). |
|
|
36
|
+
| `goodTo` | expression | End of the good range. |
|
|
37
|
+
| `showTarget` | boolean | Shows the vertical target marker line. Default: `true`. |
|
|
38
|
+
| `showLabels` | boolean | Shows min/max value labels at the scale ends. |
|
|
39
|
+
|
|
40
|
+
### Thresholds
|
|
41
|
+
| Prop | Type | Notes |
|
|
42
|
+
|------|------|-------|
|
|
43
|
+
| `thresholds` | thresholds-editor | Conditional bar colors based on actual value. |
|
|
44
|
+
|
|
45
|
+
### Label Style
|
|
46
|
+
| Prop | Type | Options / Notes |
|
|
47
|
+
|------|------|-----------------|
|
|
48
|
+
| `labelFontSize` | expression | Font size of the label. |
|
|
49
|
+
| `labelFontWeight` | select | `300` · `400` · `500` · `600` · `700` · `800` |
|
|
50
|
+
| `labelColor` | expression | Label text color. |
|
|
51
|
+
|
|
52
|
+
### Sub-label Style
|
|
53
|
+
| Prop | Type | Options / Notes |
|
|
54
|
+
|------|------|-----------------|
|
|
55
|
+
| `sublabelFontSize` | expression | Sub-label font size. |
|
|
56
|
+
| `sublabelFontWeight` | select | `300` · `400` · `500` · `600` · `700` · `800` |
|
|
57
|
+
| `sublabelColor` | expression | Sub-label text color. |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Use Cases
|
|
62
|
+
|
|
63
|
+
**When to use:**
|
|
64
|
+
- Sales performance vs quota.
|
|
65
|
+
- Budget actual vs budget target.
|
|
66
|
+
- Any metric with an actual value compared to a reference target.
|
|
67
|
+
- When you need to show "acceptable range" (goodFrom/goodTo) alongside the actual.
|
|
68
|
+
|
|
69
|
+
**When NOT to use:**
|
|
70
|
+
- Simple gauge without a target → use `kpi-gauge`.
|
|
71
|
+
- Color-only visualization → use `kpi-color-scale`.
|
|
72
|
+
- Just progress without a target → use `progress-line`.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Schema Examples
|
|
77
|
+
|
|
78
|
+
### Sales vs quota
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"type": "kpi-bulletChart",
|
|
82
|
+
"props": {
|
|
83
|
+
"valueKey": "data.salesActual",
|
|
84
|
+
"targetKey": "data.salesTarget",
|
|
85
|
+
"min": 0,
|
|
86
|
+
"max": 200000,
|
|
87
|
+
"label": "Sales",
|
|
88
|
+
"sublabel": "vs Target",
|
|
89
|
+
"format": "currency",
|
|
90
|
+
"prefix": "$",
|
|
91
|
+
"height": "24",
|
|
92
|
+
"showTarget": true,
|
|
93
|
+
"showLabels": true,
|
|
94
|
+
"targetColor": "#333333",
|
|
95
|
+
"goodFrom": 140000,
|
|
96
|
+
"goodTo": 180000,
|
|
97
|
+
"goodColor": "rgba(76,175,80,0.2)",
|
|
98
|
+
"thresholds": [
|
|
99
|
+
{ "operator": ">=", "value": "data.salesTarget", "color": "success.main" },
|
|
100
|
+
{ "operator": "<", "value": "data.salesTarget", "color": "warning.main" }
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Budget tracker (compact)
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"type": "kpi-bulletChart",
|
|
110
|
+
"props": {
|
|
111
|
+
"valueKey": "data.spent",
|
|
112
|
+
"targetKey": "data.budget",
|
|
113
|
+
"min": 0,
|
|
114
|
+
"max": "data.budget * 1.2",
|
|
115
|
+
"label": "Budget",
|
|
116
|
+
"format": "compact",
|
|
117
|
+
"height": "16",
|
|
118
|
+
"showTarget": true,
|
|
119
|
+
"thresholds": [
|
|
120
|
+
{ "operator": "<=", "value": "data.budget * 0.8", "color": "success.main" },
|
|
121
|
+
{ "operator": "<=", "value": "data.budget", "color": "warning.main" },
|
|
122
|
+
{ "operator": ">", "value": "data.budget", "color": "error.main" }
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Component: kpi-colorScale
|
|
2
|
+
|
|
3
|
+
A horizontal color-scale bar that positions one or more value markers on a gradient or stepped color ramp. Visualizes where a value falls within a range.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
### Data
|
|
10
|
+
| Prop | Type | Options / Notes |
|
|
11
|
+
|------|------|-----------------|
|
|
12
|
+
| `valueKey` | expression | Data key or expression for the primary marker value. E.g. `"riskScore"`. |
|
|
13
|
+
| `min` | expression | Minimum of the scale range. |
|
|
14
|
+
| `max` | expression | Maximum of the scale range. |
|
|
15
|
+
| `label` | expression | Label shown below or beside the scale. |
|
|
16
|
+
|
|
17
|
+
### Format
|
|
18
|
+
| Prop | Type | Options / Notes |
|
|
19
|
+
|------|------|-----------------|
|
|
20
|
+
| `format` | select | `number` · `currency` · `percent` · `compact` |
|
|
21
|
+
| `prefix` | expression | Prefix for marker label. |
|
|
22
|
+
| `suffix` | expression | Suffix for marker label. |
|
|
23
|
+
|
|
24
|
+
### Track Coloring
|
|
25
|
+
| Prop | Type | Options / Notes |
|
|
26
|
+
|------|------|-----------------|
|
|
27
|
+
| `scaleMode` | select | `gradient` — smooth color ramp between color schema stops. `steps` — discrete colored zones based on thresholds. |
|
|
28
|
+
| `colorSchema` | color-schema | Color palette defining the gradient stops or zone colors. |
|
|
29
|
+
| `segments` | expression | Number of gradient stops in gradient mode. Default: `5`. |
|
|
30
|
+
|
|
31
|
+
### Thresholds (Steps Mode)
|
|
32
|
+
| Prop | Type | Notes |
|
|
33
|
+
|------|------|-------|
|
|
34
|
+
| `thresholds` | thresholds-editor | Define zone breakpoints. Each threshold value becomes a zone boundary. Threshold colors take priority over color schema in steps mode. |
|
|
35
|
+
|
|
36
|
+
### Appearance
|
|
37
|
+
| Prop | Type | Options / Notes |
|
|
38
|
+
|------|------|-----------------|
|
|
39
|
+
| `height` | expression | Track bar height in px, e.g. `"20"`. |
|
|
40
|
+
| `borderRadius` | expression | Track corner radius, e.g. `"4px"`. |
|
|
41
|
+
| `showLabels` | boolean | Shows min/max value labels at the track ends. |
|
|
42
|
+
|
|
43
|
+
### Label Style
|
|
44
|
+
| Prop | Type | Options / Notes |
|
|
45
|
+
|------|------|-----------------|
|
|
46
|
+
| `labelFontSize` | expression | Label font size. |
|
|
47
|
+
| `labelFontWeight` | select | `300` · `400` · `500` · `600` · `700` · `800` |
|
|
48
|
+
| `labelColor` | expression | Label text color. |
|
|
49
|
+
|
|
50
|
+
### Primary Marker
|
|
51
|
+
| Prop | Type | Options / Notes |
|
|
52
|
+
|------|------|-----------------|
|
|
53
|
+
| `showMarker` | boolean | Shows the primary value marker (triangle/dot) on the scale. |
|
|
54
|
+
| `markerColor` | expression | Marker color. Default: `"#333"`. |
|
|
55
|
+
|
|
56
|
+
### Additional Markers
|
|
57
|
+
| Prop | Type | Notes |
|
|
58
|
+
|------|------|-------|
|
|
59
|
+
| `markers` | markers-editor | Extra markers with their own `valueKey`, color, shape, and label. E.g. a "target" marker alongside the primary. |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Use Cases
|
|
64
|
+
|
|
65
|
+
**When to use:**
|
|
66
|
+
- Risk scores, quality scores, health indices that fall on a color spectrum.
|
|
67
|
+
- Temperature zones: cold/normal/hot.
|
|
68
|
+
- Sentiment scores: negative/neutral/positive.
|
|
69
|
+
- Visualizing where a value sits within color-coded ranges.
|
|
70
|
+
- Comparing multiple values on the same scale (primary + additional markers).
|
|
71
|
+
|
|
72
|
+
**When NOT to use:**
|
|
73
|
+
- Progress toward a single target → use `kpi-bullet`.
|
|
74
|
+
- Simple percentage → use `kpi-gauge` or `progress-line`.
|
|
75
|
+
- Categorical status → use `kpi-badge`.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Schema Examples
|
|
80
|
+
|
|
81
|
+
### Gradient risk score
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"type": "kpi-colorScale",
|
|
85
|
+
"props": {
|
|
86
|
+
"valueKey": "data.riskScore",
|
|
87
|
+
"min": 0,
|
|
88
|
+
"max": 100,
|
|
89
|
+
"label": "Risk Score",
|
|
90
|
+
"format": "number",
|
|
91
|
+
"scaleMode": "gradient",
|
|
92
|
+
"colorSchema": "RdYlGn",
|
|
93
|
+
"height": "24",
|
|
94
|
+
"borderRadius": "4px",
|
|
95
|
+
"showLabels": true,
|
|
96
|
+
"showMarker": true,
|
|
97
|
+
"markerColor": "#333333"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Stepped zones with thresholds
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"type": "kpi-colorScale",
|
|
106
|
+
"props": {
|
|
107
|
+
"valueKey": "data.qualityScore",
|
|
108
|
+
"min": 0,
|
|
109
|
+
"max": 100,
|
|
110
|
+
"label": "Quality",
|
|
111
|
+
"format": "number",
|
|
112
|
+
"scaleMode": "steps",
|
|
113
|
+
"height": "20",
|
|
114
|
+
"showMarker": true,
|
|
115
|
+
"showLabels": true,
|
|
116
|
+
"thresholds": [
|
|
117
|
+
{ "operator": "<", "value": 40, "color": "#f44336" },
|
|
118
|
+
{ "operator": "<", "value": 70, "color": "#ff9800" },
|
|
119
|
+
{ "operator": ">=", "value": 70, "color": "#4caf50" }
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### With primary + target marker
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"type": "kpi-colorScale",
|
|
129
|
+
"props": {
|
|
130
|
+
"valueKey": "data.actual",
|
|
131
|
+
"min": 0,
|
|
132
|
+
"max": 200,
|
|
133
|
+
"label": "Performance",
|
|
134
|
+
"scaleMode": "gradient",
|
|
135
|
+
"height": "16",
|
|
136
|
+
"showMarker": true,
|
|
137
|
+
"markerColor": "#1976d2",
|
|
138
|
+
"markers": [
|
|
139
|
+
{ "valueKey": "data.target", "color": "#d32f2f", "label": "Target" }
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|