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

@opitzconsulting/segmented-bar-chart

v1.0.0

Published

animated horizontal multi level bar chart component

Downloads

4

Readme

SegmentedBarChart

npm version

An animated horizontal multi level bar chart component. The user can click on bars and navigate within these levels. Changes will be displayed with smooth transitions.

The library has been developed with Angular 6. It should work with older versions of Angular too, but this isn't tested yet.

This repository is maintained by volunteers of OPITZ CONSULTING Deutschland GmbH.

SegmentedBarChart example 1 SegmentedBarChart example 2

There is a demo component SegmentedBarChartDemoComponent in this repository at https://github.com/opitzconsulting/ngx-d3.

npm install @opitzconsulting/segmented-bar-chart

In your application root module definition add SegmentedBarChartModule.

import { SegmentedBarChartModule } from '@opitzconsulting/segmented-bar-chart';
@NgModule({
  bootstrap: [ /* ... */ ],
  declarations: [ /* ... */ ],
  imports: [
    /* ... */
    SegmentedBarChartModule
  ]
})
export class AppModule {}

In your components template add oc-segmented-bar-chart tag.

<oc-segmented-bar-chart [data]="data" width="500"></oc-segmented-bar-chart>

In your component class you can declare the data like following:

import { SegmentedBarChartData } from 'oc-segmented-bar-chart';
/* ... */
public data: SegmentedBarChartData[]: SegmentedBarChartData[] = [
  {
    caption: 'fruits', color: 'purple', segments: [
      { caption: 'apples', value: 10, color: 'green' },
      { caption: 'oranges', value: 20, color: 'orange' },
      { caption: 'bananas', value: 30, color: 'yellow' }
    ]
  }
];

Please notice, tooltip values and x axis values are formated using Angulars DecimalPipe. Thousand and decimal separator could be changed by Angulars locale settings.

Properties:

  • data (SegmentedBarChartData[]) - Array of entries with caption and value. A fixed color can also be specified for each item optional. You can define further children by using segments property. For the last level you musst assign the value property.
  • width (number) - The chart width in pixel (default 800).
  • duration (number) - The duration of any animations in milliseconds (default 2500).

Events

  • chartClick: fires when click on a chart has occured, returns regarding chart entry.
  • chartHover: fires when mouseover (hover) on a chart has occured, returns regarding chart entry.

License

This implementation is released unter the Apache License v2.

The library is based on D3.js, which has been published under an BSD 3-Clause "New" or "Revised" License.