Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
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-liquidchart';
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'));
a percentage from 0 to 100
if true then animate
if true then animate waves
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
The font size attribute for the number
font size for the percentage sign
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 86 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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.