Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
react-liquidchart
Advanced tools
A Nice looking liquid chart done with d3 and react
Download the package from npm
npm i -S react-liquidchart
import React, { Component } from 'react';
import { render } from 'react-dom';
import Liquid from 'react-liquidchartr';
class Chart extends Component {
constructor() {
super();
this.onClick = this.onClick.bind(this);
this.state = {
value: Math.random() * 100,
};
}
onClick() {
this.setState({ value: Math.random() * 100 });
}
render() {
return (
<div
style={{
width: '800px',
height: '350px',
marginLeft: 'auto',
marginRight: 'auto',
}}
>
<Liquid
onClick={this.onClick}
value={this.state.value}
animate
/>
</div>
);
}
}
render(<Chart />, document.getElementById('app'));
render(app, document.getElementById('app');
a percentage from 0 to 100
if true then animate
A function that is called when animation is done
A fill and stroke for the outer arc, defaults to fill: 'rgb(23, 139, 202)'
A fill and stroke for the liquid, defaults to fill: 'rgb(23, 139, 202)'
A fill and stroke for the part of the number that is in liquid defaults to fill: 'rgb(164, 219, 248)',
A fill and stroke for the 'dry' part of the number default to fill: 'rgb(4, 86, 129)'
the wave height
The inverse of frequency actually, the higher the number the smother the wave
Makes the chart listen to changes in screen size and resize the chart on screen resize
Testing done with Jest
npm run test
Run the webpack dev server
npm run start
#Credits This is a react remake and slightly altered version of http://bl.ocks.org/brattonc/5e5ce9beee483220e2f6
So a big thanks to Chris Bratton for making the original
FAQs
A Reusable liquid chart made with d3 and react
The npm package react-liquidchart receives a total of 44 weekly downloads. As such, react-liquidchart popularity was classified as not popular.
We found that react-liquidchart 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.