@kong-ui-public/dashboard-renderer 10.3.13 → 10.4.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 +53 -0
- package/dist/{GeoMapRenderer-BW9o7xWd.js → GeoMapRenderer-ZCK9njhP.js} +1 -1
- package/dist/dashboard-renderer.es.js +1 -1
- package/dist/dashboard-renderer.umd.js +13 -13
- package/dist/{index-Bsi1y-gv.js → index-DgVfcThf.js} +2530 -2504
- package/dist/style.css +1 -1
- package/dist/types/components/DashboardRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/DashboardTile.vue.d.ts.map +1 -1
- package/package.json +5 -5
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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as v, ref as p, computed as o, openBlock as q, createBlock as C, withCtx as g, createVNode as x, unref as _ } from "vue";
|
|
2
|
-
import { _ as M } from "./index-
|
|
2
|
+
import { _ as M } from "./index-DgVfcThf.js";
|
|
3
3
|
import { exploreResultToCountryMetrics as E, AnalyticsGeoMap as O } from "@kong-ui-public/analytics-geo-map";
|
|
4
4
|
import { COUNTRIES as R } from "@kong-ui-public/analytics-utilities";
|
|
5
5
|
const U = /* @__PURE__ */ v({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as s, a as R, b as _, D as T, c as e, d as i, e as D, f as I, E as L, F as N, g as O, I as S, h as o, T as r, i as A, j as C, k as n, l as F, m } from "./index-
|
|
1
|
+
import { C as s, a as R, b as _, D as T, c as e, d as i, e as D, f as I, E as L, F as N, g as O, I as S, h as o, T as r, i as A, j as C, k as n, l as F, m } from "./index-DgVfcThf.js";
|
|
2
2
|
export {
|
|
3
3
|
s as CELLS_PER_ROW,
|
|
4
4
|
R as CP_ID_TOKEN,
|