From ac804afa2e84dd6002bb0e7340176a2a30f7f33a Mon Sep 17 00:00:00 2001 From: Brian Lagunas <835562+brianlagunas@users.noreply.github.com> Date: Tue, 5 Nov 2024 12:18:27 -0700 Subject: [PATCH] added visualization viewer component --- .../visualization-viewer.component.scss | 0 .../visualization-viewer.component.ts | 23 +++++++++++++++++++ packages/wrappers-angular/src/index.ts | 3 ++- .../src/app/app.component.html | 2 ++ .../sandbox-angular/src/app/app.component.ts | 4 ++-- 5 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 packages/wrappers-angular/src/components/visualization-viewer/visualization-viewer.component.scss create mode 100644 packages/wrappers-angular/src/components/visualization-viewer/visualization-viewer.component.ts diff --git a/packages/wrappers-angular/src/components/visualization-viewer/visualization-viewer.component.scss b/packages/wrappers-angular/src/components/visualization-viewer/visualization-viewer.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/packages/wrappers-angular/src/components/visualization-viewer/visualization-viewer.component.ts b/packages/wrappers-angular/src/components/visualization-viewer/visualization-viewer.component.ts new file mode 100644 index 0000000..6099fa0 --- /dev/null +++ b/packages/wrappers-angular/src/components/visualization-viewer/visualization-viewer.component.ts @@ -0,0 +1,23 @@ +import { Component, CUSTOM_ELEMENTS_SCHEMA, ElementRef, Input, ViewChild } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { defineRevealSdkWrappers, RvVisualizationViewer, VisualizationViewerOptions } from 'reveal-sdk-wrappers'; +defineRevealSdkWrappers(RvVisualizationViewer); + +@Component({ + selector: 'rva-visualization-viewer', + standalone: true, + imports: [CommonModule], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + template: ``, + styleUrl: './visualization-viewer.component.scss', +}) +export class VisualizationViewerComponent { + @ViewChild('viewer', { static: true }) viewer!: ElementRef; + @Input() dashboard?: string | unknown; + @Input() options: VisualizationViewerOptions = {}; + @Input() visualization: string | number = 0; +} diff --git a/packages/wrappers-angular/src/index.ts b/packages/wrappers-angular/src/index.ts index 3cb53b9..c0bede0 100644 --- a/packages/wrappers-angular/src/index.ts +++ b/packages/wrappers-angular/src/index.ts @@ -1,2 +1,3 @@ -export * from './components/reveal-view/reveal-view.component'; \ No newline at end of file +export * from './components/reveal-view/reveal-view.component'; +export * from './components/visualization-viewer/visualization-viewer.component'; \ No newline at end of file diff --git a/samples/sandbox-angular/src/app/app.component.html b/samples/sandbox-angular/src/app/app.component.html index 7f5413a..45491a3 100644 --- a/samples/sandbox-angular/src/app/app.component.html +++ b/samples/sandbox-angular/src/app/app.component.html @@ -1,3 +1,5 @@ + + diff --git a/samples/sandbox-angular/src/app/app.component.ts b/samples/sandbox-angular/src/app/app.component.ts index c012dda..8ac047d 100644 --- a/samples/sandbox-angular/src/app/app.component.ts +++ b/samples/sandbox-angular/src/app/app.component.ts @@ -1,14 +1,14 @@ import { Component } from '@angular/core'; import { RouterModule } from '@angular/router'; import { DataSourcesRequestedArgs, RevealViewOptions } from 'reveal-sdk-wrappers'; -import { RevealViewComponent } from 'reveal-sdk-wrappers-angular'; +import { RevealViewComponent, VisualizationViewerComponent } from 'reveal-sdk-wrappers-angular'; declare const $: any; $.ig.RevealSdkSettings.setBaseUrl("https://samples.revealbi.io/upmedia-backend/reveal-api/"); @Component({ standalone: true, - imports: [RouterModule, RevealViewComponent], + imports: [RouterModule, RevealViewComponent, VisualizationViewerComponent], selector: 'app-root', templateUrl: './app.component.html', styleUrl: './app.component.scss',