@aquera/nile-visualization 0.5.0 → 0.6.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 (38) hide show
  1. package/dist/src/index.d.ts +8 -2
  2. package/dist/src/index.js +3 -0
  3. package/dist/src/internal/dashboard-adapters.d.ts +13 -0
  4. package/dist/src/internal/dashboard-adapters.js +123 -0
  5. package/dist/src/internal/highcharts-provider.js +27 -0
  6. package/dist/src/internal/types/chart-config.type.d.ts +2 -1
  7. package/dist/src/internal/types/chart-map-config.type.d.ts +29 -0
  8. package/dist/src/internal/types/chart-map-config.type.js +2 -0
  9. package/dist/src/internal/types/dashboard-config.type.d.ts +8 -0
  10. package/dist/src/internal/types/dashboard-config.type.js +2 -0
  11. package/dist/src/internal/types/index.d.ts +1 -0
  12. package/dist/src/internal/types/widget-config.type.d.ts +23 -0
  13. package/dist/src/internal/types/widget-config.type.js +2 -0
  14. package/dist/src/internal/types/widget-layout.type.d.ts +11 -0
  15. package/dist/src/internal/types/widget-layout.type.js +2 -0
  16. package/dist/src/nile-chart/index.d.ts +2 -2
  17. package/dist/src/nile-chart/nile-chart-config.d.ts +119 -30
  18. package/dist/src/nile-chart/nile-chart.d.ts +11 -0
  19. package/dist/src/nile-chart/nile-chart.js +33 -0
  20. package/dist/src/nile-dashboard-viewer/index.d.ts +2 -0
  21. package/dist/src/nile-dashboard-viewer/index.js +2 -0
  22. package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.css.d.ts +1 -0
  23. package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.css.js +29 -0
  24. package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.d.ts +43 -0
  25. package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.js +84 -0
  26. package/dist/src/nile-map-chart/index.d.ts +2 -0
  27. package/dist/src/nile-map-chart/index.js +2 -0
  28. package/dist/src/nile-map-chart/nile-map-chart.css.d.ts +1 -0
  29. package/dist/src/nile-map-chart/nile-map-chart.css.js +28 -0
  30. package/dist/src/nile-map-chart/nile-map-chart.d.ts +74 -0
  31. package/dist/src/nile-map-chart/nile-map-chart.js +263 -0
  32. package/dist/src/nile-widget-viewer/index.d.ts +3 -0
  33. package/dist/src/nile-widget-viewer/index.js +2 -0
  34. package/dist/src/nile-widget-viewer/nile-widget-viewer.css.d.ts +1 -0
  35. package/dist/src/nile-widget-viewer/nile-widget-viewer.css.js +20 -0
  36. package/dist/src/nile-widget-viewer/nile-widget-viewer.d.ts +33 -0
  37. package/dist/src/nile-widget-viewer/nile-widget-viewer.js +50 -0
  38. package/package.json +4 -2
@@ -0,0 +1,33 @@
1
+ import { nothing } from 'lit';
2
+ import type { CSSResultGroup, TemplateResult } from 'lit';
3
+ import NileElement from '../internal/nile-element.js';
4
+ import type { NileWidgetConfig } from '../internal/types/widget-config.type.js';
5
+ import '../nile-chart/index.js';
6
+ import '../nile-kpi-chart/index.js';
7
+ /**
8
+ * Renders a single dashboard widget — either a `<nile-chart>` or a `<nile-kpi-chart>` —
9
+ * based on the discriminated `type` field of the config.
10
+ *
11
+ * @example
12
+ * ```html
13
+ * <nile-widget-viewer></nile-widget-viewer>
14
+ * ```
15
+ * ```js
16
+ * el.config = {
17
+ * type: 'chart',
18
+ * layout: { x: 0, y: 0, w: 6, h: 4 },
19
+ * nileConfig: { chart: { type: 'pie', data: [...] }, aq: { chartTitle: 'My Chart' } }
20
+ * };
21
+ * ```
22
+ */
23
+ export declare class NileWidgetViewer extends NileElement {
24
+ static styles: CSSResultGroup;
25
+ /** Widget configuration. Discriminated on `type`: `'chart'` or `'kpi'`. */
26
+ config: NileWidgetConfig | null;
27
+ render(): TemplateResult | typeof nothing;
28
+ }
29
+ declare global {
30
+ interface HTMLElementTagNameMap {
31
+ 'nile-widget-viewer': NileWidgetViewer;
32
+ }
33
+ }
@@ -0,0 +1,50 @@
1
+ import { __decorate } from "tslib";
2
+ import { customElement, property } from 'lit/decorators.js';
3
+ import { html, nothing } from 'lit';
4
+ import NileElement from '../internal/nile-element.js';
5
+ import { styles } from './nile-widget-viewer.css.js';
6
+ import '../nile-chart/index.js';
7
+ import '../nile-kpi-chart/index.js';
8
+ /**
9
+ * Renders a single dashboard widget — either a `<nile-chart>` or a `<nile-kpi-chart>` —
10
+ * based on the discriminated `type` field of the config.
11
+ *
12
+ * @example
13
+ * ```html
14
+ * <nile-widget-viewer></nile-widget-viewer>
15
+ * ```
16
+ * ```js
17
+ * el.config = {
18
+ * type: 'chart',
19
+ * layout: { x: 0, y: 0, w: 6, h: 4 },
20
+ * nileConfig: { chart: { type: 'pie', data: [...] }, aq: { chartTitle: 'My Chart' } }
21
+ * };
22
+ * ```
23
+ */
24
+ let NileWidgetViewer = class NileWidgetViewer extends NileElement {
25
+ constructor() {
26
+ super(...arguments);
27
+ /** Widget configuration. Discriminated on `type`: `'chart'` or `'kpi'`. */
28
+ this.config = null;
29
+ }
30
+ render() {
31
+ if (!this.config)
32
+ return nothing;
33
+ if (this.config.type === 'chart') {
34
+ return html `<nile-chart .config=${this.config.nileConfig}></nile-chart>`;
35
+ }
36
+ if (this.config.type === 'kpi') {
37
+ return html `<nile-kpi-chart .config=${this.config.nileConfig}></nile-kpi-chart>`;
38
+ }
39
+ return nothing;
40
+ }
41
+ };
42
+ NileWidgetViewer.styles = styles;
43
+ __decorate([
44
+ property({ type: Object })
45
+ ], NileWidgetViewer.prototype, "config", void 0);
46
+ NileWidgetViewer = __decorate([
47
+ customElement('nile-widget-viewer')
48
+ ], NileWidgetViewer);
49
+ export { NileWidgetViewer };
50
+ //# sourceMappingURL=nile-widget-viewer.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aquera/nile-visualization",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "A visualization Library for the Nile Design System",
5
5
  "license": "MIT",
6
6
  "author": "Aquera Inc",
@@ -40,7 +40,9 @@
40
40
  "./nile-ai-sender": "./dist/src/nile-ai-sender/index.js",
41
41
  "./nile-ai-panel": "./dist/src/nile-ai-panel/index.js",
42
42
  "./nile-kpi-chart": "./dist/src/nile-kpi-chart/index.js",
43
- "./nile-chart": "./dist/src/nile-chart/index.js"
43
+ "./nile-chart": "./dist/src/nile-chart/index.js",
44
+ "./nile-widget-viewer": "./dist/src/nile-widget-viewer/index.js",
45
+ "./nile-dashboard-viewer": "./dist/src/nile-dashboard-viewer/index.js"
44
46
  },
45
47
  "files": [
46
48
  "dist/src/**/*.js",