npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tibco/spotfire-wrapper

v0.18.1

Published

Wrapper for TIBCO Spotfire(R) package.

Downloads

286

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:

  • NPM package can be found here: https://www.npmjs.com/package/@tibco/spotfire-wrapper
  • Visit JS library README to read more about the JS alternate way. If you

[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