Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@vx/legend
Advanced tools
Legends associate shapes and colors to data.
import { LegendThreshold } from '@vx/legend';
import { scaleThreshold } from '@vx/scale';
const threshold = scaleThreshold({
domain: [0.02, 0.04, 0.06, 0.08, 0.1],
range: ['#f2f0f7', '#dadaeb', '#bcbddc', '#9e9ac8', '#756bb1', '#54278f']
});
function MyChart() {
return (
<div>
<svg>{/** chart stuff */}</svg>
<LegendThreshold
scale={threshold}
direction="column-reverse"
itemDirection="row-reverse"
labelMargin="0 20px 0 0"
shapeMargin="1px 0 0"
/>
</div>
);
}
npm install --save @vx/legend
# Legend.children<func>
# Legend.className<string>
# Legend.direction<string>
Default | 'column' |
# Legend.domain<array>
# Legend.fill<any>
Default | valueOrIdentity |
# Legend.itemDirection<string>
Default | 'row' |
# Legend.itemMargin<string>
Default | '0' |
# Legend.labelAlign<string>
Default | 'left' |
# Legend.labelFlex<string>
Default | '1' |
# Legend.labelFormat<func>
Default | valueOrIdentity |
# Legend.labelMargin<string>
Default | '0 4px' |
# Legend.labelTransform<func>
Default | function defaultTransform({ scale, labelFormat }) {
return (d, i) => {
return {
datum: d,
index: i,
text: ${labelFormat(d, i)} ,
value: scale(d)
};
};
} |
# Legend.scale<union(func|object)> required
# Legend.shape<any>
# Legend.shapeHeight<union(number|string)>
Default | 15 |
# Legend.shapeMargin<any>
Default | '2px 4px 2px 0' |
# Legend.shapeStyle<any>
# Legend.shapeWidth<union(number|string)>
Default | 15 |
# Legend.size<any>
Default | valueOrIdentity |
# Legend.style<any>
Default | { display: 'flex' } |
# LegendItem.alignItems<string>
Default | 'center' |
# LegendItem.children<any>
# LegendItem.display
Default | 'flex' |
# LegendItem.flexDirection<string>
Default | 'row' |
# LegendItem.margin<union(string|number)>
Default | '0' |
# LegendLabel.align<string>
Default | 'left' |
# LegendLabel.children<any>
# LegendLabel.flex<union(string|number)>
Default | '1' |
# LegendLabel.label<any>
# LegendLabel.margin<union(string|number)>
Default | '5px 0' |
# LegendShape.fill<any>
# LegendShape.height<any>
# LegendShape.label<any>
# LegendShape.margin<any>
# LegendShape.shape<any>
Default | ShapeRect |
# LegendShape.shapeStyle<any>
# LegendShape.size<any>
# LegendShape.width<any>
# Linear.domain<array>
# Linear.labelFormat<func>
Default | x => x |
# Linear.labelTransform<func>
Default | function defaultTransform({ scale, labelFormat }) {
return (d, i) => {
return {
text: ${labelFormat(d, i)} ,
value: scale(d)
};
};
} |
# Linear.scale<func> required
# Linear.steps<number>
Default | 5 |
# Ordinal.domain<array>
# Ordinal.labelFormat<func>
Default | valueOrIdentity |
# Ordinal.labelTransform<func>
Default | function defaultTransform({ scale, labelFormat }) {
return (d, i) => {
return {
datum: d,
index: i,
text: ${labelFormat(d, i)} ,
value: scale(d)
};
};
} |
# Ordinal.scale<func> required
# Quantile.domain<array>
# Quantile.labelDelimiter<string>
Default | '-' |
# Quantile.labelFormat<func>
Default | x => x |
# Quantile.labelTransform<func>
# Quantile.scale<func> required
# Size.labelFormat
Default | x => x |
# Size.labelTransform
Default | function defaultTransform({ scale, labelFormat }) {
return (d, i) => {
return {
text: ${labelFormat(d, i)} ,
value: scale(d),
datum: d,
index: i
};
};
} |
# Size.steps
Default | 5 |
# Threshold.domain<array>
# Threshold.labelDelimiter<string>
Default | 'to' |
# Threshold.labelFormat<func>
Default | x => x |
# Threshold.labelLower<string>
Default | 'Less than ' |
# Threshold.labelTransform<func>
# Threshold.labelUpper<string>
Default | 'More than ' |
# Threshold.scale<func> required
# Circle.fill<any>
# Circle.height<union(number|string)>
# Circle.style<object>
# Circle.width<union(number|string)>
# Rect.fill<any>
# Rect.height<union(number|string)>
# Rect.style<object>
# Rect.width<union(number|string)>
v0.0.183
innerRef
prop to <ScaleSVG />
. #393clipAboveTo
and clipBelowTo
prop types to number|func
. #401Changes:
- @vx/annotation: 0.0.182 => 0.0.183
- @vx/axis: 0.0.182 => 0.0.183
- @vx/boxplot: 0.0.182 => 0.0.183
- @vx/chord: 0.0.182 => 0.0.183
- @vx/clip-path: 0.0.182 => 0.0.183
- @vx/demo: 0.0.182 => 0.0.183
- @vx/drag: 0.0.182 => 0.0.183
- @vx/geo: 0.0.182 => 0.0.183
- @vx/glyph: 0.0.182 => 0.0.183
- @vx/gradient: 0.0.182 => 0.0.183
- @vx/grid: 0.0.182 => 0.0.183
- @vx/group: 0.0.182 => 0.0.183
- @vx/heatmap: 0.0.182 => 0.0.183
- @vx/hierarchy: 0.0.182 => 0.0.183
- @vx/legend: 0.0.182 => 0.0.183
- @vx/marker: 0.0.182 => 0.0.183
- @vx/network: 0.0.182 => 0.0.183
- @vx/pattern: 0.0.182 => 0.0.183
- @vx/responsive: 0.0.182 => 0.0.183
- @vx/shape: 0.0.182 => 0.0.183
- @vx/stats: 0.0.182 => 0.0.183
- @vx/text: 0.0.182 => 0.0.183
- @vx/threshold: 0.0.182 => 0.0.183
- @vx/voronoi: 0.0.182 => 0.0.183
- @vx/vx: 0.0.182 => 0.0.183
FAQs
vx legend
The npm package @vx/legend receives a total of 30,618 weekly downloads. As such, @vx/legend popularity was classified as popular.
We found that @vx/legend 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.