Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@visx/annotation
Advanced tools
Changelog
Readme
SVG Annotation
s enable you to label points, thresholds, or regions of a visualization to provide
additional context to for your chart consumer. This package is heavily inspired by
Susie Lu's
react-annotation
library.
Each annotation consists of three (optional) parts:
Subject
(CircleSubject
, LineSubject
, more 🔜) – what part of a chart is being annotated
(point, line, region)
Label
– the text component for the annotation. Handles SVG text wrapping using @visx/text
,
and supports title
and subtitle
customization as well as vertical & horizontal anchors /
alignment
Connector
– line connecting a subject and label
The Annotation
or EditableAnnotation
component wrappers allow you to compose these components
and simplify their individual positioning:
<EditableAnnotation
x={subjectX}
y={subjectY}
dx={labelDx} // x offset of label from subject
dy={labelDy} // y offset of label from subject
onDragEnd={({ x, y, dx, dy }) => ...}
>
<Connector />
<CircleSubject />
<Label title="Context about this point" subtitle="More deets">
</EditableAnnotation>
Components can also be used in isolation, in which case you must specify exact positions for each item:
() => (
<g>
<Connector x={subjectX} y={subjectY} dx={labelDx} dy={labelDy} />
<CircleSubject x={subjectX} y={subjectY} />
<Label x={subjectX + labelDx} y={subjectY + labelDy} title="...">
</g>
)
ResizeObserver
dependencyThe Label
component relies on ResizeObserver
s for auto-sizing. If you need a polyfill, you can
either polute the window
object or inject it cleanly through props:
import { ResizeObserver } from 'your-favorite-polyfill';
function App() {
return <Label resizeObserverPolyfill={ResizeObserver} {...} />
npm install --save @visx/annotation
FAQs
visx annotation
The npm package @visx/annotation receives a total of 203,196 weekly downloads. As such, @visx/annotation popularity was classified as popular.
We found that @visx/annotation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.