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

ng-d3-scattered-chart

v1.0.10

Published

Angular + D3 Scattered Chart

Downloads

5

Readme

ng-d3-scattered-chart

Angular + D3 Reusable Scattered Chart Component

Demo

How to use it in your project

download it from npm

npm install ng-d3-scattered-chart --save

use the scattered Chart Component in your project, you just need to imports into your module;

import { D3ScatteredComponent } from 'ng-d3-scattered-chart';

Add the data model in the componet code file to add the data

import * as chartModel from './d3-scattered-chart/d3.scattered.chart.model';

Add it in a html tag in component file, such as:

<app-d3-scattered-chart 
    [data]="chartConfig.chartData" 
    [svgBgColor]="chartConfig.svgBgColor"
    [svgWidth]="chartConfig.svgWidth" 
    [svgHeigth]="chartConfig.svgHeigth" 
    [groupNames]="chartConfig.groupNames"
    [groupColors]="chartConfig.groupColors" 
    [xAxisLabel]="chartConfig.xAxisLabel" 
    [yAxisLabel]="chartConfig.yAxisLabel"
    [showBorder]="chartConfig.showBorder" 
    [circleRadius]="chartConfig.circleRadius"
    [displayYaxis]="chartConfig.displayYaxis"
    [displayXaxis]="chartConfig.displayXaxis" 
    (bubbleClick)="onBubbleClick($event)"></app-d3-scattered-chart >

Add the config in component code file, such as:

chartConfig = {
    svgBgColor: 'transparent',
    showBorder: true,
    displayYaxis: true,
    displayXaxis: true,
    svgWidth: 520,
    svgHeigth: 520,
    circleRadius: 5,
    xAxisLabel: 'Spetal Length',
    yAxisLabel: 'Petal Length',
    groupNames: ['setosa', 'versicolor', 'virginica'],
    groupColors: ['#F8766D', '#00BA38', '#619CFF'],
    chartData: chartModel.chartData
}

Properties

| Name | Default Value | |------------------|-----------------------------------------------------------------------| | data | chart data | | svgBgColor | Chart background color | | svgWidth | Chart block width | | svgHeigth | Chart block height | | groupNames | Chart group | | groupColors | Chart group colors | | xAxisLabel | X axis label | | yAxisLabel | Y axis label | | showBorder | true/false | | circleRadius | Radius of dot circle | | displayYaxis | true/false | | displayXaxis | true/false |

method

onBubbleClick(data) {
    this.clickedNodedata = `Node group name: ${data.Species}, Node Node Petal Length:${data.Petal_Length}, Node group Spetal Length:${data.Sepal_Length}`;
    console.log(data);
  }

it will return the data of the node you clicked !!!

Setup

# install dependencies
npm install

# serve with hot reload at localhost:4200
npm start

### License
MIT