From 8363d0775ccc5f42af3bf16050e9117189096541 Mon Sep 17 00:00:00 2001 From: futpib Date: Thu, 21 Mar 2019 22:17:13 +0300 Subject: [PATCH] Upgrade `react-digraph` --- components/graph/satellites-graph.js | 14 +-- package.json | 2 +- yarn.lock | 126 +++++++++++++++++++++++++-- 3 files changed, 122 insertions(+), 20 deletions(-) diff --git a/components/graph/satellites-graph.js b/components/graph/satellites-graph.js index da80199..1f9f6f7 100644 --- a/components/graph/satellites-graph.js +++ b/components/graph/satellites-graph.js @@ -73,7 +73,6 @@ class SatellitesGraphView extends React.Component { this.graphViewRef = this.props.graphViewRef || React.createRef(); Object.assign(this, { - onSwapEdge: this.onSwapEdge.bind(this), onNodeMove: this.onNodeMove.bind(this), onSelectEdge: this.onSelectEdge.bind(this), @@ -150,17 +149,6 @@ class SatellitesGraphView extends React.Component { }); } - onSwapEdge(sourceNode, targetNode, edge) { - this.props.onSwapEdge(sourceNode, targetNode, edge); - - const { nodeKey } = this.props; - - const createdEdgeId = `edge-${sourceNode[nodeKey]}-${targetNode[nodeKey]}-container`; - const createdEdge = document.getElementById(createdEdgeId); - createdEdge.remove(); - this.graphViewRef.current.forceUpdate(); - } - onCreateEdge(source, target) { const { nodeKey, onCreateEdge } = this.props; onCreateEdge(source, target); @@ -241,7 +229,7 @@ class SatellitesGraphView extends React.Component { nodes, edges, - onSwapEdge: this.onSwapEdge, + onSwapEdge: this.props.onSwapEdge, onNodeMove: this.onNodeMove, onSelectEdge: this.onSelectEdge, diff --git a/package.json b/package.json index e880886..16d7613 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "ramda": "^0.25.0", "react": "^16.6.0", "react-addons-css-transition-group": "^15.6.2", - "react-digraph": "^6.0.0", + "react-digraph": "^6.2.2", "react-dom": "^16.6.0", "react-hotkeys": "^1.1.4", "react-modal": "^3.6.1", diff --git a/yarn.lock b/yarn.lock index 4f1873e..bbc86dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1695,6 +1695,15 @@ create-error-class@^3.0.0: dependencies: capture-stack-trace "^1.0.0" +create-react-class@^15.6.0: + version "15.6.3" + resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.3.tgz#2d73237fb3f970ae6ebe011a9e66f46dbca80036" + integrity sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg== + dependencies: + fbjs "^0.8.9" + loose-envify "^1.3.1" + object-assign "^4.1.1" + cross-spawn@^4: version "4.0.2" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" @@ -1733,6 +1742,16 @@ crypto-random-string@^1.0.0: resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= +css@2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/css/-/css-2.2.4.tgz#c646755c73971f2bba6a601e2cf2fd71b1298929" + integrity sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw== + dependencies: + inherits "^2.0.3" + source-map "^0.6.1" + source-map-resolve "^0.5.2" + urix "^0.1.0" + cuint@^0.2.1: version "0.2.2" resolved "https://registry.yarnpkg.com/cuint/-/cuint-0.2.2.tgz#408086d409550c2631155619e9fa7bcadc3b991b" @@ -2230,6 +2249,41 @@ dom-helpers@^3.2.0: dependencies: "@babel/runtime" "^7.1.2" +dom-serializer@0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" + integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA== + dependencies: + domelementtype "^1.3.0" + entities "^1.1.1" + +domelementtype@1, domelementtype@^1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" + integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== + +domhandler@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738" + integrity sha1-LeWaCCLVAn+r/28DLCsloqir5zg= + dependencies: + domelementtype "1" + +domhandler@^2.3.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" + integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== + dependencies: + domelementtype "1" + +domutils@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" + integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== + dependencies: + dom-serializer "0" + domelementtype "1" + dot-prop@^4.1.0: version "4.2.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" @@ -2375,6 +2429,11 @@ enhance-visitors@^1.0.0: dependencies: lodash "^4.13.1" +entities@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" + integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== + env-editor@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/env-editor/-/env-editor-0.3.1.tgz#30d0540c2101414f258a94d4c0a524c06c13e3c6" @@ -2912,7 +2971,7 @@ fast-levenshtein@~2.0.4: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -fbjs@^0.8.1: +fbjs@^0.8.1, fbjs@^0.8.9: version "0.8.17" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90= @@ -3625,6 +3684,35 @@ hosted-git-info@^2.1.4: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== +html-dom-parser@0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/html-dom-parser/-/html-dom-parser-0.1.3.tgz#fe22aa84206a46484069138849f29b154a5ee884" + integrity sha512-kGhjJDkfiA2/3y0gc2Bi+rseJWJSKz4CioS4EM+vN80fw863f1hn3G+7EaP0/benxceky4a8TzEeW6+dDjUh7A== + dependencies: + domhandler "2.3.0" + htmlparser2 "3.9.1" + +html-react-parser@^0.6.1: + version "0.6.3" + resolved "https://registry.yarnpkg.com/html-react-parser/-/html-react-parser-0.6.3.tgz#e40a4ab27fbcad83dda7215525cf1931d192a5c3" + integrity sha512-TywqHE20qEtQ8lKZCnmhsAW4SV4POd5fiCDefdiXV6JZVg/TuWb3xvbsbONUMa/LDFFy3FNpaja6iXhgFP/LPA== + dependencies: + html-dom-parser "0.1.3" + react-dom-core "0.0.4" + style-to-object "0.2.2" + +htmlparser2@3.9.1: + version "3.9.1" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.9.1.tgz#621b7a58bc9acd003f7af0a2c9a00aa67c8505d2" + integrity sha1-Yht6WLyazQA/evCiyaAKpnyFBdI= + dependencies: + domelementtype "^1.3.0" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^2.0.2" + http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: version "1.6.3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" @@ -6077,18 +6165,26 @@ react-addons-css-transition-group@^15.6.2: dependencies: react-transition-group "^1.2.0" -react-digraph@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/react-digraph/-/react-digraph-6.0.0.tgz#f9bc73525aac629fe7dee16331263167f430bce8" - integrity sha512-wMWoakhqVVm/sGY63+TyIJurdDGSrfo0ArfMyBAphz9ZXBRCQ7X1x7WFaWqYpU7YhzXSV7u6HXuvleW6NMCQrg== +react-digraph@^6.2.2: + version "6.2.2" + resolved "https://registry.yarnpkg.com/react-digraph/-/react-digraph-6.2.2.tgz#485fda10572423458983fad95c6818b272ce72e4" + integrity sha512-D9HfiNaiEcla2WdChqzUT9m0QzHL7oylTDc4BiO33TFfD+puhVzZSoyxadE5Ntk4Gt88uPXC2sG6lleUPL4J8w== dependencies: d3 "^5.7.0" dagre "^0.8.2" + html-react-parser "^0.6.1" kld-affine "^2.0.4" kld-intersections "^0.4.3" line-intersect "^2.1.1" svg-intersections "^0.4.0" +react-dom-core@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/react-dom-core/-/react-dom-core-0.0.4.tgz#26ef74749c1235993b0e570a83308f323a485b2a" + integrity sha512-nJoncKG/Ltlv3K7f0uVwX3kEvhrRl3dyKguxpYR3OmFF1REcRHiWWxSkD1hJdgeVfoBFp/DPVp48JZuaQhwLoQ== + dependencies: + react "15" + react-dom-factories@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/react-dom-factories/-/react-dom-factories-1.0.2.tgz#eb7705c4db36fb501b3aa38ff759616aa0ff96e0" @@ -6174,6 +6270,17 @@ react-transition-group@^1.2.0: prop-types "^15.5.6" warning "^3.0.0" +react@15: + version "15.6.2" + resolved "https://registry.yarnpkg.com/react/-/react-15.6.2.tgz#dba0434ab439cfe82f108f0f511663908179aa72" + integrity sha1-26BDSrQ5z+gvEI8PURZjkIF5qnI= + dependencies: + create-react-class "^15.6.0" + fbjs "^0.8.9" + loose-envify "^1.1.0" + object-assign "^4.1.0" + prop-types "^15.5.10" + react@^16.6.0: version "16.6.0" resolved "https://registry.yarnpkg.com/react/-/react-16.6.0.tgz#b34761cfaf3e30f5508bc732fb4736730b7da246" @@ -7036,7 +7143,7 @@ sort-keys@^2.0.0: dependencies: is-plain-obj "^1.0.0" -source-map-resolve@^0.5.0: +source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== @@ -7276,6 +7383,13 @@ strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= +style-to-object@0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.2.2.tgz#3ea3b276bd3fa9da1195fcdcdd03bc52aa2aae01" + integrity sha512-GcbtvfsqyKmIPpHeOHZ5Rmwsx2MDJct4W9apmTGcbPTbpA2FcgTFl2Z43Hm4Qb61MWGPNK8Chki7ITiY7lLOow== + dependencies: + css "2.2.4" + sumchecker@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-2.0.2.tgz#0f42c10e5d05da5d42eea3e56c3399a37d6c5b3e"