
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
fluid-meter
Advanced tools
a dependency free library that draws a circular meter where progress is displayed as the amount of liquid on it
Dependency free library to represent progress as the amount of fluid in a container.
https://aarcoraci.github.io/fluid-meter/
npm i fluid-meter
The library is higlhly customizable but it can be easily initialized. It requires a DOM container with a setted width and height (inline or css).
<div id="target" style="width:500px;height:500px"></div>
import { CircularFluidMeter } from 'fluid-meter';
const target = document.querySelector('#target');
new CircularFluidMeter(target, {
initialProgress: 33
});
A new bundled version has been added. It can be accessed via the IIFE on the global scope.
1 - Add the bundle file to your project (can be found as bundle.js in the /dist directory):
<!-- make sure the path is correct -->
<script src="dist/bundle.js"></script>
2 - Access via the IIFE on the global scope (named cfmModule):
const target = document.querySelector("#target");
new cfmModule.CircularFluidMeter(target, {
initialProgress: 33,
});
The library is prepared to work on a responsive scenario if needed via the BreakpointValueConfig:
const config = {
initialProgress: 75,
borderWidth: [
{
resolution: 0,
value: 15
},
{
resolution: 1024,
value: 60
}
],
fontSize: [
{
resolution: 0,
value: 25
},
{
resolution: 768,
value: 50
}
]
};
See the supported responsive values on the Configuration table
Here are some examples on how to use it. It's with typescript but should be the same with plain javascript. https://github.com/aarcoraci/fluid-meter/blob/main/src/main.ts
| option | type | default | info |
|---|---|---|---|
| initialProgress | number | 0 | initial progress to show |
| maxProgress | number | 100 | max progress of the meter |
| borderWidth | number or BreakpointValueConfig | 30 | border width. Can be a number or an array of breakpoint value configs |
| borderColor | string | #75758b | color of the outer border. |
| padding | number | 30 | space between the boundaries of the container and the meter. Usefull if drop shadow is enabled |
| backgroundColor | string | #9f9fae | meter background color |
| showProgress | boolean | true | displays or not the center text |
| showBubbles | boolean | true | displays or not the bubbles |
| bubbleColor | string | #ffffff | color of the bubbles |
| textColor | string | #ffffff | text color |
| textDropShadow | boolean | true | text has a small shadow. Helps when colors are too similar or on difficult contrasting scenarios |
| textShadowOpacity | number | 1 | intensity of the shadow between 0 and 1: 0 invisible and 1 fully visible |
| textShadowColor | string | #000000 | text shadow color |
| fontFamily | string | Arial | name of the typeface to use |
| fontSize | number or BreakpointValueConfig | 30 | tex size. Can be a number of an array of breakpoint value configs |
| use3D | boolean | true | enables details that gives the impresion of depth |
| dropShadow | boolean | true | meter drops shadow. Requires some padding to show correctly |
| dropShadowColor | string | #000000 | meter shadow color |
| progressFormatter | (value: number) => string | (value: number) => Math.round(value).toString() | a function that transforms the value shown in the center of the meter |
| fluidConfiguration | FluidLayerConfiguration | {color: '#ff0000',waveSpeed: Speed.NORMAL,horizontalSpeed: Speed.NORMAL} | values of the fluid being displayed |
import { CircularFluidMeter } from 'fluid-meter';
const target = document.querySelector('#target');
const m = new CircularFluidMeter(target, {
initialProgress: 50
});
m.targetProgress = 50;
m.dropShadow = false;
m.use3D = false;
| setter / getter | info |
|---|---|
| progress | number |
| maxProgress (only getter) | number |
| borderWidth | number or BreakpointValueConfig[] |
| borderColor | string |
| meterPadding | number |
| backgroundColor | string |
| textColor | string |
| fontFamily | string |
| fontSize | number or BreakpointValueConfig[] |
| textDropShadow | boolean |
| textShadowOpacity | number (between 0 and 1) |
| textShadowColor | string |
| showProgress | boolean |
| showBubbles | boolean |
| bubbleColor | string |
| use3D | boolean |
| dropShadow | boolean |
| dropShadowColor | string |
| progressFormatter (only getter) | (value: number) => string |
If yo are using the library on a context where you will be adding it or removing it dynamically you should call dispose when removing it to correctly clear the animation:
meter.dispose();
FAQs
a dependency free library that draws a circular meter where progress is displayed as the amount of liquid on it
We found that fluid-meter 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.