Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@vx/bounds
Advanced tools
npm install --save @vx/bounds
withBoundingRects
HOCIt's often useful to determine whether elements (e.g., tooltips) overflow the bounds of their parent container and adjust positioning accordingly. The withBoundingRects
higher-order component is meant to simplify this computation by passing in a component's bounding rect as well as its parent's bounding rect.
Example usage with a <Tooltip />
component
import React from 'react';
import PropTypes from 'prop-types';
import { withBoundingRects, withBoundingRectsProps } from '@vx/bounds';
const propTypes = {
...withBoundingRectsProps,
left: PropTypes.number.isRequired,
top: PropTypes.number.isRequired,
children: PropTypes.node,
};
const defaultProps = {
children: null,
};
function Tooltip({
left: initialLeft,
top: initialTop,
rect,
parentRect,
children,
}) {
let left = initialLeft;
let top = initialTop;
if (rect && parentRect) {
left = rect.right > parentRect.right ? (left - rect.width) : left;
top = rect.bottom > parentRect.bottom ? (top - rect.height) : top;
}
return (
<div style={{ top, left, ...myTheme }}>
{children}
</div>
);
}
Tooltip.propTypes = propTypes;
Tooltip.defaultProps = defaultProps;
export default withBoundingRects(Tooltip);
v0.0.196
defaultStyles
:// before
import { Tooltip } from '@vx/tooltip';
...
<Tooltip style={{ color: myCustomColor }} />
// after
import { Tooltip, defaultStyles } from '@vx/tooltip';
...
<Tooltip style={{ ...defaultStyles, color: myCustomColor }} />
Changes:
- @vx/annotation: 0.0.195 => 0.0.196
- @vx/axis: 0.0.195 => 0.0.196
- @vx/bounds: 0.0.195 => 0.0.196
- @vx/brush: 0.0.195 => 0.0.196
- @vx/chord: 0.0.195 => 0.0.196
- @vx/clip-path: 0.0.195 => 0.0.196
- @vx/curve: 0.0.195 => 0.0.196
- @vx/demo: 0.0.195 => 0.0.196
- @vx/drag: 0.0.195 => 0.0.196
- @vx/event: 0.0.195 => 0.0.196
- @vx/geo: 0.0.195 => 0.0.196
- @vx/glyph: 0.0.195 => 0.0.196
- @vx/gradient: 0.0.195 => 0.0.196
- @vx/grid: 0.0.195 => 0.0.196
- @vx/group: 0.0.195 => 0.0.196
- @vx/heatmap: 0.0.195 => 0.0.196
- @vx/hierarchy: 0.0.195 => 0.0.196
- @vx/legend: 0.0.195 => 0.0.196
- @vx/marker: 0.0.195 => 0.0.196
- @vx/mock-data: 0.0.195 => 0.0.196
- @vx/network: 0.0.195 => 0.0.196
- @vx/pattern: 0.0.195 => 0.0.196
- @vx/point: 0.0.195 => 0.0.196
- @vx/responsive: 0.0.195 => 0.0.196
- @vx/scale: 0.0.195 => 0.0.196
- @vx/shape: 0.0.195 => 0.0.196
- @vx/stats: 0.0.195 => 0.0.196
- @vx/text: 0.0.195 => 0.0.196
- @vx/threshold: 0.0.195 => 0.0.196
- @vx/tooltip: 0.0.195 => 0.0.196
- @vx/voronoi: 0.0.195 => 0.0.196
- @vx/vx: 0.0.195 => 0.0.196
- @vx/zoom: 0.0.195 => 0.0.196
FAQs
Utilities to make your life with bounding boxes better
The npm package @vx/bounds receives a total of 20,328 weekly downloads. As such, @vx/bounds popularity was classified as popular.
We found that @vx/bounds demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.