animate pan to selected instance

This commit is contained in:
Tao Bojlén 2019-08-22 09:04:35 +00:00
parent 528d4e4386
commit 6972237d21
5 changed files with 25 additions and 18 deletions

View file

@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Animate the pan when you select a new instance.
### Deprecated
### Removed

View file

@ -46,7 +46,11 @@ defmodule BackendWeb.Endpoint do
)
plug(Corsica,
origins: ["http://localhost:3000", ~r{^https?://(.*\.?)fediverse\.space$}],
origins: [
"http://localhost:3000",
~r{^https?://(.*\.?)fediverse\.space$},
~r{^https?://(.*\.?)fediverse-space\.netlify.com$}
],
allow_headers: ["content-type", "token"]
)

View file

@ -34,7 +34,7 @@
"classnames": "^2.2.6",
"connected-react-router": "^6.5.2",
"cross-fetch": "^3.0.4",
"cytoscape": "^3.9.0",
"cytoscape": "^3.9.1",
"cytoscape-popper": "^1.0.4",
"inflection": "^1.12.0",
"lodash": "^4.17.15",
@ -66,13 +66,13 @@
"@types/react": "^16.9.2",
"@types/react-dom": "^16.9.0",
"@types/react-redux": "^7.1.2",
"@types/react-router-dom": "^4.3.4",
"@types/react-router-dom": "^4.3.5",
"@types/sanitize-html": "^1.20.1",
"@types/styled-components": "4.1.18",
"husky": "^3.0.4",
"lint-staged": "^9.2.3",
"react-axe": "^3.2.0",
"tslint": "^5.18.0",
"tslint": "^5.19.0",
"tslint-config-security": "^1.16.0",
"tslint-eslint-rules": "^5.4.0",
"typescript": "^3.5.3"

View file

@ -200,8 +200,9 @@ class Cytoscape extends React.PureComponent<ICytoscapeProps> {
// Select instance
this.cy.$id(currentNodeId).select();
// Center it
const selected = this.cy.$id(currentNodeId);
this.cy.center(selected);
this.cy.animate({
pan: this.cy.$id(currentNodeId).position()
});
}
};

View file

@ -1672,10 +1672,10 @@
hoist-non-react-statics "^3.3.0"
redux "^4.0.0"
"@types/react-router-dom@^4.3.4":
version "4.3.4"
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-4.3.4.tgz#63a7a8558129d2f4ff76e4bdd099bf4b98e25a0d"
integrity sha512-xrwaWHpnxKk/TTRe7pmoGy3E4SyF/ojFqNfFJacw7OLdfLXRvGfk4r/XePVaZNVfeJzL8fcnNilPN7xOdJ/vGw==
"@types/react-router-dom@^4.3.5":
version "4.3.5"
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-4.3.5.tgz#72f229967690c890d00f96e6b85e9ee5780db31f"
integrity sha512-eFajSUASYbPHg2BDM1G8Btx+YqGgvROPIg6sBhl3O4kbDdYXdFdfrgQFf/pcBuQVObjfT9AL/dd15jilR5DIEA==
dependencies:
"@types/history" "*"
"@types/react" "*"
@ -3734,10 +3734,10 @@ cytoscape-popper@^1.0.4:
dependencies:
popper.js "^1.0.0"
cytoscape@^3.9.0:
version "3.9.0"
resolved "https://registry.yarnpkg.com/cytoscape/-/cytoscape-3.9.0.tgz#7cc9f10c2e02a167ddf7aeb2e3fddcf704913776"
integrity sha512-tEslrW0opFmcoDEU1XL68snE40HoVIdGvYcYabqVBxe+pE1YoHL7k3+07CFXDg3o52kRInRPUxnCc73V1pY4wQ==
cytoscape@^3.9.1:
version "3.9.1"
resolved "https://registry.yarnpkg.com/cytoscape/-/cytoscape-3.9.1.tgz#b5520de3d7af9bf1d178d646d32557278d979f3c"
integrity sha512-NdmRylOdIelOXskUwK4Ayg+BRWsKzxj0moZbhffuwvNGfwylK8dTkIOkfeYkXd3CHtB4gtw11PTpTZStc7DWtQ==
dependencies:
heap "^0.2.6"
lodash.debounce "^4.0.8"
@ -11095,10 +11095,10 @@ tslint-react@^4.0.0:
dependencies:
tsutils "^3.9.1"
tslint@^5.18.0:
version "5.18.0"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.18.0.tgz#f61a6ddcf372344ac5e41708095bbf043a147ac6"
integrity sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==
tslint@^5.19.0:
version "5.19.0"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.19.0.tgz#a2cbd4a7699386da823f6b499b8394d6c47bb968"
integrity sha512-1LwwtBxfRJZnUvoS9c0uj8XQtAnyhWr9KlNvDIdB+oXyT+VpsOAaEhEgKi1HrZ8rq0ki/AAnbGSv4KM6/AfVZw==
dependencies:
"@babel/code-frame" "^7.0.0"
builtin-modules "^1.1.1"