Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
boygirl committed Jun 20, 2020
1 parent 1363d65 commit 6891d47
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions demo/js/components/draggable-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class App extends React.Component {

onDomainChange(domain, props) {
const { name } = props;
const newBars = this.state.bars.map(
(bar) => (bar.name === name ? { name, range: domain } : bar)
const newBars = this.state.bars.map((bar) =>
bar.name === name ? { name, range: domain } : bar
);
this.setState({ bars: newBars });
}
Expand Down
4 changes: 2 additions & 2 deletions demo/ts/components/draggable-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ class App extends React.Component<any, DraggableDemoInterface> {

onDomainChange(domain: DomainTuple, props: any) {
const { name } = props;
const newBars = this.state.bars.map(
(bar) => (bar.name === name ? { name, range: domain } : bar)
const newBars = this.state.bars.map((bar) =>
bar.name === name ? { name, range: domain } : bar
);

this.setState({ bars: newBars });
Expand Down
17 changes: 10 additions & 7 deletions packages/victory-core/src/victory-util/immutable.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ export default {

shallowToJS(x, whitelist) {
return this.isIterable(x)
? x.reduce((prev, curr, key) => {
if (whitelist && whitelist[key]) {
curr = this.shallowToJS(curr);
}
prev[key] = curr;
return prev;
}, this.isList(x) ? [] : {})
? x.reduce(
(prev, curr, key) => {
if (whitelist && whitelist[key]) {
curr = this.shallowToJS(curr);
}
prev[key] = curr;
return prev;
},
this.isList(x) ? [] : {}
)
: x;
}
};
17 changes: 8 additions & 9 deletions packages/victory-stack/src/helper-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ function getY0(datum, index, datasets) {
const previousPoints = previousDatasets.reduce((prev, dataset) => {
return prev.concat(
dataset
.filter(
(previousDatum) =>
datum._x instanceof Date
? previousDatum._x.getTime() === datum._x.getTime()
: previousDatum._x === datum._x
.filter((previousDatum) =>
datum._x instanceof Date
? previousDatum._x.getTime() === datum._x.getTime()
: previousDatum._x === datum._x
)
.map((previousDatum) => previousDatum._y || 0)
);
Expand All @@ -88,14 +87,14 @@ function addLayoutData(props, datasets, index) {
datum._y === null
? null
: datum._y instanceof Date
? new Date(+datum._y + +yOffset)
: datum._y + yOffset,
? new Date(+datum._y + +yOffset)
: datum._y + yOffset,
_x1:
datum._x === null
? null
: datum._x instanceof Date
? new Date(+datum._x + +xOffset)
: datum._x + xOffset
? new Date(+datum._x + +xOffset)
: datum._x + xOffset
});
});
}
Expand Down

0 comments on commit 6891d47

Please sign in to comment.