Skip to content

Commit

Permalink
added visualization viewer component
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlagunas committed Nov 5, 2024
1 parent bbe0d6e commit ac804af
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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: `<rv-visualization-viewer #viewer
[dashboard]="dashboard"
[options]="options"
[visualization]="visualization"
></rv-visualization-viewer>`,
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;
}
3 changes: 2 additions & 1 deletion packages/wrappers-angular/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

export * from './components/reveal-view/reveal-view.component';
export * from './components/reveal-view/reveal-view.component';
export * from './components/visualization-viewer/visualization-viewer.component';
2 changes: 2 additions & 0 deletions samples/sandbox-angular/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<rva-reveal-view [dashboard]="dashboard" [options]="options"
[dataSourcesRequested]="dataSourcesRequested">
</rva-reveal-view>

<!-- <rva-visualization-viewer [dashboard]="dashboard" visualization="3"></rva-visualization-viewer> -->
4 changes: 2 additions & 2 deletions samples/sandbox-angular/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down

0 comments on commit ac804af

Please sign in to comment.