
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@morphatic/charts
Advanced tools
This is a library of Angular components that can create data visualizations using the powerful d3 framework, and the d3Kit library, which is designed to make it easier to create reusable d3 code. These charts should also work within Ionic projects, as well.
To install, from the root directory of your project type:
npm i -S d3 d3kit @morphatic/charts
The d3 and d3Kit libraries are listed as peerDependencies so you have to explicitly install them separately.
Then in the app.module.ts file in your project, import the MorphaticChartsModule and add it to the imports array of your @NgModule decorator as follows:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { MorphaticChartsModule } from '@morphatic/charts';
@NgModule({
declarations: [ AppComponent ],
imports: [
BrowserModule,
MorphaticChartsModule
],
providers: [],
bootstrap: [ AppComponent ]
})
export class AppModule {}
At this point, the various different chart components will be available to your templates.
To use the chart components, all you need to do is add the right tag to the appropriate template, and provide it with data in the correct format. The format of the expected data will differ for each type of chart and will be explained below.
Bar charts consist of vertical bars representing the numeric values of a collection of categories or dates.

In your template you should add a tag as follows:
<bar-chart [data]="barData"></bar-chart>
The variable barData is an array of BarDatum objects which have a pre-defined signature. In your component's .ts file, you should have something like:
import { Component } from '@angular/core';
import { BarDatum } from '@morphatic/charts';
@Component({
selector: 'home-page',
templateUrl: './home.html'
})
export class HomePage {
barData: BarDatum[];
constructor() {
this.barData = [
{
category: "apples",
value: 12
},
{
category: "oranges",
value: 7
},
{
category: "pears",
value: 15
}
];
}
}
This code would generate a bar chart with three bars with the labels shown in the categories. Of course, data can be generated any way you like, e.g. retrieved from a database, pulled from a REST API, etc. It's also possible to change the chart, just by changing the data. The charts are fully styleable with CSS.
FAQs
A charting library for Angular 5+ that uses d3 and d3kit.
We found that @morphatic/charts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.