Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
chartjs-chart-treemap
Advanced tools
Chart.js module for creating treemap charts
To create a treemap chart, include chartjs-chart-treemap.js after chart.js and then create the chart by setting the type
attribute to 'treemap'
new Chart(ctx, {
type: 'treemap',
tree: dataObject,
key: 'value',
groups: ['main', 'sub']
});
Tree data should be provided in tree
property of dataset. data
is then automatically build. key
defines the key name in data objects to use for value. groups
array can be provided to display multiple levels of hierarchy.
Data is summarized to groups internally.
new Chart(ctx, {
type: 'treemap',
data: {
datasets: [{
label: 'Basic treemap',
tree: [6,6,5,4,3,2,2,1],
fontColor: '#000',
fontFamily: 'serif',
fontSize: 12,
fontStyle: 'normal',
backgroundColor: function(ctx) {
var value = ctx.dataset.data[ctx.dataIndex];
var alpha = (value + 3) / 10;
return Color('blue').alpha(alpha).rgbString();
}
}]
},
});
You first need to install node dependencies (requires Node.js):
> npm install
The following commands will then be available from the repository root:
> gulp build // build dist files
> gulp build --watch // build and watch for changes
> gulp test // run all tests
> gulp test --watch // run all tests and watch for changes
> gulp test --coverage // run all tests and generate code coverage
> gulp lint // perform code linting
> gulp package // create an archive with dist files and samples
chartjs-chart-treemap is available under the MIT license.
FAQs
Chart.js module for creating treemap charts
The npm package chartjs-chart-treemap receives a total of 8,413 weekly downloads. As such, chartjs-chart-treemap popularity was classified as popular.
We found that chartjs-chart-treemap demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.