@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.
Files changed (30) hide show
  1. package/README.md +46 -15
  2. package/dist/dashboard-renderer.es.js +555 -330
  3. package/dist/dashboard-renderer.umd.js +1 -1
  4. package/dist/style.css +1 -1
  5. package/dist/types/components/{AnalyticsChartRenderer.vue.d.ts → BarChartRenderer.vue.d.ts} +17 -1
  6. package/dist/types/components/BarChartRenderer.vue.d.ts.map +1 -0
  7. package/dist/types/components/DashboardRenderer.vue.d.ts +84 -28
  8. package/dist/types/components/DashboardRenderer.vue.d.ts.map +1 -1
  9. package/dist/types/components/DashboardTile.vue.d.ts +40 -5
  10. package/dist/types/components/DashboardTile.vue.d.ts.map +1 -1
  11. package/dist/types/components/SimpleChartRenderer.vue.d.ts +8 -0
  12. package/dist/types/components/SimpleChartRenderer.vue.d.ts.map +1 -1
  13. package/dist/types/components/TimeseriesChartRenderer.vue.d.ts +54 -0
  14. package/dist/types/components/TimeseriesChartRenderer.vue.d.ts.map +1 -0
  15. package/dist/types/components/layout/GridLayout.vue.d.ts +63 -0
  16. package/dist/types/components/layout/GridLayout.vue.d.ts.map +1 -0
  17. package/dist/types/constants.d.ts +2 -0
  18. package/dist/types/constants.d.ts.map +1 -0
  19. package/dist/types/index.d.ts +2 -1
  20. package/dist/types/index.d.ts.map +1 -1
  21. package/dist/types/types/dashboard-renderer-types.d.ts +399 -49
  22. package/dist/types/types/dashboard-renderer-types.d.ts.map +1 -1
  23. package/dist/types/types/grid-layout-types.d.ts +28 -0
  24. package/dist/types/types/grid-layout-types.d.ts.map +1 -0
  25. package/dist/types/types/index.d.ts +2 -0
  26. package/dist/types/types/index.d.ts.map +1 -1
  27. package/package.json +3 -3
  28. package/dist/types/components/AnalyticsChartRenderer.vue.d.ts.map +0 -1
  29. package/dist/types/mock-data.d.ts +0 -25
  30. 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
- - `context`: The time range that the dashboard should query and any additional filters that should be applied.
26
- - `definition`: The dashboard definition.
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
- :definition="definition"
33
+ :config="config"
34
34
  />
35
35
  ```
36
36
 
@@ -45,24 +45,55 @@ const context: DashboardRendererContext = {
45
45
  },
46
46
  }
47
47
 
48
- const definition: DashboardDefinition = {
48
+ const config: DashboardConfig = {
49
+ // 5 x 5 grid
50
+ gridSize: {
51
+ cols: 5,
52
+ rows: 5,
53
+ }
49
54
  tiles: [
50
55
  {
51
- title: 'Analytics chart',
52
- chart: {
53
- type: ChartTypes.HorizontalBar,
56
+ definition: {
57
+ chart: {
58
+ type: ChartTypes.HorizontalBar,
59
+ },
60
+ query: {},
54
61
  },
55
- query: {},
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
- title: 'Simple chart',
59
- chart: {
60
- type: ChartTypes.Gauge,
61
- metricDisplay: ChartMetricDisplay.Full,
62
- reverseDataset: true,
63
- numerator: 0,
76
+ definition: {
77
+ chart: {
78
+ type: ChartTypes.Gauge,
79
+ metricDisplay: ChartMetricDisplay.Full,
80
+ reverseDataset: true,
81
+ numerator: 0,
82
+ },
83
+ query: {},
64
84
  },
65
- query: {},
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
  }