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, based off http://bl.ocks.org/brattonc/5e5ce9beee483220e2f6
npm install react-liquidchart
For now, this will have to do.
import React, { Component } from 'react';
import { render } from 'react-dom';
import LiquidChart from 'react-liquidchart';
class ChartLiquid extends Component {
constructor() {
super();
}
render() {
return (
<div
style={{
width: '100%',
height: '500px',
}}
>
<LiquidChart
responsive
legend="Percentage of Completed Tasks"
value={Math.random() * 100}
showDecimal
amplitude={4}
frequency={2}
animationTime={2000}
animationWavesTime={2250}
gradient={{
type: 1,
x1: 0,
x2: 0,
y1: 100,
y2: 0,
}}
postfix="%"
legendFontSize={0.1}
/>
</div>
);
}
}
render(<ChartLiquid />, document.getElementById('app'));
Name | Type | Default | Description |
---|---|---|---|
Width | number | null | The width of the chart, used if responsive is false |
height | number | null | The width of the chart, used if responsive is false |
responsive | bool | true | If set to true then the element will fill out into parent container, and resize on window dimension change |
Value | number | 65 | The value, tops at 100 and 0 is the minimum |
animationWavesTime | number | null | The speed of the wave animation, going back and forth |
animationTime | number | 2000 | milliseconds for animation when updating value |
animationEase | string | 'easeCubicInOut' | The name of the d3 easing function, other values like, easeBack, easeBackInOut, easeSinInOut, easeExpInOut. See d3 easing page for more ideas. |
outerBound | number | 0.9 | This is the outerRadius of the chart where 1 would be 100% of the radius and 0 would be 0% of the radius.. |
innerBound | number | 0.8 | The innerwidth of the outerpath surronding the liquid, again 0.8 would be 80% of the radius. |
margin | number | 0.025 | The margin between the outer path and the liquid, here 0.025 would be 2.5% |
amplitude | number | 4 | The Amplitude X * sine(frequency) part of the formula |
frequency | number | 2 | The frequency, how many full circles are in the chart. |
waveScaleLimit | bool | true | This is in the original, this will create a scale that limits the wave height close to 0 or 100 |
outerStyle | shape | { fill: 'rgb(23,139,202)'} | The style of the outerarc fill and stroke |
liquidStyle | shape | { fill: 'rgb(23, 139, 202)'} | The style of the liquid, fill and stroke |
dryStyle | shape | {fill: 'rgb(164, 219, 248)'} | The style of the number that is in the liquid, fill and stroke |
wetStyle | shape | {fill: 'rgb(4, 86, 129)'} | The style of the number that is not in the liquid, fill and stroke |
fontSizes | shape | The sizes of the fonts in ratio to the radius. |
This software was available initially under the BSD-2-Clause and it still is. Please see the original and put a github like on it at https://gist.github.com/brattonc/5e5ce9beee483220e2f6
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.