
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
@vx/mock-data
Advanced tools
The @vx/mock-data package is here to help you test out your graphs.
npm install --save @vx/mock-data
Generators can create simple generic data for you like this:
import Mock from '@vx/mock-data';
const points = Mock.genRandomNormalPoints();
Mock.genRandomNormalPoints()Returns a series of random normal x,y points.
Mock.getDateValue(n)Generates n date values an hour apart from each other starting with the current time.
Mock are essentially a bunch of data dumps that you can use like this:
import Mock from '@vx/mock-data';
// or import { cityTemperature } from '@vx/mock-data';
const data = Mock.cityTemperature;
Mock.appleStockinterface AppleStock {
date: string;
close: number;
}
const appleStock: AppleStock[] = [
{ date: '2007-04-24T07:00:00.000Z', close: 93.24 },
...
];
Mock.bitcoinPriceinterface BitcoinPrices {
currency: string;
prices: BitcoinPrice[];
}
const bitcoinPrice: BitcoinPrices = {
currency: 'USD',
prices: [
{ price: '2486.69', time: '2017-07-03T00:00:00Z' },
...
]
};
Mock.browserUsageconst browserUsage: BrowserUsage[] = [
{
date: '2015 Jun 15',
'Google Chrome': '48.09',
'Internet Explorer': '24.14',
Firefox: '18.82',
Safari: '7.46',
'Microsoft Edge': '0.03',
Opera: '1.32',
Mozilla: '0.12',
'Other/Unknown': '0.01',
},
...
];
Mock.cityTemperatureinterface CityTemperature {
date: string;
'New York': string;
'San Francisco': string;
Austin: string;
}
const cityTemperature: CityTemperature[] = [
{
date: '20111001',
'New York': '63.4',
'San Francisco': '62.7',
Austin: '72.2',
},
...
];
Mock.exoplanetsinterface Exoplanets {
name: string;
radius: number;
distance: number | null;
}
const exoplanets: Exoplanets[] = [
{
name: 'Jupiter',
radius: 10.97,
distance: 0,
},
...
];
Mock.groupDateValueinterface GroupDateValue {
key: string;
value: string;
date: string;
}
const groupDateValue: GroupDateValue[] = [
{ key: 'Group1', value: '37', date: '04/23/12' },
...
];
Mock.lesMiserablesinterface LesMiserablesNode {
id: string;
group: number;
}
interface LesMiserablesLink {
source: string;
target: string;
value: number;
}
interface LesMiserables {
nodes: LesMiserablesNode[];
links: LesMiserablesLink[];
}
const lesMiserables: LesMiserables = {
nodes: [
{ id: 'Myriel', group: 1 },
...
],
links: [
{ source: 'Napoleon', target: 'Myriel', value: 1 },
...
],
};
Mock.letterFrequencyinterface LetterFrequency {
letter: string;
frequency: number;
}
const letterFrequency: LetterFrequency[] = [
{ letter: 'A', frequency: 0.08167 },
...
];
Mock.shakespeareinterface Shakespeare {
id: string;
parent: string | null;
size: number | null;
}
const shakespeare: Shakespeare[] = [
{
id: 'Shakespeare',
parent: null,
size: 0,
},
...
];
generators/mocks/v0.0.199
rangeRound field in the input of scaleLinear(), scaleLog(), scalePoint(), scalePower(), scaleSqrt(), scaleTime() and scaleUtc(). #766
Instead of
scaleLinear({ rangeRound: xxx })
Do this instead
scaleLinear({ range: xxx, round: true });
ticks and tickFormat in the input of scaleQuantize(). It was not really doing anything anyway as both scale.ticks() and scale.tickFormat() do not mutate the scale. #766scale.type field that was attached to the d3 scales. #766@vx/grid components now accept D3 Scale as generic type instead of ScaleInput. Developers should not expect to specify this generic type as it can be inferred from the passed scale. #775GridColumnProps => GridColumnsProps (+s) to match GridRowsProps. #787<Marker /> implementation of a Line and some Text. #783AnyD3Scale, InferD3ScaleOutput, InferD3ScaleDiscreteInput, InferD3ScaleThresholdInput and ScaleInput. Add new utilities functions: getTicks, coerceNumber and toString. #773@vx/legend shapes from the index for convenience / non-deep imports. #772children prop to GridRows + GridColumns to support animated rendering. #787<BarRounded /> shape. #774d3-shape and export as part of vx/shape (arc, area, line, pie, radialLine),
similar to vx/scale has factories for d3-scale. #776SplitLinePath component to @vx/shape that allows you to create a line path split into multiple smaller line paths that can be styled independently. #778vx/scale and vx/axis. More fields passed to child render props of Axis. #773Axis is refactored to accept a ticksComponent which allows us to animate them. #779values to tickFormat(value, index, values) so that format logic can more easily leverage all ticks (because numTicks is approximate, lib consumers do not know how many tick values exist a priori). #779<Marker /> that matches actual SVG <marker>. #783<MarkerArrow />, <MarkerCross />, <MarkerX />, <MarkerCircle />, <MarkerLine />. #783@vx/react-spring that includes react-spring as a peerDep and can be a home for things that depend on react-spring. #779<AnimatedAxis /> and <AnimatedTicksRender /> in @vx/react-spring. #779vx-demo/axis demo to use <AnimatedAxis />. #779AnimatedGridRows + AnimatedGridColumns. #787AnimatedTicks/useAnimatedTicksConfig to spring-configs/useAnimatedLineTransitionConfig so it can power both animated tick + grid lines. #787animationTrajectory=outside | inside | min | max to AnimatedAxis and AnimatedGridRows/Columns. #787enableDebounceLeadingCall prop being passed into div. #763vx/scale package has 100% test coverage. #766<Marker>. #783/axis demo to include AnimatedGrid* and a animationTrajectory config. #787 - @vx/annotation: 0.0.198 => 0.0.199
- @vx/axis: 0.0.198 => 0.0.199
- @vx/bounds: 0.0.198 => 0.0.199
- @vx/brush: 0.0.198 => 0.0.199
- @vx/chord: 0.0.198 => 0.0.199
- @vx/clip-path: 0.0.198 => 0.0.199
- @vx/curve: 0.0.198 => 0.0.199
- @vx/demo: 0.0.198 => 0.0.199
- @vx/drag: 0.0.198 => 0.0.199
- @vx/event: 0.0.198 => 0.0.199
- @vx/geo: 0.0.198 => 0.0.199
- @vx/glyph: 0.0.198 => 0.0.199
- @vx/gradient: 0.0.198 => 0.0.199
- @vx/grid: 0.0.198 => 0.0.199
- @vx/group: 0.0.198 => 0.0.199
- @vx/heatmap: 0.0.198 => 0.0.199
- @vx/hierarchy: 0.0.198 => 0.0.199
- @vx/legend: 0.0.198 => 0.0.199
- @vx/marker: 0.0.198 => 0.0.199
- @vx/mock-data: 0.0.198 => 0.0.199
- @vx/network: 0.0.198 => 0.0.199
- @vx/pattern: 0.0.198 => 0.0.199
- @vx/point: 0.0.198 => 0.0.199
- @vx/react-spring: 0.0.198 => 0.0.199
- @vx/responsive: 0.0.198 => 0.0.199
- @vx/scale: 0.0.198 => 0.0.199
- @vx/shape: 0.0.198 => 0.0.199
- @vx/stats: 0.0.198 => 0.0.199
- @vx/text: 0.0.198 => 0.0.199
- @vx/threshold: 0.0.198 => 0.0.199
- @vx/tooltip: 0.0.198 => 0.0.199
- @vx/voronoi: 0.0.198 => 0.0.199
- @vx/vx: 0.0.198 => 0.0.199
- @vx/xychart: 0.0.0 => 0.0.199 (private)
- @vx/zoom: 0.0.198 => 0.0.199
FAQs
vx mock data
The npm package @vx/mock-data receives a total of 5,995 weekly downloads. As such, @vx/mock-data popularity was classified as popular.
We found that @vx/mock-data 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
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.