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

ng-interpolated-charts

v1.3.2

Published

Angular component for interpolated-charts

Downloads

1

Readme

Angular Interpolated Charts

Angular 2 component for interpolated-charts

Installation

  1. Install package with npm
npm install ng-interpolated-charts interpolated-charts --save
  1. Import and register module
import { InterpolatedChartModule } from 'ng-interpolated-charts';

@NgModule({
  imports: [
    InterpolatedChartModule
  ]
})

Usage

Inside template:

<!-- line chart -->
<interpolated-chart
  [data]="chartData"
  [yAxisValueFormat]="yAxisValueFormat"
  [valueFormatter]="valueFormatter">
</interpolated-chart>

<!-- stack bar -->
<interpolated-stack-bar
  [data]="stackBarData">
</interpolated-stack-bar>

Inside component:

chartData = [
  {
    name: 'Minsk',
    data: [
      { 'date': new Date('2015-01-01T00:00:00'), 'value': 20 },
      { 'date': new Date('2015-01-02T00:00:00'), 'value': 16 },
      { 'date': new Date('2015-01-03T00:00:00'), 'value': 21 }
    ]
  }
];
yAxisValueFormat = value => `${value}°C`;
valueFormatter = ({interpolatedValue}) => `${interpolatedValue.toFixed(1)}°C`;

stackBarData = [
  { date: new Date('2015-01-01T00:00:00'), color: 'red', name: 'dry', value: 1 },
  { date: new Date('2015-01-02T00:00:00'), color: 'red', name: 'dry', value: 1 },
  { date: new Date('2015-01-03T00:00:00'), color: 'yellow', name: 'wet', value: 2 },
  { date: new Date('2015-01-04T00:00:00'), color: 'yellow', name: 'wet', value: 2 },

  { date: new Date('2015-01-06T00:00:00'), color: 'blue', name: 'snow', value: 3 },
  { date: new Date('2015-01-07T00:00:00'), color: 'blue', name: 'snow', value: 3 },
  { date: new Date('2015-01-11T00:00:00'), color: 'green', name: 'ice', value: 4 },
  { date: new Date('2015-01-12T00:00:00'), color: 'green', name: 'ice', value: 4 },
  { date: new Date('2015-01-13T00:00:00'), color: 'green', name: 'ice', value: 4 }
];

Documentation

Chart documentation here

Component inputs:

Line Chart config

Binding name | Config Name --- | --- width | width height | height margin | margin maxTimeRangeDifferenceToDraw | maxTimeRangeDifferenceToDraw xAxisTimeFormat | xAxisTimeFormat yAxisValueFormat | yAxisValueFormat curve | curve interpolationMaxIterationCount | interpolationMaxIterationCount interpolationAccuracy | interpolationAccuracy mouseMoveTimeTreshold | mouseMoveTimeTreshold xAxisDateFrom | xAxisDateFrom xAxisDateTo | xAxisDateTo

Mouse events:

Binding name | --- | onMouseEnter | onMouseLeave | onMouseMove | onMouseClick |

Stack Bar config

Binding name | Config Name --- | --- width | width height | height margin | margin backgroundColor | backgroundColor maxTimeRangeDifferenceToDraw | maxTimeRangeDifferenceToDraw xAxisTimeFormat | xAxisTimeFormat mouseMoveTimeTreshold | mouseMoveTimeTreshold xAxisDateFrom | xAxisDateFrom xAxisDateTo | xAxisDateTo

Mouse events:

Binding name | --- | onMouseEnter | onMouseLeave | onMouseMove | onMouseClick |

Marker plugin config

Binding name | Config Name --- | --- cx | cx cy | cy radius | radius fill | fill stroke | stroke strokeWidth | strokeWidth markerSort | sort

Tooltip plugin config

Binding name | Config Name --- | --- tooltipWidth | tooltipWidth horizontalMouseMargin | horizontalMouseMargin verticalBorderMargin | verticalBorderMargin headerFormatter | headerFormatter topicFormatter | topicFormatter valueFormatter | valueFormatter tooltipSort | sort

Development

Library creation docs

Library location in project - projects/ng-interpolated-charts.

Build library (with ng-packagr to Angular Package Format): ng build ng-interpolated-charts

Publish to npm: npm publish projects/ng-interpolated-charts