Applied autofix for object-curly-newline rule.

This commit is contained in:
Filip Barl
2017-10-17 19:07:14 +02:00
parent d9a8afe81d
commit 2fcbdb7e16
45 changed files with 209 additions and 78 deletions
@@ -15,10 +15,18 @@ describe('LayouterUtils', () => {
c: {}
});
expect(initEdgesFromNodes(input).toJS()).toEqual({
[edge('a', 'b')]: { id: edge('a', 'b'), source: 'a', target: 'b', value: 1 },
[edge('a', 'c')]: { id: edge('a', 'c'), source: 'a', target: 'c', value: 1 },
[edge('b', 'a')]: { id: edge('b', 'a'), source: 'b', target: 'a', value: 1 },
[edge('b', 'b')]: { id: edge('b', 'b'), source: 'b', target: 'b', value: 1 },
[edge('a', 'b')]: {
id: edge('a', 'b'), source: 'a', target: 'b', value: 1
},
[edge('a', 'c')]: {
id: edge('a', 'c'), source: 'a', target: 'c', value: 1
},
[edge('b', 'a')]: {
id: edge('b', 'a'), source: 'b', target: 'a', value: 1
},
[edge('b', 'b')]: {
id: edge('b', 'b'), source: 'b', target: 'b', value: 1
},
});
});
});
@@ -37,9 +37,15 @@ describe('MathUtils', () => {
expect(f(fromJS({...entryA, ...entryB}))).toBe(30);
expect(f(fromJS({...entryA, ...entryC}))).toBe(40);
expect(f(fromJS({...entryB, ...entryC}))).toBe(50);
expect(f(fromJS({...entryA, ...entryB, ...entryC, ...entryD}))).toBe(30);
expect(f(fromJS({...entryA, ...entryB, ...entryC, ...entryD, ...entryE}))).toBe(1);
expect(f(fromJS({...entryA, ...entryB, ...entryC, ...entryD, ...entryF}))).toBe(0);
expect(f(fromJS({
...entryA, ...entryB, ...entryC, ...entryD
}))).toBe(30);
expect(f(fromJS({
...entryA, ...entryB, ...entryC, ...entryD, ...entryE
}))).toBe(1);
expect(f(fromJS({
...entryA, ...entryB, ...entryC, ...entryD, ...entryF
}))).toBe(0);
});
});
});
@@ -140,7 +140,9 @@ describe('SearchUtils', () => {
);
expect(matches.size).toBe(1);
expect(matches.getIn(['node1', 'field1'])).toBeDefined();
const {text, label, start, length} = matches.getIn(['node1', 'field1']);
const {
text, label, start, length
} = matches.getIn(['node1', 'field1']);
expect(text).toBe('samevalue');
expect(label).toBe('some label');
expect(start).toBe(0);
+3 -1
View File
@@ -26,7 +26,9 @@ export function initEdgesFromNodes(nodes) {
// The direction source->target is important since dagre takes
// directionality into account when calculating the layout.
const edgeId = constructEdgeId(source, target);
const edge = makeMap({ id: edgeId, value: 1, source, target });
const edge = makeMap({
id: edgeId, value: 1, source, target
});
edges = edges.set(edgeId, edge);
}
});
+3 -1
View File
@@ -22,7 +22,9 @@ function curvedUnitPolygonPath(n) {
export const circleShapeProps = { r: 1 };
export const triangleShapeProps = { d: curvedUnitPolygonPath(3) };
export const squareShapeProps = { width: 1.8, height: 1.8, rx: 0.4, ry: 0.4, x: -0.9, y: -0.9 };
export const squareShapeProps = {
width: 1.8, height: 1.8, rx: 0.4, ry: 0.4, x: -0.9, y: -0.9
};
export const pentagonShapeProps = { d: curvedUnitPolygonPath(5) };
export const hexagonShapeProps = { d: curvedUnitPolygonPath(6) };
export const heptagonShapeProps = { d: curvedUnitPolygonPath(7) };
+6 -2
View File
@@ -74,7 +74,9 @@ function findNodeMatch(nodeMatches, keyPath, text, query, prefix, label, truncat
const index = text.search(queryRe);
nodeMatches = nodeMatches.setIn(
keyPath,
{text, label, start: index, length: firstMatch.length, truncate}
{
text, label, start: index, length: firstMatch.length, truncate
}
);
}
}
@@ -121,7 +123,9 @@ function findNodeMatchMetric(nodeMatches, keyPath, fieldValue, fieldLabel, metri
return nodeMatches;
}
export function searchNode(node, { prefix, query, metric, comp, value }) {
export function searchNode(node, {
prefix, query, metric, comp, value
}) {
let nodeMatches = makeMap();
if (query) {
+9 -3
View File
@@ -4,7 +4,9 @@ const applyTranslateY = ({ scaleY = 1, translateY = 0 }, y) => (y * scaleY) + tr
const applyScaleX = ({ scaleX = 1 }, width) => width * scaleX;
const applyScaleY = ({ scaleY = 1 }, height) => height * scaleY;
export const applyTransform = (transform, { width = 0, height = 0, x, y }) => ({
export const applyTransform = (transform, {
width = 0, height = 0, x, y
}) => ({
x: applyTranslateX(transform, x),
y: applyTranslateY(transform, y),
width: applyScaleX(transform, width),
@@ -17,7 +19,9 @@ const inverseTranslateY = ({ scaleY = 1, translateY = 0 }, y) => (y - translateY
const inverseScaleX = ({ scaleX = 1 }, width) => width / scaleX;
const inverseScaleY = ({ scaleY = 1 }, height) => height / scaleY;
export const inverseTransform = (transform, { width = 0, height = 0, x, y }) => ({
export const inverseTransform = (transform, {
width = 0, height = 0, x, y
}) => ({
x: inverseTranslateX(transform, x),
y: inverseTranslateY(transform, y),
width: inverseScaleX(transform, width),
@@ -25,6 +29,8 @@ export const inverseTransform = (transform, { width = 0, height = 0, x, y }) =>
});
export const transformToString = ({ translateX = 0, translateY = 0, scaleX = 1, scaleY = 1 }) => (
export const transformToString = ({
translateX = 0, translateY = 0, scaleX = 1, scaleY = 1
}) => (
`translate(${translateX},${translateY}) scale(${scaleX},${scaleY})`
);