Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@tibco/spotfire-wrapper

TIBCOSoftware123BSD-3-Clause0.18.1TypeScript support: included

Wrapper for TIBCO Spotfire(R) package.

TIBCO, Spotfire

readme

Wrapper for TIBCO Spotfire(R) - the Angular package

This is the home for the Wrapper for TIBCO Spotfire(R) Angular package.

Wrapper for TIBCO Spotfire(R) is an Angular Component built for and with Angular 10+.

Notes:

[Optional] Create an Angular 10+ App if you don't already have one:

ng new myapp
cd myapp
npm outdated
npm install @angular/cdk@10

npm outdated is used to list libraies that may need upgrade. Make sure you are using Angular 10+ libraries.

Two ways to install the NPM package:

1 - Install Wrapper for TIBCO Spotfire(R) using Schematics:

Use the Angular CLI's to install schematic to add Wrapper for TIBCO Spotfire(R) to your project by running the following command:

ng add @tibco/spotfire-wrapper

2 - Install Wrapper for TIBCO Spotfire(R) with npm install:

npm install @angular/cdk @tibco/spotfire-wrapper

Then it's really easy to get started !

Create a dashboard using schematics

Running the dashboard schematic generates a new SpotfireDashboard component that can be used and modified to display a dashboard of your Spotfire(R):

ng generate @tibco/spotfire-wrapper:dashboard --name MySpot

Next, you will add MySpotViewerComponent to the array "declarations" of your angular modules, and use <my-spot></my-spot> in an HTML template of one of component declared in this module.

A Spotfire dashboard will be displayed!

Have a look at src/app/my-spot.component.ts file to see dashboard settings...

Run the server:

Run ng serve --port=4204 for a dev server. Navigate to http://localhost:4204/. The app will automatically reload if you change any of the source files.

Create your own component

You may also want to create your own component:

import { BrowserModule        } from '@angular/platform-browser';
import { NgModule, Component  } from '@angular/core';
import { SpotfireViewerModule } from '@tibco/spotfire-wrapper';

@Component({
  selector: 'app-root',
  styles: [` spotfire-viewer { height: 300px; }`],
  template: `
  <spotfire-viewer
      [url]="url"
      [path]="path"
      [customization]="cust"
      [markingOn]="mon"
      [maxRows]="15"
      (markingEvent)="onMarking($event)">
  </spotfire-viewer>`
})
export class AppComponent {
  url       = 'https://spotfire-next.cloud.tibco.com';
  path      = 'Samples/Sales and Marketing';
  cust      = { showAuthor: true, showFilterPanel: true, showToolBar: true };
  mon       = { SalesAndMarketing: ['*'] };
  onMarking = (e: Event) => console.log('[AppComponent] MARKING returns', e);
}

@NgModule({
  imports:      [ BrowserModule, SpotfireViewerModule ],
  declarations: [ AppComponent ],
  bootstrap:    [ AppComponent ]
})
export class AppModule {}

Extend SpotfireViewerComponent component

You can also extend SpotfireViewerComponent like this :

@Component({
  selector: 'my-spotfire',
  template: `Override spotfire-viewer template:
  <button *ngFor="let p of ['Sales performance', 'Territory analysis', 'Effect of promotions']" (click)="openPage(p)">{{p}}</button>
  <div class="mys" #spot></div>`,
  styles: [`
  div.mys { width:600px; height:400px; background:#ebebeb; border-radius: 20px}
  button { padding:10px }
`]
})
class MySpotfireViewerComponent extends SpotfireViewerComponent implements OnInit {
  // No var please (or set a constructor)
  ngOnInit(): void {
    this.url = 'https://spotfire-next.cloud.tibco.com';
    this.path = 'Samples/Sales and Marketing';
    this.customization = { showAuthor: true, showFilterPanel: true, showToolBar: true } as SpotfireCustomization;
    this.markingOn = '{"SalesAndMarketing": ["*"]}';

    // Show default page:
    this.display();

    // Subscribe to markingEvent
    //
    this.markingEvent.subscribe(e => console.log('MARKING MySpot', e));
  }
}

and use your new directove <my-spotfire><my-spotifire> in your templates

Demos

Demo #1: Use <spotfire-viewer> tag inside an Angular application:

see https://github.com/TIBCOSoftware/spotfire-wrapper/tree/master/demo1

ng serve demo1 --port=4205 --open

It will open a browser http://localhost:4205.

Sources are available in demo1 directory.

Demo #2: Extend SpotfireViewerComponent inside an Angular application:

see https://github.com/TIBCOSoftware/spotfire-wrapper/tree/master/demo2

ng serve demo2 --port=4206 --open

It will open a browser http://localhost:4206.

Sources are available in demo2 directory.

Demo #3: Use exposed SpotfireDocument to manage properties:

see https://github.com/TIBCOSoftware/spotfire-wrapper/tree/master/demo3

ng serve demo3 --port=4207 --open

It will open a browser http://localhost:4207.

Sources are available in demo3 directory.

Note:

The code of these demos has been extremely simplified. Check the demo*/main.ts files.

DemoLinked: Display two reports of the same Spotfire dashboard. Both are linked:

see https://github.com/TIBCOSoftware/spotfire-wrapper/tree/master/demoLinked

ng serve demoLinked --port=4208 --open

It will open a browser http://localhost:4208.

Sources are available in demoLinked directory.

Note:

The code of these demos has been extremely simplified. Check the demo*/main.ts files.



License

Copyright © 2019-2021. TIBCO Software Inc.

This file is subject to the license terms contained in the license file that is distributed with this file.

Please see LICENSE for details of license and dependent third party components referenced by this library, or it can be found here:

https://github.com/TIBCOSoftware/spotfire-wrapper/blob/master/LICENSE

changelog

Wrapper for TIBCO Spotfire(R) Changelog

(all changes without author notice are by @nicolasderoche)

0.18.1

Bug Fix

  • Change to link the main doc to the right Spotfire API (#158 by @hpeters83)

0.18.0

Improvements

0.16.0

Improvements

  • Upgrade to Angular 12.2.11

0.15.1

Bug Fixes

  • Marked rows were sometimes not emited after marking changes.

0.15.0

Improvements

  • Upgrade to Angular 11.2.14
  • Open multiple reports of the same Spotfire dashboard on one webpage, All are linked together. The marking and filtering performed on one report is reflected to the others - (#108 by @hpeters83)

0.14.3

Improvements

  • export SpotfireFilterSetting
  • when parameters is modified, the dashboard is reloaded

0.14.2

Improvements

  • Upgrade to Angular 11.2.6
  • When debug mode is set to false (its default value) the spotfire-wrapper now displays no debug messages.
  • When path is modified, the dashboard is updated accordingly
  • Monitoring of Spotfire Server status is only activated when serverStatusEvent is used

Bug Fixes

  • ngOnChanges not triggered for Input parameters (#87)

0.14.1

Improvements

  • Publish as public package to GitHub Packages

0.14.0

Improvements

  • Upgrade to Angular 11.1.1

0.13.0

Improvements

  • displayInfoMessage and displayErrorMessage can be overriden by child class (#81 by @mcrodrig)
  • Upgrade to Angular 10.1.6

0.12.2

Bug Fixes

  • Fixed timer issue on Server monitoring

0.12.1

Bug Fixes

0.12.0

Features

  • Upgrade to Angular 10.1.1
  • Added a new service that monitors the status of the TIBCO Spotfire Server. (#79 by @Gerromie)
  • Add a new output parameter serverStatusEvent that emits a SpotfireServer class after the TIBCO Spotfire Server has been monitored. (#79 by @Gerromie)
  • Demo1 can demonstrate the code. (#79 by @Gerromie)
  • expose SpotfireApplication and SpotfireDocument to have access to their properties and methods ex: access to Spotfire document properties, as demonstrated in demo3

Breaking Changes

  • All expoed classes have now 'Spotfire' as prefix (SpotfireApplication, SpotfireDocument, SpotfireReporting, ...).

0.11.6

Bug Fixes

  • Restores the ability to install the NPM package. Reopened Issue #75.

0.11.1

Features

  • Allow the spotfire-wrapper component to specify a version of the JavaScript API or to default to a reasonable server version. (#73 by @Gerromie)

Bug Fixes

  • Restores the ability to install the NPM package. Issue #75.

0.11.0

Features

0.10.0

Features

  • Add a new output parameter filtering that emits a SpotfireFiltering class once document is ready. This SpotfireFilteringclass provides the following functions: getFilteringScheme(filteringSchemeName), getFilteringSchemes(), getActiveFilteringScheme(), setFilters(), resetAllFilters() and getAllModifiedFilterColumns$()

Breaking Changes

  • The output parameter reportingEvent as been renamed reporting.

0.9.0

Features

0.8.0

Features

  • Migrate to Angular 8.2.14.
  • Add a new output parameter reportingEvent that emits a SpotfireExporting class once document is ready. This SpotfireExporting class provides the following export functions: print, exportToPowerPoint, exportToPdf, exportReport, exportActiveVisualAsImage and getReports. Note: These export functions may require specific tooling inside Spotfire (check any javascript errors thrown in console if nothing appears).
  • Updated demo1 with: filters as an object, filters as a string, export buttons and a fullscreen button to enlarge Spotfire dashboard using CSS.

Bug Fixes

  • filters when send as a string were not properly parsed. This is fixed.

0.7.3

  • Listen for change of filters parameters

0.2.1

Features

  • Publish on artifacts.tibco.com

0.2.1

Performance Improvements

  • Use setActivePage when document is already created. Quicker to move from one page to an other one.