
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.
react-envelope-graph
Advanced tools
A drag-and-drop-enabled, responsive, envelope graph that allows to shape a wave with attack, decay, sustain and release
A drag-and-drop-enabled, responsive, envelope graph that allows to shape a wave with attack, decay, sustain and release.
Check out the Demo!
$ npm i --save react-envelope-graph
or
$ yarn add react-envelope-graph
Import the component
import EnvelopeGraph from "react-envelope-graph";
and then use it:
function App() {
return (
<EnvelopeGraph
defaultXa={1}
defaultXd={0.5}
defaultYs={0.5}
defaultXr={0.7}
ratio={{
xa: 0.25,
xd: 0.25,
xr: 0.2
}}
style={{
backgroundColor: "black",
padding: "2.5%",
height: "100vh",
width: "20vw"
}}
styles={{
line: {
fill: "none",
stroke: "red",
strokeWidth: 2,
},
dndBox: {
fill: "none",
stroke: "blue",
strokeWidth: 0.1,
height: 1,
width: 1
},
dndBoxActive: {
fill: "blue",
}
}}
onChange={console.log}
/>
);
}
height/width ratio is preserved within the svgwidth and height can be specified via the style propdefaultXa, defaultXd, defaultYs and defaultXr need to have a value
between 0 and 1ratio, the sum of the values xa, xd and xr needs to remain below
0.75. xs is internally set to xs === 0.25.styles prop must not use a unit (e.g. px or
em) as they set values on SVG components (user units)styles is not a regular style prop, but a custom prop that
additionally allows to configure interaction reactions toostyle propdefaultXa, defaultXd, defaultYs and defaultXr props are changed,
no onChange event is fired and the graph is set to these values.ratio, dndBox, onChange, styleTo try the component:
$ git clone git@github.com:TimDaub/react-envelope-graph.git
$ npm i
$ npm run dev
Help is very much appreciated. I'll try to handle PRs as fast as I can. Below is a list of the current limitations:
ya value cannot be set via draggingdefaultXa, defaultXd, defaultYs and defaultXr can now be used to
continuously set the graphs values without an onChange event firinggetBoundingClientRect in favor of getComputedStyles for
measuring the svg's dimensions. Setting margin and padding via style
should now be possible without problems.height and width. They're now
members of the style propheight/width of graph to 100% to respect ratio. I'll have
to go back on that fix later...onAttackChange, onDecayChange,
onSustainChange and onReleaseChange in favor of onChange, which returns
all values as an objectheight and width, the graph's ratio is adjusts
accordinglyratio.xs from configurable paramspadding through native style prop and remove
marginTop, marginRight, marginBottom, and marginRight propsstyles prop to allow to styling of the componentdndBox prop to stylesMIT
FAQs
A drag-and-drop-enabled, responsive, envelope graph that allows to shape a wave with attack, decay, sustain and release
The npm package react-envelope-graph receives a total of 10 weekly downloads. As such, react-envelope-graph popularity was classified as not popular.
We found that react-envelope-graph 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.