Navigation Menu

Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
kousun12 committed Jun 24, 2019
1 parent 42a731b commit dd22573
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .prettierrc
@@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"printWidth": 100,
"parser": "babel-flow"
}
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -62,7 +62,8 @@
},
"devDependencies": {
"flow-bin": "^0.81.0",
"gh-pages": "^2.0.1"
"gh-pages": "^2.0.1",
"prettier": "^1.18.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down
13 changes: 8 additions & 5 deletions src/components/NodeGraph.js
Expand Up @@ -172,11 +172,14 @@ class NodeGraph extends React.Component<P, S> {
};

resetSize = () => {
const maxW = Math.max(...this.state.graph.nodes.map(nis => nis.pos.x))
const maxH = Math.max(...this.state.graph.nodes.map(nis => nis.pos.y))
document.getElementById('eternal-root').style.width = maxW + 300
document.getElementById('eternal-root').style.height = maxH + 500
}
const maxW = Math.max(...this.state.graph.nodes.map(nis => nis.pos.x));
const maxH = Math.max(...this.state.graph.nodes.map(nis => nis.pos.y));
const elem = document.getElementById('eternal-root');
if (elem) {
elem.style.width = maxW + 300;
elem.style.height = maxH + 500;
}
};

_drawEdges = () => {
const {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Expand Up @@ -10501,6 +10501,11 @@ prepend-http@^1.0.0:
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=

prettier@^1.18.2:
version "1.18.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==

pretty-bytes@^5.1.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.2.0.tgz#96c92c6e95a0b35059253fb33c03e260d40f5a1f"
Expand Down

0 comments on commit dd22573

Please sign in to comment.