@kong-ui-public/dashboard-renderer 8.12.15 → 8.12.16
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 +20 -16
- package/dist/{GeoMapRenderer-azbs6_67.js → GeoMapRenderer-CDCvLcNv.js} +1 -1
- package/dist/dashboard-renderer.es.js +1 -1
- package/dist/dashboard-renderer.umd.js +5 -5
- package/dist/{index-B-sUo98c.js → index-DxrhvuyE.js} +1171 -1195
- package/dist/style.css +1 -1
- package/dist/types/components/DashboardRenderer.vue.d.ts +18 -44
- package/dist/types/components/DashboardRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/DashboardTile.vue.d.ts +18 -12
- package/dist/types/components/DashboardTile.vue.d.ts.map +1 -1
- package/dist/types/components/DashboardTilePreview.vue.d.ts.map +1 -1
- package/dist/types/composables/useContextLinks.d.ts +4 -4
- package/dist/types/composables/useContextLinks.d.ts.map +1 -1
- package/dist/types/utils/configure-definition.d.ts.map +1 -1
- package/dist/types/utils/duplicate-tile.d.ts +1 -9
- package/dist/types/utils/duplicate-tile.d.ts.map +1 -1
- package/dist/types/utils/tile-definition.d.ts +3 -0
- package/dist/types/utils/tile-definition.d.ts.map +1 -0
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Render Analytics charts on a page from a JSON definition.
|
|
|
16
16
|
- [Tile Definition](#tile-definition)
|
|
17
17
|
- [Chart Options](#chart-options)
|
|
18
18
|
- [Chart Types](#chart-types)
|
|
19
|
-
- [Table
|
|
19
|
+
- [Table Chart Configuration](#table-chart-configuration)
|
|
20
20
|
- [Common Chart Properties](#common-chart-properties)
|
|
21
21
|
- [Query Configuration](#query-configuration)
|
|
22
22
|
- [Time Range Configuration](#time-range-configuration)
|
|
@@ -29,7 +29,7 @@ Render Analytics charts on a page from a JSON definition.
|
|
|
29
29
|
- A plugin providing an `AnalyticsBridge` must be installed in the root of the application.
|
|
30
30
|
- This plugin must `provide` the necessary methods to adhere to the [AnalyticsBridge](https://github.com/Kong/public-ui-components/blob/main/packages/analytics/analytics-utilities/src/types/query-bridge.ts) interface defined in `@kong-ui-public/analytics-utilities`.
|
|
31
31
|
- The plugin's query method is in charge of passing the query to the correct API for the host app's environment.
|
|
32
|
-
- For
|
|
32
|
+
- For table chart tiles, the plugin must provide `tabularQueryFn`; the renderer passes a datasource-aware tabular query to that function and renders the returned records.
|
|
33
33
|
- See the sandbox plugin [sandbox-query-provider.ts](https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/sandbox/sandbox-query-provider.ts) for an example that simply returns static data rather than consuming an API.
|
|
34
34
|
- The host application must supply peer dependencies for:
|
|
35
35
|
- `@kong-ui-public/analytics-chart`
|
|
@@ -437,7 +437,7 @@ Configuration for individual dashboard tiles.
|
|
|
437
437
|
|
|
438
438
|
```typescript
|
|
439
439
|
interface TileConfig {
|
|
440
|
-
type: 'chart'
|
|
440
|
+
type: 'chart' // The top-level tile kind
|
|
441
441
|
definition: TileDefinition // The tile's renderer-specific definition
|
|
442
442
|
layout: TileLayout // The tile's position and size in the grid
|
|
443
443
|
id?: string // Optional unique identifier (required for editable dashboards)
|
|
@@ -448,15 +448,15 @@ interface TileConfig {
|
|
|
448
448
|
Configuration for the renderer and query within a tile.
|
|
449
449
|
|
|
450
450
|
```typescript
|
|
451
|
-
type TileDefinition = ChartTileDefinition |
|
|
451
|
+
type TileDefinition = ChartTileDefinition | TableChartTileDefinition
|
|
452
452
|
|
|
453
453
|
interface ChartTileDefinition {
|
|
454
|
-
chart: ChartOptions // Configuration for
|
|
454
|
+
chart: ChartOptions // Configuration for a non-table chart type and options
|
|
455
455
|
query: ValidDashboardChartQuery // Configuration for the chart data query
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
interface
|
|
459
|
-
|
|
458
|
+
interface TableChartTileDefinition {
|
|
459
|
+
chart: TableChartOptions // Configuration for the table chart
|
|
460
460
|
query: PlatformTabularQuery & { datasource: 'platform' } // Configuration for the platform tabular query
|
|
461
461
|
}
|
|
462
462
|
```
|
|
@@ -489,13 +489,14 @@ The following chart types are supported:
|
|
|
489
489
|
|
|
490
490
|
Each chart type has its own configuration schema with specific options.
|
|
491
491
|
|
|
492
|
-
### Table
|
|
492
|
+
### Table Chart Configuration
|
|
493
493
|
|
|
494
|
-
Table tiles
|
|
494
|
+
Table visuals are chart tiles with `type: 'chart'` on the tile itself and `definition.chart.type: 'table'`. Their `definition.query` uses the platform tabular query shape and renders through `TableDataGridRenderer`.
|
|
495
495
|
|
|
496
496
|
```typescript
|
|
497
|
-
interface
|
|
498
|
-
|
|
497
|
+
interface TableChartOptions {
|
|
498
|
+
type: 'table'
|
|
499
|
+
chart_title?: string
|
|
499
500
|
}
|
|
500
501
|
|
|
501
502
|
interface PlatformTabularQuery {
|
|
@@ -507,18 +508,21 @@ interface PlatformTabularQuery {
|
|
|
507
508
|
}
|
|
508
509
|
```
|
|
509
510
|
|
|
510
|
-
`definition.query.columns` controls the visible table columns. If columns are omitted, the renderer can fall back to response `meta.columns` after the first tabular response. `definition.
|
|
511
|
+
`definition.query.columns` controls the visible table columns. If columns are omitted, the renderer can fall back to response `meta.columns` after the first tabular response. `definition.chart.chart_title` controls the tile title.
|
|
511
512
|
|
|
512
513
|
The dashboard config query includes `datasource: 'platform'`. The host application's `AnalyticsBridge.tabularQueryFn` receives a datasource-aware tabular query, currently `{ datasource: 'platform', query: { entity, columns, filters, page_size, cursor } }`.
|
|
513
514
|
|
|
514
515
|
The renderer replaces raw record values with display labels when the tabular response includes a matching `meta.display[column][value].name`. Missing display entries and `null` values are rendered unchanged.
|
|
515
516
|
|
|
517
|
+
Table charts do not expose CSV export or API Requests links. They may expose Explore links when the host application provides the Explore context-link bridge.
|
|
518
|
+
|
|
516
519
|
```typescript
|
|
517
520
|
const tableTile: TileConfig = {
|
|
518
|
-
type: '
|
|
521
|
+
type: 'chart',
|
|
519
522
|
definition: {
|
|
520
|
-
|
|
521
|
-
|
|
523
|
+
chart: {
|
|
524
|
+
type: 'table',
|
|
525
|
+
chart_title: 'Platform routes',
|
|
522
526
|
},
|
|
523
527
|
query: {
|
|
524
528
|
datasource: 'platform',
|
|
@@ -575,7 +579,7 @@ Chart query fields include:
|
|
|
575
579
|
- `granularity`: Time bucket size for temporal queries
|
|
576
580
|
- `limit`: Number of results to return
|
|
577
581
|
|
|
578
|
-
Table
|
|
582
|
+
Table chart queries use the platform tabular query shape:
|
|
579
583
|
- `datasource`: Must be `platform`
|
|
580
584
|
- `entity`: Entity collection to query, such as `route`
|
|
581
585
|
- `columns`: Ordered table columns to request and render
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as q, ref as C, computed as c, openBlock as x, createBlock as g, withCtx as _, createVNode as E, unref as M } from "vue";
|
|
2
|
-
import { _ as O } from "./index-
|
|
2
|
+
import { _ as O } from "./index-DxrhvuyE.js";
|
|
3
3
|
import { exploreResultToCountryMetrics as b, AnalyticsGeoMap as k } from "@kong-ui-public/analytics-geo-map";
|
|
4
4
|
import { COUNTRIES as B } from "@kong-ui-public/analytics-utilities";
|
|
5
5
|
const R = /* @__PURE__ */ q({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as a, D as R, a as T, b as s, c as L, d as I, E as e, F as D, e as N, G as S, I as r, T as A, f as F } from "./index-
|
|
1
|
+
import { C as a, D as R, a as T, b as s, c as L, d as I, E as e, F as D, e as N, G as S, I as r, T as A, f as F } from "./index-DxrhvuyE.js";
|
|
2
2
|
export {
|
|
3
3
|
a as CP_ID_TOKEN,
|
|
4
4
|
R as DASHBOARD_COLS,
|