@kong-ui-public/dashboard-renderer 0.1.14 → 0.2.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 +46 -15
- package/dist/dashboard-renderer.es.js +555 -330
- package/dist/dashboard-renderer.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/{AnalyticsChartRenderer.vue.d.ts → BarChartRenderer.vue.d.ts} +17 -1
- package/dist/types/components/BarChartRenderer.vue.d.ts.map +1 -0
- package/dist/types/components/DashboardRenderer.vue.d.ts +84 -28
- package/dist/types/components/DashboardRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/DashboardTile.vue.d.ts +40 -5
- package/dist/types/components/DashboardTile.vue.d.ts.map +1 -1
- package/dist/types/components/SimpleChartRenderer.vue.d.ts +8 -0
- package/dist/types/components/SimpleChartRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/TimeseriesChartRenderer.vue.d.ts +54 -0
- package/dist/types/components/TimeseriesChartRenderer.vue.d.ts.map +1 -0
- package/dist/types/components/layout/GridLayout.vue.d.ts +63 -0
- package/dist/types/components/layout/GridLayout.vue.d.ts.map +1 -0
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/dashboard-renderer-types.d.ts +399 -49
- package/dist/types/types/dashboard-renderer-types.d.ts.map +1 -1
- package/dist/types/types/grid-layout-types.d.ts +28 -0
- package/dist/types/types/grid-layout-types.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/types/components/AnalyticsChartRenderer.vue.d.ts.map +0 -1
- package/dist/types/mock-data.d.ts +0 -25
- package/dist/types/mock-data.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -22,15 +22,15 @@ Render Analytics charts on a page from a JSON definition.
|
|
|
22
22
|
|
|
23
23
|
This component only takes two properties:
|
|
24
24
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
25
|
+
- [context](https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/src/types/dashboard-renderer-types.ts) : The time range that the dashboard should query and any additional filters that should be applied.
|
|
26
|
+
- [config](https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/src/types/dashboard-renderer-types.ts) : The dashboard config and layout.
|
|
27
27
|
|
|
28
28
|
### Example
|
|
29
29
|
|
|
30
30
|
```vue
|
|
31
31
|
<DashboardRenderer
|
|
32
32
|
:context="context"
|
|
33
|
-
:
|
|
33
|
+
:config="config"
|
|
34
34
|
/>
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -45,24 +45,55 @@ const context: DashboardRendererContext = {
|
|
|
45
45
|
},
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
const
|
|
48
|
+
const config: DashboardConfig = {
|
|
49
|
+
// 5 x 5 grid
|
|
50
|
+
gridSize: {
|
|
51
|
+
cols: 5,
|
|
52
|
+
rows: 5,
|
|
53
|
+
}
|
|
49
54
|
tiles: [
|
|
50
55
|
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
definition: {
|
|
57
|
+
chart: {
|
|
58
|
+
type: ChartTypes.HorizontalBar,
|
|
59
|
+
},
|
|
60
|
+
query: {},
|
|
54
61
|
},
|
|
55
|
-
|
|
62
|
+
layout: {
|
|
63
|
+
// Position at column 0, row 0
|
|
64
|
+
position: {
|
|
65
|
+
col: 1,
|
|
66
|
+
row: 1,
|
|
67
|
+
},
|
|
68
|
+
// Spans 3 columns and 2 rows
|
|
69
|
+
size: {
|
|
70
|
+
col: 3,
|
|
71
|
+
row: 2,
|
|
72
|
+
}
|
|
73
|
+
}
|
|
56
74
|
},
|
|
57
75
|
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
76
|
+
definition: {
|
|
77
|
+
chart: {
|
|
78
|
+
type: ChartTypes.Gauge,
|
|
79
|
+
metricDisplay: ChartMetricDisplay.Full,
|
|
80
|
+
reverseDataset: true,
|
|
81
|
+
numerator: 0,
|
|
82
|
+
},
|
|
83
|
+
query: {},
|
|
64
84
|
},
|
|
65
|
-
|
|
85
|
+
layout: {
|
|
86
|
+
// Position at column 0, row 2
|
|
87
|
+
position: {
|
|
88
|
+
col: 0,
|
|
89
|
+
row: 2,
|
|
90
|
+
},
|
|
91
|
+
// Spans 3 columns and 2 rows
|
|
92
|
+
size: {
|
|
93
|
+
col: 3,
|
|
94
|
+
row: 2,
|
|
95
|
+
}
|
|
96
|
+
}
|
|
66
97
|
},
|
|
67
98
|
],
|
|
68
99
|
}
|