@kong-ui-public/dashboard-renderer 10.3.12 → 10.3.13-pr.4032.bd87801fc.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 (2) hide show
  1. package/README.md +53 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  Render Analytics charts on a page from a JSON definition.
4
4
 
5
+ - [Consumer entry points](#consumer-entry-points)
5
6
  - [Requirements](#requirements)
6
7
  - [Usage](#usage)
7
8
  - [Props](#props)
@@ -24,6 +25,58 @@ Render Analytics charts on a page from a JSON definition.
24
25
  - [Layout Configuration](#layout-configuration)
25
26
  - [Usage Example](#usage-example)
26
27
 
28
+ ## Consumer entry points
29
+
30
+ Use `DashboardRenderer` for a dashboard or layout of analytics tiles. Use
31
+ `DashboardTilePreview` for a single embedded tile, including a tile inside a
32
+ custom card. Both use the host's `AnalyticsBridge` and own query execution,
33
+ readiness, context filters, loading/error states, and rendering. Custom page
34
+ layout does not require direct `AnalyticsChart` use.
35
+
36
+ Application code must use these entry points instead of importing or rendering
37
+ `AnalyticsChart` directly. A direct use is permitted only for a required
38
+ capability neither entry point supports. First investigate extending the
39
+ shared renderer; document the concrete blocker and smallest necessary
40
+ exception in the PR. This restriction does not apply to the renderer's internal
41
+ implementation or tests/examples of the chart primitive itself.
42
+
43
+ For one tile, after installing the bridge described in [Requirements](#requirements):
44
+
45
+ ```vue
46
+ <template>
47
+ <DashboardTilePreview :context="context" :definition="definition" />
48
+ </template>
49
+
50
+ <script setup lang="ts">
51
+ import { DashboardTilePreview } from '@kong-ui-public/dashboard-renderer'
52
+ import type { DashboardRendererContext } from '@kong-ui-public/dashboard-renderer'
53
+ import type { ChartTileDefinition } from '@kong-ui-public/analytics-utilities'
54
+
55
+ import '@kong-ui-public/analytics-chart/dist/style.css'
56
+ import '@kong-ui-public/analytics-metric-provider/dist/style.css'
57
+ import '@kong-ui-public/dashboard-renderer/dist/style.css'
58
+
59
+ const context: DashboardRendererContext = {
60
+ filters: [],
61
+ timeSpec: { type: 'relative', time_range: '7d' },
62
+ }
63
+ const definition: ChartTileDefinition = {
64
+ chart: { type: 'timeseries_bar' },
65
+ query: {
66
+ datasource: 'api_usage',
67
+ metrics: ['request_count'],
68
+ dimensions: ['time'],
69
+ granularity: 'daily',
70
+ },
71
+ }
72
+ </script>
73
+ ```
74
+
75
+ For a metric selector, set the tile query's `metrics` to the selected metric.
76
+ `AnalyticsChart.activeMetric` only selects among grouped multi-metric time
77
+ series; ungrouped results keep all queried metrics. Do not combine requests,
78
+ tokens, latency, and cost on a single axis and rely on that prop to select one.
79
+
27
80
  ## Requirements
28
81
 
29
82
  - `vue` must be initialized in the host application
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/dashboard-renderer",
3
- "version": "10.3.12",
3
+ "version": "10.3.13-pr.4032.bd87801fc.0",
4
4
  "type": "module",
5
5
  "main": "./dist/dashboard-renderer.umd.js",
6
6
  "module": "./dist/dashboard-renderer.es.js",
@@ -21,7 +21,7 @@
21
21
  "access": "public"
22
22
  },
23
23
  "devDependencies": {
24
- "@kong-ui-public/analytics-chart": "^13.2.9",
24
+ "@kong-ui-public/analytics-chart": "^13.2.10-pr.4032.bd87801fc.0",
25
25
  "@kong-ui-public/analytics-config-store": "^2.0.12",
26
26
  "@kong-ui-public/analytics-geo-map": "^1.10.18",
27
27
  "@kong-ui-public/analytics-metric-provider": "^11.7.20",
@@ -62,7 +62,7 @@
62
62
  "errorLimit": "2MB"
63
63
  },
64
64
  "peerDependencies": {
65
- "@kong-ui-public/analytics-chart": "^13.2.9",
65
+ "@kong-ui-public/analytics-chart": "^13.2.10-pr.4032.bd87801fc.0",
66
66
  "@kong-ui-public/analytics-config-store": "^2.0.12",
67
67
  "@kong-ui-public/analytics-geo-map": "^1.10.18",
68
68
  "@kong-ui-public/analytics-metric-provider": "^11.7.20",