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

sigplot-ts

v0.3.5

Published

TypeScript-based Integration Library for SigPlot 2.0

Downloads

154

Readme

SigPlot TypeScript Integration Library

This library aims to simplify integration with SigPlot by adding additional Typings, classes, enumerations, and interfaces to the existing basic Typings support. The library is distributed as ES5 and ES6 modules, making it useful for developers using other languages as well.

At this time, the two plot types are Line and (Falling) Raster. These correspond to Type 1000 and 2000 (1D and 2D, respectively). An abstract base class (BasePlot) is also provided in the event your application needs other features.

Important: At this time, this library uses a fork of SigPlot that has basic typings support in the 2.0 development branch.

Installation

Install this library for your project using npm:

npm install --save sigplot-ts

Usage

In your TypeScript environment, import and utilize the plot type of interest:

import {
    RasterPlot,
    RasterPlotData,
    FormatSize,
    FormatType
} from 'sigplot-ts';

// Somewhere in the application
let plot = new RasterPlot(dom_element);

// Then when data is received
const data: RasterPlotData = {
    buffer: data_vector,
    dataSize: FormatSize.Scalar,
    dataType: FormatType.Float32
};

// Push the data
plot.push(data);

Important: Your HTML dom_element must have a non-zero height set, otherwise SigPlot will not be displayed at all. Once this is set, call checkResize on the plot instance to refresh the plot to the new dimensions.

Construction Options and Runtime Settings

The sigplot.Plot interface supports a variety of options, some of which an only be set when the plot is created. The ConstructorOptions class is provided to simplify that interface. Once the plot is instantiated, one can use the settings member to access the runtime subset of those options and force an update using checkSettings:

plot.settings.legend = false; // hide the legend
plot.checkSettings();

X and Y Axis Labels

The default construction options structure maps the X and Y label, via function, to the xlab and ylab members, which can be set to an enumeration (Units, corresponding to sigplot.m.UNITS). The default function uses the enumeration to produce a string value like Amplitude. The base plot class exposes these two members directly in the event one would like to update the X and Y labels at runtime:

import { Units } from 'sigplot-ts';

// Somewhere below
this.plot.xlab = Units.Power; // Results in an X label of 'Power'

The relationship is that the enumeration name, as a string, becomes the corresponding label text (if shown).

Advanced Usage

If you find that the interfaces exposed by your selected sigplot-ts plot do not expose the feature you want, you can access the underlying sigplot.Plot instance at the class's _plot member.

Such usage is discouraged, and users interested in doing so are encouraged to see SigPlot for more information since those interface and configuration descriptions are not maintained in this library.