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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sigma-plugins/common-services-ng

v1.0.11

Published

Angular services for Sigma plugin development

Readme

@sigma-plugins/common-services-ng

Angular services for Sigma plugin development. This package provides reusable Angular services for common Sigma plugin functionality.

Installation

npm install @sigma-plugins/common-services-ng

Peer Dependencies

Make sure you have the following peer dependencies installed:

npm install @angular/core @sigmacomputing/plugin rxjs

Usage

Import the Module

Import the CommonServicesNgModule in your Angular module:

import { NgModule } from '@angular/core';
import { CommonServicesNgModule } from '@sigma-plugins/common-services-ng';

@NgModule({
  imports: [
    CommonServicesNgModule,
    // other imports...
  ],
  // ...
})
export class AppModule { }

Using Individual Services

You can also import and use individual services:

import { Injectable } from '@angular/core';
import { ConfigService, ElementDataService, VariableService, PluginService } from '@sigma-plugins/common-services-ng';

@Injectable()
export class MyService {
  constructor(
    private configService: ConfigService,
    private elementDataService: ElementDataService,
    private variableService: VariableService,
    private pluginService: PluginService
  ) {}
}

Services

ConfigService

Manages plugin configuration and provides reactive access to configuration changes.

Methods:

  • getConfig(): Observable<any> - Get the full configuration object
  • getConfigKey(key: string): Observable<any> - Get a specific configuration key

Example:

this.configService.getConfig().subscribe(config => {
  console.log('Current config:', config);
});

this.configService.getConfigKey('allowExpansion').subscribe(value => {
  console.log('Allow expansion:', value);
});

ElementDataService

Manages workbook element data subscriptions for different configuration IDs.

Methods:

  • getElementData(configId: string): Observable<WorkbookElementData> - Subscribe to element data changes

Example:

this.elementDataService.getElementData('source').subscribe(data => {
  console.log('Element data:', data);
});

VariableService

Manages workbook variables with reactive subscriptions and synchronous access.

Methods:

  • getVariable(id: string): Observable<WorkbookVariable | undefined> - Subscribe to variable changes
  • setVariable(id: string, ...values: unknown[]): void - Set variable value
  • getVariableValue(id: string): WorkbookVariable | undefined - Get current value synchronously

Example:

// Subscribe to variable changes
this.variableService.getVariable('taskIdControl').subscribe(variable => {
  console.log('Variable value:', variable?.value);
});

// Set variable value
this.variableService.setVariable('taskIdControl', 'task1,task2,task3');

// Get current value synchronously
const currentValue = this.variableService.getVariableValue('taskIdControl');

PluginService

Provides access to the Sigma plugin client instance.

Methods:

  • getPluginInstance() - Get the Sigma plugin client instance

Example:

const client = this.pluginService.getPluginInstance();
// Use client for direct plugin API access

Development

Building

npm run build

Building TypeScript only

npm run build:tsc

License

MIT

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request