Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
more: [10, 30, 40]
};
const x: Array = d3Array.permute(testObject, ['name', 'val', 'when', 'more']);
// range() ---------------------------------------------------------------------
numbersArray = d3Array.range(10);
numbersArray = d3Array.range(1, 10);
numbersArray = d3Array.range(1, 10, 0.5);
// shuffle() -------------------------------------------------------------------
mergedArray = d3Array.shuffle(mergedArray);
mergedArray = d3Array.shuffle(mergedArray, 1);
mergedArray = d3Array.shuffle(mergedArray, 1, 3);
// ticks() ---------------------------------------------------------------------
numbersArray = d3Array.ticks(1, 10, 5);
// tickStep() ------------------------------------------------------------------
numbersArray = d3Array.tickStep(1, 10, 5);
// transpose() -----------------------------------------------------------------
testArrays = d3Array.transpose([
[
new MixedObject(10, new Date(2016, 6, 1)),
name: 'Test',
when: new Date(),
more: [10, 30, 40]
};
const x: Array = d3Array.permute(testObject, ['name', 'val', 'when', 'more']);
// range() ---------------------------------------------------------------------
numbersArray = d3Array.range(10);
numbersArray = d3Array.range(1, 10);
numbersArray = d3Array.range(1, 10, 0.5);
// shuffle() -------------------------------------------------------------------
mergedArray = d3Array.shuffle(mergedArray);
mergedArray = d3Array.shuffle(mergedArray, 1);
mergedArray = d3Array.shuffle(mergedArray, 1, 3);
// ticks() ---------------------------------------------------------------------
numbersArray = d3Array.ticks(1, 10, 5);
// tickStep() ------------------------------------------------------------------
numbersArray = d3Array.tickStep(1, 10, 5);
// transpose() -----------------------------------------------------------------
testArrays = d3Array.transpose([
value: 19,
},
];
// **************************************************
// Example
// **************************************************
class Example extends PureComponent {
constructor(props) {
super(props);
(this:any).update = this.update.bind(this);
}
state = {
data: shuffle(mockData).slice(0, Math.floor(Math.random() * ((mockData.length + 2) - (5 + 1))) + 5),
}
update() {
this.setState({
data: shuffle(mockData).slice(0, Math.floor(Math.random() * ((mockData.length + 2) - (5 + 1))) + 5),
});
}
render() {
const scale = scaleBand()
.rangeRound([0, dims[0]])
.domain(this.state.data.map((d) => d.name))
.padding(0.1);
return (
<div></div>
value: 12,
}, {
name: 'Oyoba',
value: 69,
}, {
name: 'Ntags',
value: 17,
},
]
// **************************************************
// Example
// **************************************************
class Example extends PureComponent {
state = {
data: shuffle(mockData).slice(0, Math.floor(Math.random() * ((mockData.length + 2) - (5 + 1))) + 5),
}
update = () => {
this.setState({
data: shuffle(mockData).slice(0, Math.floor(Math.random() * ((mockData.length + 2) - (5 + 1))) + 5),
})
}
render() {
const scale = scaleBand()
.rangeRound([0, dims[0]])
.domain(this.state.data.map((d) => d.name))
.padding(0.1)
return (
<div></div>
generateData() {
return d3Array.shuffle(alphabet)
.slice(0, this.props.minItems +
Math.floor(Math.random() * (26 - this.props.minItems)))
.sort()
.map(letter => ({
letter,
number: Math.floor(Math.random() * 100)
}));
},
function getArcs() {
const data = shuffle(mockData)
.map(({ name }) => ({ name, value: getRandom(10, 100) }));
return pieLayout(sortBy(data, (d) => d.name));
}
function getData() {
return shuffle(range(count).map((d) => ({ value: d }))).slice(0, count / 1.5)
}
static async getInitialProps() {
return {
galleryItems: shuffle(gallery)
}
}
constructor(props) {
generateData() {
return d3Array.shuffle(alphabet)
.slice(0, this.props.minItems +
Math.floor(Math.random() * (26 - this.props.minItems)))
.sort()
.map(letter => ({
letter,
number: Math.floor(Math.random() * 100)
}));
},
function getArcs() {
const data = shuffle(mockData)
.map(({ name }) => ({ name, value: getRandom(10, 100) }))
return pieLayout(sortBy(data, (d) => d.name))
}