Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Chart.Smith.js
Advanced tools
Provides a Smith Chart for use with Chart.js
To create a Smith Chart, include Chart.Smith.js
after Chart.js
and then create the chart by setting the type
attribute to 'smith'
var mySmithChart = new Chart({
type: 'smith',
data: dataObject
});
The smith chart can graph multiple datasets at once. The data for each dataset is in the form of complex numbers.
var smithChartData = {
datasets: [{
label: 'Dataset 1',
data: [{
real: 0,
imag: 1
}, {
real: 1,
imag: 1
}]
}]
};
The smith chart scale can be configured by placing options into the config that is passed to the chart upon creation.
new Chart({
config: {
scale: {
display: true, // setting false will hide the scale
gridLines: {
// setting false will hide the grid lines
display: true,
// the color of the grid lines
color: rgba(0, 0, 0, 0.1),
// thickness of grid lines
lineWidth: 1,
},
ticks: {
// The color of the scale label text
fontColor: 'black',
// The font family used to render labels
fontFamily: 'Helvetica',
// The font size in px
fontSize: 12,
// Style of font
fontStyle: 'normal'
// Function used to convert real valued ticks to strings
rCallback: function(tick, index, ticks) {}
// Function used to convert imaginary valued ticks to strings
xCallback: function(tick, index, ticks) {}
}
}
}
});
The datasets for smith charts support many of the same options as the line chart
{
// Bezier Curve tension. Set to 0 for straight lines
tension: 0,
// Fill color for dataset
backgroundColor: 'rgba(0, 0, 0, 0.1)',
// Width of line
borderWidth: 1,
// Line color
borderColor: 'rgba(0, 0, 0, 0.1)',
// Line ending style
borderCapStyle: 'butt',
// Line dash style
borderDash: [],
// Dash offset. Used in conjunction with borderDash property
borderDashOffset: 0,
// Line join style
borderJoinStyle: 'miter',
// Do we fill the line?
fill: true,
// Point radius
radius: 3,
// Point style (circle, cross, etc)
pointStyle: 'circle',
// Point fill color
pointBackgroundColor: 'rgba(0, 0, 0, 0.1)',
// Point stroke color
pointBorderColor: 'rgba(0, 0, 0, 0.1)',
// Point stroke width
pointBorderWidth: 1,
// Used for hit detection
hitRadius: 3
}
Chart.Smith.js is available under the MIT license.
When reporting bugs or issues, if you could include a link to a simple jsbin or similar demonstrating the issue, that would be really helpful.
FAQs
Smith chart implementation for Chart.js
We found that Chart.Smith.js 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.