@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 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 Tile Configuration](#table-tile-configuration)
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 `table` tiles, the plugin must provide `tabularQueryFn`; the renderer passes a datasource-aware tabular query to that function and renders the returned records.
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' | 'table' // The top-level tile kind
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 | TableTileDefinition
451
+ type TileDefinition = ChartTileDefinition | TableChartTileDefinition
452
452
 
453
453
  interface ChartTileDefinition {
454
- chart: ChartOptions // Configuration for the chart type and options
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 TableTileDefinition {
459
- config: TableTileConfig // Configuration for the table tile
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 Tile Configuration
492
+ ### Table Chart Configuration
493
493
 
494
- Table tiles use `type: 'table'` on the tile itself. They are not chart tiles, so their definition uses `config` instead of `chart`.
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 TableTileConfig {
498
- title?: string
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.config.title` controls the tile title.
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: 'table',
521
+ type: 'chart',
519
522
  definition: {
520
- config: {
521
- title: 'Platform routes',
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 tile queries use the platform tabular query shape:
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-B-sUo98c.js";
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-B-sUo98c.js";
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,