Commit b8956dfd by kevalbhatt

ATLAS-3911: UI: Type system managment

parent 74229d87
...@@ -24,4 +24,6 @@ target/ ...@@ -24,4 +24,6 @@ target/
*.log *.log
*.tgz *.tgz
node/ node/
.npmrc
dist/ dist/
!public/js/external_lib/atlas-lineage/dist
\ No newline at end of file
...@@ -94,7 +94,7 @@ module.exports = function(grunt) { ...@@ -94,7 +94,7 @@ module.exports = function(grunt) {
'backgrid-sizeable-columns.js': { 'backgrid-sizeable-columns': 'backgrid-sizeable-columns/js' }, 'backgrid-sizeable-columns.js': { 'backgrid-sizeable-columns': 'backgrid-sizeable-columns/js' },
'Backgrid.ColumnManager.js': { 'backgrid-columnmanager/src': 'backgrid-columnmanager/js' }, 'Backgrid.ColumnManager.js': { 'backgrid-columnmanager/src': 'backgrid-columnmanager/js' },
'jquery-asBreadcrumbs.min.js': { 'jquery-asBreadcrumbs/dist': 'jquery-asBreadcrumbs/js' }, 'jquery-asBreadcrumbs.min.js': { 'jquery-asBreadcrumbs/dist': 'jquery-asBreadcrumbs/js' },
'd3.min.js': { 'd3': 'd3' }, 'd3.min.js': { 'd3/dist': 'd3' },
'index.js': { 'd3-tip': 'd3/' }, 'index.js': { 'd3-tip': 'd3/' },
'dagre-d3.min.js': { 'dagre-d3/dist': 'dagre-d3' }, 'dagre-d3.min.js': { 'dagre-d3/dist': 'dagre-d3' },
'select2.full.min.js': { 'select2/dist/js': 'select2' }, 'select2.full.min.js': { 'select2/dist/js': 'select2' },
...@@ -218,7 +218,7 @@ module.exports = function(grunt) { ...@@ -218,7 +218,7 @@ module.exports = function(grunt) {
build: { build: {
expand: true, expand: true,
cwd: modulesPath, cwd: modulesPath,
src: ['**', '!**/scss/**', "!index.html.tpl"], src: ['**', '!**/scss/**', "!**/atlas-lineage/**", "**/atlas-lineage/dist/**", "!index.html.tpl"],
dest: distPath dest: distPath
} }
}, },
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
} }
}, },
"ajv": { "ajv": {
"version": "6.12.0", "version": "6.12.4",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz",
"integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"fast-deep-equal": "^3.1.1", "fast-deep-equal": "^3.1.1",
...@@ -179,9 +179,9 @@ ...@@ -179,9 +179,9 @@
"dev": true "dev": true
}, },
"aws4": { "aws4": {
"version": "1.9.1", "version": "1.10.1",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz",
"integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==",
"dev": true "dev": true
}, },
"babel-runtime": { "babel-runtime": {
...@@ -617,9 +617,42 @@ ...@@ -617,9 +617,42 @@
"integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=" "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU="
}, },
"d3": { "d3": {
"version": "3.5.17", "version": "5.14.2",
"resolved": "https://registry.npmjs.org/d3/-/d3-3.5.17.tgz", "resolved": "https://registry.npmjs.org/d3/-/d3-5.14.2.tgz",
"integrity": "sha1-vEZ0gAQ3iyGjYMn8fPUjF5B2L7g=" "integrity": "sha512-Ccipa9XrYW5N0QkP6u0Qb8kU6WekIXBiDenmZm1zLvuq/9pBBhRCJLCICEOsH5Og4B0Xw02bhqGkK5VN/oPH0w==",
"requires": {
"d3-array": "1",
"d3-axis": "1",
"d3-brush": "1",
"d3-chord": "1",
"d3-collection": "1",
"d3-color": "1",
"d3-contour": "1",
"d3-dispatch": "1",
"d3-drag": "1",
"d3-dsv": "1",
"d3-ease": "1",
"d3-fetch": "1",
"d3-force": "1",
"d3-format": "1",
"d3-geo": "1",
"d3-hierarchy": "1",
"d3-interpolate": "1",
"d3-path": "1",
"d3-polygon": "1",
"d3-quadtree": "1",
"d3-random": "1",
"d3-scale": "2",
"d3-scale-chromatic": "1",
"d3-selection": "1",
"d3-shape": "1",
"d3-time": "1",
"d3-time-format": "2",
"d3-timer": "1",
"d3-transition": "1",
"d3-voronoi": "1",
"d3-zoom": "1"
}
}, },
"d3-array": { "d3-array": {
"version": "1.2.4", "version": "1.2.4",
...@@ -632,9 +665,9 @@ ...@@ -632,9 +665,9 @@
"integrity": "sha512-ejINPfPSNdGFKEOAtnBtdkpr24c4d4jsei6Lg98mxf424ivoDP2956/5HDpIAtmHo85lqT4pruy+zEgvRUBqaQ==" "integrity": "sha512-ejINPfPSNdGFKEOAtnBtdkpr24c4d4jsei6Lg98mxf424ivoDP2956/5HDpIAtmHo85lqT4pruy+zEgvRUBqaQ=="
}, },
"d3-brush": { "d3-brush": {
"version": "1.1.5", "version": "1.1.6",
"resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-1.1.5.tgz", "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-1.1.6.tgz",
"integrity": "sha512-rEaJ5gHlgLxXugWjIkolTA0OyMvw8UWU1imYXy1v642XyyswmI1ybKOv05Ft+ewq+TFmdliD3VuK0pRp1VT/5A==", "integrity": "sha512-7RW+w7HfMCPyZLifTz/UnJmI5kdkXtpCbombUSs8xniAyo0vIbrDzDwUJB6eJOgl9u5DQOt2TQlYumxzD1SvYA==",
"requires": { "requires": {
"d3-dispatch": "1", "d3-dispatch": "1",
"d3-drag": "1", "d3-drag": "1",
...@@ -658,9 +691,9 @@ ...@@ -658,9 +691,9 @@
"integrity": "sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A==" "integrity": "sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A=="
}, },
"d3-color": { "d3-color": {
"version": "1.4.0", "version": "1.4.1",
"resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.0.tgz", "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz",
"integrity": "sha512-TzNPeJy2+iEepfiL92LAAB7fvnp/dV2YwANPVHdDWmYMm23qIJBYww3qT8I8C1wXrmrg4UWs7BKc2tKIgyjzHg==" "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q=="
}, },
"d3-contour": { "d3-contour": {
"version": "1.3.2", "version": "1.3.2",
...@@ -695,14 +728,14 @@ ...@@ -695,14 +728,14 @@
} }
}, },
"d3-ease": { "d3-ease": {
"version": "1.0.6", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.6.tgz", "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz",
"integrity": "sha512-SZ/lVU7LRXafqp7XtIcBdxnWl8yyLpgOmzAk0mWBI9gXNzLDx5ybZgnRbH9dN/yY5tzVBqCQ9avltSnqVwessQ==" "integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ=="
}, },
"d3-fetch": { "d3-fetch": {
"version": "1.1.2", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-1.1.2.tgz", "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-1.2.0.tgz",
"integrity": "sha512-S2loaQCV/ZeyTyIF2oP8D1K9Z4QizUzW7cWeAOAS4U88qOt3Ucf6GsmgthuYSdyB2HyEm4CeGvkQxWsmInsIVA==", "integrity": "sha512-yC78NBVcd2zFAyR/HnUiBS7Lf6inSCoWcSxFfw8FYL7ydiqe80SazNwoffcqOfs95XaLo7yebsmQqDKSsXUtvA==",
"requires": { "requires": {
"d3-dsv": "1" "d3-dsv": "1"
} }
...@@ -719,14 +752,14 @@ ...@@ -719,14 +752,14 @@
} }
}, },
"d3-format": { "d3-format": {
"version": "1.4.4", "version": "1.4.5",
"resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.4.tgz", "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.5.tgz",
"integrity": "sha512-TWks25e7t8/cqctxCmxpUuzZN11QxIA7YrMbram94zMQ0PXjE4LVIMe/f6a4+xxL8HQ3OsAFULOINQi1pE62Aw==" "integrity": "sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ=="
}, },
"d3-geo": { "d3-geo": {
"version": "1.11.9", "version": "1.12.1",
"resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.11.9.tgz", "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.12.1.tgz",
"integrity": "sha512-9edcH6J3s/Aa3KJITWqFJbyB/8q3mMlA9Fi7z6yy+FAYMnRaxmC7jBhUnsINxVWD14GmqX3DK8uk7nV6/Ekt4A==", "integrity": "sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg==",
"requires": { "requires": {
"d3-array": "1" "d3-array": "1"
} }
...@@ -787,9 +820,9 @@ ...@@ -787,9 +820,9 @@
} }
}, },
"d3-selection": { "d3-selection": {
"version": "1.4.1", "version": "1.4.2",
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.1.tgz", "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz",
"integrity": "sha512-BTIbRjv/m5rcVTfBs4AMBLKs4x8XaaLkwm28KWu9S2vKNqXkXt2AH2Qf0sdPZHjFxcWg/YL53zcqAz+3g4/7PA==" "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg=="
}, },
"d3-shape": { "d3-shape": {
"version": "1.3.7", "version": "1.3.7",
...@@ -805,9 +838,9 @@ ...@@ -805,9 +838,9 @@
"integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==" "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA=="
}, },
"d3-time-format": { "d3-time-format": {
"version": "2.2.3", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.2.3.tgz", "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz",
"integrity": "sha512-RAHNnD8+XvC4Zc4d2A56Uw0yJoM7bsvOlJR33bclxq399Rak/b9bhvu/InjxdWhPtkgU53JJcleJTGkNRnN6IA==", "integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==",
"requires": { "requires": {
"d3-time": "1" "d3-time": "1"
} }
...@@ -823,6 +856,13 @@ ...@@ -823,6 +856,13 @@
"integrity": "sha1-5bRJGuiYP95kbqSQCP9UKgM8Ciw=", "integrity": "sha1-5bRJGuiYP95kbqSQCP9UKgM8Ciw=",
"requires": { "requires": {
"d3": "^3.5.5" "d3": "^3.5.5"
},
"dependencies": {
"d3": {
"version": "3.5.17",
"resolved": "https://registry.npmjs.org/d3/-/d3-3.5.17.tgz",
"integrity": "sha1-vEZ0gAQ3iyGjYMn8fPUjF5B2L7g="
}
} }
}, },
"d3-transition": { "d3-transition": {
...@@ -873,46 +913,6 @@ ...@@ -873,46 +913,6 @@
"dagre": "^0.8.5", "dagre": "^0.8.5",
"graphlib": "^2.1.8", "graphlib": "^2.1.8",
"lodash": "^4.17.15" "lodash": "^4.17.15"
},
"dependencies": {
"d3": {
"version": "5.15.1",
"resolved": "https://registry.npmjs.org/d3/-/d3-5.15.1.tgz",
"integrity": "sha512-Xu9gT6Lm0jH3wWJJSRomFwqnGGi3YAfWIfxNFl4++YVgYOjo3F8V2idAG3nJBgpZOkD0/RHPZX6F4k6tzgOvYw==",
"requires": {
"d3-array": "1",
"d3-axis": "1",
"d3-brush": "1",
"d3-chord": "1",
"d3-collection": "1",
"d3-color": "1",
"d3-contour": "1",
"d3-dispatch": "1",
"d3-drag": "1",
"d3-dsv": "1",
"d3-ease": "1",
"d3-fetch": "1",
"d3-force": "1",
"d3-format": "1",
"d3-geo": "1",
"d3-hierarchy": "1",
"d3-interpolate": "1",
"d3-path": "1",
"d3-polygon": "1",
"d3-quadtree": "1",
"d3-random": "1",
"d3-scale": "2",
"d3-scale-chromatic": "1",
"d3-selection": "1",
"d3-shape": "1",
"d3-time": "1",
"d3-time-format": "2",
"d3-timer": "1",
"d3-transition": "1",
"d3-voronoi": "1",
"d3-zoom": "1"
}
}
} }
}, },
"dashdash": { "dashdash": {
...@@ -1105,9 +1105,9 @@ ...@@ -1105,9 +1105,9 @@
"dev": true "dev": true
}, },
"fast-deep-equal": { "fast-deep-equal": {
"version": "3.1.1", "version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true "dev": true
}, },
"fast-json-stable-stringify": { "fast-json-stable-stringify": {
...@@ -1309,13 +1309,13 @@ ...@@ -1309,13 +1309,13 @@
} }
}, },
"globule": { "globule": {
"version": "1.3.1", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/globule/-/globule-1.3.1.tgz", "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.2.tgz",
"integrity": "sha512-OVyWOHgw29yosRHCHo7NncwR1hW5ew0W/UrvtwvjefVJeQ26q4/8r8FmPsSF1hJ93IgWkyv16pCTz6WblMzm/g==", "integrity": "sha512-7IDTQTIu2xzXkT+6mlluidnWo+BypnbSoEVVQCGfzqnl5Ik8d3e1d4wycb8Rj9tWW+Z39uPWsdlquqiqPCd/pA==",
"dev": true, "dev": true,
"requires": { "requires": {
"glob": "~7.1.1", "glob": "~7.1.1",
"lodash": "~4.17.12", "lodash": "~4.17.10",
"minimatch": "~3.0.2" "minimatch": "~3.0.2"
}, },
"dependencies": { "dependencies": {
...@@ -1336,9 +1336,9 @@ ...@@ -1336,9 +1336,9 @@
} }
}, },
"graceful-fs": { "graceful-fs": {
"version": "4.2.3", "version": "4.2.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
"integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
"dev": true "dev": true
}, },
"graceful-readlink": { "graceful-readlink": {
...@@ -1693,12 +1693,12 @@ ...@@ -1693,12 +1693,12 @@
"dev": true "dev": true
}, },
"har-validator": { "har-validator": {
"version": "5.1.3", "version": "5.1.5",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
"integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
"dev": true, "dev": true,
"requires": { "requires": {
"ajv": "^6.5.5", "ajv": "^6.12.3",
"har-schema": "^2.0.0" "har-schema": "^2.0.0"
} }
}, },
...@@ -1801,9 +1801,9 @@ ...@@ -1801,9 +1801,9 @@
} }
}, },
"http-parser-js": { "http-parser-js": {
"version": "0.4.10", "version": "0.5.2",
"resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.10.tgz", "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.2.tgz",
"integrity": "sha1-ksnBN0w1CF912zWexWzCV8u5P6Q=", "integrity": "sha512-opCO9ASqg5Wy2FNo7A0sxy71yGbbkJJXLdgMK04Tcypw9jr2MgWbyubb0+WdmDmGnFflO7fRbqbaihh/ENDlRQ==",
"dev": true "dev": true
}, },
"http-signature": { "http-signature": {
...@@ -1979,9 +1979,9 @@ ...@@ -1979,9 +1979,9 @@
"integrity": "sha1-DO7gsNLkkUOYGtEg1FjtVuqOGSQ=" "integrity": "sha1-DO7gsNLkkUOYGtEg1FjtVuqOGSQ="
}, },
"js-base64": { "js-base64": {
"version": "2.5.2", "version": "2.6.4",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.2.tgz", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz",
"integrity": "sha512-Vg8czh0Q7sFBSUMWWArX/miJeBWYBPpdU/3M/DKSaekLMqrqVPaedp+5mZhie/r0lgrcaYBfwXatEew6gwgiQQ==", "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==",
"dev": true "dev": true
}, },
"js-yaml": { "js-yaml": {
...@@ -2094,9 +2094,9 @@ ...@@ -2094,9 +2094,9 @@
} }
}, },
"lodash": { "lodash": {
"version": "4.17.15", "version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
}, },
"longest": { "longest": {
"version": "1.0.1", "version": "1.0.1",
...@@ -2205,18 +2205,18 @@ ...@@ -2205,18 +2205,18 @@
"dev": true "dev": true
}, },
"mime-db": { "mime-db": {
"version": "1.43.0", "version": "1.44.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
"integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==",
"dev": true "dev": true
}, },
"mime-types": { "mime-types": {
"version": "2.1.26", "version": "2.1.27",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
"integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
"dev": true, "dev": true,
"requires": { "requires": {
"mime-db": "1.43.0" "mime-db": "1.44.0"
} }
}, },
"minimatch": { "minimatch": {
...@@ -2288,9 +2288,9 @@ ...@@ -2288,9 +2288,9 @@
} }
}, },
"nan": { "nan": {
"version": "2.14.0", "version": "2.14.1",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz",
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==",
"dev": true "dev": true
}, },
"ncname": { "ncname": {
...@@ -2696,9 +2696,9 @@ ...@@ -2696,9 +2696,9 @@
"dev": true "dev": true
}, },
"qs": { "qs": {
"version": "6.9.3", "version": "6.9.4",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.9.3.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz",
"integrity": "sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==", "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==",
"dev": true "dev": true
}, },
"range-parser": { "range-parser": {
...@@ -2856,9 +2856,9 @@ ...@@ -2856,9 +2856,9 @@
"integrity": "sha1-ExOHM2E/xEV7fhJH6Mt1HfeqVCk=" "integrity": "sha1-ExOHM2E/xEV7fhJH6Mt1HfeqVCk="
}, },
"resolve": { "resolve": {
"version": "1.16.0", "version": "1.17.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.16.0.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
"integrity": "sha512-LarL/PIKJvc09k1jaeT4kQb/8/7P+qV4qSnN2K80AES+OHdfZELAKVOBjxsvtToT/uLOfFbvYvKfZmV8cee7nA==", "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
"dev": true, "dev": true,
"requires": { "requires": {
"path-parse": "^1.0.6" "path-parse": "^1.0.6"
...@@ -2941,9 +2941,9 @@ ...@@ -2941,9 +2941,9 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
}, },
"sass-graph": { "sass-graph": {
"version": "2.2.4", "version": "2.2.6",
"resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.6.tgz",
"integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", "integrity": "sha512-MKuEYXFSGuRSi8FZ3A7imN1CeVn9Gpw0/SFJKdL1ejXJneI9a5rwlEZrKejhEFAA3O6yr3eIyl/WuvASvlT36g==",
"dev": true, "dev": true,
"requires": { "requires": {
"glob": "^7.0.0", "glob": "^7.0.0",
...@@ -2970,9 +2970,9 @@ ...@@ -2970,9 +2970,9 @@
} }
}, },
"yargs": { "yargs": {
"version": "7.1.0", "version": "7.1.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.1.tgz",
"integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", "integrity": "sha512-huO4Fr1f9PmiJJdll5kwoS2e4GqzGSsMT3PPMpOwoVkOK8ckqAewMTZyA6LXVQWflleb/Z8oPBEvNsMft0XE+g==",
"dev": true, "dev": true,
"requires": { "requires": {
"camelcase": "^3.0.0", "camelcase": "^3.0.0",
...@@ -2987,7 +2987,7 @@ ...@@ -2987,7 +2987,7 @@
"string-width": "^1.0.2", "string-width": "^1.0.2",
"which-module": "^1.0.0", "which-module": "^1.0.0",
"y18n": "^3.2.1", "y18n": "^3.2.1",
"yargs-parser": "^5.0.0" "yargs-parser": "5.0.0-security.0"
} }
} }
} }
...@@ -3134,9 +3134,9 @@ ...@@ -3134,9 +3134,9 @@
"dev": true "dev": true
}, },
"spdx-correct": { "spdx-correct": {
"version": "3.1.0", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
"integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==",
"dev": true, "dev": true,
"requires": { "requires": {
"spdx-expression-parse": "^3.0.0", "spdx-expression-parse": "^3.0.0",
...@@ -3144,15 +3144,15 @@ ...@@ -3144,15 +3144,15 @@
} }
}, },
"spdx-exceptions": { "spdx-exceptions": {
"version": "2.2.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
"integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==",
"dev": true "dev": true
}, },
"spdx-expression-parse": { "spdx-expression-parse": {
"version": "3.0.0", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
"integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"spdx-exceptions": "^2.1.0", "spdx-exceptions": "^2.1.0",
...@@ -3445,9 +3445,9 @@ ...@@ -3445,9 +3445,9 @@
"dev": true "dev": true
}, },
"uri-js": { "uri-js": {
"version": "4.2.2", "version": "4.4.0",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz",
"integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==",
"dev": true, "dev": true,
"requires": { "requires": {
"punycode": "^2.1.0" "punycode": "^2.1.0"
...@@ -3499,20 +3499,20 @@ ...@@ -3499,20 +3499,20 @@
} }
}, },
"websocket-driver": { "websocket-driver": {
"version": "0.7.3", "version": "0.7.4",
"resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.3.tgz", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz",
"integrity": "sha512-bpxWlvbbB459Mlipc5GBzzZwhoZgGEZLuqPaR0INBGnPAY1vdBX6hPnoFXiw+3yWxDuHyQjO2oXTMyS8A5haFg==", "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==",
"dev": true, "dev": true,
"requires": { "requires": {
"http-parser-js": ">=0.4.0 <0.4.11", "http-parser-js": ">=0.5.1",
"safe-buffer": ">=5.1.0", "safe-buffer": ">=5.1.0",
"websocket-extensions": ">=0.1.1" "websocket-extensions": ">=0.1.1"
} }
}, },
"websocket-extensions": { "websocket-extensions": {
"version": "0.1.3", "version": "0.1.4",
"resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz",
"integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==", "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==",
"dev": true "dev": true
}, },
"which": { "which": {
...@@ -3606,12 +3606,13 @@ ...@@ -3606,12 +3606,13 @@
} }
}, },
"yargs-parser": { "yargs-parser": {
"version": "5.0.0", "version": "5.0.0-security.0",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0-security.0.tgz",
"integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", "integrity": "sha512-T69y4Ps64LNesYxeYGYPvfoMTt/7y1XtfpIslUeK4um+9Hu7hlGoRtaDLvdXb7+/tfq4opVa2HRY5xGip022rQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"camelcase": "^3.0.0" "camelcase": "^3.0.0",
"object.assign": "^4.1.0"
}, },
"dependencies": { "dependencies": {
"camelcase": { "camelcase": {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"backgrid-sizeable-columns": "0.1.1", "backgrid-sizeable-columns": "0.1.1",
"bootstrap": "3.3.7", "bootstrap": "3.3.7",
"bootstrap-daterangepicker": "3.1.0", "bootstrap-daterangepicker": "3.1.0",
"d3": "3.5.17", "d3": "5.14.2",
"d3-tip": "0.6.8", "d3-tip": "0.6.8",
"dagre-d3": "0.6.4", "dagre-d3": "0.6.4",
"dropzone": "5.7.0", "dropzone": "5.7.0",
......
...@@ -14,189 +14,14 @@ ...@@ -14,189 +14,14 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
/* graph.scss */ /* graph.scss */
/* .graph-bg svg {
background-image: linear-gradient(to right, $black -10px, rgba(0, 0, 0, 0) 1px), linear-gradient($black -10px, $color_cararra_approx 1px);
background-size: 10px 10px;
position: relative;
} */
.node {
cursor: pointer;
text {
font-size: 10px;
font-family: $font_1;
}
//transition: opacity 0.3s linear;
rect {
stroke: $color_mountain_mist_approx;
fill: $white;
stroke-width: 1.5px;
&.serach-rect {
stroke: $color_keppel_approx;
fill: transparent;
stroke-width: 2.5px
}
}
.label {
fill: $color_suva_gray_approx;
&.highlight {
cursor: pointer;
fill: $color_havelock_blue_approx;
text-decoration: underline;
tspan {
font-weight: 400;
}
}
}
circle {
-moz-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
stroke-width: 1.5px;
&.node-detail-highlight {
stroke: $color_havelock_blue_approx;
stroke-width: 2px;
}
&.nodeImage {
&.green:hover {
stroke: #ffb203;
}
&.blue:hover {
stroke: #4b91e2;
}
&.currentNode {
stroke: #fb4200;
}
&:hover {
-moz-transform: scale(1.4);
-webkit-transform: scale(1.4);
transform: scale(1.4);
}
}
}
&.active {
circle {
-moz-transform: scale(1.4);
-webkit-transform: scale(1.4);
transform: scale(1.4);
&.nodeImage {
&.green {
stroke: #ffb203;
}
&.blue {
stroke: #4b91e2;
}
}
}
}
}
.invisible { .invisible {
.node circle { .node circle {
transition: all 0s; transition: all 0s;
} }
} }
.edgePath {
.path {
cursor: pointer;
}
}
.overlay {}
.link {
fill: none;
stroke: $color_celeste_approx;
stroke-width: 1.5px;
}
.d3-tip {
line-height: 1;
font-weight: bold;
padding: 12px;
background: $black_80;
color: $white;
z-index: 999;
max-width: 300px; //Instead of the line below you could use @include border-radius($radius, $vertical-radius)
border-radius: 2px;
.tip-inner-scroll {
overflow: auto;
max-height: 300px;
}
/* Creates a small triangle extender for the tooltip */
&:after {
box-sizing: border-box;
display: inline;
font-size: 10px;
width: 100%;
line-height: 1;
color: rgba(0, 0, 0, 0.8);
position: absolute;
}
/* Nrthward tooltips */
&.n:after {
content: "\25BC";
margin: -1px 0 0 0;
top: 100%;
left: 0;
text-align: center;
}
/* Eastward tooltips */
&.e:after {
content: "\25C0";
margin: -4px 0 0 0;
top: 50%;
left: -8px;
}
/* Southward tooltips */
&.s:after {
content: "\25B2";
margin: 0 0 1px 0;
top: -8px;
left: 0;
text-align: center;
}
/* Westward tooltips */
&.w:after {
content: "\25B6";
margin: -4px 0 0 -1px;
top: 50%;
left: 100%;
}
}
g.type-TK>rect {
fill: $color_bright_turquoise_approx;
}
.graph-toolbar { .graph-toolbar {
background-color: $white; background-color: $white;
margin-bottom: 10px; margin-bottom: 10px;
...@@ -206,7 +31,7 @@ g.type-TK>rect { ...@@ -206,7 +31,7 @@ g.type-TK>rect {
.legends { .legends {
>i { >i {
>span { >span {
font-family: 'Source Sans Pro'; font-family: "Source Sans Pro";
} }
} }
} }
...@@ -275,7 +100,6 @@ g.type-TK>rect { ...@@ -275,7 +100,6 @@ g.type-TK>rect {
text-align: left; text-align: left;
&.deleted-relation { &.deleted-relation {
.deleteBtn { .deleteBtn {
padding: 2px 8px !important; padding: 2px 8px !important;
margin: 5px 5px !important; margin: 5px 5px !important;
...@@ -283,7 +107,6 @@ g.type-TK>rect { ...@@ -283,7 +107,6 @@ g.type-TK>rect {
} }
} }
.header { .header {
background: $color_havelock_blue_approx; background: $color_havelock_blue_approx;
color: white; color: white;
...@@ -327,7 +150,7 @@ g.type-TK>rect { ...@@ -327,7 +150,7 @@ g.type-TK>rect {
background: white; background: white;
&[disabled] { &[disabled] {
opacity: .3; opacity: 0.3;
} }
&:hover { &:hover {
...@@ -337,8 +160,6 @@ g.type-TK>rect { ...@@ -337,8 +160,6 @@ g.type-TK>rect {
} }
} }
span#zoom_in { span#zoom_in {
border-bottom: 1px solid #625555; border-bottom: 1px solid #625555;
} }
...@@ -364,7 +185,7 @@ span#zoom_in { ...@@ -364,7 +185,7 @@ span#zoom_in {
} }
.active.fullscreen-mode { .active.fullscreen-mode {
position: fixed; position: fixed !important;
height: 100% !important; height: 100% !important;
top: 0; top: 0;
bottom: 0; bottom: 0;
...@@ -374,6 +195,11 @@ span#zoom_in { ...@@ -374,6 +195,11 @@ span#zoom_in {
padding: 0 !important; padding: 0 !important;
z-index: 9999; z-index: 9999;
overflow: hidden !important; overflow: hidden !important;
background: white;
.systemTypeTree {
height: 100vh !important;
}
.resizeGraph { .resizeGraph {
position: fixed; position: fixed;
...@@ -393,40 +219,6 @@ span#zoom_in { ...@@ -393,40 +219,6 @@ span#zoom_in {
} }
} }
@keyframes zoominoutsinglefeatured {
0% {
transform: scale(1, 1);
}
50% {
transform: scale(1.2, 1.2);
}
100% {
transform: scale(1, 1);
}
}
.wobble {
animation: zoominoutsinglefeatured 1s 5;
}
.hover {
g.node {
opacity: 0.1 !important;
}
g.edgePath {
opacity: 0 !important;
}
g.node.hover-active,
g.edgePath.hover-active-node {
opacity: 1 !important;
}
}
.lineage-node-detail { .lineage-node-detail {
.table-quickMenu { .table-quickMenu {
td:nth-child(1n) { td:nth-child(1n) {
...@@ -437,12 +229,7 @@ span#zoom_in { ...@@ -437,12 +229,7 @@ span#zoom_in {
} }
} }
.hidden-svg {
visibility: hidden;
}
#tab-relationship { #tab-relationship {
.entity-status { .entity-status {
&.active { &.active {
color: $color_jungle_green_approx; color: $color_jungle_green_approx;
...@@ -451,12 +238,10 @@ span#zoom_in { ...@@ -451,12 +238,10 @@ span#zoom_in {
&.deleted { &.deleted {
color: $delete_link; color: $delete_link;
} }
} }
.entity-list { .entity-list {
list-style-position: inside; list-style-position: inside;
} }
} }
...@@ -468,4 +253,17 @@ span#zoom_in { ...@@ -468,4 +253,17 @@ span#zoom_in {
to { to {
opacity: 0.5; opacity: 0.5;
} }
}
.mini-map-type-system {
background: white;
width: 200px;
position: absolute;
bottom: 5px;
right: 5px;
&>svg {
box-shadow: 0px 0px 3px 1px #80808080;
}
} }
\ No newline at end of file
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
<link href="js/libs/pretty-checkbox/css/pretty-checkbox.min.css?bust=<%- bust %>" rel="stylesheet"> <link href="js/libs/pretty-checkbox/css/pretty-checkbox.min.css?bust=<%- bust %>" rel="stylesheet">
<link href="js/libs/dropzone/css/dropzone.css?bust=<%- bust %>" rel="stylesheet"> <link href="js/libs/dropzone/css/dropzone.css?bust=<%- bust %>" rel="stylesheet">
<link href="js/libs/jstree/css/default/default-theme.min.css?bust=<%- bust %>" rel="stylesheet"> <link href="js/libs/jstree/css/default/default-theme.min.css?bust=<%- bust %>" rel="stylesheet">
<link href="js/external_lib/atlas-lineage/dist/styles.css?bust=<%- bust %>" rel="stylesheet">
<link href="css/style.css?bust=<%- bust %>" rel="stylesheet"> <link href="css/style.css?bust=<%- bust %>" rel="stylesheet">
</head> </head>
......
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=======================================================================
\ No newline at end of file
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("platform"),require("dagreD3")):"function"==typeof define&&define.amd?define(["platform","dagreD3"],e):"object"==typeof exports?exports.LineageHelper=e(require("platform"),require("dagreD3")):t.LineageHelper=e(t.platform,t.dagreD3)}(window,(function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([,function(e,n){e.exports=t},function(t,n){t.exports=e},,,,,,,function(t,e,n){},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return Dr}));var r=n(2),i=n.n(r);function o(){}var a=function(t){return null==t?o:function(){return this.querySelector(t)}};function s(){return[]}var u=function(t){return null==t?s:function(){return this.querySelectorAll(t)}},l=function(t){return function(){return this.matches(t)}},c=function(t){return new Array(t.length)};function h(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}h.prototype={constructor:h,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function f(t,e,n,r,i,o){for(var a,s=0,u=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new h(t,o[s]);for(;s<u;++s)(a=e[s])&&(i[s]=a)}function p(t,e,n,r,i,o,a){var s,u,l,c={},f=e.length,p=o.length,d=new Array(f);for(s=0;s<f;++s)(u=e[s])&&(d[s]=l="$"+a.call(u,u.__data__,s,e),l in c?i[s]=u:c[l]=u);for(s=0;s<p;++s)(u=c[l="$"+a.call(t,o[s],s,o)])?(r[s]=u,u.__data__=o[s],c[l]=null):n[s]=new h(t,o[s]);for(s=0;s<f;++s)(u=e[s])&&c[d[s]]===u&&(i[s]=u)}function d(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var g="http://www.w3.org/1999/xhtml",v={svg:"http://www.w3.org/2000/svg",xhtml:g,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},y=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),v.hasOwnProperty(e)?{space:v[e],local:t}:t};function m(t){return function(){this.removeAttribute(t)}}function _(t){return function(){this.removeAttributeNS(t.space,t.local)}}function w(t,e){return function(){this.setAttribute(t,e)}}function b(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function x(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function E(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var k=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function T(t){return function(){this.style.removeProperty(t)}}function S(t,e,n){return function(){this.style.setProperty(t,e,n)}}function N(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function O(t,e){return t.style.getPropertyValue(e)||k(t).getComputedStyle(t,null).getPropertyValue(e)}function P(t){return function(){delete this[t]}}function A(t,e){return function(){this[t]=e}}function M(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function z(t){return t.trim().split(/^|\s+/)}function j(t){return t.classList||new D(t)}function D(t){this._node=t,this._names=z(t.getAttribute("class")||"")}function C(t,e){for(var n=j(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function L(t,e){for(var n=j(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function B(t){return function(){C(this,t)}}function R(t){return function(){L(this,t)}}function I(t,e){return function(){(e.apply(this,arguments)?C:L)(this,t)}}D.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function G(){this.textContent=""}function q(t){return function(){this.textContent=t}}function U(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function H(){this.innerHTML=""}function F(t){return function(){this.innerHTML=t}}function V(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function X(){this.nextSibling&&this.parentNode.appendChild(this)}function Y(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Z(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===g&&e.documentElement.namespaceURI===g?e.createElement(t):e.createElementNS(n,t)}}function W(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var K=function(t){var e=y(t);return(e.local?W:Z)(e)};function Q(){return null}function J(){var t=this.parentNode;t&&t.removeChild(this)}function tt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function et(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var nt={},rt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(nt={mouseenter:"mouseover",mouseleave:"mouseout"}));function it(t,e,n){return t=ot(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function ot(t,e,n){return function(r){var i=rt;rt=r;try{t.call(this,this.__data__,e,n)}finally{rt=i}}}function at(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function st(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r<o;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?e.length=i:delete this.__on}}}function ut(t,e,n){var r=nt.hasOwnProperty(t.type)?it:ot;return function(i,o,a){var s,u=this.__on,l=r(e,o,a);if(u)for(var c=0,h=u.length;c<h;++c)if((s=u[c]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=l,s.capture=n),void(s.value=e);this.addEventListener(t.type,l,n),s={type:t.type,name:t.name,value:e,listener:l,capture:n},u?u.push(s):this.__on=[s]}}function lt(t,e,n,r){var i=rt;t.sourceEvent=rt,rt=t;try{return e.apply(n,r)}finally{rt=i}}function ct(t,e,n){var r=k(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function ht(t,e){return function(){return ct(this,t,e)}}function ft(t,e){return function(){return ct(this,t,e.apply(this,arguments))}}var pt=[null];function dt(t,e){this._groups=t,this._parents=e}function gt(){return new dt([[document.documentElement]],pt)}dt.prototype=gt.prototype={constructor:dt,select:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,s,u=e[i],l=u.length,c=r[i]=new Array(l),h=0;h<l;++h)(o=u[h])&&(s=t.call(o,o.__data__,h,u))&&("__data__"in o&&(s.__data__=o.__data__),c[h]=s);return new dt(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=u(t));for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a,s=e[o],l=s.length,c=0;c<l;++c)(a=s[c])&&(r.push(t.call(a,a.__data__,c,s)),i.push(a));return new dt(r,i)},filter:function(t){"function"!=typeof t&&(t=l(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a=e[i],s=a.length,u=r[i]=[],c=0;c<s;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&u.push(o);return new dt(r,this._parents)},data:function(t,e){if(!t)return v=new Array(this.size()),c=-1,this.each((function(t){v[++c]=t})),v;var n,r=e?p:f,i=this._parents,o=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=o.length,s=new Array(a),u=new Array(a),l=new Array(a),c=0;c<a;++c){var h=i[c],d=o[c],g=d.length,v=t.call(h,h&&h.__data__,c,i),y=v.length,m=u[c]=new Array(y),_=s[c]=new Array(y);r(h,d,m,_,l[c]=new Array(g),v,e);for(var w,b,x=0,E=0;x<y;++x)if(w=m[x]){for(x>=E&&(E=x+1);!(b=_[E])&&++E<y;);w._next=b||null}}return(s=new dt(s,i))._enter=u,s._exit=l,s},enter:function(){return new dt(this._enter||this._groups.map(c),this._parents)},exit:function(){return new dt(this._exit||this._groups.map(c),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(i=e(i)),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u,l=e[s],c=n[s],h=l.length,f=a[s]=new Array(h),p=0;p<h;++p)(u=l[p]||c[p])&&(f[p]=u);for(;s<r;++s)a[s]=e[s];return new dt(a,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=d);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a,s=n[o],u=s.length,l=i[o]=new Array(u),c=0;c<u;++c)(a=s[c])&&(l[c]=a);l.sort(e)}return new dt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,o=e[n],a=0,s=o.length;a<s;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,e){var n=y(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?_:m:"function"==typeof e?n.local?E:x:n.local?b:w)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?T:"function"==typeof e?N:S)(t,e,null==n?"":n)):O(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?P:"function"==typeof e?M:A)(t,e)):this.node()[t]},classed:function(t,e){var n=z(t+"");if(arguments.length<2){for(var r=j(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?I:e?B:R)(n,e))},text:function(t){return arguments.length?this.each(null==t?G:("function"==typeof t?U:q)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?H:("function"==typeof t?V:F)(t)):this.node().innerHTML},raise:function(){return this.each(X)},lower:function(){return this.each(Y)},append:function(t){var e="function"==typeof t?t:K(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:K(t),r=null==e?Q:"function"==typeof e?e:a(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(J)},clone:function(t){return this.select(t?et:tt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,o=at(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?ut:st,null==n&&(n=!1),r=0;r<a;++r)this.each(s(o[r],e,n));return this}var s=this.node().__on;if(s)for(var u,l=0,c=s.length;l<c;++l)for(r=0,u=s[l];r<a;++r)if((i=o[r]).type===u.type&&i.name===u.name)return u.value},dispatch:function(t,e){return this.each(("function"==typeof e?ft:ht)(t,e))}};var vt=gt,yt=function(t){return"string"==typeof t?new dt([[document.querySelector(t)]],[document.documentElement]):new dt([[t]],pt)};function mt(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function _t(t){this._context=t}_t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:mt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:mt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var wt=function(t){return new _t(t)},bt={value:function(){}};function xt(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new Et(r)}function Et(t){this._=t}function kt(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Tt(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function St(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=bt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}Et.prototype=xt.prototype={constructor:Et,on:function(t,e){var n,r=this._,i=kt(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=St(r[n],t.name,e);else if(null==e)for(n in r)r[n]=St(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=Tt(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Et(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var Nt=xt;function Ot(){rt.stopImmediatePropagation()}var Pt=function(){rt.preventDefault(),rt.stopImmediatePropagation()},At=function(t){var e=t.document.documentElement,n=yt(t).on("dragstart.drag",Pt,!0);"onselectstart"in e?n.on("selectstart.drag",Pt,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")};function Mt(t,e){var n=t.document.documentElement,r=yt(t).on("dragstart.drag",null);e&&(r.on("click.drag",Pt,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var zt=Math.SQRT2;function jt(t){return((t=Math.exp(t))+1/t)/2}var Dt,Ct,Lt=function(t,e){var n,r,i=t[0],o=t[1],a=t[2],s=e[0],u=e[1],l=e[2],c=s-i,h=u-o,f=c*c+h*h;if(f<1e-12)r=Math.log(l/a)/zt,n=function(t){return[i+t*c,o+t*h,a*Math.exp(zt*t*r)]};else{var p=Math.sqrt(f),d=(l*l-a*a+4*f)/(2*a*2*p),g=(l*l-a*a-4*f)/(2*l*2*p),v=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(g*g+1)-g);r=(y-v)/zt,n=function(t){var e,n=t*r,s=jt(v),u=a/(2*p)*(s*(e=zt*n+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[i+u*c,o+u*h,a*s/jt(zt*n+v)]}}return n.duration=1e3*r,n},Bt=function(){for(var t,e=rt;t=e.sourceEvent;)e=t;return e},Rt=function(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]},It=function(t){var e=Bt();return e.changedTouches&&(e=e.changedTouches[0]),Rt(t,e)},Gt=function(t,e,n){arguments.length<3&&(n=e,e=Bt().changedTouches);for(var r,i=0,o=e?e.length:0;i<o;++i)if((r=e[i]).identifier===n)return Rt(t,r);return null},qt=0,Ut=0,Ht=0,$t=0,Ft=0,Vt=0,Xt="object"==typeof performance&&performance.now?performance:Date,Yt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Zt(){return Ft||(Yt(Wt),Ft=Xt.now()+Vt)}function Wt(){Ft=0}function Kt(){this._call=this._time=this._next=null}function Qt(t,e,n){var r=new Kt;return r.restart(t,e,n),r}function Jt(){Ft=($t=Xt.now())+Vt,qt=Ut=0;try{!function(){Zt(),++qt;for(var t,e=Dt;e;)(t=Ft-e._time)>=0&&e._call.call(null,t),e=e._next;--qt}()}finally{qt=0,function(){var t,e,n=Dt,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Dt=e);Ct=t,ee(r)}(),Ft=0}}function te(){var t=Xt.now(),e=t-$t;e>1e3&&(Vt-=e,$t=t)}function ee(t){qt||(Ut&&(Ut=clearTimeout(Ut)),t-Ft>24?(t<1/0&&(Ut=setTimeout(Jt,t-Xt.now()-Vt)),Ht&&(Ht=clearInterval(Ht))):(Ht||($t=Xt.now(),Ht=setInterval(te,1e3)),qt=1,Yt(Jt)))}Kt.prototype=Qt.prototype={constructor:Kt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Zt():+n)+(null==e?0:+e),this._next||Ct===this||(Ct?Ct._next=this:Dt=this,Ct=this),this._call=t,this._time=n,ee()},stop:function(){this._call&&(this._call=null,this._time=1/0,ee())}};var ne=function(t,e,n){var r=new Kt;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r},re=Nt("start","end","cancel","interrupt"),ie=[],oe=function(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(u){var l,c,h,f;if(1!==n.state)return s();for(l in i)if((f=i[l]).name===n.name){if(3===f.state)return ne(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[l]):+l<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[l])}if(ne((function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(u))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(h=n.tween.length),l=0,c=-1;l<h;++l)(f=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(r[++c]=f);r.length=c+1}}function a(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(s),n.state=5,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=Qt((function(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:i,on:re,tween:ie,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})};function ae(t,e){var n=ue(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function se(t,e){var n=ue(t,e);if(n.state>3)throw new Error("too late; already running");return n}function ue(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var le,ce,he,fe,pe=function(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):a=!1;a&&delete t.__transition}},de=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},ge=180/Math.PI,ve={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},ye=function(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*ge,skewX:Math.atan(u)*ge,scaleX:a,scaleY:s}};function me(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var s=[],u=[];return o=t(o),a=t(a),function(t,r,i,o,a,s){if(t!==i||r!==o){var u=a.push("translate(",null,e,null,n);s.push({i:u-4,x:de(t,i)},{i:u-2,x:de(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,s,u),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:de(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,u),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:de(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,u),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:de(t,n)},{i:s-2,x:de(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,n=-1,r=u.length;++n<r;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var _e=me((function(t){return"none"===t?ve:(le||(le=document.createElement("DIV"),ce=document.documentElement,he=document.defaultView),le.style.transform=t,t=he.getComputedStyle(ce.appendChild(le),null).getPropertyValue("transform"),ce.removeChild(le),t=t.slice(7,-1).split(","),ye(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),we=me((function(t){return null==t?ve:(fe||(fe=document.createElementNS("http://www.w3.org/2000/svg","g")),fe.setAttribute("transform",t),(t=fe.transform.baseVal.consolidate())?(t=t.matrix,ye(t.a,t.b,t.c,t.d,t.e,t.f)):ve)}),", ",")",")");function be(t,e){var n,r;return function(){var i=se(this,t),o=i.tween;if(o!==n)for(var a=0,s=(r=n=o).length;a<s;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}i.tween=r}}function xe(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var o=se(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}o.tween=i}}function Ee(t,e,n){var r=t._id;return t.each((function(){var t=se(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return ue(t,r).value[e]}}var ke=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function Te(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Se(){}var Ne="\\s*([+-]?\\d+)\\s*",Oe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Pe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ae=/^#([0-9a-f]{3,8})$/,Me=new RegExp("^rgb\\("+[Ne,Ne,Ne]+"\\)$"),ze=new RegExp("^rgb\\("+[Pe,Pe,Pe]+"\\)$"),je=new RegExp("^rgba\\("+[Ne,Ne,Ne,Oe]+"\\)$"),De=new RegExp("^rgba\\("+[Pe,Pe,Pe,Oe]+"\\)$"),Ce=new RegExp("^hsl\\("+[Oe,Pe,Pe]+"\\)$"),Le=new RegExp("^hsla\\("+[Oe,Pe,Pe,Oe]+"\\)$"),Be={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Re(){return this.rgb().formatHex()}function Ie(){return this.rgb().formatRgb()}function Ge(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ae.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?qe(e):3===n?new Fe(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Ue(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Ue(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Me.exec(t))?new Fe(e[1],e[2],e[3],1):(e=ze.exec(t))?new Fe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=je.exec(t))?Ue(e[1],e[2],e[3],e[4]):(e=De.exec(t))?Ue(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ce.exec(t))?Ze(e[1],e[2]/100,e[3]/100,1):(e=Le.exec(t))?Ze(e[1],e[2]/100,e[3]/100,e[4]):Be.hasOwnProperty(t)?qe(Be[t]):"transparent"===t?new Fe(NaN,NaN,NaN,0):null}function qe(t){return new Fe(t>>16&255,t>>8&255,255&t,1)}function Ue(t,e,n,r){return r<=0&&(t=e=n=NaN),new Fe(t,e,n,r)}function He(t){return t instanceof Se||(t=Ge(t)),t?new Fe((t=t.rgb()).r,t.g,t.b,t.opacity):new Fe}function $e(t,e,n,r){return 1===arguments.length?He(t):new Fe(t,e,n,null==r?1:r)}function Fe(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ve(){return"#"+Ye(this.r)+Ye(this.g)+Ye(this.b)}function Xe(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ye(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Ze(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ke(t,e,n,r)}function We(t){if(t instanceof Ke)return new Ke(t.h,t.s,t.l,t.opacity);if(t instanceof Se||(t=Ge(t)),!t)return new Ke;if(t instanceof Ke)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new Ke(a,s,u,t.opacity)}function Ke(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Qe(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Je(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}ke(Se,Ge,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Re,formatHex:Re,formatHsl:function(){return We(this).formatHsl()},formatRgb:Ie,toString:Ie}),ke(Fe,$e,Te(Se,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ve,formatHex:Ve,formatRgb:Xe,toString:Xe})),ke(Ke,(function(t,e,n,r){return 1===arguments.length?We(t):new Ke(t,e,n,null==r?1:r)}),Te(Se,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ke(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ke(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Fe(Qe(t>=240?t-240:t+120,i,r),Qe(t,i,r),Qe(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var tn=function(t){return function(){return t}};function en(t,e){return function(n){return t+n*e}}function nn(t){return 1==(t=+t)?rn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):tn(isNaN(e)?n:e)}}function rn(t,e){var n=e-t;return n?en(t,n):tn(isNaN(t)?e:t)}var on=function t(e){var n=nn(e);function r(t,e){var r=n((t=$e(t)).r,(e=$e(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=rn(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function an(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=$e(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}an((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return Je((n-r/e)*e,a,i,o,s)}})),an((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return Je((n-r/e)*e,i,o,a,s)}}));var sn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,un=new RegExp(sn.source,"g");var ln=function(t,e){var n,r,i,o=sn.lastIndex=un.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=sn.exec(t))&&(r=un.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:de(n,r)})),o=un.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})},cn=function(t,e){var n;return("number"==typeof e?de:e instanceof Ge?on:(n=Ge(e))?(e=n,on):ln)(t,e)};function hn(t){return function(){this.removeAttribute(t)}}function fn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function pn(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=e(r=a,n)}}function dn(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=e(r=a,n)}}function gn(t,e,n){var r,i,o;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttribute(t))===(s=u+"")?null:a===r&&s===i?o:(i=s,o=e(r=a,u));this.removeAttribute(t)}}function vn(t,e,n){var r,i,o;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===(s=u+"")?null:a===r&&s===i?o:(i=s,o=e(r=a,u));this.removeAttributeNS(t.space,t.local)}}function yn(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function mn(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function _n(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&mn(t,i)),n}return i._value=e,i}function wn(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&yn(t,i)),n}return i._value=e,i}function bn(t,e){return function(){ae(this,t).delay=+e.apply(this,arguments)}}function xn(t,e){return e=+e,function(){ae(this,t).delay=e}}function En(t,e){return function(){se(this,t).duration=+e.apply(this,arguments)}}function kn(t,e){return e=+e,function(){se(this,t).duration=e}}function Tn(t,e){if("function"!=typeof e)throw new Error;return function(){se(this,t).ease=e}}function Sn(t,e,n){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ae:se;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}var Nn=vt.prototype.constructor;function On(t){return function(){this.style.removeProperty(t)}}function Pn(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function An(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Pn(t,o,n)),r}return o._value=e,o}function Mn(t){return function(e){this.textContent=t.call(this,e)}}function zn(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Mn(r)),e}return r._value=t,r}var jn=0;function Dn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Cn(){return++jn}var Ln=vt.prototype;Dn.prototype=function(t){return vt().transition(t)}.prototype={constructor:Dn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=a(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var u,l,c=r[s],h=c.length,f=o[s]=new Array(h),p=0;p<h;++p)(u=c[p])&&(l=t.call(u,u.__data__,p,c))&&("__data__"in u&&(l.__data__=u.__data__),f[p]=l,oe(f[p],e,n,p,f,ue(u,n)));return new Dn(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=u(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l,c=r[s],h=c.length,f=0;f<h;++f)if(l=c[f]){for(var p,d=t.call(l,l.__data__,f,c),g=ue(l,n),v=0,y=d.length;v<y;++v)(p=d[v])&&oe(p,e,n,v,d,g);o.push(d),a.push(l)}return new Dn(o,a,e,n)},filter:function(t){"function"!=typeof t&&(t=l(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a=e[i],s=a.length,u=r[i]=[],c=0;c<s;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&u.push(o);return new Dn(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u,l=e[s],c=n[s],h=l.length,f=a[s]=new Array(h),p=0;p<h;++p)(u=l[p]||c[p])&&(f[p]=u);for(;s<r;++s)a[s]=e[s];return new Dn(a,this._parents,this._name,this._id)},selection:function(){return new Nn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Cn(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a,s=r[o],u=s.length,l=0;l<u;++l)if(a=s[l]){var c=ue(a,e);oe(a,t,n,l,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Dn(r,this._parents,t,n)},call:Ln.call,nodes:Ln.nodes,node:Ln.node,size:Ln.size,empty:Ln.empty,each:Ln.each,on:function(t,e){var n=this._id;return arguments.length<2?ue(this.node(),n).on.on(t):this.each(Sn(n,t,e))},attr:function(t,e){var n=y(t),r="transform"===n?we:cn;return this.attrTween(t,"function"==typeof e?(n.local?vn:gn)(n,r,Ee(this,"attr."+t,e)):null==e?(n.local?fn:hn)(n):(n.local?dn:pn)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=y(t);return this.tween(n,(r.local?_n:wn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?_e:cn;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=O(this,t),a=(this.style.removeProperty(t),O(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,On(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=O(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=O(this,t)),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}(t,r,Ee(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,s="end."+a;return function(){var u=se(this,t),l=u.on,c=null==u.value[a]?o||(o=On(e)):void 0;l===n&&i===c||(r=(n=l).copy()).on(s,i=c),u.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var a=O(this,t);return a===o?null:a===r?i:i=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,An(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Ee(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,zn(t))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=ue(this.node(),n).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==e?be:xe)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?bn:xn)(e,t)):ue(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?En:kn)(e,t)):ue(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(Tn(e,t)):ue(this.node(),e).ease},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise((function(o,a){var s={value:a},u={value:function(){0==--i&&o()}};n.each((function(){var n=se(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),n.on=e}))}))}};var Bn={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Rn(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return Bn.time=Zt(),Bn;return n}vt.prototype.interrupt=function(t){return this.each((function(){pe(this,t)}))},vt.prototype.transition=function(t){var e,n;t instanceof Dn?(e=t._id,t=t._name):(e=Cn(),(n=Bn).time=Zt(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,s=r[o],u=s.length,l=0;l<u;++l)(a=s[l])&&oe(a,t,e,l,s,n||Rn(a,e));return new Dn(r,this._parents,t,e)};var In=function(t){return function(){return t}};function Gn(t,e,n){this.target=t,this.type=e,this.transform=n}function qn(t,e,n){this.k=t,this.x=e,this.y=n}qn.prototype={constructor:qn,scale:function(t){return 1===t?this:new qn(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new qn(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Un=new qn(1,0,0);function Hn(){rt.stopImmediatePropagation()}qn.prototype;var $n=function(){rt.preventDefault(),rt.stopImmediatePropagation()};function Fn(){return!rt.ctrlKey&&!rt.button}function Vn(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Xn(){return this.__zoom||Un}function Yn(){return-rt.deltaY*(1===rt.deltaMode?.05:rt.deltaMode?1:.002)}function Zn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Wn(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}var Kn=function(t){return function(){return t}};function Qn(t,e,n,r,i,o,a,s,u,l){this.target=t,this.type=e,this.subject=n,this.identifier=r,this.active=i,this.x=o,this.y=a,this.dx=s,this.dy=u,this._=l}function Jn(){return!rt.ctrlKey&&!rt.button}function tr(){return this.parentNode}function er(t){return null==t?{x:rt.x,y:rt.y}:t}function nr(){return navigator.maxTouchPoints||"ontouchstart"in this}Qn.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var rr=function(){var t,e,n,r,i=Jn,o=tr,a=er,s=nr,u={},l=Nt("start","drag","end"),c=0,h=0;function f(t){t.on("mousedown.drag",p).filter(s).on("touchstart.drag",v).on("touchmove.drag",y).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(){if(!r&&i.apply(this,arguments)){var a=_("mouse",o.apply(this,arguments),It,this,arguments);a&&(yt(rt.view).on("mousemove.drag",d,!0).on("mouseup.drag",g,!0),At(rt.view),Ot(),n=!1,t=rt.clientX,e=rt.clientY,a("start"))}}function d(){if(Pt(),!n){var r=rt.clientX-t,i=rt.clientY-e;n=r*r+i*i>h}u.mouse("drag")}function g(){yt(rt.view).on("mousemove.drag mouseup.drag",null),Mt(rt.view,n),Pt(),u.mouse("end")}function v(){if(i.apply(this,arguments)){var t,e,n=rt.changedTouches,r=o.apply(this,arguments),a=n.length;for(t=0;t<a;++t)(e=_(n[t].identifier,r,Gt,this,arguments))&&(Ot(),e("start"))}}function y(){var t,e,n=rt.changedTouches,r=n.length;for(t=0;t<r;++t)(e=u[n[t].identifier])&&(Pt(),e("drag"))}function m(){var t,e,n=rt.changedTouches,i=n.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(e=u[n[t].identifier])&&(Ot(),e("end"))}function _(t,e,n,r,i){var o,s,h,p=n(e,t),d=l.copy();if(lt(new Qn(f,"beforestart",o,t,c,p[0],p[1],0,0,d),(function(){return null!=(rt.subject=o=a.apply(r,i))&&(s=o.x-p[0]||0,h=o.y-p[1]||0,!0)})))return function a(l){var g,v=p;switch(l){case"start":u[t]=a,g=c++;break;case"end":delete u[t],--c;case"drag":p=n(e,t),g=c}lt(new Qn(f,l,o,t,g,p[0]+s,p[1]+h,p[0]-v[0],p[1]-v[1],d),d.apply,d,[l,r,i])}}return f.filter=function(t){return arguments.length?(i="function"==typeof t?t:Kn(!!t),f):i},f.container=function(t){return arguments.length?(o="function"==typeof t?t:Kn(t),f):o},f.subject=function(t){return arguments.length?(a="function"==typeof t?t:Kn(t),f):a},f.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Kn(!!t),f):s},f.on=function(){var t=l.on.apply(l,arguments);return t===l?f:t},f.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,f):Math.sqrt(h)},f},ir=Math.PI,or=2*ir,ar=or-1e-6;function sr(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ur(){return new sr}sr.prototype=ur.prototype={constructor:sr,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-t,u=r-e,l=o-t,c=a-e,h=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>1e-6)if(Math.abs(c*s-u*l)>1e-6&&i){var f=n-o,p=r-a,d=s*s+u*u,g=f*f+p*p,v=Math.sqrt(d),y=Math.sqrt(h),m=i*Math.tan((ir-Math.acos((d+h-g)/(2*v*y)))/2),_=m/y,w=m/v;Math.abs(_-1)>1e-6&&(this._+="L"+(t+_*l)+","+(e+_*c)),this._+="A"+i+","+i+",0,0,"+ +(c*f>l*p)+","+(this._x1=t+w*s)+","+(this._y1=e+w*u)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),u=t+a,l=e+s,c=1^o,h=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+l:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+u+","+l),n&&(h<0&&(h=h%or+or),h>ar?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=u)+","+(this._y1=l):h>1e-6&&(this._+="A"+n+","+n+",0,"+ +(h>=ir)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var lr=ur,cr=function(t){return function(){return t}};function hr(t){this._context=t}hr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var fr=function(t){return new hr(t)};function pr(t){return t[0]}function dr(t){return t[1]}var gr=n(1),vr=n.n(gr),yr={entityStateReadOnly:{ACTIVE:!1,DELETED:!0,STATUS_ACTIVE:!1,STATUS_DELETED:!0}},mr={nodeArrowDistance:24,refreshGraphForSafari:function(t){t.edgeEl.each((function(t){var e=this,n=$(this).find("pattern");setTimeout((function(t){$(e).find("defs").append(n)}),500)}))},refreshGraphForIE:function(t){var e=t.edgePathEl,n=0;e.each((function(t){var e=$(this).find("marker");$(this).find("marker").remove();var r=this;++n,setTimeout((function(t){$(r).find("defs").append(e),0===--n&&(this.$(".fontLoader").hide(),this.$("svg").fadeTo(1e3,1))}),1e3)}))},dragNode:function(t){var e=this,n=t.g,r=t.svg,i=t.guid,o=(t.edgePathEl,{dragmove:function(t,e){var r=this,i=yt(t),o=n.node(e),a=o.x,s=o.y;o.x+=rt.dx,o.y+=rt.dy,i.attr("transform","translate("+o.x+","+o.y+")");var u=o.x-a,l=o.y-s;n.edges().forEach((function(t){if(t.v==e||t.w==e){var i=n.edge(t.v,t.w);r.translateEdge(i,u,l),yt(i.elem).select("path").attr("d",r.calcPoints(t))}}))},translateEdge:function(t,e,n){t.points.forEach((function(t){t.x=t.x+e,t.y=t.y+n}))},calcPoints:function(t){var e=n.edge(t.v,t.w),r=n.node(t.v),i=n.node(t.w),o=e.points.slice(1,e.points.length-1);e.points.slice(1,e.points.length-1);return o.unshift(this.intersectRect(r,o[0])),o.push(this.intersectRect(i,o[o.length-1])),function(){var t=pr,e=dr,n=cr(!0),r=null,i=fr,o=null;function a(a){var s,u,l,c=a.length,h=!1;for(null==r&&(o=i(l=lr())),s=0;s<=c;++s)!(s<c&&n(u=a[s],s,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(u,s,a),+e(u,s,a));if(l)return o=null,l+""||null}return a.x=function(e){return arguments.length?(t="function"==typeof e?e:cr(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:cr(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:cr(!!t),a):n},a.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),a):i},a.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),a):r},a}().x((function(t){return t.x})).y((function(t){return t.y})).curve(wt)(o)},intersectRect:function(t,n){var r=t.x,o=t.y,a=n.x-r,s=n.y-o,u=i?e.nodeArrowDistance+3:e.nodeArrowDistance,l=u,c=u,h=0,f=0;return Math.abs(s)*l>Math.abs(a)*c?(s<0&&(c=-c),h=0===s?0:c*a/s,f=c):(a<0&&(l=-l),h=l,f=0===a?0:l*s/a),{x:r+h,y:o+f}}}),a=rr().on("drag",(function(t){o.dragmove.call(o,this,t)})),s=rr().on("drag",(function(t){o.translateEdge(n.edge(t.v,t.w),rt.dx,rt.dy);var e=n.edge(t.v,t.w);yt(e.elem).select("path").attr("d",o.calcPoints(t))}));a(r.selectAll("g.node")),s(r.selectAll("g.edgePath"))},zoomIn:function(t){var e=t.svg,n=t.scaleFactor,r=void 0===n?1.3:n;this.d3Zoom.scaleBy(e.transition().duration(750),r)},zoomOut:function(t){var e=t.svg,n=t.scaleFactor,r=void 0===n?.8:n;this.d3Zoom.scaleBy(e.transition().duration(750),r)},zoom:function(t){var e=t.svg,n=t.xa,r=t.ya,i=t.scale;e.transition().duration(750).call(this.d3Zoom.transform,Un.translate(n,r).scale(i))},fitToScreen:function(t){var e=t.svg,n=e.node(),r=n.getBBox(),i=n.parentElement,o=i.clientWidth,a=i.clientHeight,s=r.width,u=r.height,l=r.x+s/2,c=r.y+u/2,h=(h||.95)/Math.max(s/o,u/a),f=o/2-h*l,p=a/2-h*c;this.zoom({svg:e,xa:f,ya:p,scale:h})},centerNode:function(t){var e=t.guid,n=t.g,r=t.svg,i=t.svgGroupEl,o=(t.edgePathEl,t.width),a=t.height,s=t.fitToScreen,u=t.onCenterZoomed;this.d3Zoom=function(){var t,e,n=Fn,r=Vn,i=Wn,o=Yn,a=Zn,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Lt,h=Nt("start","zoom","end"),f=0;function p(t){t.property("__zoom",Xn).on("wheel.zoom",w).on("mousedown.zoom",b).on("dblclick.zoom",x).filter(a).on("touchstart.zoom",E).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",T).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(t,e){return(e=Math.max(s[0],Math.min(s[1],e)))===t.k?t:new qn(e,t.x,t.y)}function g(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new qn(t.k,r,i)}function v(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function y(t,e,n){t.on("start.zoom",(function(){m(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){m(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,o=m(t,i),a=r.apply(t,i),s=null==n?v(a):"function"==typeof n?n.apply(t,i):n,u=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),l=t.__zoom,h="function"==typeof e?e.apply(t,i):e,f=c(l.invert(s).concat(u/l.k),h.invert(s).concat(u/h.k));return function(t){if(1===t)t=h;else{var e=f(t),n=u/e[2];t=new qn(n,s[0]-e[0]*n,s[1]-e[1]*n)}o.zoom(null,t)}}))}function m(t,e,n){return!n&&t.__zooming||new _(t,e)}function _(t,e){this.that=t,this.args=e,this.active=0,this.extent=r.apply(t,e),this.taps=0}function w(){if(n.apply(this,arguments)){var t=m(this,arguments),e=this.__zoom,r=Math.max(s[0],Math.min(s[1],e.k*Math.pow(2,o.apply(this,arguments)))),a=It(this);if(t.wheel)t.mouse[0][0]===a[0]&&t.mouse[0][1]===a[1]||(t.mouse[1]=e.invert(t.mouse[0]=a)),clearTimeout(t.wheel);else{if(e.k===r)return;t.mouse=[a,e.invert(a)],pe(this),t.start()}$n(),t.wheel=setTimeout(l,150),t.zoom("mouse",i(g(d(e,r),t.mouse[0],t.mouse[1]),t.extent,u))}function l(){t.wheel=null,t.end()}}function b(){if(!e&&n.apply(this,arguments)){var t=m(this,arguments,!0),r=yt(rt.view).on("mousemove.zoom",l,!0).on("mouseup.zoom",c,!0),o=It(this),a=rt.clientX,s=rt.clientY;At(rt.view),Hn(),t.mouse=[o,this.__zoom.invert(o)],pe(this),t.start()}function l(){if($n(),!t.moved){var e=rt.clientX-a,n=rt.clientY-s;t.moved=e*e+n*n>f}t.zoom("mouse",i(g(t.that.__zoom,t.mouse[0]=It(t.that),t.mouse[1]),t.extent,u))}function c(){r.on("mousemove.zoom mouseup.zoom",null),Mt(rt.view,t.moved),$n(),t.end()}}function x(){if(n.apply(this,arguments)){var t=this.__zoom,e=It(this),o=t.invert(e),a=t.k*(rt.shiftKey?.5:2),s=i(g(d(t,a),e,o),r.apply(this,arguments),u);$n(),l>0?yt(this).transition().duration(l).call(y,s,e):yt(this).call(p.transform,s)}}function E(){if(n.apply(this,arguments)){var e,r,i,o,a=rt.touches,s=a.length,u=m(this,arguments,rt.changedTouches.length===s);for(Hn(),r=0;r<s;++r)i=a[r],o=[o=Gt(this,a,i.identifier),this.__zoom.invert(o),i.identifier],u.touch0?u.touch1||u.touch0[2]===o[2]||(u.touch1=o,u.taps=0):(u.touch0=o,e=!0,u.taps=1+!!t);t&&(t=clearTimeout(t)),e&&(u.taps<2&&(t=setTimeout((function(){t=null}),500)),pe(this),u.start())}}function k(){if(this.__zooming){var e,n,r,o,a=m(this,arguments),s=rt.changedTouches,l=s.length;for($n(),t&&(t=clearTimeout(t)),a.taps=0,e=0;e<l;++e)n=s[e],r=Gt(this,s,n.identifier),a.touch0&&a.touch0[2]===n.identifier?a.touch0[0]=r:a.touch1&&a.touch1[2]===n.identifier&&(a.touch1[0]=r);if(n=a.that.__zoom,a.touch1){var c=a.touch0[0],h=a.touch0[1],f=a.touch1[0],p=a.touch1[1],v=(v=f[0]-c[0])*v+(v=f[1]-c[1])*v,y=(y=p[0]-h[0])*y+(y=p[1]-h[1])*y;n=d(n,Math.sqrt(v/y)),r=[(c[0]+f[0])/2,(c[1]+f[1])/2],o=[(h[0]+p[0])/2,(h[1]+p[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],o=a.touch0[1]}a.zoom("touch",i(g(n,r,o),a.extent,u))}}function T(){if(this.__zooming){var t,n,r=m(this,arguments),i=rt.changedTouches,o=i.length;for(Hn(),e&&clearTimeout(e),e=setTimeout((function(){e=null}),500),t=0;t<o;++t)n=i[t],r.touch0&&r.touch0[2]===n.identifier?delete r.touch0:r.touch1&&r.touch1[2]===n.identifier&&delete r.touch1;if(r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0)r.touch0[1]=this.__zoom.invert(r.touch0[0]);else if(r.end(),2===r.taps){var a=yt(this).on("dblclick.zoom");a&&a.apply(this,arguments)}}}return p.transform=function(t,e,n){var r=t.selection?t.selection():t;r.property("__zoom",Xn),t!==r?y(t,e,n):r.interrupt().each((function(){m(this,arguments).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},p.scaleBy=function(t,e,n){p.scaleTo(t,(function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n}),n)},p.scaleTo=function(t,e,n){p.transform(t,(function(){var t=r.apply(this,arguments),o=this.__zoom,a=null==n?v(t):"function"==typeof n?n.apply(this,arguments):n,s=o.invert(a),l="function"==typeof e?e.apply(this,arguments):e;return i(g(d(o,l),a,s),t,u)}),n)},p.translateBy=function(t,e,n){p.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),u)}))},p.translateTo=function(t,e,n,o){p.transform(t,(function(){var t=r.apply(this,arguments),a=this.__zoom,s=null==o?v(t):"function"==typeof o?o.apply(this,arguments):o;return i(Un.translate(s[0],s[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,u)}),o)},_.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){lt(new Gn(p,t,this.that.__zoom),h.apply,h,[t,this.that,this.args])}},p.wheelDelta=function(t){return arguments.length?(o="function"==typeof t?t:In(+t),p):o},p.filter=function(t){return arguments.length?(n="function"==typeof t?t:In(!!t),p):n},p.touchable=function(t){return arguments.length?(a="function"==typeof t?t:In(!!t),p):a},p.extent=function(t){return arguments.length?(r="function"==typeof t?t:In([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),p):r},p.scaleExtent=function(t){return arguments.length?(s[0]=+t[0],s[1]=+t[1],p):[s[0],s[1]]},p.translateExtent=function(t){return arguments.length?(u[0][0]=+t[0][0],u[1][0]=+t[1][0],u[0][1]=+t[0][1],u[1][1]=+t[1][1],p):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},p.constrain=function(t){return arguments.length?(i=t,p):i},p.duration=function(t){return arguments.length?(l=+t,p):l},p.interpolate=function(t){return arguments.length?(c=t,p):c},p.on=function(){var t=h.on.apply(h,arguments);return t===h?p:t},p.clickDistance=function(t){return arguments.length?(f=(t=+t)*t,p):Math.sqrt(f)},p}(),r.call(this.d3Zoom).on("dblclick.zoom",null);var l=r.selectAll("g.nodes>g[id='"+e+"']"),c=(this.d3Zoom.scaleExtent([.01,50]).on("zoom",(function(){i.attr("transform",rt.transform)})),null),h=null;if(l.empty()){if(s)return void this.fitToScreen({svg:r});c=n.graph().width/2,h=n.graph().height/2}else{var f=l.attr("transform").replace(/[^0-9\-.,]/g,"").split(",");c=f[0],h=f[1]}var p=-(1.2*c-o/2),d=-(1.2*h-a/2);this.zoom({svg:r,xa:p,ya:d,scale:1.2}),r.transition().duration(750).call(this.d3Zoom.transform,Un.translate(p,d).scale(1.2)),u&&u({newScale:1.2,newTranslate:[p,d],d3Zoom:this.d3Zoom,selectedNodeEl:l})},getToolTipDirection:function(t){var e=t.el,n=yt("body").node().getBoundingClientRect().width,r=yt(e).node().getBoundingClientRect(),i="e";return n-r.left<330?(i=n-r.left<330&&r.top<400?"sw":"w",n-r.left<330&&r.top>600&&(i="nw")):r.top>600?(i=n-r.left<330&&r.top>600?"nw":"n",r.left<50&&(i="ne")):r.top<400&&(i=r.left<50?"se":"s"),i},onHoverFade:function(t){var e=t.svg,n=t.g,r=t.mouseenter,i=t.nodesToHighlight,o=t.hoveredNode;return function(t){var i=e.selectAll(".node"),a=e.selectAll(".edgePath");if(r){e.classed("hover",!0);var s=n.successors(o),u=n.predecessors(o);t=s.concat(u);i.classed("hover-active-node",(function(e,n,r){return!!function(t,e,n){if(t===n||e&&e.length&&-1!=e.indexOf(n))return!0}(o,t,e)})),a.classed("hover-active-path",(function(t){return!!(t.v===o||t.w===o?1:0)}))}else e.classed("hover",!1),i.classed("hover-active-node",!1),a.classed("hover-active-path",!1)}(i)},getBaseUrl:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.pathname;return t.replace(/\/[\w-]+.(jsp|html)|\/+$/gi,"")},getEntityIconPath:function(t){var e=t.entityData,n=t.errorUrl,r=t.imgBasePath,i=this.getBaseUrl()+(r||"/img/entity-icon/");if(e){var o=function(t){return i+(yr.entityStateReadOnly[l]?"disabled/"+t:t)},a=function(){return c?yr.entityStateReadOnly[l]?i+"disabled/process.png":i+"process.png":yr.entityStateReadOnly[l]?i+"disabled/table.png":i+"table.png"},s=e.typeName,u=e.serviceType,l=e.status,c=e.isProcess;if(n){if(n.indexOf("table.png")>-1||n.indexOf("process.png")>-1)return null;var h=!(!n||!n.match("entity-icon/"+s+".png|disabled/"+s+".png"));return u&&h?o(u+".png"):a()}return s?o(s+".png"):u?o(u+".png"):a()}},base64Encode:function(t,e){var n=new FileReader;n.addEventListener("load",(function(){return e(n.result)})),n.readAsDataURL(t)},imgShapeRender:function(t,e,n,r){var i=r.dagreD3,o=r.defsEl,a=r.imgBasePath,s=r.guid,u=this,l=s,c=this.getEntityIconPath({entityData:n,imgBasePath:a}),h=c.split("/").pop();if(void 0===this.imageObject&&(this.imageObject={}),n.isDeleted&&(h="deleted_"+h),n.id==l)var f=!0;var p=t.append("circle").attr("fill","url(#img_"+h+")").attr("r","24px").attr("data-stroke",n.id).attr("stroke-width","2px").attr("class","nodeImage "+(f?"currentNode":n.isProcess?"process":"node"));return f&&p.attr("stroke","#fb4200"),!0===n.isIncomplete&&(t.attr("class","node isIncomplete show"),t.insert("foreignObject").attr("x","-25").attr("y","-25").attr("width","50").attr("height","50").append("xhtml:div").insert("i").attr("class","fa fa-hourglass-half")),o.select('pattern[id="img_'+h+'"]').empty()&&o.append("pattern").attr("x","0%").attr("y","0%").attr("patternUnits","objectBoundingBox").attr("id","img_"+h).attr("width","100%").attr("height","100%").append("image").attr("href",(function(t){var e=this;if(n){!function t(r){var i=r.imagePath,o={url:i,method:"GET",cache:!0};p.attr("data-iconpath",i);var a=new XMLHttpRequest;a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)"IE"!==vr.a.name?u.base64Encode(this.response,(function(t){u.imageObject[c]=t,yt(e).attr("xlink:href",t)})):u.imageObject[c]=i,c!==p.attr("data-iconpath")&&p.attr("data-iconpathorigin",c);else if(404===a.status){var r=u.getEntityIconPath({entityData:n,errorUrl:i});if(null===r){var o=yt(e.parentElement);o.select("image").remove(),o.attr("patternContentUnits","objectBoundingBox").append("circle").attr("r","24px").attr("fill","#e8e8e8")}else t({imagePath:r})}},a.responseType="blob",a.open(o.method,o.url,!0),a.send(null)}({imagePath:c})}})).attr("x","4").attr("y",f?"3":"4").attr("width","40").attr("height","40"),n.intersect=function(t){return i.intersect.circle(n,f?u.nodeArrowDistance+3:u.nodeArrowDistance,t)},p},arrowPointRender:function(t,e,n,r,i){var o=i.dagreD3,a=t.node(),s=a?a.parentNode:t;yt(s).select("path.path").attr("marker-end","url(#"+e+")");var u=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",8).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",4).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",n.styleObj.stroke);o.util.applyStyle(u,n[r+"Style"])},saveSvg:function(t){var e=t.svg,n=t.width,r=t.height,i=t.downloadFileName,o=t.onExportLineage,a=this,s=e.clone(!0).node();setTimeout((function(){"Firefox"===vr.a.name&&(s.setAttribute("width",n),s.setAttribute("height",r));var t=yt("body").append("div");t.classed("hidden-svg",!0),t.node().appendChild(s);var e=yt(".hidden-svg svg");e.select("g").attr("transform","scale(1)"),e.select("foreignObject").remove();var u=150,l=150,c=s.getBBox().width+u,h=s.getBBox().height+l,f=s.getBBox().x,p=s.getBBox().y;s.attributes.viewBox.value=f+","+p+","+c+","+h;var d=document.createElement("canvas");d.id="canvas",d.style.display="none",d.width=1*s.getBBox().width+u,d.height=1*s.getBBox().height+l,yt("body").node().appendChild(d);var g=d.getContext("2d"),v=(new XMLSerializer).serializeToString(s),y=window.URL||window.webkitURL||window;g.fillStyle="#FFFFFF",g.fillRect(0,0,d.width,d.height),g.strokeRect(0,0,d.width,d.height),g.restore();var m=new Image(d.width,d.height),_=new Blob([v],{type:"image/svg+xml;base64"});"Safari"===vr.a.name&&(_=new Blob([v],{type:"image/svg+xml"}));var w=y.createObjectURL(_);m.onload=function(){try{var e=document.createElement("a");e.download=i,document.body.appendChild(e),g.drawImage(m,50,50,d.width,d.height),d.toBlob((function(t){t?(e.href=y.createObjectURL(t),t.size>1e7&&o({status:"failed",message:"The Image size is huge, please open the image in a browser!"}),e.click(),o({status:"Success",message:"Successful"}),"Safari"===vr.a.name&&a.refreshGraphForSafari({edgeEl:a.$("svg g.node")})):o({status:"failed",message:"There was an error in downloading Lineage!"})}),"image/png"),t.remove(),d.remove()}catch(t){o({status:"failed",message:"There was an error in downloading Lineage!"})}},m.src=w}),0)}};function _r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_r(Object(n),!0).forEach((function(e){br(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function br(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var xr={getBaseUrl:function(t){return t.replace(/\/[\w-]+.(jsp|html)|\/+$/gi,"")},getEntityIconPath:function(){var t,e,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.entityData,o=r.errorUrl,a=this.getBaseUrl(window.location.pathname)+Globals.entityImgPath;function s(t){return a+(yr.entityStateReadOnly[e]?"disabled/"+t:t)}function u(){return i.isProcess?yr.entityStateReadOnly[e]?a+"disabled/process.png":a+"process.png":yr.entityStateReadOnly[e]?a+"disabled/table.png":a+"table.png"}if(i&&(n=i.typeName,t=i&&i.serviceType,e=i&&i.status),i){if(o){var l=!(!o||!o.match("entity-icon/"+n+".png|disabled/"+n+".png"));return t&&l?s(t+".png"):u()}return i.typeName?s(i.typeName+".png"):u()}},isProcess:function(t){var e=t.typeName,n=t.superTypes;t.entityDef;return"Process"==e||n.indexOf("Process")>-1},isDeleted:function(t){if(void 0!==t)return yr.entityStateReadOnly[t.status]},isNodeToBeUpdated:function(t,e){var n=e.isProcessHideCheck,r=e.isDeletedEntityHideCheck,i={isProcess:n&&t.isProcess,isDeleted:r&&t.isDeleted};return i.update=i.isProcess||i.isDeleted,i},getServiceType:function(t){var e=t.typeName,n=t.entityDef,r=null;return e&&n&&(r=n.serviceType||null),r},getEntityDef:function(t){var e=t.typeName,n=t.entityDefCollection,r=null;return e&&(r=n.find((function(t){return t.name==e}))),r},getNestedSuperTypes:function(t){var e=t.entityDef,n=t.entityDefCollection,r=new Set;return function t(e,n){e&&e.superTypes&&e.superTypes.length&&e.superTypes.forEach((function(e){r.add(e);var i=n.find((function(t){t.name}));i&&t(i,n)}))}(e,n),Array.from(r)},generateData:function(t){var e=this,n=t.data,r=void 0===n?{}:n,i=t.filterObj,o=t.entityDefCollection,a=t.g,s=t.guid,u=t.setGraphEdge,l=t.setGraphNode;return new Promise((function(t,n){try{var c=r.relations||{},h=r.guidEntityMap||{},f=i.isProcessHideCheck||i.isDeletedEntityHideCheck,p={fill:"none",stroke:"#ffb203",width:3},d=function(t){if(t){if(t.updatedValues)return t;var n=Object.assign(t,{shape:"img",updatedValues:!0,label:t.displayText.trunc(18),toolTipLabel:t.displayText,id:t.guid,isLineage:!0,isIncomplete:t.isIncomplete,entityDef:e.getEntityDef({typeName:t.typeName,entityDefCollection:o})});return n.serviceType=e.getServiceType(n),n.superTypes=e.getNestedSuperTypes(wr(wr({},n),{},{entityDefCollection:o})),n.isProcess=e.isProcess(n),n.isDeleted=e.isDeleted(n),n}},g=function(t){return"fill:"+t.fill+";stroke:"+t.stroke+";stroke-width:"+t.width},v=function(t,n,r){var i=[];return t.forEach((function(t){if(e.isNodeToBeUpdated(d(h[t]),r).update)if(w[t])i=i.concat(w[t]);else{var n=function t(n,r){if(n&&b[n]){var i=[];return b[n].forEach((function(n){if(e.isNodeToBeUpdated(d(h[n]),r).update){var o=t(n,r);o&&(i=i.concat(o))}else i.push(n)})),i}return null}(t,r);n&&(i=i.concat(n))}else i.push(t)})),i},y=function(t){if(a._nodes[t])return a._nodes[t];var e=d(h[t]);return l(t,e),e},m=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};u(t,e,wr({arrowhead:"arrowPoint",curve:wt,style:g(p),styleObj:p},n))},_=function(t,e){y(t),y(e),m(t,e)},w={};if(f){var b=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.relations,n={};return e.forEach((function(t){n[t.fromEntityId]?n[t.fromEntityId].push(t.toEntityId):n[t.fromEntityId]=[t.toEntityId]})),n}(r);Object.keys(b).forEach((function(t){var n=b[t],r=e.isNodeToBeUpdated(d(h[t]),i),o=v(n,0,i);r.update?w[t]?w[t]=w[t].concat(o):w[t]=o:o.forEach((function(e){_(t,e)}))}))}else c.forEach((function(t){_(t.fromEntityId,t.toEntityId)}));a._nodes[s]&&(a._nodes[s]&&(a._nodes[s].isLineage=!1),e.findImpactNodeAndUpdateData({guid:s,g:a,setEdge:m,getStyleObjStr:g})),t(a)}catch(t){n(t)}}))},findImpactNodeAndUpdateData:function(t){var e=t.guid,n=t.getStyleObjStr,r=t.g,i=t.setEdge,o={},a={fill:"none",stroke:"#fb4200",width:3};!function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0,u=Object.keys(e);u.length&&(o[s]||(o[s]=!0,u.forEach((function(e){r._nodes[e]&&(r._nodes[e].isLineage=!1),i(s,e,{style:n(a),styleObj:a}),t(r._sucs[e],e)}))))}(r._sucs[e],e)}};String.prototype.trunc=String.prototype.trunc||function(t){return this.length>t?this.substr(0,t-1)+"...":this};function Er(){}function kr(t,e){var n=new Er;if(t instanceof Er)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==e)for(;++i<o;)n.set(i,t[i]);else for(;++i<o;)n.set(e(r=t[i],i,t),r)}else if(t)for(var a in t)n.set(a,t[a]);return n}Er.prototype=kr.prototype={constructor:Er,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};var Tr=kr;function Sr(){}var Nr=Tr.prototype;function Or(t,e){var n=new Sr;if(t instanceof Sr)t.each((function(t){n.add(t)}));else if(t){var r=-1,i=t.length;if(null==e)for(;++r<i;)n.add(t[r]);else for(;++r<i;)n.add(e(t[r],r,t))}return n}Sr.prototype=Or.prototype={constructor:Sr,has:Nr.has,add:function(t){return this["$"+(t+="")]=t,this},remove:Nr.remove,clear:Nr.clear,values:Nr.keys,size:Nr.size,empty:Nr.empty,each:Nr.each};n(9);function Pr(t){return(Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ar(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Mr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ar(Object(n),!0).forEach((function(e){zr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ar(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function zr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Dr=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._setGraphNode=function(t,e){n.actualData[t]=Object.assign({},e),n.g.setNode(t,e)},this._setGraphEdge=function(t,e,r){n.g.setEdge(t,e,Mr({curve:wt},r))},this._updateOptions(e);var r=this.options,i=r.el,o=r.manualTrigger,a=void 0!==o&&o;if(void 0===i)throw new Error("LineageHelper requires el propety to render the graph");return this.initReturnObj={init:function(t){return n.init(t)},createGraph:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n._createGraph(n.options,n.graphOptions,t)},clear:function(t){return n.clear(t)},refresh:function(t){return n.refresh(t)},centerAlign:function(t){return n.centerAlign(t)},exportLineage:function(t){return n.exportLineage(t)},zoomIn:function(t){return n.zoomIn(t)},zoomOut:function(t){return n.zoomOut(t)},zoom:function(t){return n.zoom(t)},fullScreen:function(t){return n.fullScreen(t)},searchNode:function(t){return n.searchNode(t)},removeNodeSelection:function(t){return n.removeNodeSelection(t)},getGraphOptions:function(){return n.graphOptions},getNode:function(t,e){var r=null;return(r=e?n.actualData[t]:n.g._nodes[t])&&(r=Object.assign({},r)),r},getNodes:function(t,e){var r=null;return(r=e?n.actualData:n.g._nodes)&&(r=Object.assign({},r)),r},setNode:this._setGraphNode,setEdge:this._setGraphEdge},!1===a&&this.init(),this.initReturnObj}var e,n,r;return e=t,(n=[{key:"_updateOptions",value:function(t){this.options={},Object.assign(this.options,{filterObj:{isProcessHideCheck:!1,isDeletedEntityHideCheck:!1}},t)}},{key:"init",value:function(){var t=this.options.data,e=void 0===t?{}:t;e.baseEntityGuid&&(this.guid=e.baseEntityGuid),this._initializeGraph(),this._initGraph()}},{key:"clear",value:function(){this.options.el||(this.svg.remove(),this.svg=null),this.g=null,this.graphOptions={}}},{key:"centerAlign",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.svg.select("g"),n=e.selectAll("g.edgePath");mr.centerNode(Mr(Mr({},this.graphOptions),{},{svgGroupEl:e,edgePathEl:n},t))}},{key:"zoomIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};mr.zoomIn(Mr(Mr({},this.graphOptions),t))}},{key:"zoomOut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};mr.zoomOut(Mr(Mr({},this.graphOptions),t))}},{key:"zoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};mr.zoom(Mr(Mr({},this.graphOptions),t))}},{key:"refresh",value:function(){this.clear(),this._initializeGraph(),this._initGraph({refresh:!0})}},{key:"removeNodeSelection",value:function(){this.svg.selectAll("g.node>circle").classed("node-detail-highlight",!1)}},{key:"searchNode",value:function(t){var e=t.guid,n=t.onSearchNode;this.svg.selectAll(".serach-rect").remove(),this.centerAlign({guid:e,onCenterZoomed:function(t){var e=t.selectedNodeEl;e.select(".label").attr("stroke","#316132"),e.select("circle").classed("wobble",!0),e.insert("rect","circle").attr("class","serach-rect").attr("x",-50).attr("y",-27.5).attr("width",100).attr("height",55),n&&"function"==typeof n&&n(t)}})}},{key:"exportLineage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.downloadFileName;if(void 0===e){var n=this.g._nodes[this.guid];e=n&&n.attributes?"".concat(n.attributes.qualifiedName||n.attributes.name||"lineage_export",".png"):"lineage_export.png"}mr.saveSvg(Mr(Mr({},this.graphOptions),{},{downloadFileName:e,onExportLineage:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(e){t.onExportLineage&&onExportLineage(e)}))}))}},{key:"fullScreen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.el;if(void 0===e)throw new Error("LineageHelper requires el propety to apply fullScreen class");var n=yt(e);return n.classed("fullscreen-mode")?(n.classed("fullscreen-mode",!1),!1):(n.classed("fullscreen-mode",!0),!0)}},{key:"_getValueFromUser",value:function(t){if(void 0!==t)return"function"==typeof t?t():t}},{key:"_initializeGraph",value:function(){var t=this.options,e=t.width,n=void 0===e?"100%":e,r=t.height,o=void 0===r?"100%":r,a=t.el;this.svg=yt(a),a instanceof SVGElement||(this.svg=this.svg.append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr(" xmlns:xlink","http://www.w3.org/1999/xlink").attr("version","1.1").attr("width",n).attr("height",o)),this.g=(new i.a.graphlib.Graph).setGraph(Object.assign({nodesep:50,ranksep:90,rankdir:"LR",marginx:20,marginy:20,transition:function(t){return t.transition().duration(500)}},this.options.dagreOptions)).setDefaultEdgeLabel((function(){return{}}));var s=this.svg.node().getBoundingClientRect();this.actualData={},this.graphOptions={svg:this.svg,g:this.g,dagreD3:i.a,guid:this.guid,width:this.options.width||s.width,height:this.options.height||s.height}}},{key:"_initGraph",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.refresh;this.svg&&this.svg.select("g").remove();var r=this.options.filterObj;if(this.options.getFilterObj){var i=this.options.getFilterObj();if(void 0!==i||null!==i){if("object"!==Pr(i))throw new Error("getFilterObj expect return type `object`,`null` or `Undefined`");r=i}}if(!0!==this.options.setDataManually)return void 0===this.options.data||this.options.data&&0===this.options.data.relations.length?(this.options.beforeRender&&this.options.beforeRender(),this.svg.append("text").attr("x","50%").attr("y","50%").attr("alignment-baseline","middle").attr("text-anchor","middle").text("No lineage data found"),void(this.options.afterRender&&this.options.afterRender())):xr.generateData(Mr(Mr(Mr({},this.options),{},{filterObj:r},this.graphOptions),{},{setGraphNode:this._setGraphNode,setGraphEdge:this._setGraphEdge})).then((function(e){t._createGraph(t.options,t.graphOptions,{refresh:n})}))}},{key:"_createGraph",value:function(t,e,n){var r=this,o=t.data,a=void 0===o?{}:o,s=t.imgBasePath,u=t.isShowTooltip,l=t.isShowHoverPath,c=t.onLabelClick,h=t.onPathClick,f=t.onNodeClick,p=t.zoom,d=t.fitToScreen,g=n.refresh;this.options.beforeRender&&this.options.beforeRender();var v=this,y=e.svg,m=e.g,_=e.width,w=e.height;if(y instanceof vt==0)throw new Error("svg is not initialized or something went wrong while creatig graph instance");if(void 0!==m._nodes&&0!==m._nodes.length){m.nodes().forEach((function(t){var e=m.node(t);e&&(e.rx=e.ry=5)})),y.attr("viewBox","0 0 "+_+" "+w).attr("enable-background","new 0 0 "+_+" "+w);var b=y.append("g"),x=y.append("defs"),E=new i.a.render;E.arrows().arrowPoint=function(){return mr.arrowPointRender.apply(mr,Array.prototype.slice.call(arguments).concat([Mr({},e)]))},E.shapes().img=function(){return mr.imgShapeRender.apply(mr,Array.prototype.slice.call(arguments).concat([Mr(Mr({},e),{},{imgBasePath:v._getValueFromUser(s),defsEl:x})]))};var k=function(){var t=function(){return"n"},e=function(){return[0,0]},n=function(){return" "},r=document.body,i=h(),o=null,a=null,s=null;function u(t){(o=function(t){var e=t.node();return e?"svg"===e.tagName.toLowerCase()?e:e.ownerSVGElement:null}(t))&&(a=o.createSVGPoint(),r.appendChild(i))}u.show=function(){var i=Array.prototype.slice.call(arguments);i[i.length-1]instanceof SVGElement&&(s=i.pop());var o,a=n.apply(this,i),h=e.apply(this,i),p=t.apply(this,i),d=f(),g=c.length,v=document.documentElement.scrollTop||r.scrollTop,y=document.documentElement.scrollLeft||r.scrollLeft;for(d.html(a).style("opacity",1).style("pointer-events","all");g--;)d.classed(c[g],!1);return o=l.get(p).apply(this),d.classed(p,!0).style("top",o.top+h[0]+v+"px").style("left",o.left+h[1]+y+"px"),u},u.hide=function(){return f().style("opacity",0).style("pointer-events","none"),u},u.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return f().attr(t);var n=Array.prototype.slice.call(arguments);return vt.prototype.attr.apply(f(),n),u},u.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return f().style(t);var n=Array.prototype.slice.call(arguments);return vt.prototype.style.apply(f(),n),u},u.direction=function(e){return arguments.length?(t=null==e?e:d(e),u):t},u.offset=function(t){return arguments.length?(e=null==t?t:d(t),u):e},u.html=function(t){return arguments.length?(n=null==t?t:d(t),u):n},u.rootElement=function(t){return arguments.length?(r=null==t?t:d(t),u):r},u.destroy=function(){return i&&(f().remove(),i=null),u};var l=Tr({n:function(){var t=p(this);return{top:t.n.y-i.offsetHeight,left:t.n.x-i.offsetWidth/2}},s:function(){var t=p(this);return{top:t.s.y,left:t.s.x-i.offsetWidth/2}},e:function(){var t=p(this);return{top:t.e.y-i.offsetHeight/2,left:t.e.x}},w:function(){var t=p(this);return{top:t.w.y-i.offsetHeight/2,left:t.w.x-i.offsetWidth}},nw:function(){var t=p(this);return{top:t.nw.y-i.offsetHeight,left:t.nw.x-i.offsetWidth}},ne:function(){var t=p(this);return{top:t.ne.y-i.offsetHeight,left:t.ne.x}},sw:function(){var t=p(this);return{top:t.sw.y,left:t.sw.x-i.offsetWidth}},se:function(){var t=p(this);return{top:t.se.y,left:t.se.x}}}),c=l.keys();function h(){var t=yt(document.createElement("div"));return t.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),t.node()}function f(){return null==i&&(i=h(),r.appendChild(i)),yt(i)}function p(t){for(var e=s||t;null==e.getScreenCTM&&null!=e.parentNode;)e=e.parentNode;var n={},r=e.getScreenCTM(),i=e.getBBox(),o=i.width,u=i.height,l=i.x,c=i.y;return a.x=l,a.y=c,n.nw=a.matrixTransform(r),a.x+=o,n.ne=a.matrixTransform(r),a.y+=u,n.se=a.matrixTransform(r),a.x-=o,n.sw=a.matrixTransform(r),a.y-=u/2,n.w=a.matrixTransform(r),a.x+=o,n.e=a.matrixTransform(r),a.x-=o/2,a.y-=u/2,n.n=a.matrixTransform(r),a.y+=u,n.s=a.matrixTransform(r),n}function d(t){return"function"==typeof t?t:function(){return t}}return u}().attr("class","d3-tip").offset([10,0]).html((function(t){var e=m.node(t),n="";return e.id!==r.guid&&(n="<h5 style='text-align: center;'>"+(e.isLineage?"Lineage":"Impact")+"</h5>"),n+="<h5 class='text-center'><span style='color:#359f89'>"+e.toolTipLabel+"</span></h5> ",e.typeName&&(n+="<h5 class='text-center'><span>("+e.typeName+")</span></h5> "),e.queryText&&(n+="<h5>Query: <span style='color:#359f89'>"+e.queryText+"</span></h5> "),"<div class='tip-inner-scroll'>"+n+"</div>"}));y.call(k),E(b,m),b.selectAll("g.nodes g.label").attr("transform","translate(2,-35)").on("mouseenter",(function(t){rt.preventDefault(),yt(this).classed("highlight",!0)})).on("mouseleave",(function(t){rt.preventDefault(),yt(this).classed("highlight",!1)})).on("click",(function(t){rt.preventDefault(),c&&"function"==typeof c&&c({clickedData:t}),k.hide(t)})),b.selectAll("g.nodes g.node circle").on("mouseenter",(function(t,n,r){if(v.activeNode=!0,this.getScreenCTM().translate(+this.getAttribute("cx"),+this.getAttribute("cy")),v.svg.selectAll(".node").classed("active",!1),yt(this).classed("active",!0),v._getValueFromUser(u)){var i=mr.getToolTipDirection({el:this});k.direction(i).show(t,this)}!1!==v._getValueFromUser(l)&&mr.onHoverFade(Mr({opacity:.3,mouseenter:!0,hoveredNode:t},e))})).on("mouseleave",(function(t){v.activeNode=!1;var n=this;setTimeout((function(e){v.activeTip||v.activeNode||(yt(n).classed("active",!1),v._getValueFromUser(u)&&k.hide(t))}),150),!1!==v._getValueFromUser(l)&&mr.onHoverFade(Mr({mouseenter:!1,hoveredNode:t},e))})).on("click",(function(t){rt.defaultPrevented||(rt.preventDefault(),k.hide(t),y.selectAll("g.node>circle").classed("node-detail-highlight",!1),yt(this).classed("node-detail-highlight",!0),f&&"function"==typeof f&&f({clickedData:t,el:this}))}));var T=b.selectAll("g.edgePath");T.selectAll("path.path").on("click",(function(t){if(h&&"function"==typeof h){var e=a.relations.find((function(e){if(e.fromEntityId===t.v&&e.toEntityId===t.w)return!0}));h({pathRelationObj:e,clickedData:t})}})),!1!==p&&mr.centerNode(Mr(Mr({},e),{},{fitToScreen:d,svgGroupEl:b,edgePathEl:T})),mr.dragNode(Mr(Mr({},e),{},{edgePathEl:T})),!0!==g&&this._addLegend(),this.options.afterRender&&this.options.afterRender()}else y.html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relations to display</text>')}},{key:"_addLegend",value:function(){if(!1!==this.options.legends){var t=yt(this.options.legendsEl||this.options.el).insert("div",":first-child").classed("legends",!0),e=t.append("span").style("color","#fb4200");e.append("i").classed("fa fa-circle-o fa-fw",!0),e.append("span").html("Current Entity"),(e=t.append("span").style("color","#686868")).append("i").classed("fa fa-hourglass-half fa-fw",!0),e.append("span").html("In Progress"),(e=t.append("span").style("color","#df9b00")).append("i").classed("fa fa-long-arrow-right fa-fw",!0),e.append("span").html("Lineage"),(e=t.append("span").style("color","#fb4200")).append("i").classed("fa fa-long-arrow-right fa-fw",!0),e.append("span").html("Impact")}}}])&&jr(e.prototype,n),r&&jr(e,r),t}()}])}));
\ No newline at end of file
.node{cursor:pointer}.node text{font-size:10px;font-family:sans-serif}.node rect{stroke:#999;fill:#fff;stroke-width:1.5px}.node rect.serach-rect{stroke:#37bb9b;fill:transparent;stroke-width:2.5px}.node .label{fill:#868686}.node .label.highlight{cursor:pointer;fill:#4a90e2;text-decoration:underline}.node .label.highlight tspan{font-weight:400}.node circle{-moz-transition:all 0.3s;-webkit-transition:all 0.3s;transition:all 0.3s;stroke-width:1.5px}.node circle.node-detail-highlight{stroke:#4a90e2;stroke-width:2px}.node circle.nodeImage.green:hover{stroke:#ffb203}.node circle.nodeImage.blue:hover{stroke:#4b91e2}.node circle.nodeImage.currentNode{stroke:#fb4200}.node circle.nodeImage:hover{-moz-transform:scale(1.4);-webkit-transform:scale(1.4);transform:scale(1.4)}.node.active circle{-moz-transform:scale(1.4);-webkit-transform:scale(1.4);transform:scale(1.4)}.node.active circle.nodeImage.green{stroke:#ffb203}.node.active circle.nodeImage.blue{stroke:#4b91e2}.legends>span{margin-right:8px;font-family:Source Sans Pro}svg.hover g.node{opacity:0.1 !important}svg.hover g.edgePath{opacity:0 !important}svg.hover g.node.hover-active-node,svg.hover g.edgePath.hover-active-path{opacity:1 !important}.invisible .node circle{transition:all 0s}.edgePath .path{cursor:pointer}.link{fill:none;stroke:#ccc;stroke-width:1.5px}.text-center{text-align:center}.d3-tip{line-height:1;font-weight:bold;padding:12px;background:rgba(0,0,0,0.8);color:#fff;z-index:999;max-width:300px;border-radius:2px}.d3-tip .tip-inner-scroll{overflow:auto;max-height:300px}.d3-tip .tip-inner-scroll h5{margin:7px 0px}.d3-tip:after{box-sizing:border-box;display:inline;font-size:10px;width:100%;line-height:1;color:rgba(0,0,0,0.8);position:absolute}.d3-tip.n:after{content:"\25BC";margin:-1px 0 0 0;top:100%;left:0;text-align:center}.d3-tip.e:after{content:"\25C0";margin:-4px 0 0 0;top:50%;left:-8px}.d3-tip.s:after{content:"\25B2";margin:0 0 1px 0;top:-8px;left:0;text-align:center}.d3-tip.w:after{content:"\25B6";margin:-4px 0 0 -1px;top:50%;left:100%}g.type-TK>rect{fill:#00ffd0}.fullscreen-mode{position:fixed;height:100% !important;top:0;bottom:0;left:0;width:100%;right:0;padding:0 !important;z-index:9999;overflow:hidden !important}.fullscreen-mode .resizeGraph{position:fixed;height:100% !important}.fullscreen-mode .resizeGraph .ui-resizable-handle{display:none}.fullscreen-mode .lineage-box{padding:10px !important}.fullscreen-mode .box-panel{margin:10px !important}@keyframes zoominoutsinglefeatured{0%{transform:scale(1, 1)}50%{transform:scale(1.2, 1.2)}100%{transform:scale(1, 1)}}.wobble{animation:zoominoutsinglefeatured 1s 5}.hidden-svg{visibility:hidden}@-webkit-keyframes blink{from{opacity:0.2}to{opacity:0.5}}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "atlas-lineage-module",
"version": "1.0.0",
"description": "The module will help to render the lineage graph with the help dagre-d3,d3 js lib",
"main": "dist/index.js",
"scripts": {
"start": "NODE_ENV=development webpack --watch",
"build": "webpack"
},
"repository": {
"type": "git",
"url": "git+https://github.com/apache/atlas.git"
},
"keywords": [
"lineage",
"dagre-d3",
"d3"
],
"author": "kevalbhatt",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/apache/atlas/issues"
},
"homepage": "https://github.com/apache/atlas#readme",
"dependencies": {
"d3-tip": "^0.9.1",
"dagre-d3": "^0.6.4",
"platform": "^1.3.5"
},
"devDependencies": {
"@babel/core": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"babel-loader": "^8.1.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"css-loader": "^3.5.3",
"mini-css-extract-plugin": "^0.9.0",
"path": "^0.12.7",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
}
}
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
entityStateReadOnly: {
ACTIVE: false,
DELETED: true,
STATUS_ACTIVE: false,
STATUS_DELETED: true
}
};
\ No newline at end of file
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Enums from "../Enums";
import { curveBasis } from "d3-shape";
const DataUtils = {
/**
* [getBaseUrl description]
* @param {[type]} url [description]
* @return {[type]} [description]
*/
getBaseUrl: function(url) {
return url.replace(/\/[\w-]+.(jsp|html)|\/+$/gi, "");
},
/**
* [getEntityIconPath description]
* @param {[type]} options.entityData [description]
* @param {Object} options.errorUrl } [description]
* @return {[type]} [description]
*/
getEntityIconPath: function({ entityData, errorUrl } = {}) {
var serviceType,
status,
typeName,
iconBasePath = this.getBaseUrl(window.location.pathname) + Globals.entityImgPath;
if (entityData) {
typeName = entityData.typeName;
serviceType = entityData && entityData.serviceType;
status = entityData && entityData.status;
}
function getImgPath(imageName) {
return iconBasePath + (Enums.entityStateReadOnly[status] ? "disabled/" + imageName : imageName);
}
function getDefaultImgPath() {
if (entityData.isProcess) {
if (Enums.entityStateReadOnly[status]) {
return iconBasePath + "disabled/process.png";
} else {
return iconBasePath + "process.png";
}
} else {
if (Enums.entityStateReadOnly[status]) {
return iconBasePath + "disabled/table.png";
} else {
return iconBasePath + "table.png";
}
}
}
if (entityData) {
if (errorUrl) {
var isErrorInTypeName = errorUrl && errorUrl.match("entity-icon/" + typeName + ".png|disabled/" + typeName + ".png") ? true : false;
if (serviceType && isErrorInTypeName) {
var imageName = serviceType + ".png";
return getImgPath(imageName);
} else {
return getDefaultImgPath();
}
} else if (entityData.typeName) {
var imageName = entityData.typeName + ".png";
return getImgPath(imageName);
} else {
return getDefaultImgPath();
}
}
},
/**
* [isProcess description]
* @param {[type]} options.typeName [description]
* @param {[type]} options.superTypes [description]
* @param {[type]} options.entityDef [description]
* @return {Boolean} [description]
*/
isProcess: function({ typeName, superTypes, entityDef }) {
if (typeName == "Process") {
return true;
}
return superTypes.indexOf("Process") > -1;
},
/**
* [isDeleted description]
* @param {[type]} node [description]
* @return {Boolean} [description]
*/
isDeleted: function(node) {
if (node === undefined) {
return;
}
return Enums.entityStateReadOnly[node.status];
},
isNodeToBeUpdated: function(node, filterObj) {
var isProcessHideCheck = filterObj.isProcessHideCheck,
isDeletedEntityHideCheck = filterObj.isDeletedEntityHideCheck;
var returnObj = {
isProcess: isProcessHideCheck && node.isProcess,
isDeleted: isDeletedEntityHideCheck && node.isDeleted
};
returnObj["update"] = returnObj.isProcess || returnObj.isDeleted;
return returnObj;
},
/**
* [getServiceType description]
* @param {[type]} options.typeName [description]
* @param {[type]} options.entityDef [description]
* @return {[type]} [description]
*/
getServiceType: function({ typeName, entityDef }) {
var serviceType = null;
if (typeName) {
if (entityDef) {
serviceType = entityDef.serviceType || null;
}
}
return serviceType;
},
/**
* [getEntityDef description]
* @param {[type]} options.typeName [description]
* @param {[type]} options.entityDefCollection [description]
* @return {[type]} [description]
*/
getEntityDef: function({ typeName, entityDefCollection }) {
var entityDef = null;
if (typeName) {
entityDef = entityDefCollection.find(function(obj) {
return obj.name == typeName;
});
}
return entityDef;
},
/**
* [getNestedSuperTypes description]
* @param {[type]} options.entityDef [description]
* @param {[type]} options.entityDefCollection [description]
* @return {[type]} [description]
*/
getNestedSuperTypes: function({ entityDef, entityDefCollection }) {
var data = entityDef,
collection = entityDefCollection,
superTypes = new Set();
var getData = function(data, collection) {
if (data) {
if (data.superTypes && data.superTypes.length) {
data.superTypes.forEach(function(superTypeName) {
superTypes.add(superTypeName);
var collectionData = collection.find(function(obj) {
obj.name === superTypeName;
});
if (collectionData) {
getData(collectionData, collection);
}
});
}
}
};
getData(data, collection);
return Array.from(superTypes);
},
generateData: function({ data = {}, filterObj, entityDefCollection, g, guid, setGraphEdge, setGraphNode }) {
return new Promise((resolve, reject) => {
try {
var relations = data.relations || {},
guidEntityMap = data.guidEntityMap || {},
isHideFilterOn = filterObj.isProcessHideCheck || filterObj.isDeletedEntityHideCheck,
newHashMap = {},
styleObj = {
fill: "none",
stroke: "#ffb203",
width: 3
},
makeNodeData = (relationObj) => {
if (relationObj) {
if (relationObj.updatedValues) {
return relationObj;
}
var obj = Object.assign(relationObj, {
shape: "img",
updatedValues: true,
label: relationObj.displayText.trunc(18),
toolTipLabel: relationObj.displayText,
id: relationObj.guid,
isLineage: true,
isIncomplete: relationObj.isIncomplete,
entityDef: this.getEntityDef({ typeName: relationObj.typeName, entityDefCollection })
});
obj["serviceType"] = this.getServiceType(obj);
obj["superTypes"] = this.getNestedSuperTypes({
...obj,
entityDefCollection: entityDefCollection
});
obj["isProcess"] = this.isProcess(obj);
obj["isDeleted"] = this.isDeleted(obj);
return obj;
}
},
crateLineageRelationshipHashMap = function({ relations } = {}) {
var newHashMap = {};
relations.forEach(function(obj) {
if (newHashMap[obj.fromEntityId]) {
newHashMap[obj.fromEntityId].push(obj.toEntityId);
} else {
newHashMap[obj.fromEntityId] = [obj.toEntityId];
}
});
return newHashMap;
},
getStyleObjStr = function(styleObj) {
return "fill:" + styleObj.fill + ";stroke:" + styleObj.stroke + ";stroke-width:" + styleObj.width;
},
getNewToNodeRelationship = (toNodeGuid, filterObj) => {
if (toNodeGuid && relationshipMap[toNodeGuid]) {
var newRelationship = [];
relationshipMap[toNodeGuid].forEach((guid) => {
var nodeToBeUpdated = this.isNodeToBeUpdated(makeNodeData(guidEntityMap[guid]), filterObj);
if (nodeToBeUpdated.update) {
var newRelation = getNewToNodeRelationship(guid, filterObj);
if (newRelation) {
newRelationship = newRelationship.concat(newRelation);
}
} else {
newRelationship.push(guid);
}
});
return newRelationship;
} else {
return null;
}
},
getToNodeRelation = (toNodes, fromNodeToBeUpdated, filterObj) => {
var toNodeRelationship = [];
toNodes.forEach((toNodeGuid) => {
var toNodeToBeUpdated = this.isNodeToBeUpdated(makeNodeData(guidEntityMap[toNodeGuid]), filterObj);
if (toNodeToBeUpdated.update) {
// To node need to updated
if (pendingFromRelationship[toNodeGuid]) {
toNodeRelationship = toNodeRelationship.concat(pendingFromRelationship[toNodeGuid]);
} else {
var newToNodeRelationship = getNewToNodeRelationship(toNodeGuid, filterObj);
if (newToNodeRelationship) {
toNodeRelationship = toNodeRelationship.concat(newToNodeRelationship);
}
}
} else {
//when bothe node not to be updated.
toNodeRelationship.push(toNodeGuid);
}
});
return toNodeRelationship;
},
setNode = (guid) => {
if (!g._nodes[guid]) {
var nodeData = makeNodeData(guidEntityMap[guid]);
setGraphNode(guid, nodeData);
return nodeData;
} else {
return g._nodes[guid];
}
},
setEdge = function(fromNodeGuid, toNodeGuid, opt = {}) {
setGraphEdge(fromNodeGuid, toNodeGuid, {
arrowhead: "arrowPoint",
curve: curveBasis,
style: getStyleObjStr(styleObj),
styleObj: styleObj,
...opt
});
},
setGraphData = function(fromEntityId, toEntityId) {
setNode(fromEntityId);
setNode(toEntityId);
setEdge(fromEntityId, toEntityId);
},
pendingFromRelationship = {};
if (isHideFilterOn) {
var relationshipMap = crateLineageRelationshipHashMap(data);
Object.keys(relationshipMap).forEach((fromNodeGuid) => {
var toNodes = relationshipMap[fromNodeGuid],
fromNodeToBeUpdated = this.isNodeToBeUpdated(makeNodeData(guidEntityMap[fromNodeGuid]), filterObj),
toNodeList = getToNodeRelation(toNodes, fromNodeToBeUpdated, filterObj);
if (fromNodeToBeUpdated.update) {
if (pendingFromRelationship[fromNodeGuid]) {
pendingFromRelationship[fromNodeGuid] = pendingFromRelationship[fromNodeGuid].concat(toNodeList);
} else {
pendingFromRelationship[fromNodeGuid] = toNodeList;
}
} else {
toNodeList.forEach(function(toNodeGuid) {
setGraphData(fromNodeGuid, toNodeGuid);
});
}
});
} else {
relations.forEach(function(obj) {
setGraphData(obj.fromEntityId, obj.toEntityId);
});
}
if (g._nodes[guid]) {
if (g._nodes[guid]) {
g._nodes[guid]["isLineage"] = false;
}
this.findImpactNodeAndUpdateData({
guid,
g,
setEdge,
getStyleObjStr
});
}
resolve(g);
} catch (e) {
reject(e);
}
});
},
findImpactNodeAndUpdateData: function({ guid, getStyleObjStr, g, setEdge }) {
var that = this,
traversedMap = {},
styleObj = {
fill: "none",
stroke: "#fb4200",
width: 3
},
traversed = function(toNodeList = {}, fromNodeGuid) {
let toNodeKeyList = Object.keys(toNodeList);
if (toNodeKeyList.length) {
if (!traversedMap[fromNodeGuid]) {
traversedMap[fromNodeGuid] = true;
toNodeKeyList.forEach(function(toNodeGuid) {
if (g._nodes[toNodeGuid]) {
g._nodes[toNodeGuid]["isLineage"] = false;
}
setEdge(fromNodeGuid, toNodeGuid, {
style: getStyleObjStr(styleObj),
styleObj: styleObj
});
traversed(g._sucs[toNodeGuid], toNodeGuid);
});
}
}
};
traversed(g._sucs[guid], guid);
}
};
export default DataUtils;
\ No newline at end of file
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { select, event } from "d3-selection";
import { zoom, zoomIdentity } from "d3-zoom";
import { drag } from "d3-drag";
import { line, curveBasis } from "d3-shape";
import platform from "platform";
import Enums from "../Enums";
const LineageUtils = {
/**
* [nodeArrowDistance variable use to define the distance between arrow and node]
* @type {Number}
*/
nodeArrowDistance: 24,
refreshGraphForSafari: function (options) {
var edgePathEl = options.edgeEl,
IEGraphRenderDone = 0;
edgePathEl.each(function (argument) {
var eleRef = this,
childNode = $(this).find("pattern");
setTimeout(function (argument) {
$(eleRef).find("defs").append(childNode);
}, 500);
});
},
refreshGraphForIE: function ({ edgePathEl }) {
var IEGraphRenderDone = 0;
edgePathEl.each(function (argument) {
var childNode = $(this).find("marker");
$(this).find("marker").remove();
var eleRef = this;
++IEGraphRenderDone;
setTimeout(function (argument) {
$(eleRef).find("defs").append(childNode);
--IEGraphRenderDone;
if (IEGraphRenderDone === 0) {
this.$(".fontLoader").hide();
this.$("svg").fadeTo(1000, 1);
}
}, 1000);
});
},
/**
* [dragNode description]
* @param {[type]} options.g [description]
* @param {[type]} options.svg [description]
* @param {[type]} options.guid [description]
* @param {[type]} options.edgePathEl [description]
* @return {[type]} [description]
*/
dragNode: function ({ g, svg, guid, edgePathEl }) {
var dragHelper = {
dragmove: function (el, d) {
var node = select(el),
selectedNode = g.node(d),
prevX = selectedNode.x,
prevY = selectedNode.y;
selectedNode.x += event.dx;
selectedNode.y += event.dy;
node.attr("transform", "translate(" + selectedNode.x + "," + selectedNode.y + ")");
var dx = selectedNode.x - prevX,
dy = selectedNode.y - prevY;
g.edges().forEach((e) => {
if (e.v == d || e.w == d) {
var edge = g.edge(e.v, e.w);
this.translateEdge(edge, dx, dy);
select(edge.elem).select("path").attr("d", this.calcPoints(e));
}
});
//LineageUtils.refreshGraphForIE({ edgePathEl: edgePathEl });
},
translateEdge: function (e, dx, dy) {
e.points.forEach(function (p) {
p.x = p.x + dx;
p.y = p.y + dy;
});
},
calcPoints: function (e) {
var edge = g.edge(e.v, e.w),
tail = g.node(e.v),
head = g.node(e.w),
points = edge.points.slice(1, edge.points.length - 1),
afterslice = edge.points.slice(1, edge.points.length - 1);
points.unshift(this.intersectRect(tail, points[0]));
points.push(this.intersectRect(head, points[points.length - 1]));
return line()
.x(function (d) {
return d.x;
})
.y(function (d) {
return d.y;
})
.curve(curveBasis)(points);
},
intersectRect: (node, point) => {
var x = node.x,
y = node.y,
dx = point.x - x,
dy = point.y - y,
nodeDistance = guid ? this.nodeArrowDistance + 3 : this.nodeArrowDistance,
w = nodeDistance,
h = nodeDistance,
sx = 0,
sy = 0;
if (Math.abs(dy) * w > Math.abs(dx) * h) {
// Intersection is top or bottom of rect.
if (dy < 0) {
h = -h;
}
sx = dy === 0 ? 0 : (h * dx) / dy;
sy = h;
} else {
// Intersection is left or right of rect.
if (dx < 0) {
w = -w;
}
sx = w;
sy = dx === 0 ? 0 : (w * dy) / dx;
}
return {
x: x + sx,
y: y + sy
};
}
};
var dragNodeHandler = drag().on("drag", function (d) {
dragHelper.dragmove.call(dragHelper, this, d);
}),
dragEdgePathHandler = drag().on("drag", function (d) {
dragHelper.translateEdge(g.edge(d.v, d.w), event.dx, event.dy);
var edgeObj = g.edge(d.v, d.w);
select(edgeObj.elem).select("path").attr("d", dragHelper.calcPoints(d));
});
dragNodeHandler(svg.selectAll("g.node"));
dragEdgePathHandler(svg.selectAll("g.edgePath"));
},
zoomIn: function ({ svg, scaleFactor = 1.3 }) {
this.d3Zoom.scaleBy(svg.transition().duration(750), scaleFactor);
},
zoomOut: function ({ svg, scaleFactor = 0.8 }) {
this.d3Zoom.scaleBy(svg.transition().duration(750), scaleFactor);
},
zoom: function ({ svg, xa, ya, scale }) {
svg.transition().duration(750).call(this.d3Zoom.transform, zoomIdentity.translate(xa, ya).scale(scale));
},
fitToScreen: function ({ svg }) {
var node = svg.node();
var bounds = node.getBBox();
var parent = node.parentElement,
fullWidth = parent.clientWidth,
fullHeight = parent.clientHeight;
var width = bounds.width,
height = bounds.height;
var midX = bounds.x + width / 2,
midY = bounds.y + height / 2;
var scale = (scale || 0.95) / Math.max(width / fullWidth, height / fullHeight),
xa = fullWidth / 2 - scale * midX,
ya = fullHeight / 2 - scale * midY;
this.zoom({ svg, xa, ya, scale });
},
/**
* [centerNode description]
* @param {[type]} options.guid [description]
* @param {[type]} options.g [description]
* @param {[type]} options.svg [description]
* @param {[type]} options.svgGroupEl [description]
* @param {[type]} options.edgePathEl [description]
* @param {[type]} options.width [description]
* @param {[type]} options.height [description]
* @param {[type]} options.onCenterZoomed [description]
* @return {[type]} [description]
*/
centerNode: function ({ guid, g, svg, svgGroupEl, edgePathEl, width, height, fitToScreen, onCenterZoomed }) {
this.d3Zoom = zoom();
svg.call(this.d3Zoom).on("dblclick.zoom", null);
// restrict events
let selectedNodeEl = svg.selectAll("g.nodes>g[id='" + guid + "']"),
zoomListener = this.d3Zoom.scaleExtent([0.01, 50]).on("zoom", function () {
svgGroupEl.attr("transform", event.transform);
}),
x = null,
y = null,
scale = 1.2;
if (selectedNodeEl.empty()) {
if (fitToScreen) {
this.fitToScreen({ svg });
return;
} else {
x = g.graph().width / 2;
y = g.graph().height / 2;
}
} else {
var matrix = selectedNodeEl
.attr("transform")
.replace(/[^0-9\-.,]/g, "")
.split(",");
// if (platform.name === "IE" || platform.name === "Microsoft Edge") {
// var matrix = selectedNode
// .attr("transform")
// .replace(/[a-z\()]/g, "")
// .split(" ");
// }
x = matrix[0];
y = matrix[1];
}
var xa = -(x * scale - width / 2),
ya = -(y * scale - height / 2);
this.zoom({ svg, xa, ya, scale });
svg.transition().duration(750).call(this.d3Zoom.transform, zoomIdentity.translate(xa, ya).scale(scale));
if (onCenterZoomed) {
onCenterZoomed({ newScale: scale, newTranslate: [xa, ya], d3Zoom: this.d3Zoom, selectedNodeEl });
}
// if (platform.name === "IE") {
// LineageUtils.refreshGraphForIE({ edgePathEl: edgePathEl });
// }
},
/**
* [getToolTipDirection description]
* @param {[type]} options.el [description]
* @return {[type]} [description]
*/
getToolTipDirection: function ({ el }) {
var width = select("body").node().getBoundingClientRect().width,
currentELWidth = select(el).node().getBoundingClientRect(),
direction = "e";
if (width - currentELWidth.left < 330) {
direction = width - currentELWidth.left < 330 && currentELWidth.top < 400 ? "sw" : "w";
if (width - currentELWidth.left < 330 && currentELWidth.top > 600) {
direction = "nw";
}
} else if (currentELWidth.top > 600) {
direction = width - currentELWidth.left < 330 && currentELWidth.top > 600 ? "nw" : "n";
if (currentELWidth.left < 50) {
direction = "ne";
}
} else if (currentELWidth.top < 400) {
direction = currentELWidth.left < 50 ? "se" : "s";
}
return direction;
},
/**
* [onHoverFade description]
* @param {[type]} options.svg [description]
* @param {[type]} options.g [description]
* @param {[type]} options.mouseenter [description]
* @param {[type]} options.opacity [description]
* @param {[type]} options.nodesToHighlight [description]
* @param {[type]} options.hoveredNode [description]
* @return {[type]} [description]
*/
onHoverFade: function ({ svg, g, mouseenter, nodesToHighlight, hoveredNode }) {
var node = svg.selectAll(".node"),
path = svg.selectAll(".edgePath"),
isConnected = function (a, b, o) {
if (a === o || (b && b.length && b.indexOf(o) != -1)) {
return true;
}
};
if (mouseenter) {
svg.classed("hover", true);
var nextNode = g.successors(hoveredNode),
previousNode = g.predecessors(hoveredNode),
nodesToHighlight = nextNode.concat(previousNode);
node.classed("hover-active-node", function (currentNode, i, nodes) {
if (isConnected(hoveredNode, nodesToHighlight, currentNode)) {
return true;
} else {
return false;
}
});
path.classed("hover-active-path", function (c) {
var _thisOpacity = c.v === hoveredNode || c.w === hoveredNode ? 1 : 0;
if (_thisOpacity) {
return true;
} else {
return false;
}
});
} else {
svg.classed("hover", false);
node.classed("hover-active-node", false);
path.classed("hover-active-path", false);
}
},
/**
* [getBaseUrl description]
* @param {[type]} path [description]
* @return {[type]} [description]
*/
getBaseUrl: function (url = window.location.pathname) {
return url.replace(/\/[\w-]+.(jsp|html)|\/+$/gi, "");
},
getEntityIconPath: function ({ entityData, errorUrl, imgBasePath }) {
var iconBasePath = this.getBaseUrl() + (imgBasePath || "/img/entity-icon/");
if (entityData) {
let { typeName, serviceType, status, isProcess } = entityData;
function getImgPath(imageName) {
return iconBasePath + (Enums.entityStateReadOnly[status] ? "disabled/" + imageName : imageName);
}
function getDefaultImgPath() {
if (isProcess) {
if (Enums.entityStateReadOnly[status]) {
return iconBasePath + "disabled/process.png";
} else {
return iconBasePath + "process.png";
}
} else {
if (Enums.entityStateReadOnly[status]) {
return iconBasePath + "disabled/table.png";
} else {
return iconBasePath + "table.png";
}
}
}
if (errorUrl) {
// Check if the default img path has error, if yes then stop recursion.
if (errorUrl.indexOf("table.png") > -1 || errorUrl.indexOf("process.png") > -1) {
return null;
}
var isErrorInTypeName = errorUrl && errorUrl.match("entity-icon/" + typeName + ".png|disabled/" + typeName + ".png") ? true : false;
if (serviceType && isErrorInTypeName) {
var imageName = serviceType + ".png";
return getImgPath(imageName);
} else {
return getDefaultImgPath();
}
} else if (typeName) {
var imageName = typeName + ".png";
return getImgPath(imageName);
} else if (serviceType) {
var imageName = serviceType + ".png";
return getImgPath(imageName);
} else {
return getDefaultImgPath();
}
}
},
base64Encode: function (file, callback) {
const reader = new FileReader();
reader.addEventListener("load", () => callback(reader.result));
reader.readAsDataURL(file);
},
imgShapeRender: function (parent, bbox, node, { dagreD3, defsEl, imgBasePath, guid }) {
var that = this,
viewGuid = guid,
imageIconPath = this.getEntityIconPath({ entityData: node, imgBasePath }),
imgName = imageIconPath.split("/").pop();
if (this.imageObject === undefined) {
this.imageObject = {};
}
if (node.isDeleted) {
imgName = "deleted_" + imgName;
}
if (node.id == viewGuid) {
var currentNode = true;
}
var shapeSvg = parent
.append("circle")
.attr("fill", "url(#img_" + imgName + ")")
.attr("r", "24px")
.attr("data-stroke", node.id)
.attr("stroke-width", "2px")
.attr("class", "nodeImage " + (currentNode ? "currentNode" : node.isProcess ? "process" : "node"));
if (currentNode) {
shapeSvg.attr("stroke", "#fb4200");
}
if (node.isIncomplete === true) {
parent.attr("class", "node isIncomplete show");
parent
.insert("foreignObject")
.attr("x", "-25")
.attr("y", "-25")
.attr("width", "50")
.attr("height", "50")
.append("xhtml:div")
.insert("i")
.attr("class", "fa fa-hourglass-half");
}
if (defsEl.select('pattern[id="img_' + imgName + '"]').empty()) {
defsEl
.append("pattern")
.attr("x", "0%")
.attr("y", "0%")
.attr("patternUnits", "objectBoundingBox")
.attr("id", "img_" + imgName)
.attr("width", "100%")
.attr("height", "100%")
.append("image")
.attr("href", function (d) {
var imgEl = this;
if (node) {
var getImageData = function (options) {
var imagePath = options.imagePath,
ajaxOptions = {
url: imagePath,
method: "GET",
cache: true
};
// if (platform.name !== "IE") {
// ajaxOptions["mimeType"] = "text/plain; charset=x-user-defined";
// }
shapeSvg.attr("data-iconpath", imagePath);
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
if (platform.name !== "IE") {
that.base64Encode(this.response, (url) => {
that.imageObject[imageIconPath] = url;
select(imgEl).attr("xlink:href", url);
});
} else {
that.imageObject[imageIconPath] = imagePath;
}
if (imageIconPath !== shapeSvg.attr("data-iconpath")) {
shapeSvg.attr("data-iconpathorigin", imageIconPath);
}
} else if (xhr.status === 404) {
const imgPath = that.getEntityIconPath({ entityData: node, errorUrl: imagePath });
if (imgPath === null) {
const patternEL = select(imgEl.parentElement);
patternEL.select("image").remove();
patternEL
.attr("patternContentUnits", "objectBoundingBox")
.append("circle")
.attr("r", "24px")
.attr("fill", "#e8e8e8");
} else {
getImageData({
imagePath: imgPath
});
}
}
}
};
xhr.responseType = "blob";
xhr.open(ajaxOptions.method, ajaxOptions.url, true);
xhr.send(null);
};
getImageData({
imagePath: imageIconPath
});
}
})
.attr("x", "4")
.attr("y", currentNode ? "3" : "4")
.attr("width", "40")
.attr("height", "40");
}
node.intersect = function (point) {
return dagreD3.intersect.circle(node, currentNode ? that.nodeArrowDistance + 3 : that.nodeArrowDistance, point);
};
return shapeSvg;
},
/**
* [arrowPointRender description]
* @param {[type]} {parent, id, edge, type, viewOptions [description]
* @return {[type]} [description]
*/
arrowPointRender: function (parent, id, edge, type, { dagreD3 }) {
var node = parent.node(),
parentNode = node ? node.parentNode : parent;
select(parentNode)
.select("path.path")
.attr("marker-end", "url(#" + id + ")");
var marker = parent
.append("marker")
.attr("id", id)
.attr("viewBox", "0 0 10 10")
.attr("refX", 8)
.attr("refY", 5)
.attr("markerUnits", "strokeWidth")
.attr("markerWidth", 4)
.attr("markerHeight", 4)
.attr("orient", "auto");
var path = marker.append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").style("fill", edge.styleObj.stroke);
dagreD3.util.applyStyle(path, edge[type + "Style"]);
},
/**
* [saveSvg description]
* @param {[type]} options.svg [description]
* @param {[type]} options.width [description]
* @param {[type]} options.height [description]
* @param {[type]} options.downloadFileName [description]
* @param {[type]} options.onExportLineage [description]
* @return {[type]} [description]
*/
saveSvg: function ({ svg, width, height, downloadFileName, onExportLineage }) {
var that = this,
svgClone = svg.clone(true).node(),
scaleFactor = 1;
setTimeout(function () {
if (platform.name === "Firefox") {
svgClone.setAttribute("width", width);
svgClone.setAttribute("height", height);
}
const hiddenSvgEl = select("body").append("div");
hiddenSvgEl.classed("hidden-svg", true);
hiddenSvgEl.node().appendChild(svgClone);
const svgCloneEl = select(".hidden-svg svg");
svgCloneEl.select("g").attr("transform", "scale(" + scaleFactor + ")");
svgCloneEl.select("foreignObject").remove();
var canvasOffset = { x: 150, y: 150 },
setWidth = svgClone.getBBox().width + canvasOffset.x,
setHeight = svgClone.getBBox().height + canvasOffset.y,
xAxis = svgClone.getBBox().x,
yAxis = svgClone.getBBox().y;
svgClone.attributes.viewBox.value = xAxis + "," + yAxis + "," + setWidth + "," + setHeight;
var canvas = document.createElement("canvas");
canvas.id = "canvas";
canvas.style.display = "none";
canvas.width = svgClone.getBBox().width * scaleFactor + canvasOffset.x;
canvas.height = svgClone.getBBox().height * scaleFactor + canvasOffset.y;
// Append Canvas in DOM
select("body").node().appendChild(canvas);
var ctx = canvas.getContext("2d"),
data = new XMLSerializer().serializeToString(svgClone),
DOMURL = window.URL || window.webkitURL || window;
ctx.fillStyle = "#FFFFFF";
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.strokeRect(0, 0, canvas.width, canvas.height);
ctx.restore();
var img = new Image(canvas.width, canvas.height);
var svgBlob = new Blob([data], { type: "image/svg+xml;base64" });
if (platform.name === "Safari") {
svgBlob = new Blob([data], { type: "image/svg+xml" });
}
var url = DOMURL.createObjectURL(svgBlob);
img.onload = function () {
try {
var a = document.createElement("a");
a.download = downloadFileName;
document.body.appendChild(a);
ctx.drawImage(img, 50, 50, canvas.width, canvas.height);
canvas.toBlob(function (blob) {
if (!blob) {
onExportLineage({ status: "failed", message: "There was an error in downloading Lineage!" });
return;
}
a.href = DOMURL.createObjectURL(blob);
if (blob.size > 10000000) {
onExportLineage({ status: "failed", message: "The Image size is huge, please open the image in a browser!" });
}
a.click();
onExportLineage({ status: "Success", message: "Successful" });
if (platform.name === "Safari") {
that.refreshGraphForSafari({
edgeEl: that.$("svg g.node")
});
}
}, "image/png");
hiddenSvgEl.remove();
canvas.remove();
} catch (err) {
onExportLineage({ status: "failed", message: "There was an error in downloading Lineage!" });
}
};
img.src = url;
}, 0);
}
};
export default LineageUtils;
\ No newline at end of file
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import LineageUtils from "./LineageUtils";
import DataUtils from "./DataUtils";
String.prototype.trunc =
String.prototype.trunc ||
function(n) {
return this.length > n ? this.substr(0, n - 1) + "..." : this;
};
export { LineageUtils, DataUtils };
\ No newline at end of file
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import dagreD3 from "dagre-d3";
import { select, selection, event } from "d3-selection";
import { curveBasis } from "d3-shape";
import { LineageUtils, DataUtils } from "./Utils";
import d3Tip from "d3-tip";
import "./styles/style.scss";
export default class LineageHelper {
constructor(options) {
this._updateOptions(options);
const { el, manualTrigger = false } = this.options;
if (el === undefined) {
throw new Error("LineageHelper requires el propety to render the graph");
}
this.initReturnObj = {
init: (arg) => this.init(arg),
createGraph: (opt = {}) => this._createGraph(this.options, this.graphOptions, opt),
clear: (arg) => this.clear(arg),
refresh: (arg) => this.refresh(arg),
centerAlign: (arg) => this.centerAlign(arg),
exportLineage: (arg) => this.exportLineage(arg),
zoomIn: (arg) => this.zoomIn(arg),
zoomOut: (arg) => this.zoomOut(arg),
zoom: (arg) => this.zoom(arg),
fullScreen: (arg) => this.fullScreen(arg),
searchNode: (arg) => this.searchNode(arg),
removeNodeSelection: (arg) => this.removeNodeSelection(arg),
getGraphOptions: () => this.graphOptions,
getNode: (guid, actual) => {
let rObj = null;
if (actual) {
rObj = this.actualData[guid];
} else {
rObj = this.g._nodes[guid];
}
if (rObj) {
rObj = Object.assign({}, rObj);
}
return rObj;
},
getNodes: (guid, actual) => {
let rObj = null;
if (actual) {
rObj = this.actualData;
} else {
rObj = this.g._nodes;
}
if (rObj) {
rObj = Object.assign({}, rObj);
}
return rObj;
},
setNode: this._setGraphNode,
setEdge: this._setGraphEdge
};
if (manualTrigger === false) {
this.init();
}
return this.initReturnObj;
}
/**
* [updateOptions get the options from user and appedn add it in this,option context]
* @param {[Object]} options [lib options from user]
* @return {[null]} [null]
*/
_updateOptions(options) {
this.options = {};
Object.assign(this.options, { filterObj: { isProcessHideCheck: false, isDeletedEntityHideCheck: false } }, options);
}
/**
* [init Start the graph build process]
* @return {[null]} [null]
*/
init() {
const { data = {} } = this.options;
if (data.baseEntityGuid) {
this.guid = data.baseEntityGuid;
}
// Call the initializeGraph method to initlize dagreD3 graphlib
this._initializeGraph();
this._initGraph();
}
/**
* [clear Allows user to clear the graph refrence and dom]
* @return {[type]} [description]
*/
clear() {
if (!this.options.el) {
this.svg.remove();
this.svg = null;
}
this.g = null;
this.graphOptions = {};
}
/**
* [centerAlign Allows user to center the lineage position, without rerender]
* @return {[type]} [description]
*/
centerAlign(opt = {}) {
var svgGroupEl = this.svg.select("g"),
edgePathEl = svgGroupEl.selectAll("g.edgePath");
LineageUtils.centerNode({
...this.graphOptions,
svgGroupEl,
edgePathEl,
...opt
});
}
/**
* [zoomIn description]
* @return {[type]} [description]
*/
zoomIn(opt = {}) {
LineageUtils.zoomIn({ ...this.graphOptions, ...opt });
}
/**
* [zoomOut description]
* @return {[type]} [description]
*/
zoomOut(opt = {}) {
LineageUtils.zoomOut({ ...this.graphOptions, ...opt });
}
/**
* [zoom description]
* @return {[type]} [description]
*/
zoom(opt = {}) {
LineageUtils.zoom({ ...this.graphOptions, ...opt });
}
/**
* [refresh Allows user to rerender the lineage]
* @return {[type]} [description]
*/
refresh() {
this.clear();
this._initializeGraph();
this._initGraph({ refresh: true });
}
/**
* [removeNodeSelection description]
* @return {[type]} [description]
*/
removeNodeSelection() {
this.svg.selectAll("g.node>circle").classed("node-detail-highlight", false);
}
/**
* [searchNode description]
* @return {[type]} [description]
*/
searchNode({ guid, onSearchNode }) {
this.svg.selectAll(".serach-rect").remove();
this.centerAlign({
guid: guid,
onCenterZoomed: function (opts) {
const { selectedNodeEl } = opts;
selectedNodeEl.select(".label").attr("stroke", "#316132");
selectedNodeEl.select("circle").classed("wobble", true);
selectedNodeEl
.insert("rect", "circle")
.attr("class", "serach-rect")
.attr("x", -50)
.attr("y", -27.5)
.attr("width", 100)
.attr("height", 55);
if (onSearchNode && typeof onSearchNode === "function") {
onSearchNode(opts);
}
}
});
}
/**
* [exportLineage description]
* @param {Object} options [description]
* @return {[type]} [description]
*/
exportLineage(options = {}) {
let downloadFileName = options.downloadFileName;
if (downloadFileName === undefined) {
let node = this.g._nodes[this.guid];
if (node && node.attributes) {
downloadFileName = `${node.attributes.qualifiedName || node.attributes.name || "lineage_export"}.png`;
} else {
downloadFileName = "lineage_export.png";
}
}
LineageUtils.saveSvg({
...this.graphOptions,
downloadFileName: downloadFileName,
onExportLineage: (opt) => {
if (options.onExportLineage) {
onExportLineage(opt);
}
}
});
}
/**
* [fullScreen description]
* @param {Object} options.el } [description]
* @return {[type]} [description]
*/
fullScreen({ el } = {}) {
if (el === undefined) {
throw new Error("LineageHelper requires el propety to apply fullScreen class");
}
const fullScreenEl = select(el);
if (fullScreenEl.classed("fullscreen-mode")) {
fullScreenEl.classed("fullscreen-mode", false);
return false;
} else {
fullScreenEl.classed("fullscreen-mode", true);
return true;
}
}
/**
* [_getValueFromUser description]
* @param {[type]} ref [description]
* @return {[type]} [description]
*/
_getValueFromUser(ref) {
if (ref !== undefined) {
if (typeof ref === "function") {
return ref();
} else {
return ref;
}
}
return;
}
/**
* [initializeGraph initlize the dagreD3 graphlib]
* @return {[null]} [null]
*/
_initializeGraph() {
const { width = "100%", height = "100%", el } = this.options;
// Append the svg using d3.
this.svg = select(el);
if (!(el instanceof SVGElement)) {
this.svg = this.svg
.append("svg")
.attr("xmlns", "http://www.w3.org/2000/svg")
.attr(" xmlns:xlink", "http://www.w3.org/1999/xlink")
.attr("version", "1.1")
.attr("width", width)
.attr("height", height);
}
// initlize the dagreD3 graphlib
this.g = new dagreD3.graphlib.Graph()
.setGraph(
Object.assign(
{
nodesep: 50,
ranksep: 90,
rankdir: "LR",
marginx: 20,
marginy: 20,
transition: function transition(selection) {
return selection.transition().duration(500);
}
},
this.options.dagreOptions
)
)
.setDefaultEdgeLabel(function () {
return {};
});
// Create graphOptions for common use
var svgRect = this.svg.node().getBoundingClientRect();
this.actualData = {};
this.graphOptions = {
svg: this.svg,
g: this.g,
dagreD3: dagreD3,
guid: this.guid,
width: this.options.width || svgRect.width,
height: this.options.height || svgRect.height
};
}
/**
* [_initGraph description]
* @return {[type]} [description]
*/
_initGraph({ refresh } = {}) {
if (this.svg) {
this.svg.select("g").remove();
}
let filterObj = this.options.filterObj;
if (this.options.getFilterObj) {
let filterObjVal = this.options.getFilterObj();
if (filterObjVal !== undefined || filterObjVal !== null) {
if (typeof filterObjVal === "object") {
filterObj = filterObjVal;
} else {
throw new Error("getFilterObj expect return type `object`,`null` or `Undefined`");
}
}
}
if (this.options.setDataManually === true) {
return;
} else if (this.options.data === undefined || (this.options.data && this.options.data.relations.length === 0)) {
if (this.options.beforeRender) {
this.options.beforeRender();
}
this.svg
.append("text")
.attr("x", "50%")
.attr("y", "50%")
.attr("alignment-baseline", "middle")
.attr("text-anchor", "middle")
.text("No lineage data found");
if (this.options.afterRender) {
this.options.afterRender();
}
return;
}
return DataUtils.generateData({
...this.options,
filterObj: filterObj,
...this.graphOptions,
setGraphNode: this._setGraphNode,
setGraphEdge: this._setGraphEdge
}).then((graphObj) => {
this._createGraph(this.options, this.graphOptions, { refresh });
});
}
/**
* [description]
* @param {[type]} guid [description]
* @param {[type]} nodeData [description]
* @return {[type]} [description]
*/
_setGraphNode = (guid, nodeData) => {
this.actualData[guid] = Object.assign({}, nodeData);
this.g.setNode(guid, nodeData);
};
/**
* [description]
* @param {[type]} fromGuid [description]
* @param {[type]} toGuid [description]
* @param {[type]} opts [description]
* @return {[type]} [description]
*/
_setGraphEdge = (fromGuid, toGuid, opts) => {
this.g.setEdge(fromGuid, toGuid, {
curve: curveBasis,
...opts
});
};
/**
* [_createGraph description]
* @param {Object} options.data [description]
* @param {Boolean} isShowTooltip [description]
* @param {Boolean} isShowHoverPath [description]
* @param {[type]} onLabelClick [description]
* @param {[type]} onPathClick [description]
* @param {[type]} onNodeClick } [description]
* @param {[type]} graphOptions [description]
* @return {[type]} [description]
*/
_createGraph(
{ data = {}, imgBasePath, isShowTooltip, isShowHoverPath, onLabelClick, onPathClick, onNodeClick, zoom, fitToScreen },
graphOptions,
{ refresh }
) {
if (this.options.beforeRender) {
this.options.beforeRender();
}
const that = this,
{ svg, g, width, height } = graphOptions;
if (svg instanceof selection === false) {
throw new Error("svg is not initialized or something went wrong while creatig graph instance");
return;
}
if (g._nodes === undefined || g._nodes.length === 0) {
svg.html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relations to display</text>');
return;
}
g.nodes().forEach(function (v) {
var node = g.node(v);
// Round the corners of the nodes
if (node) {
node.rx = node.ry = 5;
}
});
svg.attr("viewBox", "0 0 " + width + " " + height).attr("enable-background", "new 0 0 " + width + " " + height);
var svgGroupEl = svg.append("g");
// Append defs
var defsEl = svg.append("defs");
// Create the renderer
var render = new dagreD3.render();
// Add our custom arrow (a hollow-point)
render.arrows().arrowPoint = function () {
return LineageUtils.arrowPointRender(...arguments, { ...graphOptions });
};
// Render custom img inside shape
render.shapes().img = function () {
return LineageUtils.imgShapeRender(...arguments, {
...graphOptions,
imgBasePath: that._getValueFromUser(imgBasePath),
defsEl
});
};
var tooltip = d3Tip()
.attr("class", "d3-tip")
.offset([10, 0])
.html((d) => {
var value = g.node(d);
var htmlStr = "";
if (value.id !== this.guid) {
htmlStr = "<h5 style='text-align: center;'>" + (value.isLineage ? "Lineage" : "Impact") + "</h5>";
}
htmlStr += "<h5 class='text-center'><span style='color:#359f89'>" + value.toolTipLabel + "</span></h5> ";
if (value.typeName) {
htmlStr += "<h5 class='text-center'><span>(" + value.typeName + ")</span></h5> ";
}
if (value.queryText) {
htmlStr += "<h5>Query: <span style='color:#359f89'>" + value.queryText + "</span></h5> ";
}
return "<div class='tip-inner-scroll'>" + htmlStr + "</div>";
});
svg.call(tooltip);
// if (platform.name !== "IE") {
// this.$(".fontLoader").hide();
// }
render(svgGroupEl, g);
//change text postion
svgGroupEl
.selectAll("g.nodes g.label")
.attr("transform", "translate(2,-35)")
.on("mouseenter", function (d) {
event.preventDefault();
select(this).classed("highlight", true);
})
.on("mouseleave", function (d) {
event.preventDefault();
select(this).classed("highlight", false);
})
.on("click", function (d) {
event.preventDefault();
if (onLabelClick && typeof onLabelClick === "function") {
onLabelClick({ clickedData: d });
}
tooltip.hide(d);
});
svgGroupEl
.selectAll("g.nodes g.node circle")
.on("mouseenter", function (d, index, element) {
that.activeNode = true;
var matrix = this.getScreenCTM().translate(+this.getAttribute("cx"), +this.getAttribute("cy"));
that.svg.selectAll(".node").classed("active", false);
select(this).classed("active", true);
if (that._getValueFromUser(isShowTooltip)) {
var direction = LineageUtils.getToolTipDirection({ el: this });
tooltip.direction(direction).show(d, this);
}
if (that._getValueFromUser(isShowHoverPath) === false) {
return;
}
LineageUtils.onHoverFade({
opacity: 0.3,
mouseenter: true,
hoveredNode: d,
...graphOptions
});
})
.on("mouseleave", function (d) {
that.activeNode = false;
var nodeEL = this;
setTimeout(function (argument) {
if (!(that.activeTip || that.activeNode)) {
select(nodeEL).classed("active", false);
if (that._getValueFromUser(isShowTooltip)) {
tooltip.hide(d);
}
}
}, 150);
if (that._getValueFromUser(isShowHoverPath) === false) {
return;
}
LineageUtils.onHoverFade({
mouseenter: false,
hoveredNode: d,
...graphOptions
});
})
.on("click", function (d) {
if (event.defaultPrevented) return; // ignore drag
event.preventDefault();
tooltip.hide(d);
svg.selectAll("g.node>circle").classed("node-detail-highlight", false);
select(this).classed("node-detail-highlight", true);
if (onNodeClick && typeof onNodeClick === "function") {
onNodeClick({ clickedData: d, el: this });
}
});
// Bind event on edgePath
var edgePathEl = svgGroupEl.selectAll("g.edgePath");
edgePathEl.selectAll("path.path").on("click", function (d) {
if (onPathClick && typeof onPathClick === "function") {
var pathRelationObj = data.relations.find(function (obj) {
if (obj.fromEntityId === d.v && obj.toEntityId === d.w) {
return true;
}
});
onPathClick({ pathRelationObj, clickedData: d });
}
});
// tooltip hover handle to fix node hover conflict
// select("body").on("mouseover", ".d3-tip", function(el) {
// that.activeTip = true;
// });
// select("body").on("mouseleave", ".d3-tip", function(el) {
// that.activeTip = false;
// svg.selectAll(".node").classed("active", false);
// //tooltip.hide();
// });
// Center the graph
if (zoom !== false) {
LineageUtils.centerNode({
...graphOptions,
fitToScreen,
svgGroupEl,
edgePathEl
});
}
// if (platform.name === "IE") {
// LineageUtils.refreshGraphForIE({
// edgeEl: this.$("svg .edgePath")
// });
// }
LineageUtils.dragNode({
...graphOptions,
edgePathEl
});
if (refresh !== true) {
this._addLegend();
}
if (this.options.afterRender) {
this.options.afterRender();
}
}
_addLegend() {
if (this.options.legends === false) {
return;
}
var container = select(this.options.legendsEl || this.options.el)
.insert("div", ":first-child")
.classed("legends", true);
let span = container.append("span").style("color", "#fb4200");
span.append("i").classed("fa fa-circle-o fa-fw", true);
span.append("span").html("Current Entity");
span = container.append("span").style("color", "#686868");
span.append("i").classed("fa fa-hourglass-half fa-fw", true);
span.append("span").html("In Progress");
span = container.append("span").style("color", "#df9b00");
span.append("i").classed("fa fa-long-arrow-right fa-fw", true);
span.append("span").html("Lineage");
span = container.append("span").style("color", "#fb4200");
span.append("i").classed("fa fa-long-arrow-right fa-fw", true);
span.append("span").html("Impact");
}
}
\ No newline at end of file
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//fonts
$font_0: Source Sans Pro;
$font_1: sans-serif;
//Colors
$white: #fff;
$dark_gray: #666;
$light_gray: #e8e8e8;
$black_80: rgba(0, 0, 0, 0.8);
$color_mountain_mist_approx: #999;
$color_keppel_approx: #37bb9b;
$color_suva_gray_approx: #868686;
$color_havelock_blue_approx: #4a90e2;
$color_celeste_approx: #ccc;
$color_bright_turquoise_approx: #00ffd0;
$color_jungle_green_approx: #38bb9b;
$delete_link: #bb5838;
\ No newline at end of file
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/* graph.scss */
.node {
cursor: pointer;
text {
font-size: 10px;
font-family: $font_1;
}
//transition: opacity 0.3s linear;
rect {
stroke: $color_mountain_mist_approx;
fill: $white;
stroke-width: 1.5px;
&.serach-rect {
stroke: $color_keppel_approx;
fill: transparent;
stroke-width: 2.5px;
}
}
.label {
fill: $color_suva_gray_approx;
&.highlight {
cursor: pointer;
fill: $color_havelock_blue_approx;
text-decoration: underline;
tspan {
font-weight: 400;
}
}
}
circle {
-moz-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
stroke-width: 1.5px;
&.node-detail-highlight {
stroke: $color_havelock_blue_approx;
stroke-width: 2px;
}
&.nodeImage {
&.green:hover {
stroke: #ffb203;
}
&.blue:hover {
stroke: #4b91e2;
}
&.currentNode {
stroke: #fb4200;
}
&:hover {
-moz-transform: scale(1.4);
-webkit-transform: scale(1.4);
transform: scale(1.4);
}
}
}
&.active {
circle {
-moz-transform: scale(1.4);
-webkit-transform: scale(1.4);
transform: scale(1.4);
&.nodeImage {
&.green {
stroke: #ffb203;
}
&.blue {
stroke: #4b91e2;
}
}
}
}
}
.legends {
> span {
margin-right: 8px;
font-family: $font_0;
}
}
svg.hover {
g.node {
opacity: 0.1 !important;
}
g.edgePath {
opacity: 0 !important;
}
g.node.hover-active-node,
g.edgePath.hover-active-path {
opacity: 1 !important;
}
}
.invisible {
.node circle {
transition: all 0s;
}
}
.edgePath {
.path {
cursor: pointer;
}
}
.link {
fill: none;
stroke: $color_celeste_approx;
stroke-width: 1.5px;
}
.text-center {
text-align: center;
}
.d3-tip {
line-height: 1;
font-weight: bold;
padding: 12px;
background: $black_80;
color: $white;
z-index: 999;
max-width: 300px; //Instead of the line below you could use @include border-radius($radius, $vertical-radius)
border-radius: 2px;
.tip-inner-scroll {
overflow: auto;
max-height: 300px;
h5 {
margin: 7px 0px;
}
}
/* Creates a small triangle extender for the tooltip */
&:after {
box-sizing: border-box;
display: inline;
font-size: 10px;
width: 100%;
line-height: 1;
color: rgba(0, 0, 0, 0.8);
position: absolute;
}
/* Nrthward tooltips */
&.n:after {
content: "\25BC";
margin: -1px 0 0 0;
top: 100%;
left: 0;
text-align: center;
}
/* Eastward tooltips */
&.e:after {
content: "\25C0";
margin: -4px 0 0 0;
top: 50%;
left: -8px;
}
/* Southward tooltips */
&.s:after {
content: "\25B2";
margin: 0 0 1px 0;
top: -8px;
left: 0;
text-align: center;
}
/* Westward tooltips */
&.w:after {
content: "\25B6";
margin: -4px 0 0 -1px;
top: 50%;
left: 100%;
}
}
g.type-TK > rect {
fill: $color_bright_turquoise_approx;
}
.fullscreen-mode {
position: fixed;
height: 100% !important;
top: 0;
bottom: 0;
left: 0;
width: 100%;
right: 0;
padding: 0 !important;
z-index: 9999;
overflow: hidden !important;
.resizeGraph {
position: fixed;
height: 100% !important;
.ui-resizable-handle {
display: none;
}
}
.lineage-box {
padding: 10px !important;
}
.box-panel {
margin: 10px !important;
}
}
@keyframes zoominoutsinglefeatured {
0% {
transform: scale(1, 1);
}
50% {
transform: scale(1.2, 1.2);
}
100% {
transform: scale(1, 1);
}
}
.wobble {
animation: zoominoutsinglefeatured 1s 5;
}
.hidden-svg {
visibility: hidden;
}
@-webkit-keyframes blink {
from {
opacity: 0.2;
}
to {
opacity: 0.5;
}
}
\ No newline at end of file
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
@import "./__varibale.scss";
@import "./graph.scss";
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const distPath = path.resolve(__dirname, "dist");
const node_env = process.env.NODE_ENV ? process.env.NODE_ENV : 'production';
const config = {
mode: node_env,
entry: "./src/index.js",
output: {
library: "LineageHelper",
libraryTarget: "umd",
path: distPath,
filename: "index.js"
},
plugins: [new MiniCssExtractPlugin({ filename: "styles.css" })],
externals: {
//don't bundle the 'react' npm package with our bundle.js
//but get it from a global 'React' variable
d3: "d3",
"dagre-d3": "dagreD3",
platform: "platform",
dagre: "dagre",
graphlib: "graphlib"
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"],
plugins: ["transform-class-properties"]
}
}
},
{
test: /\.s[ac]ss$/i,
use: [
MiniCssExtractPlugin.loader,
// Translates CSS into CommonJS
"css-loader",
// Compiles Sass to CSS
"sass-loader"
]
}
]
}
};
if (process.env.NODE_ENV === "development") {
config.devtool = "inline-source-map";
}
module.exports = config;
\ No newline at end of file
...@@ -99,10 +99,20 @@ require.config({ ...@@ -99,10 +99,20 @@ require.config({
'deps': ['d3'], 'deps': ['d3'],
'exports': ['d3-tip'] 'exports': ['d3-tip']
}, },
'LineageHelper': {
'deps': ['d3'],
},
'dagreD3': { 'dagreD3': {
'deps': ['d3'], 'deps': ['d3'],
'exports': ['dagreD3'] 'exports': ['dagreD3']
}, },
'nvd3': {
'deps': ['d3']
},
'sparkline': {
'deps': ['jquery'],
'exports': ['sparkline']
},
'pnotify': { 'pnotify': {
'exports': ['pnotify'] 'exports': ['pnotify']
}, },
...@@ -121,13 +131,6 @@ require.config({ ...@@ -121,13 +131,6 @@ require.config({
'moment': { 'moment': {
'exports': ['moment'] 'exports': ['moment']
}, },
'nvd3': {
'deps': ['d3']
},
'sparkline': {
'deps': ['jquery'],
'exports': ['sparkline']
},
'jstree': { 'jstree': {
'deps': ['jquery'] 'deps': ['jquery']
}, },
...@@ -154,12 +157,15 @@ require.config({ ...@@ -154,12 +157,15 @@ require.config({
'asBreadcrumbs': 'libs/jquery-asBreadcrumbs/js/jquery-asBreadcrumbs.min', 'asBreadcrumbs': 'libs/jquery-asBreadcrumbs/js/jquery-asBreadcrumbs.min',
'd3': 'libs/d3/d3.min', 'd3': 'libs/d3/d3.min',
'd3-tip': 'libs/d3/index', 'd3-tip': 'libs/d3/index',
'LineageHelper': 'external_lib/atlas-lineage/dist/index',
'dagreD3': 'libs/dagre-d3/dagre-d3.min',
'nvd3': 'libs/nvd3/nv.d3.min',
'sparkline': 'libs/sparkline/jquery.sparkline.min',
'tmpl': 'templates', 'tmpl': 'templates',
'requirejs.text': 'libs/requirejs-text/text', 'requirejs.text': 'libs/requirejs-text/text',
'handlebars': 'external_lib/require-handlebars-plugin/js/handlebars', 'handlebars': 'external_lib/require-handlebars-plugin/js/handlebars',
'hbs': 'external_lib/require-handlebars-plugin/js/hbs', 'hbs': 'external_lib/require-handlebars-plugin/js/hbs',
'i18nprecompile': 'external_lib/require-handlebars-plugin/js/i18nprecompile', 'i18nprecompile': 'external_lib/require-handlebars-plugin/js/i18nprecompile',
'dagreD3': 'libs/dagre-d3/dagre-d3.min',
'select2': 'libs/select2/select2.full.min', 'select2': 'libs/select2/select2.full.min',
'backgrid-select-all': 'libs/backgrid-select-all/backgrid-select-all.min', 'backgrid-select-all': 'libs/backgrid-select-all/backgrid-select-all.min',
'moment': 'libs/moment/js/moment.min', 'moment': 'libs/moment/js/moment.min',
...@@ -172,8 +178,6 @@ require.config({ ...@@ -172,8 +178,6 @@ require.config({
'platform': 'libs/platform/platform', 'platform': 'libs/platform/platform',
'query-builder': 'libs/jQueryQueryBuilder/js/query-builder.standalone.min', 'query-builder': 'libs/jQueryQueryBuilder/js/query-builder.standalone.min',
'daterangepicker': 'libs/bootstrap-daterangepicker/js/daterangepicker', 'daterangepicker': 'libs/bootstrap-daterangepicker/js/daterangepicker',
'nvd3': 'libs/nvd3/nv.d3.min',
'sparkline': 'libs/sparkline/jquery.sparkline.min',
'table-dragger': 'libs/table-dragger/table-dragger', 'table-dragger': 'libs/table-dragger/table-dragger',
'jstree': 'libs/jstree/jstree.min', 'jstree': 'libs/jstree/jstree.min',
'jquery-steps': 'libs/jquery-steps/jquery.steps.min', 'jquery-steps': 'libs/jquery-steps/jquery.steps.min',
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<li role="businessMetadata" class="tab active"><a href="#tab-businessMetadata" aria-controls="tab-businessMetadata" role="tab" data-toggle="tab">Business Metadata</a></li> <li role="businessMetadata" class="tab active"><a href="#tab-businessMetadata" aria-controls="tab-businessMetadata" role="tab" data-toggle="tab">Business Metadata</a></li>
<li role="enum"><a href="#tab-enum" aria-controls="tab-enum" role="tab" data-toggle="tab">Enumerations</a></li> <li role="enum"><a href="#tab-enum" aria-controls="tab-enum" role="tab" data-toggle="tab">Enumerations</a></li>
<li role="audit"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li> <li role="audit"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li>
<li role="typeSystem"><a href="#tab-typeSystem" aria-controls="tab-typeSystem" role="tab" data-toggle="tab">Type System</a></li>
</ul> </ul>
</div> </div>
</div> </div>
...@@ -36,5 +37,9 @@ ...@@ -36,5 +37,9 @@
<div id="r_adminTableLayoutView"> <div id="r_adminTableLayoutView">
</div> </div>
</div> </div>
<div id="tab-typeSystem" role="typeSystem" class="tab-pane animated fadeIn" style="position: relative;">
<div id="r_typeSystemTreeLayoutView">
</div>
</div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -100,7 +100,9 @@ ...@@ -100,7 +100,9 @@
</button> </button>
</div> </div>
<div> <div>
<button type="button" data-id="setting-toggler" title="Settings" class="btn btn-action btn-gray btn-sm"><i class="fa fa-gear"></i></button> <button type="button" data-id="setting-toggler" title="Settings" class="btn btn-action btn-gray btn-sm">
<i class="fa fa-gear"></i>
</button>
</div> </div>
<div> <div>
<button type="button" data-id="filter-toggler" title="Filter" class="btn btn-action btn-gray btn-sm"><i class="fa fa-filter"></i></button> <button type="button" data-id="filter-toggler" title="Filter" class="btn btn-action btn-gray btn-sm"><i class="fa fa-filter"></i></button>
...@@ -109,11 +111,17 @@ ...@@ -109,11 +111,17 @@
<button type="button" data-id="search-toggler" title="Search" class="btn btn-action btn-gray btn-sm"><i class="fa fa-search"></i></button> <button type="button" data-id="search-toggler" title="Search" class="btn btn-action btn-gray btn-sm"><i class="fa fa-search"></i></button>
</div> </div>
<div class="btn-group"> <div class="btn-group">
<button type="button" id="zoom_in" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom In" data-id="refreshBtn"> <i class="fa fa-search-plus"></i></button> <button type="button" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom In" data-id="zoom-in">
<button type="button" id="zoom_out" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom Out" data-id="refreshBtn"> <i class="fa fa-search-minus"></i></button> <i class="fa fa-search-plus"></i>
</button>
<button type="button" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom Out" data-id="zoom-out">
<i class="fa fa-search-minus"></i>
</button>
</div> </div>
<div> <div>
<button type="button" data-id="fullScreen-toggler" title="Full screen" class="btn btn-action btn-gray btn-sm fullscreen_lineage"><i class="fa fa-expand"></i></button> <button type="button" data-id="fullScreen-toggler" title="Full screen" class="btn btn-action btn-gray btn-sm fullscreen_lineage">
<i class="fa fa-expand"></i>
</button>
</div> </div>
</div> </div>
<div class="box-panel size-lg node-details slide-from-left lineage-node-detail"> <div class="box-panel size-lg node-details slide-from-left lineage-node-detail">
...@@ -123,7 +131,7 @@ ...@@ -123,7 +131,7 @@
<span data-id="box-close" class="btn btn-sm btn-close lineage-node-detail-close"><i class="fa fa-close"></i></span> <span data-id="box-close" class="btn btn-sm btn-close lineage-node-detail-close"><i class="fa fa-close"></i></span>
</div> </div>
<div class="body"> <div class="body">
<table class='table bold-key'> <table class="table bold-key">
<tbody data-id="nodeDetailTable"></tbody> <tbody data-id="nodeDetailTable"></tbody>
</table> </table>
</div> </div>
...@@ -131,11 +139,7 @@ ...@@ -131,11 +139,7 @@
<div class="fontLoader"> <div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </div>
<div class="legends pull-left" style="height: 25px; padding: 2px;"> <div class="legends pull-left" style="height: 25px; padding: 2px;"></div>
<span style="margin-right: 8px; color:#fb4200;"><i class="fa fa-circle-o fa-fw"></i>Current Entity</span> <div class="svg" style="height: 100%; width: 100%"></div>
<span style="margin-right: 8px; color:#df9b00;"><i class="fa fa-long-arrow-right fa-fw"></i>Lineage</span>
<span style="margin-right: 8px; color:#fb4200;"><i class="fa fa-long-arrow-right fa-fw"></i>Impact</span>
</div>
<svg width="{{width}}" height="{{height}}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"></svg>
</div> </div>
<div class="hidden-svg"></div> <div class="hidden-svg"></div>
\ No newline at end of file
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div id="typeSystemTreeViewPage" data-id="typeSystemTreeViewPage" class="systemTypeTree" style="height: calc(100vh - 180px); width: 100%; position: relative;overflow: hidden;">
<div class="box-panel size-lg node-details slide-from-left lineage-node-detail">
<div class="header clearfix">
<h4><span data-id="typeName"></span></h4>
<span data-id="box-close" class="btn btn-sm btn-close lineage-node-detail-close"><i class="fa fa-close"></i></span>
<span data-id="box-close" class="btn btn-sm btn-close lineage-node-detail-close"><i class="fa fa-close"></i></span>
</div>
<div class="body">
<table class="table bold-key">
<tbody data-id="nodeDetailTable"></tbody>
</table>
</div>
</div>
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div class="box-panel filter-box">
<div class="header clearfix">
<h4>Filters</h4>
<span data-id="box-close" class="btn btn-sm btn-close"><i class="fa fa-close"></i></span>
</div>
<div class="body">
<div class="form-group text-left col-sm-12">
<select data-id="filterServiceType"></select>
</div>
</div>
</div>
<div class="box-panel search-box">
<div class="header clearfix">
<h4>Search</h4>
<span data-id="box-close" class="btn btn-sm btn-close"><i class="fa fa-close"></i></span>
</div>
<div class="body">
<div class="col-sm-12 no-padding">
<div class="srchType clearfix">
<label class="srchTitle">Search Lineage Entity: </label>
<div class="">
<div class="col-sm-12 no-padding temFilter">
<select data-id="typeSearch"></select>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="graph-button-group pull-right">
<div>
<button data-id="reset" class="btn btn-action btn-gray btn-sm" title="Realign Lineage">
<i class="fa fa-retweet"></i>
</button>
</div>
<div>
<button type="button" data-id="filter-toggler" title="Filter" class="btn btn-action btn-gray btn-sm"><i class="fa fa-filter"></i></button>
</div>
<div>
<button type="button" data-id="search-toggler" title="Search" class="btn btn-action btn-gray btn-sm"><i class="fa fa-search"></i></button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom In" data-id="zoom-in">
<i class="fa fa-search-plus"></i>
</button>
<button type="button" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom Out" data-id="zoom-out">
<i class="fa fa-search-minus"></i>
</button>
</div>
<div>
<button type="button" data-id="fullScreen-toggler" title="Full screen" class="btn btn-action btn-gray btn-sm fullscreen_lineage">
<i class="fa fa-expand"></i>
</button>
</div>
</div>
<svg class="main" width="100%" height="100%">
</svg>
<!-- <div id="mini" class="mini-map-type-system">
<svg class="mini" width="100%" height="100%">
</svg>
</div> -->
</div>
\ No newline at end of file
...@@ -143,7 +143,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -143,7 +143,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
id = data.guid; id = data.guid;
} }
if (value.length > 0) { if (value.length > 0) {
scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/' + id + '">' + getValue(value, key) + '</a>'); scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/' + id + '">' + getValue(value) + '</a>');
} else { } else {
scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/' + id + '">' + _.escape(id) + '</a>'); scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/' + id + '">' + _.escape(id) + '</a>');
} }
......
...@@ -39,7 +39,9 @@ define(['require', ...@@ -39,7 +39,9 @@ define(['require',
regions: { regions: {
RBusinessMetadataTableLayoutView: "#r_businessMetadataTableLayoutView", RBusinessMetadataTableLayoutView: "#r_businessMetadataTableLayoutView",
REnumTableLayoutView: '#r_enumTableLayoutView', REnumTableLayoutView: '#r_enumTableLayoutView',
RAdminTableLayoutView: '#r_adminTableLayoutView' RAdminTableLayoutView: '#r_adminTableLayoutView',
RTypeSystemTreeLayoutView: '#r_typeSystemTreeLayoutView',
}, },
/** ui selector cache */ /** ui selector cache */
...@@ -81,6 +83,7 @@ define(['require', ...@@ -81,6 +83,7 @@ define(['require',
bindEvents: function() { bindEvents: function() {
this.renderEnumLayoutView(); this.renderEnumLayoutView();
this.renderAdminLayoutView(); this.renderAdminLayoutView();
this.renderTypeSystemTreeLayoutView();
}, },
onRender: function() { onRender: function() {
this.renderBusinessMetadataLayoutView(); this.renderBusinessMetadataLayoutView();
...@@ -112,6 +115,15 @@ define(['require', ...@@ -112,6 +115,15 @@ define(['require',
}); });
that.RAdminTableLayoutView.show(view); that.RAdminTableLayoutView.show(view);
}); });
},
renderTypeSystemTreeLayoutView: function(obj) {
var that = this;
require(["views/graph/TypeSystemTreeView"], function(TypeSystemTreeView) {
var view = new TypeSystemTreeView({
entityDefCollection: that.entityDefCollection
});
that.RTypeSystemTreeLayoutView.show(view);
});
} }
}); });
return AdministratorLayoutView; return AdministratorLayoutView;
......
...@@ -22,7 +22,8 @@ define(['require', ...@@ -22,7 +22,8 @@ define(['require',
'collection/VLineageList', 'collection/VLineageList',
'models/VEntity', 'models/VEntity',
'utils/Utils', 'utils/Utils',
'views/graph/LineageUtils', 'LineageHelper',
'd3',
'dagreD3', 'dagreD3',
'd3-tip', 'd3-tip',
'utils/Enums', 'utils/Enums',
...@@ -31,7 +32,7 @@ define(['require', ...@@ -31,7 +32,7 @@ define(['require',
'utils/CommonViewFunction', 'utils/CommonViewFunction',
'platform', 'platform',
'jquery-ui' 'jquery-ui'
], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, Utils, LineageUtils, dagreD3, d3Tip, Enums, UrlLinks, Globals, CommonViewFunction, platform) { ], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, Utils, LineageHelper, d3, dagreD3, d3Tip, Enums, UrlLinks, Globals, CommonViewFunction, platform) {
'use strict'; 'use strict';
var LineageLayoutView = Backbone.Marionette.LayoutView.extend( var LineageLayoutView = Backbone.Marionette.LayoutView.extend(
...@@ -65,7 +66,9 @@ define(['require', ...@@ -65,7 +66,9 @@ define(['require',
showOnlyHoverPath: '[data-id="showOnlyHoverPath"]', showOnlyHoverPath: '[data-id="showOnlyHoverPath"]',
showTooltip: '[data-id="showTooltip"]', showTooltip: '[data-id="showTooltip"]',
saveSvg: '[data-id="saveSvg"]', saveSvg: '[data-id="saveSvg"]',
resetLineage: '[data-id="resetLineage"]' resetLineage: '[data-id="resetLineage"]',
onZoomIn: '[data-id="zoom-in"]',
onZoomOut: '[data-id="zoom-out"]'
}, },
templateHelpers: function() { templateHelpers: function() {
return { return {
...@@ -86,6 +89,8 @@ define(['require', ...@@ -86,6 +89,8 @@ define(['require',
events["click " + this.ui.searchToggler] = 'onClickSearchToggler'; events["click " + this.ui.searchToggler] = 'onClickSearchToggler';
events["click " + this.ui.saveSvg] = 'onClickSaveSvg'; events["click " + this.ui.saveSvg] = 'onClickSaveSvg';
events["click " + this.ui.resetLineage] = 'onClickResetLineage'; events["click " + this.ui.resetLineage] = 'onClickResetLineage';
events["click " + this.ui.onZoomIn] = 'onClickZoomIn';
events["click " + this.ui.onZoomOut] = 'onClickZoomOut';
return events; return events;
}, },
...@@ -96,7 +101,6 @@ define(['require', ...@@ -96,7 +101,6 @@ define(['require',
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'processCheck', 'guid', 'entity', 'entityName', 'entityDefCollection', 'actionCallBack', 'fetchCollection', 'attributeDefs')); _.extend(this, _.pick(options, 'processCheck', 'guid', 'entity', 'entityName', 'entityDefCollection', 'actionCallBack', 'fetchCollection', 'attributeDefs'));
this.collection = new VLineageList(); this.collection = new VLineageList();
this.lineageData = null;
this.typeMap = {}; this.typeMap = {};
this.apiGuid = {}; this.apiGuid = {};
this.edgeCall; this.edgeCall;
...@@ -109,42 +113,18 @@ define(['require', ...@@ -109,42 +113,18 @@ define(['require',
selectedNode: '' selectedNode: ''
} }
}, },
initializeGraph: function() {
this.g = {};
this.g = new dagreD3.graphlib.Graph()
.setGraph({
nodesep: 50,
ranksep: 90,
rankdir: "LR",
marginx: 20,
marginy: 20,
transition: function transition(selection) {
return selection.transition().duration(500);
}
})
.setDefaultEdgeLabel(function() {
return {};
});
},
onRender: function() { onRender: function() {
var that = this; var that = this;
this.ui.searchToggler.prop("disabled", true); this.ui.searchToggler.prop("disabled", true);
this.$graphButtonsEl = this.$(".graph-button-group button,select[data-id='selectDepth']") this.$graphButtonsEl = this.$(".graph-button-group button,select[data-id='selectDepth']")
this.fetchGraphData(); this.fetchGraphData();
if (platform.name === "IE") {
this.$('svg').css('opacity', '0');
}
if (platform.name === "Microsoft Edge" || platform.name === "IE") {
$(that.ui.saveSvg).hide();
}
if (this.layoutRendered) { if (this.layoutRendered) {
this.layoutRendered(); this.layoutRendered();
} }
if (this.processCheck) { if (this.processCheck) {
this.hideCheckForProcess(); this.hideCheckForProcess();
} }
this.initializeGraph(); //this.initializeGraph();
this.ui.selectDepth.select2({ this.ui.selectDepth.select2({
data: _.sortBy([3, 6, 9, 12, 15, 18, 21]), data: _.sortBy([3, 6, 9, 12, 15, 18, 21]),
tags: true, tags: true,
...@@ -175,21 +155,13 @@ define(['require', ...@@ -175,21 +155,13 @@ define(['require',
}, },
onCheckUnwantedEntity: function(e) { onCheckUnwantedEntity: function(e) {
var that = this; var that = this;
this.initializeGraph(); //this.initializeGraph();
if ($(e.target).data("id") === "checkHideProcess") { if ($(e.target).data("id") === "checkHideProcess") {
this.filterObj.isProcessHideCheck = e.target.checked; this.filterObj.isProcessHideCheck = e.target.checked;
} else { } else {
this.filterObj.isDeletedEntityHideCheck = e.target.checked; this.filterObj.isDeletedEntityHideCheck = e.target.checked;
} }
that.toggleDisableState({ this.LineageHelperRef.refresh();
"el": that.$graphButtonsEl
});
this.generateData(this.lineageData).then(function() {
that.createGraph();
that.toggleDisableState({
"el": that.$graphButtonsEl
});
});
}, },
toggleBoxPanel: function(options) { toggleBoxPanel: function(options) {
var el = options && options.el, var el = options && options.el,
...@@ -201,6 +173,24 @@ define(['require', ...@@ -201,6 +173,24 @@ define(['require',
} }
this.$('circle.node-detail-highlight').removeClass("node-detail-highlight"); this.$('circle.node-detail-highlight').removeClass("node-detail-highlight");
}, },
toggleLoader: function(element) {
if ((element).hasClass('fa-camera')) {
(element).removeClass('fa-camera').addClass("fa-spin-custom fa-refresh");
} else {
(element).removeClass("fa-spin-custom fa-refresh").addClass('fa-camera');
}
},
toggleDisableState: function(options) {
var el = options.el,
disabled = options.disabled;
if (el && el.prop) {
if (disabled) {
el.prop("disabled", disabled);
} else {
el.prop("disabled", !el.prop("disabled"));
}
}
},
onClickNodeToggler: function(options) { onClickNodeToggler: function(options) {
this.toggleBoxPanel({ el: this.$('.lineage-node-detail'), nodeDetailToggler: true }); this.toggleBoxPanel({ el: this.$('.lineage-node-detail'), nodeDetailToggler: true });
}, },
...@@ -214,17 +204,30 @@ define(['require', ...@@ -214,17 +204,30 @@ define(['require',
this.toggleBoxPanel({ el: this.ui.searchBox }); this.toggleBoxPanel({ el: this.ui.searchBox });
}, },
onSelectDepthChange: function(e, options) { onSelectDepthChange: function(e, options) {
this.initializeGraph(); //this.initializeGraph();
this.filterObj.depthCount = e.currentTarget.value; this.filterObj.depthCount = e.currentTarget.value;
this.fetchGraphData({ queryParam: { 'depth': this.filterObj.depthCount } }); this.fetchGraphData({ queryParam: { 'depth': this.filterObj.depthCount } });
}, },
onClickResetLineage: function() {
this.LineageHelperRef.refresh();
},
onClickSaveSvg: function(e, a) {
this.LineageHelperRef.exportLineage();
},
onClickZoomIn: function() {
this.LineageHelperRef.zoomIn();
},
onClickZoomOut: function() {
this.LineageHelperRef.zoomOut();
},
fetchGraphData: function(options) { fetchGraphData: function(options) {
var that = this, var that = this,
queryParam = options && options.queryParam || {}; queryParam = options && options.queryParam || {};
this.$('.fontLoader').show(); this.$('.fontLoader').show();
this.$('svg>g').hide(); this.$('svg>g').hide();
this.toggleDisableState({ this.toggleDisableState({
"el": that.$(".graph-button-group button,select[data-id='selectDepth']") "el": that.$graphButtonsEl,
disabled: true
}); });
this.collection.getLineage(this.guid, { this.collection.getLineage(this.guid, {
queryParam: queryParam, queryParam: queryParam,
...@@ -232,24 +235,11 @@ define(['require', ...@@ -232,24 +235,11 @@ define(['require',
if (that.isDestroyed) { if (that.isDestroyed) {
return; return;
} }
if (data.relations.length) {
that.lineageData = $.extend(true, {}, data); that.createGraph(data);
that.generateData(that.lineageData).then(function(graphObj) { that.renderLineageTypeSearch(data);
that.createGraph();
that.toggleDisableState({
"el": that.$graphButtonsEl
});
});
that.renderLineageTypeSearch().then(function() {
that.ui.searchToggler.prop("disabled", false);
});
} else {
that.noLineage();
that.hideCheckForProcess();
}
}, },
cust_error: function(model, response) { cust_error: function(model, response) {
that.lineageData = [];
that.noLineage(); that.noLineage();
}, },
complete: function() { complete: function() {
...@@ -258,524 +248,99 @@ define(['require', ...@@ -258,524 +248,99 @@ define(['require',
} }
}) })
}, },
noLineage: function() { createGraph: function(data) {
this.$('.fontLoader').hide(); // if (_.isEmpty(this.g._nodes)) {
this.$('.depth-container').hide(); // this.$('svg').html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relations to display</text>');
this.$('svg').html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No lineage data found</text>'); // return;
if (this.actionCallBack) { // }
this.actionCallBack(); var that = this;
} $('.resizeGraph').css("height", this.$('.svg').height() + "px");
},
hideCheckForProcess: function() { this.LineageHelperRef = new LineageHelper.default({
this.$('.hideProcessContainer').hide(); entityDefCollection: this.entityDefCollection.fullCollection.toJSON(),
}, data: data,
isProcess: function(node) { el: this.$('.svg')[0],
var typeName = node.typeName, legendsEl: this.$('.legends')[0],
superTypes = node.superTypes, getFilterObj: function() {
entityDef = node.entityDef; return {
if (typeName == "Process") { isProcessHideCheck: that.filterObj.isProcessHideCheck,
return true; isDeletedEntityHideCheck: that.filterObj.isDeletedEntityHideCheck
}
return _.contains(superTypes, "Process");
},
isDeleted: function(node) {
if (_.isUndefined(node)) {
return
}
return Enums.entityStateReadOnly[node.status];
},
isNodeToBeUpdated: function(node) {
var isProcessHideCheck = this.filterObj.isProcessHideCheck,
isDeletedEntityHideCheck = this.filterObj.isDeletedEntityHideCheck
var returnObj = {
isProcess: (isProcessHideCheck && node.isProcess),
isDeleted: (isDeletedEntityHideCheck && node.isDeleted)
};
returnObj["update"] = returnObj.isProcess || returnObj.isDeleted;
return returnObj;
},
getNestedSuperTypes: function(options) {
var entityDef = options.entityDef;
return Utils.getNestedSuperTypes({ data: entityDef, collection: this.entityDefCollection })
},
getEntityDef: function(typeName) {
var entityDef = null;
if (typeName) {
entityDef = this.entityDefCollection.fullCollection.find({ name: typeName });
entityDef = entityDef ? entityDef.toJSON() : entityDef;
}
return entityDef;
},
getServiceType: function(options) {
if (!options) {
return;
}
var typeName = options.typeName,
entityDef = options.entityDef,
serviceType = null;
if (typeName) {
if (entityDef) {
serviceType = entityDef.serviceType || null;
}
}
return serviceType;
},
generateData: function(options) {
return new Promise(function(resolve, reject) {
try {
var that = this,
relations = options && options.relations || {},
guidEntityMap = options && options.guidEntityMap || {},
isHideFilterOn = this.filterObj.isProcessHideCheck || this.filterObj.isDeletedEntityHideCheck,
newHashMap = {},
styleObj = {
fill: 'none',
stroke: '#ffb203',
width: 3
},
makeNodeData = function(relationObj) {
if (relationObj) {
if (relationObj.updatedValues) {
return relationObj;
}
var obj = _.extend(relationObj, {
shape: "img",
updatedValues: true,
label: relationObj.displayText.trunc(18),
toolTipLabel: relationObj.displayText,
id: relationObj.guid,
isLineage: true,
isIncomplete: relationObj.isIncomplete,
entityDef: that.getEntityDef(relationObj.typeName)
});
obj["serviceType"] = that.getServiceType({ typeName: relationObj.typeName, entityDef: obj.entityDef });
obj["superTypes"] = that.getNestedSuperTypes({ entityDef: obj.entityDef });
obj['isProcess'] = that.isProcess(obj);
obj['isDeleted'] = that.isDeleted(obj);
return obj;
}
},
crateLineageRelationshipHashMap = function(data) {
var that = this,
relations = data && data.relations,
newHashMap = {};
_.each(relations, function(obj) {
if (newHashMap[obj.fromEntityId]) {
newHashMap[obj.fromEntityId].push(obj.toEntityId);
} else {
newHashMap[obj.fromEntityId] = [obj.toEntityId];
}
});
return newHashMap;
},
getStyleObjStr = function(styleObj) {
return 'fill:' + styleObj.fill + ';stroke:' + styleObj.stroke + ';stroke-width:' + styleObj.width;
},
getNewToNodeRelationship = function(toNodeGuid) {
if (toNodeGuid && relationshipMap[toNodeGuid]) {
var newRelationship = [];
_.each(relationshipMap[toNodeGuid], function(guid) {
var nodeToBeUpdated = that.isNodeToBeUpdated(makeNodeData(guidEntityMap[guid]));
if (nodeToBeUpdated.update) {
var newRelation = getNewToNodeRelationship(guid);
if (newRelation) {
newRelationship = newRelationship.concat(newRelation);
}
} else {
newRelationship.push(guid);
}
});
return newRelationship;
} else {
return null;
}
},
getToNodeRelation = function(toNodes, fromNodeToBeUpdated) {
var toNodeRelationship = [];
_.each(toNodes, function(toNodeGuid) {
var toNodeToBeUpdated = that.isNodeToBeUpdated(makeNodeData(guidEntityMap[toNodeGuid]));
if (toNodeToBeUpdated.update) {
// To node need to updated
if (pendingFromRelationship[toNodeGuid]) {
toNodeRelationship = toNodeRelationship.concat(pendingFromRelationship[toNodeGuid]);
} else {
var newToNodeRelationship = getNewToNodeRelationship(toNodeGuid);
if (newToNodeRelationship) {
toNodeRelationship = toNodeRelationship.concat(newToNodeRelationship);
}
}
} else {
//when bothe node not to be updated.
toNodeRelationship.push(toNodeGuid);
}
});
return toNodeRelationship;
},
setNode = function(guid) {
if (!that.g._nodes[guid]) {
var nodeData = makeNodeData(guidEntityMap[guid]);
that.g.setNode(guid, nodeData);
return nodeData;
} else {
return that.g._nodes[guid];
}
},
setEdge = function(fromNodeGuid, toNodeGuid) {
that.g.setEdge(fromNodeGuid, toNodeGuid, {
"arrowhead": 'arrowPoint',
"curve": LineageUtils.BezierCurve,
"style": getStyleObjStr(styleObj),
"styleObj": styleObj
});
},
setGraphData = function(fromEntityId, toEntityId) {
setNode(fromEntityId);
setNode(toEntityId);
setEdge(fromEntityId, toEntityId);
},
pendingFromRelationship = {};
if (isHideFilterOn) {
var relationshipMap = crateLineageRelationshipHashMap(options)
_.each(relationshipMap, function(toNodes, fromNodeGuid) {
var fromNodeToBeUpdated = that.isNodeToBeUpdated(makeNodeData(guidEntityMap[fromNodeGuid])),
toNodeList = getToNodeRelation(toNodes, fromNodeToBeUpdated);
if (fromNodeToBeUpdated.update) {
if (pendingFromRelationship[fromNodeGuid]) {
pendingFromRelationship[fromNodeGuid] = pendingFromRelationship[fromNodeGuid].concat(toNodeList);
} else {
pendingFromRelationship[fromNodeGuid] = toNodeList;
}
} else {
_.each(toNodeList, function(toNodeGuid) {
setGraphData(fromNodeGuid, toNodeGuid);
});
}
})
} else {
_.each(relations, function(obj) {
setGraphData(obj.fromEntityId, obj.toEntityId);
});
}
if (this.g._nodes[this.guid]) {
if (this.g._nodes[this.guid]) {
this.g._nodes[this.guid]['isLineage'] = false;
}
this.findImpactNodeAndUpdateData({ "guid": this.guid, "getStyleObjStr": getStyleObjStr });
} }
resolve(this.g);
} catch (e) {
reject(e)
}
}.bind(this));
},
findImpactNodeAndUpdateData: function(options) {
var that = this,
guid = options.guid,
getStyleObjStr = options.getStyleObjStr,
traversedMap = {},
styleObj = {
fill: 'none',
stroke: '#fb4200',
width: 3
}, },
traversed = function(toNodeList, fromNodeGuid) { isShowHoverPath: function() { return that.ui.showOnlyHoverPath.prop('checked') },
if (!_.isEmpty(toNodeList)) { isShowTooltip: function() { return that.ui.showTooltip.prop('checked') },
if (!traversedMap[fromNodeGuid]) { onPathClick: function(d) {
traversedMap[fromNodeGuid] = true; console.log("Path Clicked");
_.each(toNodeList, function(val, toNodeGuid) { if (d.pathRelationObj) {
if (that.g._nodes[toNodeGuid]) { var relationshipId = d.pathRelationObj.relationshipId;
that.g._nodes[toNodeGuid]['isLineage'] = false; require(['views/graph/PropagationPropertyModal'], function(PropagationPropertyModal) {
} var view = new PropagationPropertyModal({
that.g.setEdge(fromNodeGuid, toNodeGuid, { edgeInfo: d.pathRelationObj,
"arrowhead": 'arrowPoint', relationshipId: relationshipId,
"curve": LineageUtils.BezierCurve, lineageData: data,
"style": getStyleObjStr(styleObj), apiGuid: that.apiGuid,
'styleObj': styleObj detailPageFetchCollection: that.fetchCollection
});
traversed(that.g._sucs[toNodeGuid], toNodeGuid);
}); });
} });
}
};
traversed(this.g._sucs[guid], guid)
},
zoomed: function(that) {
this.$('svg').find('>g').attr("transform",
"translate(" + this.zoom.translate() + ")" +
"scale(" + this.zoom.scale() + ")"
);
if (platform.name === "IE") {
LineageUtils.refreshGraphForIE({
edgeEl: this.$('svg .edgePath')
});
}
},
interpolateZoom: function(translate, scale, that, zoom) {
return d3.transition().duration(350).tween("zoom", function() {
var iTranslate = d3.interpolate(zoom.translate(), translate),
iScale = d3.interpolate(zoom.scale(), scale);
return function(t) {
zoom
.scale(iScale(t))
.translate(iTranslate(t));
that.zoomed();
};
});
},
createGraph: function() {
if (_.isEmpty(this.g._nodes)) {
this.$('svg').html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relations to display</text>');
return;
}
var that = this,
width = this.$('svg').width(),
height = this.$('svg').height(),
imageObject = {};
$('.resizeGraph').css("height", height + "px");
this.g.nodes().forEach(function(v) {
var node = that.g.node(v);
// Round the corners of the nodes
if (node) {
node.rx = node.ry = 5;
}
});
// Create the renderer
var render = new dagreD3.render();
// Add our custom arrow (a hollow-point)
render.arrows().arrowPoint = function(parent, id, edge, type) {
return LineageUtils.arrowPointRender(parent, id, edge, type, { guid: that.guid, dagreD3: dagreD3 });
};
// Render custom img inside shape
render.shapes().img = function(parent, bbox, node) {
return LineageUtils.imgShapeRender(parent, bbox, node, { guid: that.guid, dagreD3: dagreD3, imageObject: imageObject, $defs: that.svg.select('defs') });
};
// Set up an SVG group so that we can translate the final graph.
if (this.$("svg").find('.output').length) {
this.$("svg").find('.output').parent('g').remove();
}
var svg = this.svg = d3.select(this.$("svg")[0])
.attr("viewBox", "0 0 " + width + " " + height)
.attr("enable-background", "new 0 0 " + width + " " + height),
svgGroup = svg.append("g");
// Append defs
svg.append("defs");
var zoom = this.zoom = d3.behavior.zoom()
.center([width / 2, height / 2])
.scaleExtent([0.01, 50])
.on("zoom", that.zoomed.bind(this));
function zoomClick() {
var clicked = d3.event.target,
direction = 1,
factor = 0.5,
target_zoom = 1,
center = [width / 2, height / 2],
translate = zoom.translate(),
translate0 = [],
l = [],
view = { x: translate[0], y: translate[1], k: zoom.scale() };
d3.event.preventDefault();
direction = (this.id === 'zoom_in') ? 1 : -1;
target_zoom = zoom.scale() * (1 + factor * direction);
translate0 = [(center[0] - view.x) / view.k, (center[1] - view.y) / view.k];
view.k = target_zoom;
l = [translate0[0] * view.k + view.x, translate0[1] * view.k + view.y];
view.x += center[0] - l[0];
view.y += center[1] - l[1];
that.interpolateZoom([view.x, view.y], view.k, that, zoom);
}
d3.selectAll(this.$('.lineageZoomButton')).on('click', zoomClick);
var tooltip = d3Tip()
.attr('class', 'd3-tip')
.offset([10, 0])
.html(function(d) {
var value = that.g.node(d);
var htmlStr = "";
if (value.id !== that.guid) {
htmlStr = "<h5 style='text-align: center;'>" + (value.isLineage ? "Lineage" : "Impact") + "</h5>";
}
htmlStr += "<h5 class='text-center'><span style='color:#359f89'>" + value.toolTipLabel + "</span></h5> ";
if (value.typeName) {
htmlStr += "<h5 class='text-center'><span>(" + value.typeName + ")</span></h5> ";
}
if (value.queryText) {
htmlStr += "<h5>Query: <span style='color:#359f89'>" + value.queryText + "</span></h5> ";
} }
return "<div class='tip-inner-scroll'>" + htmlStr + "</div>"; },
}); onNodeClick: function(d) {
that.onClickNodeToggler();
svg.call(zoom) that.updateRelationshipDetails({ guid: d.clickedData });
.call(tooltip); },
if (platform.name !== "IE") { onLabelClick: function(d) {
this.$('.fontLoader').hide(); var guid = d.clickedData;
} if (that.guid == guid) {
render(svgGroup, this.g);
svg.on("dblclick.zoom", null)
// .on("wheel.zoom", null);
//change text postion
svgGroup.selectAll("g.nodes g.label")
.attr("transform", "translate(2,-35)")
.on('mouseenter', function(d) {
d3.select(this).classed("highlight", true);
})
.on('mouseleave', function(d) {
d3.select(this).classed("highlight", false);
})
.on('click', function(d) {
d3.event.preventDefault();
tooltip.hide(d);
if (that.guid == d) {
Utils.notifyInfo({ Utils.notifyInfo({
html: true, html: true,
content: "You are already on " + "<b>" + that.entityName + "</b> detail page." content: "You are already on " + "<b>" + that.entityName + "</b> detail page."
}); });
} else { } else {
Utils.setUrl({ Utils.setUrl({
url: '#!/detailPage/' + d + '?tabActive=lineage', url: '#!/detailPage/' + guid + '?tabActive=lineage',
mergeBrowserUrl: false, mergeBrowserUrl: false,
trigger: true trigger: true
}); });
} }
}); },
svgGroup.selectAll("g.nodes g.node") beforeRender: function() {
.on('mouseenter', function(d) { that.$('.fontLoader').show();
that.activeNode = true; that.toggleDisableState({
var matrix = this.getScreenCTM() "el": that.$graphButtonsEl,
.translate(+this.getAttribute("cx"), +this.getAttribute("cy")); disabled: true
that.$('svg').find('.node').removeClass('active');
$(this).addClass('active');
// Fix
var width = $('body').width();
var currentELWidth = $(this).offset();
var direction = 'e';
if (((width - currentELWidth.left) < 330)) {
direction = (((width - currentELWidth.left) < 330) && ((currentELWidth.top) < 400)) ? 'sw' : 'w';
if (((width - currentELWidth.left) < 330) && ((currentELWidth.top) > 600)) {
direction = 'nw';
}
} else if (((currentELWidth.top) > 600)) {
direction = (((width - currentELWidth.left) < 330) && ((currentELWidth.top) > 600)) ? 'nw' : 'n';
if ((currentELWidth.left) < 50) {
direction = 'ne'
}
} else if ((currentELWidth.top) < 400) {
direction = ((currentELWidth.left) < 50) ? 'se' : 's';
}
if (that.ui.showTooltip.prop('checked')) {
tooltip.direction(direction).show(d);
}
if (!that.ui.showOnlyHoverPath.prop('checked')) {
return;
}
that.$('svg').addClass('hover');
var nextNode = that.g.successors(d),
previousNode = that.g.predecessors(d),
nodesToHighlight = nextNode.concat(previousNode);
LineageUtils.onHoverFade({
opacity: 0.3,
selectedNode: d,
highlight: nodesToHighlight,
svg: that.svg
}).init();
})
.on('mouseleave', function(d) {
that.activeNode = false;
var nodeEL = this;
setTimeout(function(argument) {
if (!(that.activeTip || that.activeNode)) {
$(nodeEL).removeClass('active');
if (that.ui.showTooltip.prop('checked')) {
tooltip.hide(d);
}
}
}, 150);
if (!that.ui.showOnlyHoverPath.prop('checked')) {
return;
}
that.$('svg').removeClass('hover');
that.$('svg').removeClass('hover-active');
LineageUtils.onHoverFade({
opacity: 1,
selectedNode: d,
svg: that.svg
}).init();
})
.on('click', function(d) {
var el = this;
if (d3.event.defaultPrevented) return; // ignore drag
d3.event.preventDefault();
tooltip.hide(d);
that.onClickNodeToggler({ obj: d });
$(el).find('circle').addClass('node-detail-highlight');
that.updateRelationshipDetails({ guid: d });
});
svgGroup.selectAll("g.edgePath path.path").on('click', function(d) {
var data = { obj: _.find(that.lineageData.relations, { "fromEntityId": d.v, "toEntityId": d.w }) };
if (data.obj) {
var relationshipId = data.obj.relationshipId;
require(['views/graph/PropagationPropertyModal'], function(PropagationPropertyModal) {
var view = new PropagationPropertyModal({
edgeInfo: data,
relationshipId: relationshipId,
lineageData: that.lineageData,
apiGuid: that.apiGuid,
detailPageFetchCollection: that.fetchCollection
});
}); });
},
afterRender: function() {
// Remove Loader
that.$('.fontLoader').hide();
if (data.relations.length) {
that.toggleDisableState({
"el": that.$graphButtonsEl,
disabled: false
});
}
} }
})
$('body').on('mouseover', '.d3-tip', function(el) {
that.activeTip = true;
}); });
$('body').on('mouseleave', '.d3-tip', function(el) { },
that.activeTip = false; noLineage: function() {
that.$('svg').find('.node').removeClass('active'); this.$('.fontLoader').hide();
tooltip.hide(); this.$('.depth-container').hide();
}); this.$('svg').html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No lineage data found</text>');
if (this.actionCallBack) {
// Center the graph this.actionCallBack();
LineageUtils.centerNode({
guid: that.guid,
svg: that.$('svg'),
g: this.g,
edgeEl: $('svg .edgePath'),
afterCenterZoomed: function(options) {
var newScale = options.newScale,
newTranslate = options.newTranslate;
that.zoom.scale(newScale);
that.zoom.translate(newTranslate);
}
}).init();
zoom.event(svg);
if (platform.name === "IE") {
LineageUtils.refreshGraphForIE({
edgeEl: this.$('svg .edgePath')
});
} }
LineageUtils.DragNode({
svg: this.svg,
g: this.g,
guid: this.guid,
edgeEl: this.$('svg .edgePath')
}).init();
}, },
renderLineageTypeSearch: function() { hideCheckForProcess: function() {
this.$('.hideProcessContainer').hide();
},
renderLineageTypeSearch: function(data) {
var that = this; var that = this;
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
try { try {
var data = [], var typeStr = '<option></option>';
typeStr = '<option></option>'; if (!_.isEmpty(data)) {
if (!_.isEmpty(that.lineageData)) { _.each(data.guidEntityMap, function(obj, index) {
_.each(that.lineageData.guidEntityMap, function(obj, index) { var nodeData = that.LineageHelperRef.getNode(obj.guid);
var nodeData = that.g._nodes[obj.guid];
if ((that.filterObj.isProcessHideCheck || that.filterObj.isDeletedEntityHideCheck) && nodeData && (nodeData.isProcess || nodeData.isDeleted)) { if ((that.filterObj.isProcessHideCheck || that.filterObj.isDeletedEntityHideCheck) && nodeData && (nodeData.isProcess || nodeData.isDeleted)) {
return; return;
} }
...@@ -799,42 +364,9 @@ define(['require', ...@@ -799,42 +364,9 @@ define(['require',
}).on('change.select2', function(e) { }).on('change.select2', function(e) {
e.stopPropagation(); e.stopPropagation();
e.stopImmediatePropagation(); e.stopImmediatePropagation();
d3.selectAll(".serach-rect").remove();
var selectedNode = $('[data-id="typeSearch"]').val(); var selectedNode = $('[data-id="typeSearch"]').val();
that.searchNodeObj.selectedNode = selectedNode; that.searchNodeObj.selectedNode = selectedNode;
LineageUtils.centerNode({ that.LineageHelperRef.searchNode({ guid: selectedNode });
guid: selectedNode,
svg: $(that.svg[0]),
g: that.g,
edgeEl: $('svg .edgePath'),
afterCenterZoomed: function(options) {
var newScale = options.newScale,
newTranslate = options.newTranslate;
that.zoom.scale(newScale);
that.zoom.translate(newTranslate);
}
}).init();
that.svg.selectAll('.nodes g.label').attr('stroke', function(c, d) {
if (c == selectedNode) {
return "#316132";
} else {
return 'none';
}
});
// Using jquery for selector because d3 select is not working for few process entities.
d3.select($(".node#" + selectedNode)[0]).insert("rect", "circle")
.attr("class", "serach-rect")
.attr("x", -50)
.attr("y", -27.5)
.attr("width", 100)
.attr("height", 55);
d3.selectAll(".nodes circle").classed("wobble", function(d, i, nodes) {
if (d == selectedNode) {
return true;
} else {
return false;
}
});
}); });
if (this.searchNodeObj.selectedNode) { if (this.searchNodeObj.selectedNode) {
this.ui.lineageTypeSearch.val(this.searchNodeObj.selectedNode); this.ui.lineageTypeSearch.val(this.searchNodeObj.selectedNode);
...@@ -844,8 +376,11 @@ define(['require', ...@@ -844,8 +376,11 @@ define(['require',
updateRelationshipDetails: function(options) { updateRelationshipDetails: function(options) {
var that = this, var that = this,
guid = options.guid, guid = options.guid,
initialData = that.g._nodes[guid], initialData = that.LineageHelperRef.getNode(guid);
typeName = initialData.typeName || guid, if (initialData === undefined) {
return;
}
var typeName = initialData.typeName || guid,
attributeDefs = initialData && initialData.entityDef ? initialData.entityDef.attributeDefs : null; attributeDefs = initialData && initialData.entityDef ? initialData.entityDef.attributeDefs : null;
this.$("[data-id='typeName']").text(typeName); this.$("[data-id='typeName']").text(typeName);
this.entityModel = new VEntity({}); this.entityModel = new VEntity({});
...@@ -876,46 +411,6 @@ define(['require', ...@@ -876,46 +411,6 @@ define(['require',
"attributeDefs": attributeDefs, "attributeDefs": attributeDefs,
"sortBy": false "sortBy": false
})); }));
},
onClickSaveSvg: function(e, a) {
var that = this,
loaderTargetDiv = $(e.currentTarget).find('>i');
if (loaderTargetDiv.hasClass('fa-refresh')) {
Utils.notifyWarn({
content: "Please wait while the lineage gets downloaded"
});
return false; // return if the lineage is not loaded.
}
this.toggleLoader(loaderTargetDiv);
Utils.notifyInfo({
content: "Lineage will be downloaded in a moment."
});
var entityAttributes = that.entity && that.entity.attributes;
LineageUtils.SaveSvg(e, {
svg: that.$('svg')[0],
svgWidth: that.$('svg').width(),
svgHeight: that.$('svg').height(),
toggleLoader: function() {
that.toggleLoader(loaderTargetDiv);
},
downloadFileName: ((entityAttributes && (entityAttributes.qualifiedName || entityAttributes.name) || "lineage_export") + ".png")
})
},
toggleLoader: function(element) {
if ((element).hasClass('fa-camera')) {
(element).removeClass('fa-camera').addClass("fa-spin-custom fa-refresh");
} else {
(element).removeClass("fa-spin-custom fa-refresh").addClass('fa-camera');
}
},
onClickResetLineage: function() {
this.createGraph()
},
toggleDisableState: function(options) {
var el = options.el;
if (el && el.prop) {
el.prop("disabled", !el.prop("disabled"));
}
} }
}); });
return LineageLayoutView; return LineageLayoutView;
......
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(['require', 'utils/Utils'], function(require, Utils) {
'use strict';
var LineageUtils = {};
LineageUtils.DragNode = function(options) {
var that = this,
g = options.g,
svg = options.svg,
guid = options.guid,
edgePathEl = options.edgeEl;
return {
init: function() {
var that = this;
//give IDs to each of the nodes so that they can be accessed
svg.selectAll("g.node rect")
.attr("id", function(d) {
return "node" + d;
});
svg.selectAll("g.edgePath path")
.attr("id", function(e) {
return e.v + "-" + e.w;
});
svg.selectAll("g.edgeLabel g")
.attr("id", function(e) {
return 'label_' + e.v + "-" + e.w;
});
g.nodes().forEach(function(v) {
var node = g.node(v);
node.customId = "node" + v;
})
g.edges().forEach(function(e) {
var edge = g.edge(e.v, e.w);
edge.customId = e.v + "-" + e.w
});
var nodeDrag = d3.behavior.drag()
.on("dragstart", this.dragstart)
.on("drag", function(d) { that.dragmove(this, d) });
var edgeDrag = d3.behavior.drag()
.on("dragstart", this.dragstart)
.on('drag', function(d) {
that.translateEdge(g.edge(d.v, d.w), d3.event.dx, d3.event.dy);
$('#' + g.edge(d.v, d.w).customId).attr('d', that.calcPoints(d));
});
nodeDrag.call(svg.selectAll("g.node"));
edgeDrag.call(svg.selectAll("g.edgePath"));
},
dragstart: function(d) {
d3.event.sourceEvent.stopPropagation();
},
dragmove: function(elem, d) {
var that = this,
node = d3.select(elem),
selectedNode = g.node(d),
prevX = selectedNode.x,
prevY = selectedNode.y;
selectedNode.x += d3.event.dx;
selectedNode.y += d3.event.dy;
node.attr('transform', 'translate(' + selectedNode.x + ',' + selectedNode.y + ')');
var dx = selectedNode.x - prevX,
dy = selectedNode.y - prevY;
g.edges().forEach(function(e) {
if (e.v == d || e.w == d) {
var edge = g.edge(e.v, e.w);
that.translateEdge(g.edge(e.v, e.w), dx, dy);
$('#' + edge.customId).attr('d', that.calcPoints(e));
var label = $('#label_' + edge.customId);
var xforms = label.attr('transform');
if (xforms != "") {
var parts = /translate\(\s*([^\s,)]+)[ ,]?([^\s,)]+)?/.exec(xforms),
X = parseInt(parts[1]) + dx,
Y = parseInt(parts[2]) + dy;
if (isNaN(Y)) {
Y = dy;
}
label.attr('transform', 'translate(' + X + ',' + Y + ')');
}
}
});
LineageUtils.refreshGraphForIE({ "edgeEl": edgePathEl })
},
translateEdge: function(e, dx, dy) {
e.points.forEach(function(p) {
p.x = p.x + dx;
p.y = p.y + dy;
});
},
calcPoints: function(e) {
var edge = g.edge(e.v, e.w),
tail = g.node(e.v),
head = g.node(e.w),
points = edge.points.slice(1, edge.points.length - 1),
afterslice = edge.points.slice(1, edge.points.length - 1);
points.unshift(this.intersectRect(tail, points[0]));
points.push(this.intersectRect(head, points[points.length - 1]));
return d3.svg.line()
.x(function(d) {
return d.x;
})
.y(function(d) {
return d.y;
})
.interpolate("basis")
(points);
},
intersectRect: function(node, point) {
var that = this,
x = node.x,
y = node.y,
dx = point.x - x,
dy = point.y - y,
w = node.id == guid ? 24 : 21,
h = node.id == guid ? 24 : 21,
sx = 0,
sy = 0;
if (Math.abs(dy) * w > Math.abs(dx) * h) {
// Intersection is top or bottom of rect.
if (dy < 0) {
h = -h;
}
sx = dy === 0 ? 0 : h * dx / dy;
sy = h;
} else {
// Intersection is left or right of rect.
if (dx < 0) {
w = -w;
}
sx = w;
sy = dx === 0 ? 0 : w * dy / dx;
}
return {
x: x + sx,
y: y + sy
};
},
}
}
LineageUtils.refreshGraphForSafari = function(options) {
var edgePathEl = options.edgeEl,
IEGraphRenderDone = 0;
edgePathEl.each(function(argument) {
var eleRef = this,
childNode = $(this).find('pattern');
setTimeout(function(argument) {
$(eleRef).find('defs').append(childNode);
}, 500);
});
}
LineageUtils.refreshGraphForIE = function(options) {
var edgePathEl = options.edgeEl,
IEGraphRenderDone = 0;
edgePathEl.each(function(argument) {
var childNode = $(this).find('marker');
$(this).find('marker').remove();
var eleRef = this;
++IEGraphRenderDone;
setTimeout(function(argument) {
$(eleRef).find('defs').append(childNode);
--IEGraphRenderDone;
if (IEGraphRenderDone === 0) {
this.$('.fontLoader').hide();
this.$('svg').fadeTo(1000, 1)
}
}, 1000);
});
}
LineageUtils.centerNode = function(options) {
var nodeID = options.guid,
svg = options.svg,
g = options.g,
afterCenterZoomed = options.afterCenterZoomed,
zoom = d3.behavior.zoom(),
svgGroup = svg.find("g"),
edgePathEl = options.edgeEl,
zoomBind = function() {
svgGroup.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")");
},
selectedNode = $(svg).find("g.nodes").find('>g#' + nodeID);
return {
init: function() {
if (selectedNode.length > 0) {
selectedNode = selectedNode;
var matrix = selectedNode.attr('transform').replace(/[^0-9\-.,]/g, '').split(',');
if (platform.name === "IE" || platform.name === "Microsoft Edge") {
var matrix = selectedNode.attr('transform').replace(/[a-z\()]/g, '').split(' ');
}
var x = matrix[0],
y = matrix[1];
} else {
selectedNode = $(svg).find("g.nodes").find('g').eq(1);
var x = g.graph().width / 2,
y = g.graph().height / 2;
}
var viewerWidth = $(svg).width(),
viewerHeight = $(svg).height(),
gBBox = d3.select('g').node().getBBox(),
zoomListener = zoom.scaleExtent([0.01, 50]).on("zoom", zoomBind),
scale = 1.2,
xa = -((x * scale) - (viewerWidth / 2)),
ya = -((y * scale) - (viewerHeight / 2));
zoom.translate([xa, ya]);
d3.select('g').transition()
.duration(350)
.attr("transform", "translate(" + xa + "," + ya + ")scale(" + scale + ")");
zoomListener.scale(scale);
zoomListener.translate([xa, ya]);
zoom.scale(scale);
afterCenterZoomed({ newScale: scale, newTranslate: [xa, ya] });
if (platform.name === "IE") {
LineageUtils.refreshGraphForIE({ "edgeEl": edgePathEl })
}
}
}
}
LineageUtils.onHoverFade = function(options) {
var opacity = options.opacity,
d = options.selectedNode,
nodesToHighlight = options.highlight,
svg = options.svg,
isConnected = function(a, b, o) {
if (a === o || (b && b.length && b.indexOf(o) != -1)) {
return true;
}
},
node = svg.selectAll('.node'),
path = svg.selectAll('.edgePath');
return {
init: function() {
node.classed("hover-active", function(selectedNode, i, nodes) {
if (isConnected(d, nodesToHighlight, selectedNode)) {
return true;
} else {
return false;
}
});
path.classed('hover-active-node', function(c) {
var _thisOpacity = c.v === d || c.w === d ? 1 : 0;
if (_thisOpacity) {
return true;
} else {
return false;
}
});
}
}
}
LineageUtils.base64Encode = function(options) {
var str = options.data,
CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
out = "",
i = 0,
len = str.length,
c1, c2, c3;
while (i < len) {
c1 = str.charCodeAt(i++) & 0xff;
if (i == len) {
out += CHARS.charAt(c1 >> 2);
out += CHARS.charAt((c1 & 0x3) << 4);
out += "==";
break;
}
c2 = str.charCodeAt(i++);
if (i == len) {
out += CHARS.charAt(c1 >> 2);
out += CHARS.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
out += CHARS.charAt((c2 & 0xF) << 2);
out += "=";
break;
}
c3 = str.charCodeAt(i++);
out += CHARS.charAt(c1 >> 2);
out += CHARS.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
out += CHARS.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
out += CHARS.charAt(c3 & 0x3F);
}
return out;
}
LineageUtils.imgShapeRender = function(parent, bbox, node, viewOptions) {
var LineageUtilsRef = this,
imageIconPath = Utils.getEntityIconPath({ entityData: node }),
imgName = imageIconPath.split("/").pop(),
viewGuid = viewOptions.guid,
dagreD3 = viewOptions.dagreD3,
imageObject = viewOptions.imageObject,
$defs = viewOptions.$defs;
if (node.isDeleted) {
imgName = "deleted_" + imgName;
}
if (node.id == viewGuid) {
var currentNode = true
}
var shapeSvg = parent.append('circle')
.attr('fill', 'url(#img_' + imgName + ')')
.attr('r', '24px')
.attr('data-stroke', node.id)
.attr('stroke-width', "2px")
.attr("class", "nodeImage " + (currentNode ? "currentNode" : (node.isProcess ? "process" : "node")));
if (currentNode) {
shapeSvg.attr("stroke", "#fb4200")
}
if ($defs.select('pattern[id="img_' + imgName + '"]').empty()) {
var $pattern = $defs.append("pattern")
.attr("x", "0%")
.attr("y", "0%")
.attr("patternUnits", "objectBoundingBox")
.attr("id", "img_" + imgName)
.attr("width", "100%")
.attr("height", "100%")
.append('image')
.attr("href", function(d) {
var that = this;
if (node) {
var getImageData = function(options) {
var imagePath = options.imagePath,
ajaxOptions = {
"url": imagePath,
"method": "get",
"cache": true
}
if (platform.name !== "IE") {
ajaxOptions["mimeType"] = "text/plain; charset=x-user-defined";
}
shapeSvg.attr("data-iconpath", imagePath);
$.ajax(ajaxOptions)
.always(function(data, status, xhr) {
if (data.status == 404) {
getImageData({
"imagePath": Utils.getEntityIconPath({ entityData: node, errorUrl: imagePath })
});
} else if (data) {
if (platform.name !== "IE") {
imageObject[imageIconPath] = 'data:image/png;base64,' + LineageUtilsRef.base64Encode({ "data": data });
} else {
imageObject[imageIconPath] = imagePath;
}
d3.select(that).attr("xlink:href", imageObject[imageIconPath]);
if (imageIconPath !== shapeSvg.attr("data-iconpath")) {
shapeSvg.attr("data-iconpathorigin", imageIconPath);
}
}
});
}
getImageData({
"imagePath": imageIconPath
});
}
})
.attr("x", "4")
.attr("y", currentNode ? "3" : "4").attr("width", "40")
.attr("height", "40");
}
node.intersect = function(point) {
return dagreD3.intersect.circle(node, currentNode ? 24 : 21, point);
};
return shapeSvg;
}
LineageUtils.arrowPointRender = function(parent, id, edge, type, viewOptions) {
var node = parent.node(),
parentNode = node ? node.parentNode : parent,
dagreD3 = viewOptions.dagreD3;
d3.select(parentNode).select('path.path').attr('marker-end', "url(#" + id + ")");
var marker = parent.append("marker")
.attr("id", id)
.attr("viewBox", "0 0 10 10")
.attr("refX", 8)
.attr("refY", 5)
.attr("markerUnits", "strokeWidth")
.attr("markerWidth", 4)
.attr("markerHeight", 4)
.attr("orient", "auto");
var path = marker.append("path")
.attr("d", "M 0 0 L 10 5 L 0 10 z")
.style("fill", edge.styleObj.stroke);
dagreD3.util.applyStyle(path, edge[type + "Style"]);
}
LineageUtils.BezierCurve = function(context) {
return {
lineStart: function() {
this.data = [];
},
point: function(x, y) {
this.data.push([x, y]);
},
lineEnd: function() {
var x0 = this.data[0][0],
y0 = this.data[0][1],
cp1x = this.data[1][0],
cp1y = this.data[1][1],
cp2Obj = this.data[this.data.length - 2],
cp2x = cp2Obj[0],
cp2y = cp2Obj[1],
axisObj = this.data[this.data.length - 1],
x1 = axisObj[0],
y1 = axisObj[1];
context.moveTo(x0, y0);
context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x1, y1);
}
}
}
LineageUtils.SaveSvg = function(e, viewOptions) {
var that = this,
svg = viewOptions.svg,
svgWidth = viewOptions.svgWidth,
svgHeight = viewOptions.svgHeight,
downloadFileName = viewOptions.downloadFileName,
toggleLoader = viewOptions.toggleLoader,
svgClone = svg.cloneNode(true),
scaleFactor = 1;
setTimeout(function() {
if (platform.name === "Firefox") {
svgClone.setAttribute('width', svgWidth);
svgClone.setAttribute('height', svgHeight);
}
$('.hidden-svg').html(svgClone);
$(svgClone).find('>g').attr("transform", "scale(" + scaleFactor + ")");
$(svgClone).find("foreignObject").remove();
var canvasOffset = { x: 150, y: 150 },
setWidth = (svgClone.getBBox().width + (canvasOffset.x)),
setHeight = (svgClone.getBBox().height + (canvasOffset.y)),
xAxis = svgClone.getBBox().x,
yAxis = svgClone.getBBox().y;
svgClone.attributes.viewBox.value = xAxis + "," + yAxis + "," + setWidth + "," + setHeight;
var createCanvas = document.createElement('canvas');
createCanvas.id = "canvas";
createCanvas.style.display = 'none';
var body = $('body').append(createCanvas),
canvas = $('canvas')[0];
canvas.width = (svgClone.getBBox().width * scaleFactor) + canvasOffset.x;
canvas.height = (svgClone.getBBox().height * scaleFactor) + canvasOffset.y;
var ctx = canvas.getContext('2d'),
data = (new XMLSerializer()).serializeToString(svgClone),
DOMURL = window.URL || window.webkitURL || window;
ctx.fillStyle = "#FFFFFF";
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.strokeRect(0, 0, canvas.width, canvas.height);
ctx.restore();
var img = new Image(canvas.width, canvas.height);
var svgBlob = new Blob([data], { type: 'image/svg+xml;base64' });
if (platform.name === "Safari") {
svgBlob = new Blob([data], { type: 'image/svg+xml' });
}
var url = DOMURL.createObjectURL(svgBlob);
img.onload = function() {
try {
var a = document.createElement("a");
a.download = downloadFileName;
document.body.appendChild(a);
ctx.drawImage(img, 50, 50, canvas.width, canvas.height);
canvas.toBlob(function(blob) {
if (!blob) {
Utils.notifyError({
content: "There was an error in downloading Lineage!"
});
toggleLoader();
return;
}
a.href = DOMURL.createObjectURL(blob);
if (blob.size > 10000000) {
Utils.notifyWarn({
content: "The Image size is huge, please open the image in a browser!"
});
}
a.click();
toggleLoader();
if (platform.name === 'Safari') {
that.refreshGraphForSafari({
edgeEl: that.$('svg g.node')
});
}
}, 'image/png');
$('.hidden-svg').html('');
createCanvas.remove();
} catch (err) {
Utils.notifyError({
content: "There was an error in downloading Lineage!"
});
toggleLoader();
}
};
img.src = url;
}, 0);
}
return LineageUtils;
});
\ No newline at end of file
...@@ -147,7 +147,7 @@ define(['require', ...@@ -147,7 +147,7 @@ define(['require',
onRender: function() {}, onRender: function() {},
updateEdgeView: function(options) { updateEdgeView: function(options) {
var obj = options.obj, var obj = options,
fromEntity = this.lineageData.guidEntityMap[obj.fromEntityId], fromEntity = this.lineageData.guidEntityMap[obj.fromEntityId],
toEntity = this.lineageData.guidEntityMap[obj.toEntityId]; toEntity = this.lineageData.guidEntityMap[obj.toEntityId];
if (fromEntity && toEntity) { if (fromEntity && toEntity) {
...@@ -183,9 +183,9 @@ define(['require', ...@@ -183,9 +183,9 @@ define(['require',
that.ui.propagationOptions.find('.both').show(); that.ui.propagationOptions.find('.both').show();
} else { } else {
that.ui.propagationOptions.find('.both').hide(); that.ui.propagationOptions.find('.both').hide();
if (that.edgeInfo.obj.fromEntityId != relationshipObj.end1.guid && relationshipObj.propagateTags == "ONE_TO_TWO") { if (that.edgeInfo.fromEntityId != relationshipObj.end1.guid && relationshipObj.propagateTags == "ONE_TO_TWO") {
isTwoToOne = true; isTwoToOne = true;
} else if (that.edgeInfo.obj.fromEntityId == relationshipObj.end1.guid && relationshipObj.propagateTags == "TWO_TO_ONE") { } else if (that.edgeInfo.fromEntityId == relationshipObj.end1.guid && relationshipObj.propagateTags == "TWO_TO_ONE") {
isTwoToOne = true; isTwoToOne = true;
} }
if (isTwoToOne) { if (isTwoToOne) {
...@@ -241,7 +241,7 @@ define(['require', ...@@ -241,7 +241,7 @@ define(['require',
relationshipProp = { relationshipProp = {
"propagateTags": that.getPropagationFlow({ "propagateTags": that.getPropagationFlow({
"relationshipData": _.extend({}, this.apiGuid[entityId].relationship, { 'propagateTags': PropagationValue }), "relationshipData": _.extend({}, this.apiGuid[entityId].relationship, { 'propagateTags': PropagationValue }),
"graphData": { from: { guid: this.edgeInfo.obj.fromEntityId } } "graphData": { from: { guid: this.edgeInfo.fromEntityId } }
}) })
} }
} else { } else {
......
...@@ -16,24 +16,26 @@ ...@@ -16,24 +16,26 @@
* limitations under the License. * limitations under the License.
*/ */
define(['require', define([
'backbone', "require",
'hbs!tmpl/graph/RelationshipLayoutView_tmpl', "backbone",
'collection/VLineageList', "hbs!tmpl/graph/RelationshipLayoutView_tmpl",
'models/VEntity', "collection/VLineageList",
'utils/Utils', "models/VEntity",
'utils/CommonViewFunction', "utils/Utils",
'd3-tip', "utils/CommonViewFunction",
'utils/Enums', "d3",
'utils/UrlLinks', "d3-tip",
'platform' "utils/Enums",
], function(require, Backbone, RelationshipLayoutViewtmpl, VLineageList, VEntity, Utils, CommonViewFunction, d3Tip, Enums, UrlLinks, platform) { "utils/UrlLinks",
'use strict'; "platform"
], function(require, Backbone, RelationshipLayoutViewtmpl, VLineageList, VEntity, Utils, CommonViewFunction, d3, d3Tip, Enums, UrlLinks, platform) {
"use strict";
var RelationshipLayoutView = Backbone.Marionette.LayoutView.extend( var RelationshipLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends RelationshipLayoutView */ /** @lends RelationshipLayoutView */
{ {
_viewName: 'RelationshipLayoutView', _viewName: "RelationshipLayoutView",
template: RelationshipLayoutViewtmpl, template: RelationshipLayoutViewtmpl,
className: "resizeGraph", className: "resizeGraph",
...@@ -59,15 +61,15 @@ define(['require', ...@@ -59,15 +61,15 @@ define(['require',
events["click " + this.ui.relationshipDetailClose] = function() { events["click " + this.ui.relationshipDetailClose] = function() {
this.toggleInformationSlider({ close: true }); this.toggleInformationSlider({ close: true });
}; };
events["keyup " + this.ui.searchNode] = 'searchNode'; events["keyup " + this.ui.searchNode] = "searchNode";
events["click " + this.ui.boxClose] = 'toggleBoxPanel'; events["click " + this.ui.boxClose] = "toggleBoxPanel";
events["change " + this.ui.relationshipViewToggle] = function(e) { events["change " + this.ui.relationshipViewToggle] = function(e) {
this.relationshipViewToggle(e.currentTarget.checked) this.relationshipViewToggle(e.currentTarget.checked);
}; };
events["click " + this.ui.noValueToggle] = function(e) { events["click " + this.ui.noValueToggle] = function(e) {
Utils.togglePropertyRelationshipTableEmptyValues({ Utils.togglePropertyRelationshipTableEmptyValues({
"inputType": this.ui.noValueToggle, inputType: this.ui.noValueToggle,
"tableEl": this.ui.relationshipDetailValue tableEl: this.ui.relationshipDetailValue
}); });
}; };
return events; return events;
...@@ -78,7 +80,7 @@ define(['require', ...@@ -78,7 +80,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'entity', 'entityName', 'guid', 'actionCallBack', 'attributeDefs')); _.extend(this, _.pick(options, "entity", "entityName", "guid", "actionCallBack", "attributeDefs"));
this.graphData = this.createData(this.entity); this.graphData = this.createData(this.entity);
}, },
createData: function(entity) { createData: function(entity) {
...@@ -89,14 +91,14 @@ define(['require', ...@@ -89,14 +91,14 @@ define(['require',
_.each(entity.relationshipAttributes, function(obj, key) { _.each(entity.relationshipAttributes, function(obj, key) {
if (!_.isEmpty(obj)) { if (!_.isEmpty(obj)) {
links.push({ links.push({
"source": nodes[that.entity.typeName] || source: nodes[that.entity.typeName] ||
(nodes[that.entity.typeName] = _.extend({ "name": that.entity.typeName }, { value: entity })), (nodes[that.entity.typeName] = _.extend({ name: that.entity.typeName }, { value: entity })),
"target": nodes[key] || target: nodes[key] ||
(nodes[key] = _.extend({ (nodes[key] = _.extend({
"name": key name: key
}, { value: obj })), }, { value: obj })),
"value": obj value: obj
}) });
} }
}); });
} }
...@@ -104,7 +106,7 @@ define(['require', ...@@ -104,7 +106,7 @@ define(['require',
}, },
onRender: function() { onRender: function() {
this.ui.zoomControl.hide(); this.ui.zoomControl.hide();
this.$el.addClass('auto-height'); this.$el.addClass("auto-height");
}, },
onShow: function(argument) { onShow: function(argument) {
if (this.graphData && _.isEmpty(this.graphData.links)) { if (this.graphData && _.isEmpty(this.graphData.links)) {
...@@ -115,29 +117,29 @@ define(['require', ...@@ -115,29 +117,29 @@ define(['require',
this.createTable(); this.createTable();
}, },
noRelationship: function() { noRelationship: function() {
this.$('svg').html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relationship data found</text>'); this.$("svg").html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relationship data found</text>');
}, },
toggleInformationSlider: function(options) { toggleInformationSlider: function(options) {
if (options.open && !this.$('.relationship-details').hasClass("open")) { if (options.open && !this.$(".relationship-details").hasClass("open")) {
this.$('.relationship-details').addClass('open'); this.$(".relationship-details").addClass("open");
} else if (options.close && this.$('.relationship-details').hasClass("open")) { } else if (options.close && this.$(".relationship-details").hasClass("open")) {
d3.selectAll('circle').attr("stroke", "none"); d3.selectAll("circle").attr("stroke", "none");
this.$('.relationship-details').removeClass('open'); this.$(".relationship-details").removeClass("open");
} }
}, },
toggleBoxPanel: function(options) { toggleBoxPanel: function(options) {
var el = options && options.el, var el = options && options.el,
nodeDetailToggler = options && options.nodeDetailToggler, nodeDetailToggler = options && options.nodeDetailToggler,
currentTarget = options.currentTarget; currentTarget = options.currentTarget;
this.$el.find('.show-box-panel').removeClass('show-box-panel'); this.$el.find(".show-box-panel").removeClass("show-box-panel");
if (el && el.addClass) { if (el && el.addClass) {
el.addClass('show-box-panel'); el.addClass("show-box-panel");
} }
this.$('circle.node-detail-highlight').removeClass("node-detail-highlight"); this.$("circle.node-detail-highlight").removeClass("node-detail-highlight");
}, },
searchNode: function(e) { searchNode: function(e) {
var $el = $(e.currentTarget); var $el = $(e.currentTarget);
this.updateRelationshipDetails(_.extend({}, $el.data(), { searchString: $el.val() })) this.updateRelationshipDetails(_.extend({}, $el.data(), { searchString: $el.val() }));
}, },
updateRelationshipDetails: function(options) { updateRelationshipDetails: function(options) {
var data = options.obj.value, var data = options.obj.value,
...@@ -147,10 +149,10 @@ define(['require', ...@@ -147,10 +149,10 @@ define(['require',
getEntityTypelist = function(options) { getEntityTypelist = function(options) {
var activeEntityColor = "#4a90e2", var activeEntityColor = "#4a90e2",
deletedEntityColor = "#BB5838", deletedEntityColor = "#BB5838",
entityTypeHtml = '<pre>', entityTypeHtml = "<pre>",
getdefault = function(obj) { getdefault = function(obj) {
var options = obj.options, var options = obj.options,
status = (Enums.entityStateReadOnly[options.entityStatus || options.status] ? " deleted-relation" : ''), status = Enums.entityStateReadOnly[options.entityStatus || options.status] ? " deleted-relation" : "",
guid = options.guid, guid = options.guid,
entityColor = obj.color, entityColor = obj.color,
name = obj.name, name = obj.name,
...@@ -167,7 +169,7 @@ define(['require', ...@@ -167,7 +169,7 @@ define(['require',
}, },
getWithButton = function(obj) { getWithButton = function(obj) {
var options = obj.options, var options = obj.options,
status = (Enums.entityStateReadOnly[options.entityStatus || options.status] ? " deleted-relation" : ''), status = Enums.entityStateReadOnly[options.entityStatus || options.status] ? " deleted-relation" : "",
guid = options.guid, guid = options.guid,
entityColor = obj.color, entityColor = obj.color,
name = obj.name, name = obj.name,
...@@ -178,7 +180,7 @@ define(['require', ...@@ -178,7 +180,7 @@ define(['require',
title = "Deleted"; title = "Deleted";
if (relationship) { if (relationship) {
icon = '<i class="fa fa-long-arrow-right"></i>'; icon = '<i class="fa fa-long-arrow-right"></i>';
status = (Enums.entityStateReadOnly[options.relationshipStatus || options.status] ? "deleted-relation" : ''); status = Enums.entityStateReadOnly[options.relationshipStatus || options.status] ? "deleted-relation" : "";
title = "Relationship Deleted"; title = "Relationship Deleted";
} }
return "<li class=" + status + ">" + return "<li class=" + status + ">" +
...@@ -191,33 +193,33 @@ define(['require', ...@@ -191,33 +193,33 @@ define(['require',
if (options.entityStatus == "ACTIVE") { if (options.entityStatus == "ACTIVE") {
if (options.relationshipStatus == "ACTIVE") { if (options.relationshipStatus == "ACTIVE") {
entityTypeHtml = getdefault({ entityTypeHtml = getdefault({
"color": activeEntityColor, color: activeEntityColor,
"options": options, options: options,
"name": name name: name
}); });
} else if (options.relationshipStatus == "DELETED") { } else if (options.relationshipStatus == "DELETED") {
entityTypeHtml = getWithButton({ entityTypeHtml = getWithButton({
"color": activeEntityColor, color: activeEntityColor,
"options": options, options: options,
"name": name, name: name,
"relationship": true relationship: true
}) });
} }
} else if (options.entityStatus == "DELETED") { } else if (options.entityStatus == "DELETED") {
entityTypeHtml = getWithButton({ entityTypeHtml = getWithButton({
"color": deletedEntityColor, color: deletedEntityColor,
"options": options, options: options,
"name": name, name: name,
"entity": true entity: true
}) });
} else { } else {
entityTypeHtml = getdefault({ entityTypeHtml = getdefault({
"color": activeEntityColor, color: activeEntityColor,
"options": options, options: options,
"name": name name: name
}); });
} }
return entityTypeHtml + '</pre>'; return entityTypeHtml + "</pre>";
}; };
this.ui.searchNode.hide(); this.ui.searchNode.hide();
this.$("[data-id='typeName']").text(typeName); this.$("[data-id='typeName']").text(typeName);
...@@ -225,7 +227,7 @@ define(['require', ...@@ -225,7 +227,7 @@ define(['require',
var name = options.entityName ? options.entityName : Utils.getName(options, "displayText"); var name = options.entityName ? options.entityName : Utils.getName(options, "displayText");
var entityTypeButton = getEntityTypelist(options); var entityTypeButton = getEntityTypelist(options);
return entityTypeButton; return entityTypeButton;
} };
if (_.isArray(data)) { if (_.isArray(data)) {
if (data.length > 1) { if (data.length > 1) {
this.ui.searchNode.show(); this.ui.searchNode.show();
...@@ -249,318 +251,304 @@ define(['require', ...@@ -249,318 +251,304 @@ define(['require',
this.$("[data-id='entityList']").html(listString); this.$("[data-id='entityList']").html(listString);
}, },
createGraph: function(data) { createGraph: function(data) {
//Ref - http://bl.ocks.org/fancellu/2c782394602a93921faff74e594d1bb1
var that = this, var that = this,
width = this.$('svg').width(), width = this.$("svg").width(),
height = this.$('svg').height(); height = this.$("svg").height(),
nodes = d3.values(data.nodes),
links = data.links;
var scale = 1.0, var activeEntityColor = "#00b98b",
activeEntityColor = "#00b98b",
deletedEntityColor = "#BB5838", deletedEntityColor = "#BB5838",
defaultEntityColor = "#e0e0e0", defaultEntityColor = "#e0e0e0",
selectedNodeColor = "#4a90e2"; selectedNodeColor = "#4a90e2";
var force = d3.layout.force() var svg = d3
.nodes(d3.values(data.nodes)) .select(this.$("svg")[0])
.links(data.links)
.size([width, height])
.linkDistance(200)
.gravity(0.5)
.friction(0.1)
.charge(function(d) {
var charge = -2000;
if (d.index === 0) charge = 100
return charge;
})
.on("tick", tick)
.start();
var zoom = d3.behavior.zoom()
.scale(scale)
.scaleExtent([1, 5])
.on("zoom", zoomed);
function zoomed() {
container.attr("transform",
"translate(" + zoom.translate() + ")" +
"scale(" + zoom.scale() + ")"
);
}
function interpolateZoom(translate, scale) {
var self = this;
return d3.transition().duration(350).tween("zoom", function() {
var iTranslate = d3.interpolate(zoom.translate(), translate),
iScale = d3.interpolate(zoom.scale(), scale);
return function(t) {
zoom
.scale(iScale(t))
.translate(iTranslate(t));
zoomed();
};
});
}
function zoomClick() {
var clicked = d3.event.target,
direction = 1,
factor = 0.5,
target_zoom = 1,
center = [width / 2, height / 2],
extent = zoom.scaleExtent(),
translate = zoom.translate(),
translate0 = [],
l = [],
view = { x: translate[0], y: translate[1], k: zoom.scale() };
d3.event.preventDefault();
direction = (this.id === 'zoom_in') ? 1 : -1;
target_zoom = zoom.scale() * (1 + factor * direction);
if (target_zoom < extent[0] || target_zoom > extent[1]) { return false; }
translate0 = [(center[0] - view.x) / view.k, (center[1] - view.y) / view.k];
view.k = target_zoom;
l = [translate0[0] * view.k + view.x, translate0[1] * view.k + view.y];
view.x += center[0] - l[0];
view.y += center[1] - l[1];
interpolateZoom([view.x, view.y], view.k);
}
d3.selectAll(this.$('.lineageZoomButton')).on('click', zoomClick);
var svg = d3.select(this.$("svg")[0])
.attr("viewBox", "0 0 " + width + " " + height) .attr("viewBox", "0 0 " + width + " " + height)
.attr("enable-background", "new 0 0 " + width + " " + height) .attr("enable-background", "new 0 0 " + width + " " + height),
.call(zoom) node,
.on("dblclick.zoom", null), path;
drag = force.drag()
.on("dragstart", dragstart);
var container = svg.append("g") var container = svg
.append("g")
.attr("id", "container") .attr("id", "container")
.attr("transform", "translate(0,0)scale(1,1)"); .attr("transform", "translate(0,0)scale(1,1)");
var zoom = d3
.zoom()
.scaleExtent([0.1, 4])
.on("zoom", function() {
container.attr("transform", d3.event.transform);
});
svg.call(zoom).on("dblclick.zoom", null);
// build the arrow. container
container.append("svg:defs").selectAll("marker") .append("svg:defs")
.selectAll("marker")
.data(["deletedLink", "activeLink"]) // Different link/path types can be defined here .data(["deletedLink", "activeLink"]) // Different link/path types can be defined here
.enter().append("svg:marker") // This section adds in the arrows .enter()
.append("svg:marker") // This section adds in the arrows
.attr("id", String) .attr("id", String)
.attr("viewBox", "0 -5 10 10") .attr("viewBox", "-0 -5 10 10")
.attr("refX", 10) .attr("refX", 10)
.attr("refY", -0.5) .attr("refY", -0.5)
.attr("orient", "auto")
.attr("markerWidth", 6) .attr("markerWidth", 6)
.attr("markerHeight", 6) .attr("markerHeight", 6)
.attr("orient", "auto")
.append("svg:path") .append("svg:path")
.attr("d", "M0,-5L10,0L0,5") .attr("d", "M 0,-5 L 10 ,0 L 0,5")
.attr("fill", function(d) { .attr("fill", function(d) {
return d == "deletedLink" ? deletedEntityColor : activeEntityColor; return d == "deletedLink" ? deletedEntityColor : activeEntityColor;
}); })
.style("stroke", "none");
function getPathColor(options) {
return isAllEntityRelationDeleted(options) ? deletedEntityColor : activeEntityColor
}
function isAllEntityRelationDeleted(options) {
var data = options.data,
type = options.type;
var d = $.extend(true, {}, data);
if (d && !_.isArray(d.value)) {
d.value = [d.value];
}
return (_.findIndex(d.value, function(val) {
if (type == "node") {
return (val.entityStatus || val.status) == "ACTIVE"
} else {
return val.relationshipStatus == "ACTIVE"
}
}) == -1);
}
// add the links and the arrows
var path = container.append("svg:g").selectAll("path")
.data(force.links())
.enter().append("svg:path")
// .attr("class", function(d) { return "link " + d.type; })
.attr("class", "relatioship-link")
.attr("stroke", function(d) { return getPathColor({ data: d, type: 'path' }) })
.attr("marker-end", function(d) {
return "url(#" + (isAllEntityRelationDeleted({ data: d }) ? "deletedLink" : "activeLink") + ")";
});
// define the nodes var forceLink = d3
var node = container.selectAll(".node") .forceLink()
.data(force.nodes()) .id(function(d) {
.enter().append("g") return d.id;
.attr("class", "node")
.on('touchstart', function(d) {
if (d && d.value && d.value.guid != that.guid) {
d3.event.stopPropagation();
}
}) })
.on('mousedown', function(d) { .distance(function(d) {
if (d && d.value && d.value.guid != that.guid) { return 100;
d3.event.stopPropagation();
}
}) })
.on('click', function(d) { .strength(1);
if (d3.event.defaultPrevented) return; // ignore drag
if (d && d.value && d.value.guid == that.guid) { var simulation = d3
that.ui.boxClose.trigger('click'); .forceSimulation()
return; .force("link", forceLink)
} .force("charge", d3.forceManyBody())
that.toggleBoxPanel({ el: that.$('.relationship-node-details') }); .force("center", d3.forceCenter(width / 2, height / 2));
that.ui.searchNode.data({ obj: d });
$(this).find('circle').addClass("node-detail-highlight"); update();
that.updateRelationshipDetails({ obj: d });
function update() {
}).call(force.drag); path = container
.append("svg:g")
// add the nodes .selectAll("path")
var circleContainer = node.append("g"); .data(links)
circleContainer.on("dblclick", function(d) { .enter()
if ((_.isArray(d.value) && d.value.length == 1) || d.value.guid) { .append("svg:path")
var guid = _.isArray(d.value) ? _.first(d.value).guid : d.value.guid; .attr("class", "relatioship-link")
Utils.setUrl({ .attr("stroke", function(d) {
url: '#!/detailPage/' + guid, return getPathColor({ data: d, type: "path" });
mergeBrowserUrl: false, })
urlParams: { tabActive: 'relationship' }, .attr("marker-end", function(d) {
trigger: true return "url(#" + (isAllEntityRelationDeleted({ data: d }) ? "deletedLink" : "activeLink") + ")";
}); });
}
})
circleContainer.append("circle") node = container
.attr("cx", 0) .selectAll(".node")
.attr("cy", 0) .data(nodes)
.attr("r", function(d) { .enter()
d.radius = 25; .append("g")
return d.radius; .attr("class", "node")
}) .on("mousedown", function() {
.attr("fill", function(d) { console.log(d3.event);
if (d && d.value && d.value.guid == that.guid) { d3.event.preventDefault();
if (isAllEntityRelationDeleted({ data: d, type: 'node' })) { })
.on("click", function(d) {
if (d3.event.defaultPrevented) return; // ignore drag
if (d && d.value && d.value.guid == that.guid) {
that.ui.boxClose.trigger("click");
return;
}
that.toggleBoxPanel({ el: that.$(".relationship-node-details") });
that.ui.searchNode.data({ obj: d });
$(this)
.find("circle")
.addClass("node-detail-highlight");
that.updateRelationshipDetails({ obj: d });
})
.call(
d3
.drag()
.on("start", dragstarted)
.on("drag", dragged)
);
var circleContainer = node.append("g");
circleContainer
.append("circle")
.attr("cx", 0)
.attr("cy", 0)
.attr("r", function(d) {
d.radius = 25;
return d.radius;
})
.attr("fill", function(d) {
if (d && d.value && d.value.guid == that.guid) {
if (isAllEntityRelationDeleted({ data: d, type: "node" })) {
return deletedEntityColor;
} else {
return selectedNodeColor;
}
} else if (isAllEntityRelationDeleted({ data: d, type: "node" })) {
return deletedEntityColor; return deletedEntityColor;
} else { } else {
return selectedNodeColor; return activeEntityColor;
} }
} else if (isAllEntityRelationDeleted({ data: d, type: 'node' })) { })
return deletedEntityColor; .attr("typename", function(d) {
} else { return d.name;
return activeEntityColor; });
}
}) circleContainer
.attr("typename", function(d) { .append("text")
return d.name; .attr("x", 0)
}) .attr("y", 0)
circleContainer.append("text") .attr("dy", 25 - 17)
.attr('x', 0) .attr("text-anchor", "middle")
.attr('y', 0) .style("font-family", "FontAwesome")
.attr('dy', (25 - 17)) .style("font-size", function(d) {
.attr("text-anchor", "middle") return "25px";
.style("font-family", "FontAwesome") })
.style('font-size', function(d) { return '25px'; }) .text(function(d) {
.text(function(d) { var iconObj = Enums.graphIcon[d.name];
var iconObj = Enums.graphIcon[d.name]; if (iconObj && iconObj.textContent) {
if (iconObj && iconObj.textContent) { return iconObj.textContent;
return iconObj.textContent;
} else {
if (d && _.isArray(d.value) && d.value.length > 1) {
return '\uf0c5';
} else { } else {
return '\uf016'; if (d && _.isArray(d.value) && d.value.length > 1) {
return "\uf0c5";
} else {
return "\uf016";
}
} }
} })
}) .attr("fill", function(d) {
.attr("fill", function(d) { return "#fff";
return "#fff"; });
});
var countBox = circleContainer.append('g')
countBox.append("circle")
.attr("cx", 18)
.attr("cy", -20)
.attr("r", function(d) {
if (_.isArray(d.value) && d.value.length > 1) {
return 10;
}
});
countBox.append("text") var countBox = circleContainer.append("g");
.attr('dx', 18)
.attr('dy', -16) countBox
.attr("text-anchor", "middle") .append("circle")
.attr("fill", defaultEntityColor) .attr("cx", 18)
.text(function(d) { .attr("cy", -20)
if (_.isArray(d.value) && d.value.length > 1) { .attr("r", function(d) {
return d.value.length; if (_.isArray(d.value) && d.value.length > 1) {
} return 10;
}); }
});
countBox
.append("text")
.attr("dx", 18)
.attr("dy", -16)
.attr("text-anchor", "middle")
.attr("fill", defaultEntityColor)
.text(function(d) {
if (_.isArray(d.value) && d.value.length > 1) {
return d.value.length;
}
});
node.append("text")
.attr("x", -15)
.attr("y", "35")
.text(function(d) {
return d.name;
});
// add the text simulation.nodes(nodes).on("tick", ticked);
node.append("text")
.attr("x", -15)
.attr("y", "35")
.text(function(d) { return d.name; });
// add the curvy lines simulation.force("link").links(links);
function tick() { }
function ticked() {
path.attr("d", function(d) { path.attr("d", function(d) {
var diffX = d.target.x - d.source.x, var diffX = d.target.x - d.source.x,
diffY = d.target.y - d.source.y, diffY = d.target.y - d.source.y,
// Length of path from center of source node to center of target node // Length of path from center of source node to center of target node
pathLength = Math.sqrt((diffX * diffX) + (diffY * diffY)), pathLength = Math.sqrt(diffX * diffX + diffY * diffY),
// x and y distances from center to outside edge of target node // x and y distances from center to outside edge of target node
offsetX = (diffX * d.target.radius) / pathLength, offsetX = (diffX * d.target.radius) / pathLength,
offsetY = (diffY * d.target.radius) / pathLength; offsetY = (diffY * d.target.radius) / pathLength;
return "M" + d.source.x + "," + d.source.y + "A" + pathLength + "," + pathLength + " 0 0,1 " + (d.target.x - offsetX) + "," + (d.target.y - offsetY) return "M" + d.source.x + "," + d.source.y + "A" + pathLength + "," + pathLength + " 0 0,1 " + (d.target.x - offsetX) + "," + (d.target.y - offsetY);
}); });
node.attr("transform", function(d) { node.attr("transform", function(d) {
if (d && d.value && d.value.guid == that.guid) {
d.x = (width / 2)
d.y = (height / 2)
}
return "translate(" + d.x + "," + d.y + ")"; return "translate(" + d.x + "," + d.y + ")";
}); });
} }
function dragstart(d) { function dragstarted(d) {
d3.select(this).classed("fixed", d.fixed = true); d3.event.sourceEvent.stopPropagation();
if (d && d.value && d.value.guid != that.guid) {
if (!d3.event.active) simulation.alphaTarget(0.3).restart();
d.fx = d.x;
d.fy = d.y;
}
}
function dragged(d) {
if (d && d.value && d.value.guid != that.guid) {
d.fx = d3.event.x;
d.fy = d3.event.y;
}
}
function getPathColor(options) {
return isAllEntityRelationDeleted(options) ? deletedEntityColor : activeEntityColor;
}
function isAllEntityRelationDeleted(options) {
var data = options.data,
type = options.type;
var d = $.extend(true, {}, data);
if (d && !_.isArray(d.value)) {
d.value = [d.value];
}
return (
_.findIndex(d.value, function(val) {
if (type == "node") {
return (val.entityStatus || val.status) == "ACTIVE";
} else {
return val.relationshipStatus == "ACTIVE";
}
}) == -1
);
}
var zoomClick = function() {
var scaleFactor = 0.8;
if (this.id === 'zoom_in') {
scaleFactor = 1.3;
}
zoom.scaleBy(svg.transition().duration(750), scaleFactor);
} }
d3.selectAll(this.$('.lineageZoomButton')).on('click', zoomClick);
}, },
createTable: function() { createTable: function() {
this.entityModel = new VEntity({}); this.entityModel = new VEntity({});
var table = CommonViewFunction.propertyTable({ scope: this, valueObject: this.entity.relationshipAttributes, attributeDefs: this.attributeDefs }); var table = CommonViewFunction.propertyTable({
scope: this,
valueObject: this.entity.relationshipAttributes,
attributeDefs: this.attributeDefs
});
this.ui.relationshipDetailValue.html(table); this.ui.relationshipDetailValue.html(table);
Utils.togglePropertyRelationshipTableEmptyValues({ Utils.togglePropertyRelationshipTableEmptyValues({
"inputType": this.ui.noValueToggle, inputType: this.ui.noValueToggle,
"tableEl": this.ui.relationshipDetailValue tableEl: this.ui.relationshipDetailValue
}); });
}, },
relationshipViewToggle: function(checked) { relationshipViewToggle: function(checked) {
this.ui.relationshipDetailTable.toggleClass('visible invisible'); this.ui.relationshipDetailTable.toggleClass("visible invisible");
this.ui.relationshipSVG.toggleClass('visible invisible'); this.ui.relationshipSVG.toggleClass("visible invisible");
if (checked) { if (checked) {
this.ui.zoomControl.hide(); this.ui.zoomControl.hide();
this.$el.addClass('auto-height'); this.$el.addClass("auto-height");
} else { } else {
this.ui.zoomControl.show(); this.ui.zoomControl.show();
this.$el.removeClass('auto-height'); this.$el.removeClass("auto-height");
} }
} }
}); }
);
return RelationshipLayoutView; return RelationshipLayoutView;
}); });
\ No newline at end of file
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define([
"require",
"backbone",
"hbs!tmpl/graph/TypeSystemTreeView_tmpl",
"collection/VLineageList",
"models/VEntity",
"LineageHelper",
"d3",
"dagreD3",
"d3-tip",
"utils/CommonViewFunction",
"utils/Utils",
"platform",
"jquery-ui"
], function(require, Backbone, TypeSystemTreeViewTmpl, VLineageList, VEntity, LineageHelper, d3, dagreD3, d3Tip, CommonViewFunction, Utils, platform) {
"use strict";
/** @lends TypeSystemTreeView */
var TypeSystemTreeView = Backbone.Marionette.LayoutView.extend({
_viewName: "TypeSystemTreeViewTmpl",
template: TypeSystemTreeViewTmpl,
templateHelpers: function() {
return {
modalID: this.viewId,
width: "100%",
height: "300px"
};
},
/** Layout sub regions */
regions: {
RTypeSystemTreeViewPage: "#r_typeSystemTreeViewPage"
},
/** ui selector cache */
ui: {
typeSystemTreeViewPage: "[data-id='typeSystemTreeViewPage']",
boxClose: '[data-id="box-close"]',
nodeDetailTable: '[data-id="nodeDetailTable"]',
typeSearch: '[data-id="typeSearch"]',
filterServiceType: '[data-id="filterServiceType"]',
onZoomIn: '[data-id="zoom-in"]',
onZoomOut: '[data-id="zoom-out"]',
filterBox: ".filter-box",
searchBox: ".search-box",
filterToggler: '[data-id="filter-toggler"]',
searchToggler: '[data-id="search-toggler"]',
reset: '[data-id="reset"]',
fullscreenToggler: '[data-id="fullScreen-toggler"]'
},
/** ui events hash */
events: function() {
var events = {};
events["click " + this.ui.boxClose] = "toggleBoxPanel";
events["click " + this.ui.onZoomIn] = "onClickZoomIn";
events["click " + this.ui.onZoomOut] = "onClickZoomOut";
events["click " + this.ui.filterToggler] = "onClickFilterToggler";
events["click " + this.ui.searchToggler] = "onClickSearchToggler";
events["click " + this.ui.fullscreenToggler] = "onClickFullscreenToggler";
events["click " + this.ui.reset] = "onClickReset";
return events;
},
/**
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, "entityDefCollection"));
},
onShow: function() {
this.$(".fontLoader").show();
this.initializeGraph();
this.fetchGraphData();
},
onRender: function() {},
fetchGraphData: function(options) {
var that = this;
var entityTypeDef = that.entityDefCollection.fullCollection.toJSON();
this.$(".fontLoader").show();
this.$("svg").empty();
if (that.isDestroyed) {
return;
}
if (entityTypeDef.length) {
that.generateData($.extend(true, {}, { data: entityTypeDef }, options)).then(function(graphObj) {
that.createGraph();
});
}
},
generateData: function(options) {
return new Promise(
function(resolve, reject) {
try {
var that = this,
newHashMap = {},
styleObj = {
fill: "none",
stroke: "#ffb203",
width: 3
},
makeNodeData = function(relationObj) {
if (relationObj) {
if (relationObj.updatedValues) {
return relationObj;
}
var obj = _.extend(relationObj, {
shape: "img",
updatedValues: true,
label: relationObj.name.trunc(18),
toolTipLabel: relationObj.name,
id: relationObj.guid,
isLineage: true,
isIncomplete: false
});
return obj;
}
},
getStyleObjStr = function(styleObj) {
return "fill:" + styleObj.fill + ";stroke:" + styleObj.stroke + ";stroke-width:" + styleObj.width;
},
setNode = function(guid, obj) {
var node = that.LineageHelperRef.getNode(guid);
if (!node) {
var nodeData = makeNodeData(obj);
that.LineageHelperRef.setNode(guid, nodeData);
return nodeData;
} else {
return node;
}
},
setEdge = function(fromNodeGuid, toNodeGuid) {
that.LineageHelperRef.setEdge(fromNodeGuid, toNodeGuid, {
arrowhead: "arrowPoint",
style: getStyleObjStr(styleObj),
styleObj: styleObj
});
},
setGraphData = function(fromEntityId, toEntityId) {
setNode(fromEntityId);
setNode(toEntityId);
setEdge(fromEntityId, toEntityId);
};
if (options.data) {
if (options.filter) {
var pendingSubList = {},
pendingSuperList = {},
temp = {},
doneList = {},
traveseSubSuper = function(obj, ignoreSubTypes) {
var fromEntityId = obj.guid;
if (!ignoreSubTypes && obj.subTypes.length) {
_.each(obj.subTypes, function(subType) {
var tempObj = doneList[subType] || temp[subType];
if (tempObj) {
setNode(tempObj.guid, tempObj);
setEdge(fromEntityId, tempObj.guid);
} else {
if (pendingSubList[subType]) {
pendingSubList[subType].push(fromEntityId);
} else {
pendingSubList[subType] = [fromEntityId];
}
}
});
}
if (obj.superTypes.length) {
_.each(obj.superTypes, function(superType) {
var tempObj = doneList[superType] || temp[superType];
if (tempObj) {
setNode(tempObj.guid, tempObj);
setEdge(tempObj.guid, fromEntityId);
if (tempObj.superTypes.length) {
traveseSubSuper(tempObj, true);
}
} else {
if (pendingSuperList[superType]) {
pendingSuperList[superType].push(fromEntityId);
} else {
pendingSuperList[superType] = [fromEntityId];
}
}
});
}
};
_.each(options.data, function(obj) {
var fromEntityId = obj.guid;
if (obj.serviceType === options.filter) {
doneList[obj.name] = obj;
setNode(fromEntityId, obj);
if (pendingSubList[obj.name]) {
_.map(pendingSubList[obj.name], function(guid) {
setEdge(guid, fromEntityId);
});
delete pendingSubList[obj.name];
}
if (pendingSuperList[obj.name]) {
_.map(pendingSuperList[obj.name], function(guid) {
setEdge(fromEntityId, guid);
});
delete pendingSuperList[obj.name];
}
traveseSubSuper(obj);
} else {
if (pendingSubList[obj.name]) {
setNode(fromEntityId, obj);
doneList[obj.name] = obj;
_.map(pendingSubList[obj.name], function(guid) {
setEdge(guid, fromEntityId);
});
delete pendingSubList[obj.name];
}
if (pendingSuperList[obj.name]) {
var fromEntityId = obj.guid;
setNode(fromEntityId, obj);
doneList[obj.name] = obj;
_.map(pendingSuperList[obj.name], function(guid) {
setEdge(fromEntityId, guid);
});
delete pendingSuperList[obj.name];
}
if (!doneList[obj.name]) {
temp[obj.name] = obj;
}
}
});
pendingSubList = null;
pendingSuperList = null;
doneList = null;
} else {
var pendingList = {},
doneList = {};
_.each(options.data, function(obj) {
var fromEntityId = obj.guid;
doneList[obj.name] = obj;
setNode(fromEntityId, obj);
if (pendingList[obj.name]) {
_.map(pendingList[obj.name], function(guid) {
setEdge(guid, fromEntityId);
});
delete pendingList[obj.name];
}
if (obj.subTypes.length) {
_.each(obj.subTypes, function(subTypes) {
//var subTypesObj = _.find(options.data({ name: superTypes });
//setNode(superTypeObj.attributes.guid, superTypeObj.attributes);
if (doneList[subTypes]) {
setEdge(fromEntityId, doneList[subTypes].guid);
} else {
if (pendingList[subTypes]) {
pendingList[subTypes].push(fromEntityId);
} else {
pendingList[subTypes] = [fromEntityId];
}
}
});
}
});
pendingList = null;
doneList = null;
}
}
resolve(this.g);
} catch (e) {
reject(e);
}
}.bind(this)
);
},
toggleBoxPanel: function(options) {
var el = options && options.el,
nodeDetailToggler = options && options.nodeDetailToggler,
currentTarget = options.currentTarget;
this.$el.find(".show-box-panel").removeClass("show-box-panel");
if (el && el.addClass) {
el.addClass("show-box-panel");
}
this.$("circle.node-detail-highlight").removeClass("node-detail-highlight");
},
onClickNodeToggler: function(options) {
this.toggleBoxPanel({ el: this.$(".lineage-node-detail"), nodeDetailToggler: true });
},
onClickZoomIn: function() {
this.LineageHelperRef.zoomIn();
},
onClickZoomOut: function() {
this.LineageHelperRef.zoomOut();
},
onClickFilterToggler: function() {
this.toggleBoxPanel({ el: this.ui.filterBox });
},
onClickSearchToggler: function() {
this.toggleBoxPanel({ el: this.ui.searchBox });
},
onClickReset: function() {
this.fetchGraphData({ refresh: true });
},
onClickFullscreenToggler: function(e) {
var icon = $(e.currentTarget).find("i"),
panel = $(e.target).parents(".tab-pane").first();
icon.toggleClass("fa-expand fa-compress");
if (icon.hasClass("fa-expand")) {
icon.parent("button").attr("data-original-title", "Full Screen");
} else {
icon.parent("button").attr("data-original-title", "Default View");
}
panel.toggleClass("fullscreen-mode");
},
updateDetails: function(data) {
this.$("[data-id='typeName']").text(Utils.getName(data));
delete data.id;
//atttributes
data["atttributes"] = (data.attributeDefs || []).map(function(obj) {
return obj.name;
});
delete data.attributeDefs;
//businessAttributes
data["businessAttributes"] = _.keys(data.businessAttributeDefs);
delete data.businessAttributeDefs;
//relationshipAttributes
data["relationshipAttributes"] = (data.relationshipAttributeDefs || []).map(function(obj) {
return obj.name;
});
delete data.relationshipAttributeDefs;
console.log(data);
this.ui.nodeDetailTable.html(
CommonViewFunction.propertyTable({
scope: this,
guidHyperLink: false,
getEmptyString: function(key) {
if (key === "subTypes" || key === "superTypes" || key === "atttributes" || key === "relationshipAttributes") {
return "[]";
}
return "N/A";
},
valueObject: _.omit(data, ["isLineage", "isIncomplete", "label", "shape", "toolTipLabel", "updatedValues"]),
sortBy: true
})
);
},
createGraph: function(refresh) {
this.LineageHelperRef.createGraph();
},
filterData: function(value) {
this.LineageHelperRef.refresh();
this.fetchGraphData({ filter: value });
},
initializeGraph: function() {
//ref - https://bl.ocks.org/seemantk/80613e25e9804934608ac42440562168
var that = this,
node = this.$("svg.main").parent()[0].getBoundingClientRect();
this.$("svg").attr("viewBox", "0 0 " + node.width + " " + node.height);
this.LineageHelperRef = new LineageHelper.default({
el: this.$("svg.main")[0],
legends: false,
setDataManually: true,
width: node.width,
height: node.height,
isShowHoverPath: true,
zoom: true,
fitToScreen: true,
dagreOptions: {
rankdir: "tb"
},
onNodeClick: function(d) {
that.onClickNodeToggler();
that.updateDetails(that.LineageHelperRef.getNode(d.clickedData, true));
},
beforeRender: function() {
that.$(".fontLoader").show();
},
afterRender: function() {
that.graphOptions = that.LineageHelperRef.getGraphOptions();
that.renderTypeFilterSearch();
that.$(".fontLoader").hide();
return;
}
});
},
renderTypeFilterSearch: function(data) {
var that = this;
var searchStr = "<option></option>",
filterStr = "<option></option>",
tempFilteMap = {};
var nodes = that.LineageHelperRef.getNodes();
if (!_.isEmpty(nodes)) {
_.each(nodes, function(obj) {
searchStr += '<option value="' + obj.guid + '">' + obj.name + "</option>";
if (obj.serviceType && !tempFilteMap[obj.serviceType]) {
tempFilteMap[obj.serviceType] = obj.serviceType;
filterStr += '<option value="' + obj.serviceType + '">' + obj.serviceType + "</option>";
}
});
}
this.ui.typeSearch.html(searchStr);
if (!this.ui.filterServiceType.data("select2")) {
this.ui.filterServiceType.html(filterStr);
}
this.initilizeTypeFilterSearch();
},
initilizeTypeFilterSearch: function() {
var that = this;
this.ui.typeSearch
.select2({
closeOnSelect: true,
placeholder: "Select Node"
})
.on("change.select2", function(e) {
e.stopPropagation();
e.stopImmediatePropagation();
var selectedNode = $('[data-id="typeSearch"]').val();
//that.searchNodeObj.selectedNode = selectedNode;
that.LineageHelperRef.searchNode({ guid: selectedNode });
});
if (!this.ui.filterServiceType.data("select2")) {
this.ui.filterServiceType
.select2({
closeOnSelect: true,
placeholder: "Select ServiceType"
})
.on("change.select2", function(e) {
e.stopPropagation();
e.stopImmediatePropagation();
var selectedNode = $('[data-id="filterServiceType"]').val();
that.filterData(selectedNode);
//that.searchNodeObj.selectedNode = selectedNode;
//that.LineageHelperRef.searchNode({ guid: selectedNode });
});
// if (this.searchNodeObj.selectedNode) {
// this.ui.typeSearch.val(this.searchNodeObj.selectedNode);
// this.ui.typeSearch.trigger("change.select2");
// }
}
}
});
return TypeSystemTreeView;
});
\ No newline at end of file
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
.DS_Store
.bower-*/
.idea/
node_modules/
public/js/libs/
dist
target/
*.log
*.tgz
node/
.npmrc
dist/
!public/js/external_lib/atlas-lineage/dist
\ No newline at end of file
...@@ -94,7 +94,7 @@ module.exports = function(grunt) { ...@@ -94,7 +94,7 @@ module.exports = function(grunt) {
'backgrid-sizeable-columns.js': { 'backgrid-sizeable-columns': 'backgrid-sizeable-columns/js' }, 'backgrid-sizeable-columns.js': { 'backgrid-sizeable-columns': 'backgrid-sizeable-columns/js' },
'Backgrid.ColumnManager.js': { 'backgrid-columnmanager/src': 'backgrid-columnmanager/js' }, 'Backgrid.ColumnManager.js': { 'backgrid-columnmanager/src': 'backgrid-columnmanager/js' },
'jquery-asBreadcrumbs.min.js': { 'jquery-asBreadcrumbs/dist': 'jquery-asBreadcrumbs/js' }, 'jquery-asBreadcrumbs.min.js': { 'jquery-asBreadcrumbs/dist': 'jquery-asBreadcrumbs/js' },
'd3.min.js': { 'd3': 'd3' }, 'd3.min.js': { 'd3/dist': 'd3' },
'index.js': { 'd3-tip': 'd3/' }, 'index.js': { 'd3-tip': 'd3/' },
'dagre-d3.min.js': { 'dagre-d3/dist': 'dagre-d3' }, 'dagre-d3.min.js': { 'dagre-d3/dist': 'dagre-d3' },
'select2.full.min.js': { 'select2/dist/js': 'select2' }, 'select2.full.min.js': { 'select2/dist/js': 'select2' },
...@@ -223,7 +223,7 @@ module.exports = function(grunt) { ...@@ -223,7 +223,7 @@ module.exports = function(grunt) {
build: { build: {
expand: true, expand: true,
cwd: modulesPath, cwd: modulesPath,
src: ['**', '!**/scss/**', "!index.html.tpl"], src: ['**', '!**/scss/**', "!**/atlas-lineage/**", "**/atlas-lineage/dist/**", "!index.html.tpl"],
dest: distPath dest: distPath
} }
}, },
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
} }
}, },
"ajv": { "ajv": {
"version": "6.12.0", "version": "6.12.4",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz",
"integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"fast-deep-equal": "^3.1.1", "fast-deep-equal": "^3.1.1",
...@@ -179,9 +179,9 @@ ...@@ -179,9 +179,9 @@
"dev": true "dev": true
}, },
"aws4": { "aws4": {
"version": "1.9.1", "version": "1.10.1",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz",
"integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==",
"dev": true "dev": true
}, },
"babel-runtime": { "babel-runtime": {
...@@ -512,12 +512,9 @@ ...@@ -512,12 +512,9 @@
} }
}, },
"commander": { "commander": {
"version": "2.9.0", "version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
"requires": {
"graceful-readlink": ">= 1.0.0"
}
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
...@@ -620,9 +617,42 @@ ...@@ -620,9 +617,42 @@
"integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=" "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU="
}, },
"d3": { "d3": {
"version": "3.5.17", "version": "5.14.2",
"resolved": "https://registry.npmjs.org/d3/-/d3-3.5.17.tgz", "resolved": "https://registry.npmjs.org/d3/-/d3-5.14.2.tgz",
"integrity": "sha1-vEZ0gAQ3iyGjYMn8fPUjF5B2L7g=" "integrity": "sha512-Ccipa9XrYW5N0QkP6u0Qb8kU6WekIXBiDenmZm1zLvuq/9pBBhRCJLCICEOsH5Og4B0Xw02bhqGkK5VN/oPH0w==",
"requires": {
"d3-array": "1",
"d3-axis": "1",
"d3-brush": "1",
"d3-chord": "1",
"d3-collection": "1",
"d3-color": "1",
"d3-contour": "1",
"d3-dispatch": "1",
"d3-drag": "1",
"d3-dsv": "1",
"d3-ease": "1",
"d3-fetch": "1",
"d3-force": "1",
"d3-format": "1",
"d3-geo": "1",
"d3-hierarchy": "1",
"d3-interpolate": "1",
"d3-path": "1",
"d3-polygon": "1",
"d3-quadtree": "1",
"d3-random": "1",
"d3-scale": "2",
"d3-scale-chromatic": "1",
"d3-selection": "1",
"d3-shape": "1",
"d3-time": "1",
"d3-time-format": "2",
"d3-timer": "1",
"d3-transition": "1",
"d3-voronoi": "1",
"d3-zoom": "1"
}
}, },
"d3-array": { "d3-array": {
"version": "1.2.4", "version": "1.2.4",
...@@ -635,9 +665,9 @@ ...@@ -635,9 +665,9 @@
"integrity": "sha512-ejINPfPSNdGFKEOAtnBtdkpr24c4d4jsei6Lg98mxf424ivoDP2956/5HDpIAtmHo85lqT4pruy+zEgvRUBqaQ==" "integrity": "sha512-ejINPfPSNdGFKEOAtnBtdkpr24c4d4jsei6Lg98mxf424ivoDP2956/5HDpIAtmHo85lqT4pruy+zEgvRUBqaQ=="
}, },
"d3-brush": { "d3-brush": {
"version": "1.1.5", "version": "1.1.6",
"resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-1.1.5.tgz", "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-1.1.6.tgz",
"integrity": "sha512-rEaJ5gHlgLxXugWjIkolTA0OyMvw8UWU1imYXy1v642XyyswmI1ybKOv05Ft+ewq+TFmdliD3VuK0pRp1VT/5A==", "integrity": "sha512-7RW+w7HfMCPyZLifTz/UnJmI5kdkXtpCbombUSs8xniAyo0vIbrDzDwUJB6eJOgl9u5DQOt2TQlYumxzD1SvYA==",
"requires": { "requires": {
"d3-dispatch": "1", "d3-dispatch": "1",
"d3-drag": "1", "d3-drag": "1",
...@@ -661,9 +691,9 @@ ...@@ -661,9 +691,9 @@
"integrity": "sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A==" "integrity": "sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A=="
}, },
"d3-color": { "d3-color": {
"version": "1.4.0", "version": "1.4.1",
"resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.0.tgz", "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz",
"integrity": "sha512-TzNPeJy2+iEepfiL92LAAB7fvnp/dV2YwANPVHdDWmYMm23qIJBYww3qT8I8C1wXrmrg4UWs7BKc2tKIgyjzHg==" "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q=="
}, },
"d3-contour": { "d3-contour": {
"version": "1.3.2", "version": "1.3.2",
...@@ -698,14 +728,14 @@ ...@@ -698,14 +728,14 @@
} }
}, },
"d3-ease": { "d3-ease": {
"version": "1.0.6", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.6.tgz", "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz",
"integrity": "sha512-SZ/lVU7LRXafqp7XtIcBdxnWl8yyLpgOmzAk0mWBI9gXNzLDx5ybZgnRbH9dN/yY5tzVBqCQ9avltSnqVwessQ==" "integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ=="
}, },
"d3-fetch": { "d3-fetch": {
"version": "1.1.2", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-1.1.2.tgz", "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-1.2.0.tgz",
"integrity": "sha512-S2loaQCV/ZeyTyIF2oP8D1K9Z4QizUzW7cWeAOAS4U88qOt3Ucf6GsmgthuYSdyB2HyEm4CeGvkQxWsmInsIVA==", "integrity": "sha512-yC78NBVcd2zFAyR/HnUiBS7Lf6inSCoWcSxFfw8FYL7ydiqe80SazNwoffcqOfs95XaLo7yebsmQqDKSsXUtvA==",
"requires": { "requires": {
"d3-dsv": "1" "d3-dsv": "1"
} }
...@@ -722,14 +752,14 @@ ...@@ -722,14 +752,14 @@
} }
}, },
"d3-format": { "d3-format": {
"version": "1.4.4", "version": "1.4.5",
"resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.4.tgz", "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.5.tgz",
"integrity": "sha512-TWks25e7t8/cqctxCmxpUuzZN11QxIA7YrMbram94zMQ0PXjE4LVIMe/f6a4+xxL8HQ3OsAFULOINQi1pE62Aw==" "integrity": "sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ=="
}, },
"d3-geo": { "d3-geo": {
"version": "1.11.9", "version": "1.12.1",
"resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.11.9.tgz", "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.12.1.tgz",
"integrity": "sha512-9edcH6J3s/Aa3KJITWqFJbyB/8q3mMlA9Fi7z6yy+FAYMnRaxmC7jBhUnsINxVWD14GmqX3DK8uk7nV6/Ekt4A==", "integrity": "sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg==",
"requires": { "requires": {
"d3-array": "1" "d3-array": "1"
} }
...@@ -790,9 +820,9 @@ ...@@ -790,9 +820,9 @@
} }
}, },
"d3-selection": { "d3-selection": {
"version": "1.4.1", "version": "1.4.2",
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.1.tgz", "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz",
"integrity": "sha512-BTIbRjv/m5rcVTfBs4AMBLKs4x8XaaLkwm28KWu9S2vKNqXkXt2AH2Qf0sdPZHjFxcWg/YL53zcqAz+3g4/7PA==" "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg=="
}, },
"d3-shape": { "d3-shape": {
"version": "1.3.7", "version": "1.3.7",
...@@ -808,9 +838,9 @@ ...@@ -808,9 +838,9 @@
"integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==" "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA=="
}, },
"d3-time-format": { "d3-time-format": {
"version": "2.2.3", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.2.3.tgz", "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz",
"integrity": "sha512-RAHNnD8+XvC4Zc4d2A56Uw0yJoM7bsvOlJR33bclxq399Rak/b9bhvu/InjxdWhPtkgU53JJcleJTGkNRnN6IA==", "integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==",
"requires": { "requires": {
"d3-time": "1" "d3-time": "1"
} }
...@@ -826,6 +856,13 @@ ...@@ -826,6 +856,13 @@
"integrity": "sha1-5bRJGuiYP95kbqSQCP9UKgM8Ciw=", "integrity": "sha1-5bRJGuiYP95kbqSQCP9UKgM8Ciw=",
"requires": { "requires": {
"d3": "^3.5.5" "d3": "^3.5.5"
},
"dependencies": {
"d3": {
"version": "3.5.17",
"resolved": "https://registry.npmjs.org/d3/-/d3-3.5.17.tgz",
"integrity": "sha1-vEZ0gAQ3iyGjYMn8fPUjF5B2L7g="
}
} }
}, },
"d3-transition": { "d3-transition": {
...@@ -876,46 +913,6 @@ ...@@ -876,46 +913,6 @@
"dagre": "^0.8.5", "dagre": "^0.8.5",
"graphlib": "^2.1.8", "graphlib": "^2.1.8",
"lodash": "^4.17.15" "lodash": "^4.17.15"
},
"dependencies": {
"d3": {
"version": "5.15.1",
"resolved": "https://registry.npmjs.org/d3/-/d3-5.15.1.tgz",
"integrity": "sha512-Xu9gT6Lm0jH3wWJJSRomFwqnGGi3YAfWIfxNFl4++YVgYOjo3F8V2idAG3nJBgpZOkD0/RHPZX6F4k6tzgOvYw==",
"requires": {
"d3-array": "1",
"d3-axis": "1",
"d3-brush": "1",
"d3-chord": "1",
"d3-collection": "1",
"d3-color": "1",
"d3-contour": "1",
"d3-dispatch": "1",
"d3-drag": "1",
"d3-dsv": "1",
"d3-ease": "1",
"d3-fetch": "1",
"d3-force": "1",
"d3-format": "1",
"d3-geo": "1",
"d3-hierarchy": "1",
"d3-interpolate": "1",
"d3-path": "1",
"d3-polygon": "1",
"d3-quadtree": "1",
"d3-random": "1",
"d3-scale": "2",
"d3-scale-chromatic": "1",
"d3-selection": "1",
"d3-shape": "1",
"d3-time": "1",
"d3-time-format": "2",
"d3-timer": "1",
"d3-transition": "1",
"d3-voronoi": "1",
"d3-zoom": "1"
}
}
} }
}, },
"dashdash": { "dashdash": {
...@@ -1108,9 +1105,9 @@ ...@@ -1108,9 +1105,9 @@
"dev": true "dev": true
}, },
"fast-deep-equal": { "fast-deep-equal": {
"version": "3.1.1", "version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true "dev": true
}, },
"fast-json-stable-stringify": { "fast-json-stable-stringify": {
...@@ -1312,13 +1309,13 @@ ...@@ -1312,13 +1309,13 @@
} }
}, },
"globule": { "globule": {
"version": "1.3.1", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/globule/-/globule-1.3.1.tgz", "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.2.tgz",
"integrity": "sha512-OVyWOHgw29yosRHCHo7NncwR1hW5ew0W/UrvtwvjefVJeQ26q4/8r8FmPsSF1hJ93IgWkyv16pCTz6WblMzm/g==", "integrity": "sha512-7IDTQTIu2xzXkT+6mlluidnWo+BypnbSoEVVQCGfzqnl5Ik8d3e1d4wycb8Rj9tWW+Z39uPWsdlquqiqPCd/pA==",
"dev": true, "dev": true,
"requires": { "requires": {
"glob": "~7.1.1", "glob": "~7.1.1",
"lodash": "~4.17.12", "lodash": "~4.17.10",
"minimatch": "~3.0.2" "minimatch": "~3.0.2"
}, },
"dependencies": { "dependencies": {
...@@ -1339,15 +1336,16 @@ ...@@ -1339,15 +1336,16 @@
} }
}, },
"graceful-fs": { "graceful-fs": {
"version": "4.2.3", "version": "4.2.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
"integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
"dev": true "dev": true
}, },
"graceful-readlink": { "graceful-readlink": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
"integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=",
"dev": true
}, },
"graphlib": { "graphlib": {
"version": "2.1.8", "version": "2.1.8",
...@@ -1695,12 +1693,12 @@ ...@@ -1695,12 +1693,12 @@
"dev": true "dev": true
}, },
"har-validator": { "har-validator": {
"version": "5.1.3", "version": "5.1.5",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
"integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
"dev": true, "dev": true,
"requires": { "requires": {
"ajv": "^6.5.5", "ajv": "^6.12.3",
"har-schema": "^2.0.0" "har-schema": "^2.0.0"
} }
}, },
...@@ -1763,6 +1761,17 @@ ...@@ -1763,6 +1761,17 @@
"param-case": "2.1.x", "param-case": "2.1.x",
"relateurl": "0.2.x", "relateurl": "0.2.x",
"uglify-js": "2.7.x" "uglify-js": "2.7.x"
},
"dependencies": {
"commander": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz",
"integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=",
"dev": true,
"requires": {
"graceful-readlink": ">= 1.0.0"
}
}
} }
}, },
"http-errors": { "http-errors": {
...@@ -1792,9 +1801,9 @@ ...@@ -1792,9 +1801,9 @@
} }
}, },
"http-parser-js": { "http-parser-js": {
"version": "0.4.10", "version": "0.5.2",
"resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.10.tgz", "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.2.tgz",
"integrity": "sha1-ksnBN0w1CF912zWexWzCV8u5P6Q=", "integrity": "sha512-opCO9ASqg5Wy2FNo7A0sxy71yGbbkJJXLdgMK04Tcypw9jr2MgWbyubb0+WdmDmGnFflO7fRbqbaihh/ENDlRQ==",
"dev": true "dev": true
}, },
"http-signature": { "http-signature": {
...@@ -1970,9 +1979,9 @@ ...@@ -1970,9 +1979,9 @@
"integrity": "sha1-DO7gsNLkkUOYGtEg1FjtVuqOGSQ=" "integrity": "sha1-DO7gsNLkkUOYGtEg1FjtVuqOGSQ="
}, },
"js-base64": { "js-base64": {
"version": "2.5.2", "version": "2.6.4",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.2.tgz", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz",
"integrity": "sha512-Vg8czh0Q7sFBSUMWWArX/miJeBWYBPpdU/3M/DKSaekLMqrqVPaedp+5mZhie/r0lgrcaYBfwXatEew6gwgiQQ==", "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==",
"dev": true "dev": true
}, },
"js-yaml": { "js-yaml": {
...@@ -2093,9 +2102,9 @@ ...@@ -2093,9 +2102,9 @@
} }
}, },
"lodash": { "lodash": {
"version": "4.17.15", "version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
}, },
"longest": { "longest": {
"version": "1.0.1", "version": "1.0.1",
...@@ -2204,18 +2213,18 @@ ...@@ -2204,18 +2213,18 @@
"dev": true "dev": true
}, },
"mime-db": { "mime-db": {
"version": "1.43.0", "version": "1.44.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
"integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==",
"dev": true "dev": true
}, },
"mime-types": { "mime-types": {
"version": "2.1.26", "version": "2.1.27",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
"integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
"dev": true, "dev": true,
"requires": { "requires": {
"mime-db": "1.43.0" "mime-db": "1.44.0"
} }
}, },
"minimatch": { "minimatch": {
...@@ -2287,9 +2296,9 @@ ...@@ -2287,9 +2296,9 @@
} }
}, },
"nan": { "nan": {
"version": "2.14.0", "version": "2.14.1",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz",
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==",
"dev": true "dev": true
}, },
"ncname": { "ncname": {
...@@ -2695,9 +2704,9 @@ ...@@ -2695,9 +2704,9 @@
"dev": true "dev": true
}, },
"qs": { "qs": {
"version": "6.9.3", "version": "6.9.4",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.9.3.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz",
"integrity": "sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==", "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==",
"dev": true "dev": true
}, },
"range-parser": { "range-parser": {
...@@ -2855,9 +2864,9 @@ ...@@ -2855,9 +2864,9 @@
"integrity": "sha1-ExOHM2E/xEV7fhJH6Mt1HfeqVCk=" "integrity": "sha1-ExOHM2E/xEV7fhJH6Mt1HfeqVCk="
}, },
"resolve": { "resolve": {
"version": "1.16.0", "version": "1.17.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.16.0.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
"integrity": "sha512-LarL/PIKJvc09k1jaeT4kQb/8/7P+qV4qSnN2K80AES+OHdfZELAKVOBjxsvtToT/uLOfFbvYvKfZmV8cee7nA==", "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
"dev": true, "dev": true,
"requires": { "requires": {
"path-parse": "^1.0.6" "path-parse": "^1.0.6"
...@@ -2940,9 +2949,9 @@ ...@@ -2940,9 +2949,9 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
}, },
"sass-graph": { "sass-graph": {
"version": "2.2.4", "version": "2.2.6",
"resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.6.tgz",
"integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", "integrity": "sha512-MKuEYXFSGuRSi8FZ3A7imN1CeVn9Gpw0/SFJKdL1ejXJneI9a5rwlEZrKejhEFAA3O6yr3eIyl/WuvASvlT36g==",
"dev": true, "dev": true,
"requires": { "requires": {
"glob": "^7.0.0", "glob": "^7.0.0",
...@@ -2969,9 +2978,9 @@ ...@@ -2969,9 +2978,9 @@
} }
}, },
"yargs": { "yargs": {
"version": "7.1.0", "version": "7.1.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.1.tgz",
"integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", "integrity": "sha512-huO4Fr1f9PmiJJdll5kwoS2e4GqzGSsMT3PPMpOwoVkOK8ckqAewMTZyA6LXVQWflleb/Z8oPBEvNsMft0XE+g==",
"dev": true, "dev": true,
"requires": { "requires": {
"camelcase": "^3.0.0", "camelcase": "^3.0.0",
...@@ -2986,7 +2995,7 @@ ...@@ -2986,7 +2995,7 @@
"string-width": "^1.0.2", "string-width": "^1.0.2",
"which-module": "^1.0.0", "which-module": "^1.0.0",
"y18n": "^3.2.1", "y18n": "^3.2.1",
"yargs-parser": "^5.0.0" "yargs-parser": "5.0.0-security.0"
} }
} }
} }
...@@ -3133,9 +3142,9 @@ ...@@ -3133,9 +3142,9 @@
"dev": true "dev": true
}, },
"spdx-correct": { "spdx-correct": {
"version": "3.1.0", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
"integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==",
"dev": true, "dev": true,
"requires": { "requires": {
"spdx-expression-parse": "^3.0.0", "spdx-expression-parse": "^3.0.0",
...@@ -3143,15 +3152,15 @@ ...@@ -3143,15 +3152,15 @@
} }
}, },
"spdx-exceptions": { "spdx-exceptions": {
"version": "2.2.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
"integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==",
"dev": true "dev": true
}, },
"spdx-expression-parse": { "spdx-expression-parse": {
"version": "3.0.0", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
"integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"spdx-exceptions": "^2.1.0", "spdx-exceptions": "^2.1.0",
...@@ -3444,9 +3453,9 @@ ...@@ -3444,9 +3453,9 @@
"dev": true "dev": true
}, },
"uri-js": { "uri-js": {
"version": "4.2.2", "version": "4.4.0",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz",
"integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==",
"dev": true, "dev": true,
"requires": { "requires": {
"punycode": "^2.1.0" "punycode": "^2.1.0"
...@@ -3498,20 +3507,20 @@ ...@@ -3498,20 +3507,20 @@
} }
}, },
"websocket-driver": { "websocket-driver": {
"version": "0.7.3", "version": "0.7.4",
"resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.3.tgz", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz",
"integrity": "sha512-bpxWlvbbB459Mlipc5GBzzZwhoZgGEZLuqPaR0INBGnPAY1vdBX6hPnoFXiw+3yWxDuHyQjO2oXTMyS8A5haFg==", "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==",
"dev": true, "dev": true,
"requires": { "requires": {
"http-parser-js": ">=0.4.0 <0.4.11", "http-parser-js": ">=0.5.1",
"safe-buffer": ">=5.1.0", "safe-buffer": ">=5.1.0",
"websocket-extensions": ">=0.1.1" "websocket-extensions": ">=0.1.1"
} }
}, },
"websocket-extensions": { "websocket-extensions": {
"version": "0.1.3", "version": "0.1.4",
"resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz",
"integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==", "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==",
"dev": true "dev": true
}, },
"which": { "which": {
...@@ -3605,12 +3614,13 @@ ...@@ -3605,12 +3614,13 @@
} }
}, },
"yargs-parser": { "yargs-parser": {
"version": "5.0.0", "version": "5.0.0-security.0",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0-security.0.tgz",
"integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", "integrity": "sha512-T69y4Ps64LNesYxeYGYPvfoMTt/7y1XtfpIslUeK4um+9Hu7hlGoRtaDLvdXb7+/tfq4opVa2HRY5xGip022rQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"camelcase": "^3.0.0" "camelcase": "^3.0.0",
"object.assign": "^4.1.0"
}, },
"dependencies": { "dependencies": {
"camelcase": { "camelcase": {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"backgrid-sizeable-columns": "0.1.1", "backgrid-sizeable-columns": "0.1.1",
"bootstrap": "3.3.7", "bootstrap": "3.3.7",
"bootstrap-daterangepicker": "3.1.0", "bootstrap-daterangepicker": "3.1.0",
"d3": "3.5.17", "d3": "5.14.2",
"d3-tip": "0.6.8", "d3-tip": "0.6.8",
"dagre-d3": "0.6.4", "dagre-d3": "0.6.4",
"dropzone": "5.7.0", "dropzone": "5.7.0",
......
...@@ -16,180 +16,12 @@ ...@@ -16,180 +16,12 @@
/* graph.scss */ /* graph.scss */
.node {
cursor: pointer;
text {
font-size: 10px;
font-family: $font_1;
}
//transition: opacity 0.3s linear;
rect {
stroke: $color_mountain_mist_approx;
fill: $white;
stroke-width: 1.5px;
&.serach-rect {
stroke: $color_keppel_approx;
fill: transparent;
stroke-width: 2.5px
}
}
.label {
fill: $color_suva_gray_approx;
&.highlight {
cursor: pointer;
fill: $color_havelock_blue_approx;
text-decoration: underline;
tspan {
font-weight: 400;
}
}
}
circle {
-moz-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
stroke-width: 1.5px;
&.node-detail-highlight {
stroke: $color_havelock_blue_approx;
stroke-width: 2px;
}
&.nodeImage {
&.green:hover {
stroke: #ffb203;
}
&.blue:hover {
stroke: #4b91e2;
}
&.currentNode {
stroke: #fb4200;
}
&:hover {
-moz-transform: scale(1.4);
-webkit-transform: scale(1.4);
transform: scale(1.4);
}
}
}
&.active {
circle {
-moz-transform: scale(1.4);
-webkit-transform: scale(1.4);
transform: scale(1.4);
&.nodeImage {
&.green {
stroke: #ffb203;
}
&.blue {
stroke: #4b91e2;
}
}
}
}
}
.invisible { .invisible {
.node circle { .node circle {
transition: all 0s; transition: all 0s;
} }
} }
.edgePath {
.path {
cursor: pointer;
}
}
.overlay {}
.link {
fill: none;
stroke: $color_celeste_approx;
stroke-width: 1.5px;
}
.d3-tip {
line-height: 1;
font-weight: bold;
padding: 12px;
background: $black_80;
color: $white;
z-index: 999;
max-width: 300px; //Instead of the line below you could use @include border-radius($radius, $vertical-radius)
border-radius: 2px;
.tip-inner-scroll {
overflow: auto;
max-height: 300px;
}
/* Creates a small triangle extender for the tooltip */
&:after {
box-sizing: border-box;
display: inline;
font-size: 10px;
width: 100%;
line-height: 1;
color: rgba(0, 0, 0, 0.8);
position: absolute;
}
/* Nrthward tooltips */
&.n:after {
content: "\25BC";
margin: -1px 0 0 0;
top: 100%;
left: 0;
text-align: center;
}
/* Eastward tooltips */
&.e:after {
content: "\25C0";
margin: -4px 0 0 0;
top: 50%;
left: -8px;
}
/* Southward tooltips */
&.s:after {
content: "\25B2";
margin: 0 0 1px 0;
top: -8px;
left: 0;
text-align: center;
}
/* Westward tooltips */
&.w:after {
content: "\25B6";
margin: -4px 0 0 -1px;
top: 50%;
left: 100%;
}
}
g.type-TK>rect {
fill: $color_bright_turquoise_approx;
}
.graph-toolbar { .graph-toolbar {
background-color: $white; background-color: $white;
margin-bottom: 10px; margin-bottom: 10px;
...@@ -199,7 +31,7 @@ g.type-TK>rect { ...@@ -199,7 +31,7 @@ g.type-TK>rect {
.legends { .legends {
>i { >i {
>span { >span {
font-family: 'Source Sans Pro'; font-family: "Source Sans Pro";
} }
} }
} }
...@@ -357,7 +189,7 @@ span#zoom_in { ...@@ -357,7 +189,7 @@ span#zoom_in {
} }
.active.fullscreen-mode { .active.fullscreen-mode {
position: fixed; position: fixed !important;
height: 100% !important; height: 100% !important;
top: 0; top: 0;
bottom: 0; bottom: 0;
...@@ -367,6 +199,11 @@ span#zoom_in { ...@@ -367,6 +199,11 @@ span#zoom_in {
padding: 0 !important; padding: 0 !important;
z-index: 9999; z-index: 9999;
overflow: hidden !important; overflow: hidden !important;
background: white;
.systemTypeTree {
height: 100vh !important;
}
.resizeGraph { .resizeGraph {
position: fixed; position: fixed;
...@@ -386,40 +223,6 @@ span#zoom_in { ...@@ -386,40 +223,6 @@ span#zoom_in {
} }
} }
@keyframes zoominoutsinglefeatured {
0% {
transform: scale(1, 1);
}
50% {
transform: scale(1.2, 1.2);
}
100% {
transform: scale(1, 1);
}
}
.wobble {
animation: zoominoutsinglefeatured 1s 5;
}
.hover {
g.node {
opacity: 0.1 !important;
}
g.edgePath {
opacity: 0 !important;
}
g.node.hover-active,
g.edgePath.hover-active-node {
opacity: 1 !important;
}
}
.lineage-node-detail { .lineage-node-detail {
.table-quickMenu { .table-quickMenu {
td:nth-child(1n) { td:nth-child(1n) {
...@@ -461,4 +264,17 @@ span#zoom_in { ...@@ -461,4 +264,17 @@ span#zoom_in {
to { to {
opacity: 0.5; opacity: 0.5;
} }
}
.mini-map-type-system {
background: white;
width: 200px;
position: absolute;
bottom: 5px;
right: 5px;
&>svg {
box-shadow: 0px 0px 3px 1px #80808080;
}
} }
\ No newline at end of file
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
<link href="js/libs/dropzone/css/dropzone.css?bust=<%- bust %>" rel="stylesheet"> <link href="js/libs/dropzone/css/dropzone.css?bust=<%- bust %>" rel="stylesheet">
<link href="js/libs/jstree/css/default/default-theme.min.css?bust=<%- bust %>" rel="stylesheet" /> <link href="js/libs/jstree/css/default/default-theme.min.css?bust=<%- bust %>" rel="stylesheet" />
<link href="js/libs/pretty-checkbox/css/pretty-checkbox.min.css?bust=<%- bust %>" rel="stylesheet" /> <link href="js/libs/pretty-checkbox/css/pretty-checkbox.min.css?bust=<%- bust %>" rel="stylesheet" />
<link href="js/external_lib/atlas-lineage/dist/styles.css?bust=<%- bust %>" rel="stylesheet">
<link href="css/style.css?bust=<%- bust %>" rel="stylesheet" /> <link href="css/style.css?bust=<%- bust %>" rel="stylesheet" />
</head> </head>
......
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=======================================================================
\ No newline at end of file
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("platform"),require("dagreD3")):"function"==typeof define&&define.amd?define(["platform","dagreD3"],e):"object"==typeof exports?exports.LineageHelper=e(require("platform"),require("dagreD3")):t.LineageHelper=e(t.platform,t.dagreD3)}(window,(function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([,function(e,n){e.exports=t},function(t,n){t.exports=e},,,,,,,function(t,e,n){},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return Dr}));var r=n(2),i=n.n(r);function o(){}var a=function(t){return null==t?o:function(){return this.querySelector(t)}};function s(){return[]}var u=function(t){return null==t?s:function(){return this.querySelectorAll(t)}},l=function(t){return function(){return this.matches(t)}},c=function(t){return new Array(t.length)};function h(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}h.prototype={constructor:h,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function f(t,e,n,r,i,o){for(var a,s=0,u=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new h(t,o[s]);for(;s<u;++s)(a=e[s])&&(i[s]=a)}function p(t,e,n,r,i,o,a){var s,u,l,c={},f=e.length,p=o.length,d=new Array(f);for(s=0;s<f;++s)(u=e[s])&&(d[s]=l="$"+a.call(u,u.__data__,s,e),l in c?i[s]=u:c[l]=u);for(s=0;s<p;++s)(u=c[l="$"+a.call(t,o[s],s,o)])?(r[s]=u,u.__data__=o[s],c[l]=null):n[s]=new h(t,o[s]);for(s=0;s<f;++s)(u=e[s])&&c[d[s]]===u&&(i[s]=u)}function d(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var g="http://www.w3.org/1999/xhtml",v={svg:"http://www.w3.org/2000/svg",xhtml:g,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},y=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),v.hasOwnProperty(e)?{space:v[e],local:t}:t};function m(t){return function(){this.removeAttribute(t)}}function _(t){return function(){this.removeAttributeNS(t.space,t.local)}}function w(t,e){return function(){this.setAttribute(t,e)}}function b(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function x(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function E(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var k=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function T(t){return function(){this.style.removeProperty(t)}}function S(t,e,n){return function(){this.style.setProperty(t,e,n)}}function N(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function O(t,e){return t.style.getPropertyValue(e)||k(t).getComputedStyle(t,null).getPropertyValue(e)}function P(t){return function(){delete this[t]}}function A(t,e){return function(){this[t]=e}}function M(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function z(t){return t.trim().split(/^|\s+/)}function j(t){return t.classList||new D(t)}function D(t){this._node=t,this._names=z(t.getAttribute("class")||"")}function C(t,e){for(var n=j(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function L(t,e){for(var n=j(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function B(t){return function(){C(this,t)}}function R(t){return function(){L(this,t)}}function I(t,e){return function(){(e.apply(this,arguments)?C:L)(this,t)}}D.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function G(){this.textContent=""}function q(t){return function(){this.textContent=t}}function U(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function H(){this.innerHTML=""}function F(t){return function(){this.innerHTML=t}}function V(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function X(){this.nextSibling&&this.parentNode.appendChild(this)}function Y(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Z(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===g&&e.documentElement.namespaceURI===g?e.createElement(t):e.createElementNS(n,t)}}function W(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var K=function(t){var e=y(t);return(e.local?W:Z)(e)};function Q(){return null}function J(){var t=this.parentNode;t&&t.removeChild(this)}function tt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function et(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var nt={},rt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(nt={mouseenter:"mouseover",mouseleave:"mouseout"}));function it(t,e,n){return t=ot(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function ot(t,e,n){return function(r){var i=rt;rt=r;try{t.call(this,this.__data__,e,n)}finally{rt=i}}}function at(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function st(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r<o;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?e.length=i:delete this.__on}}}function ut(t,e,n){var r=nt.hasOwnProperty(t.type)?it:ot;return function(i,o,a){var s,u=this.__on,l=r(e,o,a);if(u)for(var c=0,h=u.length;c<h;++c)if((s=u[c]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=l,s.capture=n),void(s.value=e);this.addEventListener(t.type,l,n),s={type:t.type,name:t.name,value:e,listener:l,capture:n},u?u.push(s):this.__on=[s]}}function lt(t,e,n,r){var i=rt;t.sourceEvent=rt,rt=t;try{return e.apply(n,r)}finally{rt=i}}function ct(t,e,n){var r=k(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function ht(t,e){return function(){return ct(this,t,e)}}function ft(t,e){return function(){return ct(this,t,e.apply(this,arguments))}}var pt=[null];function dt(t,e){this._groups=t,this._parents=e}function gt(){return new dt([[document.documentElement]],pt)}dt.prototype=gt.prototype={constructor:dt,select:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,s,u=e[i],l=u.length,c=r[i]=new Array(l),h=0;h<l;++h)(o=u[h])&&(s=t.call(o,o.__data__,h,u))&&("__data__"in o&&(s.__data__=o.__data__),c[h]=s);return new dt(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=u(t));for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a,s=e[o],l=s.length,c=0;c<l;++c)(a=s[c])&&(r.push(t.call(a,a.__data__,c,s)),i.push(a));return new dt(r,i)},filter:function(t){"function"!=typeof t&&(t=l(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a=e[i],s=a.length,u=r[i]=[],c=0;c<s;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&u.push(o);return new dt(r,this._parents)},data:function(t,e){if(!t)return v=new Array(this.size()),c=-1,this.each((function(t){v[++c]=t})),v;var n,r=e?p:f,i=this._parents,o=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=o.length,s=new Array(a),u=new Array(a),l=new Array(a),c=0;c<a;++c){var h=i[c],d=o[c],g=d.length,v=t.call(h,h&&h.__data__,c,i),y=v.length,m=u[c]=new Array(y),_=s[c]=new Array(y);r(h,d,m,_,l[c]=new Array(g),v,e);for(var w,b,x=0,E=0;x<y;++x)if(w=m[x]){for(x>=E&&(E=x+1);!(b=_[E])&&++E<y;);w._next=b||null}}return(s=new dt(s,i))._enter=u,s._exit=l,s},enter:function(){return new dt(this._enter||this._groups.map(c),this._parents)},exit:function(){return new dt(this._exit||this._groups.map(c),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(i=e(i)),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u,l=e[s],c=n[s],h=l.length,f=a[s]=new Array(h),p=0;p<h;++p)(u=l[p]||c[p])&&(f[p]=u);for(;s<r;++s)a[s]=e[s];return new dt(a,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=d);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a,s=n[o],u=s.length,l=i[o]=new Array(u),c=0;c<u;++c)(a=s[c])&&(l[c]=a);l.sort(e)}return new dt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,o=e[n],a=0,s=o.length;a<s;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,e){var n=y(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?_:m:"function"==typeof e?n.local?E:x:n.local?b:w)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?T:"function"==typeof e?N:S)(t,e,null==n?"":n)):O(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?P:"function"==typeof e?M:A)(t,e)):this.node()[t]},classed:function(t,e){var n=z(t+"");if(arguments.length<2){for(var r=j(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?I:e?B:R)(n,e))},text:function(t){return arguments.length?this.each(null==t?G:("function"==typeof t?U:q)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?H:("function"==typeof t?V:F)(t)):this.node().innerHTML},raise:function(){return this.each(X)},lower:function(){return this.each(Y)},append:function(t){var e="function"==typeof t?t:K(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:K(t),r=null==e?Q:"function"==typeof e?e:a(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(J)},clone:function(t){return this.select(t?et:tt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,o=at(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?ut:st,null==n&&(n=!1),r=0;r<a;++r)this.each(s(o[r],e,n));return this}var s=this.node().__on;if(s)for(var u,l=0,c=s.length;l<c;++l)for(r=0,u=s[l];r<a;++r)if((i=o[r]).type===u.type&&i.name===u.name)return u.value},dispatch:function(t,e){return this.each(("function"==typeof e?ft:ht)(t,e))}};var vt=gt,yt=function(t){return"string"==typeof t?new dt([[document.querySelector(t)]],[document.documentElement]):new dt([[t]],pt)};function mt(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function _t(t){this._context=t}_t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:mt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:mt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var wt=function(t){return new _t(t)},bt={value:function(){}};function xt(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new Et(r)}function Et(t){this._=t}function kt(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Tt(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function St(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=bt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}Et.prototype=xt.prototype={constructor:Et,on:function(t,e){var n,r=this._,i=kt(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=St(r[n],t.name,e);else if(null==e)for(n in r)r[n]=St(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=Tt(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Et(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var Nt=xt;function Ot(){rt.stopImmediatePropagation()}var Pt=function(){rt.preventDefault(),rt.stopImmediatePropagation()},At=function(t){var e=t.document.documentElement,n=yt(t).on("dragstart.drag",Pt,!0);"onselectstart"in e?n.on("selectstart.drag",Pt,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")};function Mt(t,e){var n=t.document.documentElement,r=yt(t).on("dragstart.drag",null);e&&(r.on("click.drag",Pt,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var zt=Math.SQRT2;function jt(t){return((t=Math.exp(t))+1/t)/2}var Dt,Ct,Lt=function(t,e){var n,r,i=t[0],o=t[1],a=t[2],s=e[0],u=e[1],l=e[2],c=s-i,h=u-o,f=c*c+h*h;if(f<1e-12)r=Math.log(l/a)/zt,n=function(t){return[i+t*c,o+t*h,a*Math.exp(zt*t*r)]};else{var p=Math.sqrt(f),d=(l*l-a*a+4*f)/(2*a*2*p),g=(l*l-a*a-4*f)/(2*l*2*p),v=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(g*g+1)-g);r=(y-v)/zt,n=function(t){var e,n=t*r,s=jt(v),u=a/(2*p)*(s*(e=zt*n+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[i+u*c,o+u*h,a*s/jt(zt*n+v)]}}return n.duration=1e3*r,n},Bt=function(){for(var t,e=rt;t=e.sourceEvent;)e=t;return e},Rt=function(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]},It=function(t){var e=Bt();return e.changedTouches&&(e=e.changedTouches[0]),Rt(t,e)},Gt=function(t,e,n){arguments.length<3&&(n=e,e=Bt().changedTouches);for(var r,i=0,o=e?e.length:0;i<o;++i)if((r=e[i]).identifier===n)return Rt(t,r);return null},qt=0,Ut=0,Ht=0,$t=0,Ft=0,Vt=0,Xt="object"==typeof performance&&performance.now?performance:Date,Yt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Zt(){return Ft||(Yt(Wt),Ft=Xt.now()+Vt)}function Wt(){Ft=0}function Kt(){this._call=this._time=this._next=null}function Qt(t,e,n){var r=new Kt;return r.restart(t,e,n),r}function Jt(){Ft=($t=Xt.now())+Vt,qt=Ut=0;try{!function(){Zt(),++qt;for(var t,e=Dt;e;)(t=Ft-e._time)>=0&&e._call.call(null,t),e=e._next;--qt}()}finally{qt=0,function(){var t,e,n=Dt,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Dt=e);Ct=t,ee(r)}(),Ft=0}}function te(){var t=Xt.now(),e=t-$t;e>1e3&&(Vt-=e,$t=t)}function ee(t){qt||(Ut&&(Ut=clearTimeout(Ut)),t-Ft>24?(t<1/0&&(Ut=setTimeout(Jt,t-Xt.now()-Vt)),Ht&&(Ht=clearInterval(Ht))):(Ht||($t=Xt.now(),Ht=setInterval(te,1e3)),qt=1,Yt(Jt)))}Kt.prototype=Qt.prototype={constructor:Kt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Zt():+n)+(null==e?0:+e),this._next||Ct===this||(Ct?Ct._next=this:Dt=this,Ct=this),this._call=t,this._time=n,ee()},stop:function(){this._call&&(this._call=null,this._time=1/0,ee())}};var ne=function(t,e,n){var r=new Kt;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r},re=Nt("start","end","cancel","interrupt"),ie=[],oe=function(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(u){var l,c,h,f;if(1!==n.state)return s();for(l in i)if((f=i[l]).name===n.name){if(3===f.state)return ne(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[l]):+l<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[l])}if(ne((function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(u))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(h=n.tween.length),l=0,c=-1;l<h;++l)(f=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(r[++c]=f);r.length=c+1}}function a(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(s),n.state=5,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=Qt((function(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:i,on:re,tween:ie,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})};function ae(t,e){var n=ue(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function se(t,e){var n=ue(t,e);if(n.state>3)throw new Error("too late; already running");return n}function ue(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var le,ce,he,fe,pe=function(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):a=!1;a&&delete t.__transition}},de=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},ge=180/Math.PI,ve={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},ye=function(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*ge,skewX:Math.atan(u)*ge,scaleX:a,scaleY:s}};function me(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var s=[],u=[];return o=t(o),a=t(a),function(t,r,i,o,a,s){if(t!==i||r!==o){var u=a.push("translate(",null,e,null,n);s.push({i:u-4,x:de(t,i)},{i:u-2,x:de(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,s,u),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:de(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,u),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:de(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,u),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:de(t,n)},{i:s-2,x:de(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,n=-1,r=u.length;++n<r;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var _e=me((function(t){return"none"===t?ve:(le||(le=document.createElement("DIV"),ce=document.documentElement,he=document.defaultView),le.style.transform=t,t=he.getComputedStyle(ce.appendChild(le),null).getPropertyValue("transform"),ce.removeChild(le),t=t.slice(7,-1).split(","),ye(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),we=me((function(t){return null==t?ve:(fe||(fe=document.createElementNS("http://www.w3.org/2000/svg","g")),fe.setAttribute("transform",t),(t=fe.transform.baseVal.consolidate())?(t=t.matrix,ye(t.a,t.b,t.c,t.d,t.e,t.f)):ve)}),", ",")",")");function be(t,e){var n,r;return function(){var i=se(this,t),o=i.tween;if(o!==n)for(var a=0,s=(r=n=o).length;a<s;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}i.tween=r}}function xe(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var o=se(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}o.tween=i}}function Ee(t,e,n){var r=t._id;return t.each((function(){var t=se(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return ue(t,r).value[e]}}var ke=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function Te(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Se(){}var Ne="\\s*([+-]?\\d+)\\s*",Oe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Pe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ae=/^#([0-9a-f]{3,8})$/,Me=new RegExp("^rgb\\("+[Ne,Ne,Ne]+"\\)$"),ze=new RegExp("^rgb\\("+[Pe,Pe,Pe]+"\\)$"),je=new RegExp("^rgba\\("+[Ne,Ne,Ne,Oe]+"\\)$"),De=new RegExp("^rgba\\("+[Pe,Pe,Pe,Oe]+"\\)$"),Ce=new RegExp("^hsl\\("+[Oe,Pe,Pe]+"\\)$"),Le=new RegExp("^hsla\\("+[Oe,Pe,Pe,Oe]+"\\)$"),Be={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Re(){return this.rgb().formatHex()}function Ie(){return this.rgb().formatRgb()}function Ge(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ae.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?qe(e):3===n?new Fe(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Ue(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Ue(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Me.exec(t))?new Fe(e[1],e[2],e[3],1):(e=ze.exec(t))?new Fe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=je.exec(t))?Ue(e[1],e[2],e[3],e[4]):(e=De.exec(t))?Ue(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ce.exec(t))?Ze(e[1],e[2]/100,e[3]/100,1):(e=Le.exec(t))?Ze(e[1],e[2]/100,e[3]/100,e[4]):Be.hasOwnProperty(t)?qe(Be[t]):"transparent"===t?new Fe(NaN,NaN,NaN,0):null}function qe(t){return new Fe(t>>16&255,t>>8&255,255&t,1)}function Ue(t,e,n,r){return r<=0&&(t=e=n=NaN),new Fe(t,e,n,r)}function He(t){return t instanceof Se||(t=Ge(t)),t?new Fe((t=t.rgb()).r,t.g,t.b,t.opacity):new Fe}function $e(t,e,n,r){return 1===arguments.length?He(t):new Fe(t,e,n,null==r?1:r)}function Fe(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ve(){return"#"+Ye(this.r)+Ye(this.g)+Ye(this.b)}function Xe(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ye(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Ze(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ke(t,e,n,r)}function We(t){if(t instanceof Ke)return new Ke(t.h,t.s,t.l,t.opacity);if(t instanceof Se||(t=Ge(t)),!t)return new Ke;if(t instanceof Ke)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new Ke(a,s,u,t.opacity)}function Ke(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Qe(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Je(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}ke(Se,Ge,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Re,formatHex:Re,formatHsl:function(){return We(this).formatHsl()},formatRgb:Ie,toString:Ie}),ke(Fe,$e,Te(Se,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ve,formatHex:Ve,formatRgb:Xe,toString:Xe})),ke(Ke,(function(t,e,n,r){return 1===arguments.length?We(t):new Ke(t,e,n,null==r?1:r)}),Te(Se,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ke(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ke(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Fe(Qe(t>=240?t-240:t+120,i,r),Qe(t,i,r),Qe(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var tn=function(t){return function(){return t}};function en(t,e){return function(n){return t+n*e}}function nn(t){return 1==(t=+t)?rn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):tn(isNaN(e)?n:e)}}function rn(t,e){var n=e-t;return n?en(t,n):tn(isNaN(t)?e:t)}var on=function t(e){var n=nn(e);function r(t,e){var r=n((t=$e(t)).r,(e=$e(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=rn(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function an(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=$e(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}an((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return Je((n-r/e)*e,a,i,o,s)}})),an((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return Je((n-r/e)*e,i,o,a,s)}}));var sn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,un=new RegExp(sn.source,"g");var ln=function(t,e){var n,r,i,o=sn.lastIndex=un.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=sn.exec(t))&&(r=un.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:de(n,r)})),o=un.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})},cn=function(t,e){var n;return("number"==typeof e?de:e instanceof Ge?on:(n=Ge(e))?(e=n,on):ln)(t,e)};function hn(t){return function(){this.removeAttribute(t)}}function fn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function pn(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=e(r=a,n)}}function dn(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=e(r=a,n)}}function gn(t,e,n){var r,i,o;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttribute(t))===(s=u+"")?null:a===r&&s===i?o:(i=s,o=e(r=a,u));this.removeAttribute(t)}}function vn(t,e,n){var r,i,o;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===(s=u+"")?null:a===r&&s===i?o:(i=s,o=e(r=a,u));this.removeAttributeNS(t.space,t.local)}}function yn(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function mn(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function _n(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&mn(t,i)),n}return i._value=e,i}function wn(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&yn(t,i)),n}return i._value=e,i}function bn(t,e){return function(){ae(this,t).delay=+e.apply(this,arguments)}}function xn(t,e){return e=+e,function(){ae(this,t).delay=e}}function En(t,e){return function(){se(this,t).duration=+e.apply(this,arguments)}}function kn(t,e){return e=+e,function(){se(this,t).duration=e}}function Tn(t,e){if("function"!=typeof e)throw new Error;return function(){se(this,t).ease=e}}function Sn(t,e,n){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ae:se;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}var Nn=vt.prototype.constructor;function On(t){return function(){this.style.removeProperty(t)}}function Pn(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function An(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Pn(t,o,n)),r}return o._value=e,o}function Mn(t){return function(e){this.textContent=t.call(this,e)}}function zn(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Mn(r)),e}return r._value=t,r}var jn=0;function Dn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Cn(){return++jn}var Ln=vt.prototype;Dn.prototype=function(t){return vt().transition(t)}.prototype={constructor:Dn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=a(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var u,l,c=r[s],h=c.length,f=o[s]=new Array(h),p=0;p<h;++p)(u=c[p])&&(l=t.call(u,u.__data__,p,c))&&("__data__"in u&&(l.__data__=u.__data__),f[p]=l,oe(f[p],e,n,p,f,ue(u,n)));return new Dn(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=u(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l,c=r[s],h=c.length,f=0;f<h;++f)if(l=c[f]){for(var p,d=t.call(l,l.__data__,f,c),g=ue(l,n),v=0,y=d.length;v<y;++v)(p=d[v])&&oe(p,e,n,v,d,g);o.push(d),a.push(l)}return new Dn(o,a,e,n)},filter:function(t){"function"!=typeof t&&(t=l(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a=e[i],s=a.length,u=r[i]=[],c=0;c<s;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&u.push(o);return new Dn(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u,l=e[s],c=n[s],h=l.length,f=a[s]=new Array(h),p=0;p<h;++p)(u=l[p]||c[p])&&(f[p]=u);for(;s<r;++s)a[s]=e[s];return new Dn(a,this._parents,this._name,this._id)},selection:function(){return new Nn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Cn(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a,s=r[o],u=s.length,l=0;l<u;++l)if(a=s[l]){var c=ue(a,e);oe(a,t,n,l,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Dn(r,this._parents,t,n)},call:Ln.call,nodes:Ln.nodes,node:Ln.node,size:Ln.size,empty:Ln.empty,each:Ln.each,on:function(t,e){var n=this._id;return arguments.length<2?ue(this.node(),n).on.on(t):this.each(Sn(n,t,e))},attr:function(t,e){var n=y(t),r="transform"===n?we:cn;return this.attrTween(t,"function"==typeof e?(n.local?vn:gn)(n,r,Ee(this,"attr."+t,e)):null==e?(n.local?fn:hn)(n):(n.local?dn:pn)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=y(t);return this.tween(n,(r.local?_n:wn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?_e:cn;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=O(this,t),a=(this.style.removeProperty(t),O(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,On(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=O(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=O(this,t)),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}(t,r,Ee(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,s="end."+a;return function(){var u=se(this,t),l=u.on,c=null==u.value[a]?o||(o=On(e)):void 0;l===n&&i===c||(r=(n=l).copy()).on(s,i=c),u.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var a=O(this,t);return a===o?null:a===r?i:i=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,An(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Ee(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,zn(t))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=ue(this.node(),n).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==e?be:xe)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?bn:xn)(e,t)):ue(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?En:kn)(e,t)):ue(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(Tn(e,t)):ue(this.node(),e).ease},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise((function(o,a){var s={value:a},u={value:function(){0==--i&&o()}};n.each((function(){var n=se(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),n.on=e}))}))}};var Bn={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Rn(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return Bn.time=Zt(),Bn;return n}vt.prototype.interrupt=function(t){return this.each((function(){pe(this,t)}))},vt.prototype.transition=function(t){var e,n;t instanceof Dn?(e=t._id,t=t._name):(e=Cn(),(n=Bn).time=Zt(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,s=r[o],u=s.length,l=0;l<u;++l)(a=s[l])&&oe(a,t,e,l,s,n||Rn(a,e));return new Dn(r,this._parents,t,e)};var In=function(t){return function(){return t}};function Gn(t,e,n){this.target=t,this.type=e,this.transform=n}function qn(t,e,n){this.k=t,this.x=e,this.y=n}qn.prototype={constructor:qn,scale:function(t){return 1===t?this:new qn(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new qn(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Un=new qn(1,0,0);function Hn(){rt.stopImmediatePropagation()}qn.prototype;var $n=function(){rt.preventDefault(),rt.stopImmediatePropagation()};function Fn(){return!rt.ctrlKey&&!rt.button}function Vn(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Xn(){return this.__zoom||Un}function Yn(){return-rt.deltaY*(1===rt.deltaMode?.05:rt.deltaMode?1:.002)}function Zn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Wn(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}var Kn=function(t){return function(){return t}};function Qn(t,e,n,r,i,o,a,s,u,l){this.target=t,this.type=e,this.subject=n,this.identifier=r,this.active=i,this.x=o,this.y=a,this.dx=s,this.dy=u,this._=l}function Jn(){return!rt.ctrlKey&&!rt.button}function tr(){return this.parentNode}function er(t){return null==t?{x:rt.x,y:rt.y}:t}function nr(){return navigator.maxTouchPoints||"ontouchstart"in this}Qn.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var rr=function(){var t,e,n,r,i=Jn,o=tr,a=er,s=nr,u={},l=Nt("start","drag","end"),c=0,h=0;function f(t){t.on("mousedown.drag",p).filter(s).on("touchstart.drag",v).on("touchmove.drag",y).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(){if(!r&&i.apply(this,arguments)){var a=_("mouse",o.apply(this,arguments),It,this,arguments);a&&(yt(rt.view).on("mousemove.drag",d,!0).on("mouseup.drag",g,!0),At(rt.view),Ot(),n=!1,t=rt.clientX,e=rt.clientY,a("start"))}}function d(){if(Pt(),!n){var r=rt.clientX-t,i=rt.clientY-e;n=r*r+i*i>h}u.mouse("drag")}function g(){yt(rt.view).on("mousemove.drag mouseup.drag",null),Mt(rt.view,n),Pt(),u.mouse("end")}function v(){if(i.apply(this,arguments)){var t,e,n=rt.changedTouches,r=o.apply(this,arguments),a=n.length;for(t=0;t<a;++t)(e=_(n[t].identifier,r,Gt,this,arguments))&&(Ot(),e("start"))}}function y(){var t,e,n=rt.changedTouches,r=n.length;for(t=0;t<r;++t)(e=u[n[t].identifier])&&(Pt(),e("drag"))}function m(){var t,e,n=rt.changedTouches,i=n.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(e=u[n[t].identifier])&&(Ot(),e("end"))}function _(t,e,n,r,i){var o,s,h,p=n(e,t),d=l.copy();if(lt(new Qn(f,"beforestart",o,t,c,p[0],p[1],0,0,d),(function(){return null!=(rt.subject=o=a.apply(r,i))&&(s=o.x-p[0]||0,h=o.y-p[1]||0,!0)})))return function a(l){var g,v=p;switch(l){case"start":u[t]=a,g=c++;break;case"end":delete u[t],--c;case"drag":p=n(e,t),g=c}lt(new Qn(f,l,o,t,g,p[0]+s,p[1]+h,p[0]-v[0],p[1]-v[1],d),d.apply,d,[l,r,i])}}return f.filter=function(t){return arguments.length?(i="function"==typeof t?t:Kn(!!t),f):i},f.container=function(t){return arguments.length?(o="function"==typeof t?t:Kn(t),f):o},f.subject=function(t){return arguments.length?(a="function"==typeof t?t:Kn(t),f):a},f.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Kn(!!t),f):s},f.on=function(){var t=l.on.apply(l,arguments);return t===l?f:t},f.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,f):Math.sqrt(h)},f},ir=Math.PI,or=2*ir,ar=or-1e-6;function sr(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ur(){return new sr}sr.prototype=ur.prototype={constructor:sr,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-t,u=r-e,l=o-t,c=a-e,h=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>1e-6)if(Math.abs(c*s-u*l)>1e-6&&i){var f=n-o,p=r-a,d=s*s+u*u,g=f*f+p*p,v=Math.sqrt(d),y=Math.sqrt(h),m=i*Math.tan((ir-Math.acos((d+h-g)/(2*v*y)))/2),_=m/y,w=m/v;Math.abs(_-1)>1e-6&&(this._+="L"+(t+_*l)+","+(e+_*c)),this._+="A"+i+","+i+",0,0,"+ +(c*f>l*p)+","+(this._x1=t+w*s)+","+(this._y1=e+w*u)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),u=t+a,l=e+s,c=1^o,h=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+l:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+u+","+l),n&&(h<0&&(h=h%or+or),h>ar?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=u)+","+(this._y1=l):h>1e-6&&(this._+="A"+n+","+n+",0,"+ +(h>=ir)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var lr=ur,cr=function(t){return function(){return t}};function hr(t){this._context=t}hr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var fr=function(t){return new hr(t)};function pr(t){return t[0]}function dr(t){return t[1]}var gr=n(1),vr=n.n(gr),yr={entityStateReadOnly:{ACTIVE:!1,DELETED:!0,STATUS_ACTIVE:!1,STATUS_DELETED:!0}},mr={nodeArrowDistance:24,refreshGraphForSafari:function(t){t.edgeEl.each((function(t){var e=this,n=$(this).find("pattern");setTimeout((function(t){$(e).find("defs").append(n)}),500)}))},refreshGraphForIE:function(t){var e=t.edgePathEl,n=0;e.each((function(t){var e=$(this).find("marker");$(this).find("marker").remove();var r=this;++n,setTimeout((function(t){$(r).find("defs").append(e),0===--n&&(this.$(".fontLoader").hide(),this.$("svg").fadeTo(1e3,1))}),1e3)}))},dragNode:function(t){var e=this,n=t.g,r=t.svg,i=t.guid,o=(t.edgePathEl,{dragmove:function(t,e){var r=this,i=yt(t),o=n.node(e),a=o.x,s=o.y;o.x+=rt.dx,o.y+=rt.dy,i.attr("transform","translate("+o.x+","+o.y+")");var u=o.x-a,l=o.y-s;n.edges().forEach((function(t){if(t.v==e||t.w==e){var i=n.edge(t.v,t.w);r.translateEdge(i,u,l),yt(i.elem).select("path").attr("d",r.calcPoints(t))}}))},translateEdge:function(t,e,n){t.points.forEach((function(t){t.x=t.x+e,t.y=t.y+n}))},calcPoints:function(t){var e=n.edge(t.v,t.w),r=n.node(t.v),i=n.node(t.w),o=e.points.slice(1,e.points.length-1);e.points.slice(1,e.points.length-1);return o.unshift(this.intersectRect(r,o[0])),o.push(this.intersectRect(i,o[o.length-1])),function(){var t=pr,e=dr,n=cr(!0),r=null,i=fr,o=null;function a(a){var s,u,l,c=a.length,h=!1;for(null==r&&(o=i(l=lr())),s=0;s<=c;++s)!(s<c&&n(u=a[s],s,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(u,s,a),+e(u,s,a));if(l)return o=null,l+""||null}return a.x=function(e){return arguments.length?(t="function"==typeof e?e:cr(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:cr(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:cr(!!t),a):n},a.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),a):i},a.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),a):r},a}().x((function(t){return t.x})).y((function(t){return t.y})).curve(wt)(o)},intersectRect:function(t,n){var r=t.x,o=t.y,a=n.x-r,s=n.y-o,u=i?e.nodeArrowDistance+3:e.nodeArrowDistance,l=u,c=u,h=0,f=0;return Math.abs(s)*l>Math.abs(a)*c?(s<0&&(c=-c),h=0===s?0:c*a/s,f=c):(a<0&&(l=-l),h=l,f=0===a?0:l*s/a),{x:r+h,y:o+f}}}),a=rr().on("drag",(function(t){o.dragmove.call(o,this,t)})),s=rr().on("drag",(function(t){o.translateEdge(n.edge(t.v,t.w),rt.dx,rt.dy);var e=n.edge(t.v,t.w);yt(e.elem).select("path").attr("d",o.calcPoints(t))}));a(r.selectAll("g.node")),s(r.selectAll("g.edgePath"))},zoomIn:function(t){var e=t.svg,n=t.scaleFactor,r=void 0===n?1.3:n;this.d3Zoom.scaleBy(e.transition().duration(750),r)},zoomOut:function(t){var e=t.svg,n=t.scaleFactor,r=void 0===n?.8:n;this.d3Zoom.scaleBy(e.transition().duration(750),r)},zoom:function(t){var e=t.svg,n=t.xa,r=t.ya,i=t.scale;e.transition().duration(750).call(this.d3Zoom.transform,Un.translate(n,r).scale(i))},fitToScreen:function(t){var e=t.svg,n=e.node(),r=n.getBBox(),i=n.parentElement,o=i.clientWidth,a=i.clientHeight,s=r.width,u=r.height,l=r.x+s/2,c=r.y+u/2,h=(h||.95)/Math.max(s/o,u/a),f=o/2-h*l,p=a/2-h*c;this.zoom({svg:e,xa:f,ya:p,scale:h})},centerNode:function(t){var e=t.guid,n=t.g,r=t.svg,i=t.svgGroupEl,o=(t.edgePathEl,t.width),a=t.height,s=t.fitToScreen,u=t.onCenterZoomed;this.d3Zoom=function(){var t,e,n=Fn,r=Vn,i=Wn,o=Yn,a=Zn,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Lt,h=Nt("start","zoom","end"),f=0;function p(t){t.property("__zoom",Xn).on("wheel.zoom",w).on("mousedown.zoom",b).on("dblclick.zoom",x).filter(a).on("touchstart.zoom",E).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",T).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(t,e){return(e=Math.max(s[0],Math.min(s[1],e)))===t.k?t:new qn(e,t.x,t.y)}function g(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new qn(t.k,r,i)}function v(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function y(t,e,n){t.on("start.zoom",(function(){m(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){m(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,o=m(t,i),a=r.apply(t,i),s=null==n?v(a):"function"==typeof n?n.apply(t,i):n,u=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),l=t.__zoom,h="function"==typeof e?e.apply(t,i):e,f=c(l.invert(s).concat(u/l.k),h.invert(s).concat(u/h.k));return function(t){if(1===t)t=h;else{var e=f(t),n=u/e[2];t=new qn(n,s[0]-e[0]*n,s[1]-e[1]*n)}o.zoom(null,t)}}))}function m(t,e,n){return!n&&t.__zooming||new _(t,e)}function _(t,e){this.that=t,this.args=e,this.active=0,this.extent=r.apply(t,e),this.taps=0}function w(){if(n.apply(this,arguments)){var t=m(this,arguments),e=this.__zoom,r=Math.max(s[0],Math.min(s[1],e.k*Math.pow(2,o.apply(this,arguments)))),a=It(this);if(t.wheel)t.mouse[0][0]===a[0]&&t.mouse[0][1]===a[1]||(t.mouse[1]=e.invert(t.mouse[0]=a)),clearTimeout(t.wheel);else{if(e.k===r)return;t.mouse=[a,e.invert(a)],pe(this),t.start()}$n(),t.wheel=setTimeout(l,150),t.zoom("mouse",i(g(d(e,r),t.mouse[0],t.mouse[1]),t.extent,u))}function l(){t.wheel=null,t.end()}}function b(){if(!e&&n.apply(this,arguments)){var t=m(this,arguments,!0),r=yt(rt.view).on("mousemove.zoom",l,!0).on("mouseup.zoom",c,!0),o=It(this),a=rt.clientX,s=rt.clientY;At(rt.view),Hn(),t.mouse=[o,this.__zoom.invert(o)],pe(this),t.start()}function l(){if($n(),!t.moved){var e=rt.clientX-a,n=rt.clientY-s;t.moved=e*e+n*n>f}t.zoom("mouse",i(g(t.that.__zoom,t.mouse[0]=It(t.that),t.mouse[1]),t.extent,u))}function c(){r.on("mousemove.zoom mouseup.zoom",null),Mt(rt.view,t.moved),$n(),t.end()}}function x(){if(n.apply(this,arguments)){var t=this.__zoom,e=It(this),o=t.invert(e),a=t.k*(rt.shiftKey?.5:2),s=i(g(d(t,a),e,o),r.apply(this,arguments),u);$n(),l>0?yt(this).transition().duration(l).call(y,s,e):yt(this).call(p.transform,s)}}function E(){if(n.apply(this,arguments)){var e,r,i,o,a=rt.touches,s=a.length,u=m(this,arguments,rt.changedTouches.length===s);for(Hn(),r=0;r<s;++r)i=a[r],o=[o=Gt(this,a,i.identifier),this.__zoom.invert(o),i.identifier],u.touch0?u.touch1||u.touch0[2]===o[2]||(u.touch1=o,u.taps=0):(u.touch0=o,e=!0,u.taps=1+!!t);t&&(t=clearTimeout(t)),e&&(u.taps<2&&(t=setTimeout((function(){t=null}),500)),pe(this),u.start())}}function k(){if(this.__zooming){var e,n,r,o,a=m(this,arguments),s=rt.changedTouches,l=s.length;for($n(),t&&(t=clearTimeout(t)),a.taps=0,e=0;e<l;++e)n=s[e],r=Gt(this,s,n.identifier),a.touch0&&a.touch0[2]===n.identifier?a.touch0[0]=r:a.touch1&&a.touch1[2]===n.identifier&&(a.touch1[0]=r);if(n=a.that.__zoom,a.touch1){var c=a.touch0[0],h=a.touch0[1],f=a.touch1[0],p=a.touch1[1],v=(v=f[0]-c[0])*v+(v=f[1]-c[1])*v,y=(y=p[0]-h[0])*y+(y=p[1]-h[1])*y;n=d(n,Math.sqrt(v/y)),r=[(c[0]+f[0])/2,(c[1]+f[1])/2],o=[(h[0]+p[0])/2,(h[1]+p[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],o=a.touch0[1]}a.zoom("touch",i(g(n,r,o),a.extent,u))}}function T(){if(this.__zooming){var t,n,r=m(this,arguments),i=rt.changedTouches,o=i.length;for(Hn(),e&&clearTimeout(e),e=setTimeout((function(){e=null}),500),t=0;t<o;++t)n=i[t],r.touch0&&r.touch0[2]===n.identifier?delete r.touch0:r.touch1&&r.touch1[2]===n.identifier&&delete r.touch1;if(r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0)r.touch0[1]=this.__zoom.invert(r.touch0[0]);else if(r.end(),2===r.taps){var a=yt(this).on("dblclick.zoom");a&&a.apply(this,arguments)}}}return p.transform=function(t,e,n){var r=t.selection?t.selection():t;r.property("__zoom",Xn),t!==r?y(t,e,n):r.interrupt().each((function(){m(this,arguments).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},p.scaleBy=function(t,e,n){p.scaleTo(t,(function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n}),n)},p.scaleTo=function(t,e,n){p.transform(t,(function(){var t=r.apply(this,arguments),o=this.__zoom,a=null==n?v(t):"function"==typeof n?n.apply(this,arguments):n,s=o.invert(a),l="function"==typeof e?e.apply(this,arguments):e;return i(g(d(o,l),a,s),t,u)}),n)},p.translateBy=function(t,e,n){p.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),u)}))},p.translateTo=function(t,e,n,o){p.transform(t,(function(){var t=r.apply(this,arguments),a=this.__zoom,s=null==o?v(t):"function"==typeof o?o.apply(this,arguments):o;return i(Un.translate(s[0],s[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,u)}),o)},_.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){lt(new Gn(p,t,this.that.__zoom),h.apply,h,[t,this.that,this.args])}},p.wheelDelta=function(t){return arguments.length?(o="function"==typeof t?t:In(+t),p):o},p.filter=function(t){return arguments.length?(n="function"==typeof t?t:In(!!t),p):n},p.touchable=function(t){return arguments.length?(a="function"==typeof t?t:In(!!t),p):a},p.extent=function(t){return arguments.length?(r="function"==typeof t?t:In([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),p):r},p.scaleExtent=function(t){return arguments.length?(s[0]=+t[0],s[1]=+t[1],p):[s[0],s[1]]},p.translateExtent=function(t){return arguments.length?(u[0][0]=+t[0][0],u[1][0]=+t[1][0],u[0][1]=+t[0][1],u[1][1]=+t[1][1],p):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},p.constrain=function(t){return arguments.length?(i=t,p):i},p.duration=function(t){return arguments.length?(l=+t,p):l},p.interpolate=function(t){return arguments.length?(c=t,p):c},p.on=function(){var t=h.on.apply(h,arguments);return t===h?p:t},p.clickDistance=function(t){return arguments.length?(f=(t=+t)*t,p):Math.sqrt(f)},p}(),r.call(this.d3Zoom).on("dblclick.zoom",null);var l=r.selectAll("g.nodes>g[id='"+e+"']"),c=(this.d3Zoom.scaleExtent([.01,50]).on("zoom",(function(){i.attr("transform",rt.transform)})),null),h=null;if(l.empty()){if(s)return void this.fitToScreen({svg:r});c=n.graph().width/2,h=n.graph().height/2}else{var f=l.attr("transform").replace(/[^0-9\-.,]/g,"").split(",");c=f[0],h=f[1]}var p=-(1.2*c-o/2),d=-(1.2*h-a/2);this.zoom({svg:r,xa:p,ya:d,scale:1.2}),r.transition().duration(750).call(this.d3Zoom.transform,Un.translate(p,d).scale(1.2)),u&&u({newScale:1.2,newTranslate:[p,d],d3Zoom:this.d3Zoom,selectedNodeEl:l})},getToolTipDirection:function(t){var e=t.el,n=yt("body").node().getBoundingClientRect().width,r=yt(e).node().getBoundingClientRect(),i="e";return n-r.left<330?(i=n-r.left<330&&r.top<400?"sw":"w",n-r.left<330&&r.top>600&&(i="nw")):r.top>600?(i=n-r.left<330&&r.top>600?"nw":"n",r.left<50&&(i="ne")):r.top<400&&(i=r.left<50?"se":"s"),i},onHoverFade:function(t){var e=t.svg,n=t.g,r=t.mouseenter,i=t.nodesToHighlight,o=t.hoveredNode;return function(t){var i=e.selectAll(".node"),a=e.selectAll(".edgePath");if(r){e.classed("hover",!0);var s=n.successors(o),u=n.predecessors(o);t=s.concat(u);i.classed("hover-active-node",(function(e,n,r){return!!function(t,e,n){if(t===n||e&&e.length&&-1!=e.indexOf(n))return!0}(o,t,e)})),a.classed("hover-active-path",(function(t){return!!(t.v===o||t.w===o?1:0)}))}else e.classed("hover",!1),i.classed("hover-active-node",!1),a.classed("hover-active-path",!1)}(i)},getBaseUrl:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.pathname;return t.replace(/\/[\w-]+.(jsp|html)|\/+$/gi,"")},getEntityIconPath:function(t){var e=t.entityData,n=t.errorUrl,r=t.imgBasePath,i=this.getBaseUrl()+(r||"/img/entity-icon/");if(e){var o=function(t){return i+(yr.entityStateReadOnly[l]?"disabled/"+t:t)},a=function(){return c?yr.entityStateReadOnly[l]?i+"disabled/process.png":i+"process.png":yr.entityStateReadOnly[l]?i+"disabled/table.png":i+"table.png"},s=e.typeName,u=e.serviceType,l=e.status,c=e.isProcess;if(n){if(n.indexOf("table.png")>-1||n.indexOf("process.png")>-1)return null;var h=!(!n||!n.match("entity-icon/"+s+".png|disabled/"+s+".png"));return u&&h?o(u+".png"):a()}return s?o(s+".png"):u?o(u+".png"):a()}},base64Encode:function(t,e){var n=new FileReader;n.addEventListener("load",(function(){return e(n.result)})),n.readAsDataURL(t)},imgShapeRender:function(t,e,n,r){var i=r.dagreD3,o=r.defsEl,a=r.imgBasePath,s=r.guid,u=this,l=s,c=this.getEntityIconPath({entityData:n,imgBasePath:a}),h=c.split("/").pop();if(void 0===this.imageObject&&(this.imageObject={}),n.isDeleted&&(h="deleted_"+h),n.id==l)var f=!0;var p=t.append("circle").attr("fill","url(#img_"+h+")").attr("r","24px").attr("data-stroke",n.id).attr("stroke-width","2px").attr("class","nodeImage "+(f?"currentNode":n.isProcess?"process":"node"));return f&&p.attr("stroke","#fb4200"),!0===n.isIncomplete&&(t.attr("class","node isIncomplete show"),t.insert("foreignObject").attr("x","-25").attr("y","-25").attr("width","50").attr("height","50").append("xhtml:div").insert("i").attr("class","fa fa-hourglass-half")),o.select('pattern[id="img_'+h+'"]').empty()&&o.append("pattern").attr("x","0%").attr("y","0%").attr("patternUnits","objectBoundingBox").attr("id","img_"+h).attr("width","100%").attr("height","100%").append("image").attr("href",(function(t){var e=this;if(n){!function t(r){var i=r.imagePath,o={url:i,method:"GET",cache:!0};p.attr("data-iconpath",i);var a=new XMLHttpRequest;a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)"IE"!==vr.a.name?u.base64Encode(this.response,(function(t){u.imageObject[c]=t,yt(e).attr("xlink:href",t)})):u.imageObject[c]=i,c!==p.attr("data-iconpath")&&p.attr("data-iconpathorigin",c);else if(404===a.status){var r=u.getEntityIconPath({entityData:n,errorUrl:i});if(null===r){var o=yt(e.parentElement);o.select("image").remove(),o.attr("patternContentUnits","objectBoundingBox").append("circle").attr("r","24px").attr("fill","#e8e8e8")}else t({imagePath:r})}},a.responseType="blob",a.open(o.method,o.url,!0),a.send(null)}({imagePath:c})}})).attr("x","4").attr("y",f?"3":"4").attr("width","40").attr("height","40"),n.intersect=function(t){return i.intersect.circle(n,f?u.nodeArrowDistance+3:u.nodeArrowDistance,t)},p},arrowPointRender:function(t,e,n,r,i){var o=i.dagreD3,a=t.node(),s=a?a.parentNode:t;yt(s).select("path.path").attr("marker-end","url(#"+e+")");var u=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",8).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",4).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",n.styleObj.stroke);o.util.applyStyle(u,n[r+"Style"])},saveSvg:function(t){var e=t.svg,n=t.width,r=t.height,i=t.downloadFileName,o=t.onExportLineage,a=this,s=e.clone(!0).node();setTimeout((function(){"Firefox"===vr.a.name&&(s.setAttribute("width",n),s.setAttribute("height",r));var t=yt("body").append("div");t.classed("hidden-svg",!0),t.node().appendChild(s);var e=yt(".hidden-svg svg");e.select("g").attr("transform","scale(1)"),e.select("foreignObject").remove();var u=150,l=150,c=s.getBBox().width+u,h=s.getBBox().height+l,f=s.getBBox().x,p=s.getBBox().y;s.attributes.viewBox.value=f+","+p+","+c+","+h;var d=document.createElement("canvas");d.id="canvas",d.style.display="none",d.width=1*s.getBBox().width+u,d.height=1*s.getBBox().height+l,yt("body").node().appendChild(d);var g=d.getContext("2d"),v=(new XMLSerializer).serializeToString(s),y=window.URL||window.webkitURL||window;g.fillStyle="#FFFFFF",g.fillRect(0,0,d.width,d.height),g.strokeRect(0,0,d.width,d.height),g.restore();var m=new Image(d.width,d.height),_=new Blob([v],{type:"image/svg+xml;base64"});"Safari"===vr.a.name&&(_=new Blob([v],{type:"image/svg+xml"}));var w=y.createObjectURL(_);m.onload=function(){try{var e=document.createElement("a");e.download=i,document.body.appendChild(e),g.drawImage(m,50,50,d.width,d.height),d.toBlob((function(t){t?(e.href=y.createObjectURL(t),t.size>1e7&&o({status:"failed",message:"The Image size is huge, please open the image in a browser!"}),e.click(),o({status:"Success",message:"Successful"}),"Safari"===vr.a.name&&a.refreshGraphForSafari({edgeEl:a.$("svg g.node")})):o({status:"failed",message:"There was an error in downloading Lineage!"})}),"image/png"),t.remove(),d.remove()}catch(t){o({status:"failed",message:"There was an error in downloading Lineage!"})}},m.src=w}),0)}};function _r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_r(Object(n),!0).forEach((function(e){br(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function br(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var xr={getBaseUrl:function(t){return t.replace(/\/[\w-]+.(jsp|html)|\/+$/gi,"")},getEntityIconPath:function(){var t,e,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.entityData,o=r.errorUrl,a=this.getBaseUrl(window.location.pathname)+Globals.entityImgPath;function s(t){return a+(yr.entityStateReadOnly[e]?"disabled/"+t:t)}function u(){return i.isProcess?yr.entityStateReadOnly[e]?a+"disabled/process.png":a+"process.png":yr.entityStateReadOnly[e]?a+"disabled/table.png":a+"table.png"}if(i&&(n=i.typeName,t=i&&i.serviceType,e=i&&i.status),i){if(o){var l=!(!o||!o.match("entity-icon/"+n+".png|disabled/"+n+".png"));return t&&l?s(t+".png"):u()}return i.typeName?s(i.typeName+".png"):u()}},isProcess:function(t){var e=t.typeName,n=t.superTypes;t.entityDef;return"Process"==e||n.indexOf("Process")>-1},isDeleted:function(t){if(void 0!==t)return yr.entityStateReadOnly[t.status]},isNodeToBeUpdated:function(t,e){var n=e.isProcessHideCheck,r=e.isDeletedEntityHideCheck,i={isProcess:n&&t.isProcess,isDeleted:r&&t.isDeleted};return i.update=i.isProcess||i.isDeleted,i},getServiceType:function(t){var e=t.typeName,n=t.entityDef,r=null;return e&&n&&(r=n.serviceType||null),r},getEntityDef:function(t){var e=t.typeName,n=t.entityDefCollection,r=null;return e&&(r=n.find((function(t){return t.name==e}))),r},getNestedSuperTypes:function(t){var e=t.entityDef,n=t.entityDefCollection,r=new Set;return function t(e,n){e&&e.superTypes&&e.superTypes.length&&e.superTypes.forEach((function(e){r.add(e);var i=n.find((function(t){t.name}));i&&t(i,n)}))}(e,n),Array.from(r)},generateData:function(t){var e=this,n=t.data,r=void 0===n?{}:n,i=t.filterObj,o=t.entityDefCollection,a=t.g,s=t.guid,u=t.setGraphEdge,l=t.setGraphNode;return new Promise((function(t,n){try{var c=r.relations||{},h=r.guidEntityMap||{},f=i.isProcessHideCheck||i.isDeletedEntityHideCheck,p={fill:"none",stroke:"#ffb203",width:3},d=function(t){if(t){if(t.updatedValues)return t;var n=Object.assign(t,{shape:"img",updatedValues:!0,label:t.displayText.trunc(18),toolTipLabel:t.displayText,id:t.guid,isLineage:!0,isIncomplete:t.isIncomplete,entityDef:e.getEntityDef({typeName:t.typeName,entityDefCollection:o})});return n.serviceType=e.getServiceType(n),n.superTypes=e.getNestedSuperTypes(wr(wr({},n),{},{entityDefCollection:o})),n.isProcess=e.isProcess(n),n.isDeleted=e.isDeleted(n),n}},g=function(t){return"fill:"+t.fill+";stroke:"+t.stroke+";stroke-width:"+t.width},v=function(t,n,r){var i=[];return t.forEach((function(t){if(e.isNodeToBeUpdated(d(h[t]),r).update)if(w[t])i=i.concat(w[t]);else{var n=function t(n,r){if(n&&b[n]){var i=[];return b[n].forEach((function(n){if(e.isNodeToBeUpdated(d(h[n]),r).update){var o=t(n,r);o&&(i=i.concat(o))}else i.push(n)})),i}return null}(t,r);n&&(i=i.concat(n))}else i.push(t)})),i},y=function(t){if(a._nodes[t])return a._nodes[t];var e=d(h[t]);return l(t,e),e},m=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};u(t,e,wr({arrowhead:"arrowPoint",curve:wt,style:g(p),styleObj:p},n))},_=function(t,e){y(t),y(e),m(t,e)},w={};if(f){var b=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.relations,n={};return e.forEach((function(t){n[t.fromEntityId]?n[t.fromEntityId].push(t.toEntityId):n[t.fromEntityId]=[t.toEntityId]})),n}(r);Object.keys(b).forEach((function(t){var n=b[t],r=e.isNodeToBeUpdated(d(h[t]),i),o=v(n,0,i);r.update?w[t]?w[t]=w[t].concat(o):w[t]=o:o.forEach((function(e){_(t,e)}))}))}else c.forEach((function(t){_(t.fromEntityId,t.toEntityId)}));a._nodes[s]&&(a._nodes[s]&&(a._nodes[s].isLineage=!1),e.findImpactNodeAndUpdateData({guid:s,g:a,setEdge:m,getStyleObjStr:g})),t(a)}catch(t){n(t)}}))},findImpactNodeAndUpdateData:function(t){var e=t.guid,n=t.getStyleObjStr,r=t.g,i=t.setEdge,o={},a={fill:"none",stroke:"#fb4200",width:3};!function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0,u=Object.keys(e);u.length&&(o[s]||(o[s]=!0,u.forEach((function(e){r._nodes[e]&&(r._nodes[e].isLineage=!1),i(s,e,{style:n(a),styleObj:a}),t(r._sucs[e],e)}))))}(r._sucs[e],e)}};String.prototype.trunc=String.prototype.trunc||function(t){return this.length>t?this.substr(0,t-1)+"...":this};function Er(){}function kr(t,e){var n=new Er;if(t instanceof Er)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==e)for(;++i<o;)n.set(i,t[i]);else for(;++i<o;)n.set(e(r=t[i],i,t),r)}else if(t)for(var a in t)n.set(a,t[a]);return n}Er.prototype=kr.prototype={constructor:Er,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};var Tr=kr;function Sr(){}var Nr=Tr.prototype;function Or(t,e){var n=new Sr;if(t instanceof Sr)t.each((function(t){n.add(t)}));else if(t){var r=-1,i=t.length;if(null==e)for(;++r<i;)n.add(t[r]);else for(;++r<i;)n.add(e(t[r],r,t))}return n}Sr.prototype=Or.prototype={constructor:Sr,has:Nr.has,add:function(t){return this["$"+(t+="")]=t,this},remove:Nr.remove,clear:Nr.clear,values:Nr.keys,size:Nr.size,empty:Nr.empty,each:Nr.each};n(9);function Pr(t){return(Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ar(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Mr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ar(Object(n),!0).forEach((function(e){zr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ar(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function zr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Dr=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._setGraphNode=function(t,e){n.actualData[t]=Object.assign({},e),n.g.setNode(t,e)},this._setGraphEdge=function(t,e,r){n.g.setEdge(t,e,Mr({curve:wt},r))},this._updateOptions(e);var r=this.options,i=r.el,o=r.manualTrigger,a=void 0!==o&&o;if(void 0===i)throw new Error("LineageHelper requires el propety to render the graph");return this.initReturnObj={init:function(t){return n.init(t)},createGraph:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n._createGraph(n.options,n.graphOptions,t)},clear:function(t){return n.clear(t)},refresh:function(t){return n.refresh(t)},centerAlign:function(t){return n.centerAlign(t)},exportLineage:function(t){return n.exportLineage(t)},zoomIn:function(t){return n.zoomIn(t)},zoomOut:function(t){return n.zoomOut(t)},zoom:function(t){return n.zoom(t)},fullScreen:function(t){return n.fullScreen(t)},searchNode:function(t){return n.searchNode(t)},removeNodeSelection:function(t){return n.removeNodeSelection(t)},getGraphOptions:function(){return n.graphOptions},getNode:function(t,e){var r=null;return(r=e?n.actualData[t]:n.g._nodes[t])&&(r=Object.assign({},r)),r},getNodes:function(t,e){var r=null;return(r=e?n.actualData:n.g._nodes)&&(r=Object.assign({},r)),r},setNode:this._setGraphNode,setEdge:this._setGraphEdge},!1===a&&this.init(),this.initReturnObj}var e,n,r;return e=t,(n=[{key:"_updateOptions",value:function(t){this.options={},Object.assign(this.options,{filterObj:{isProcessHideCheck:!1,isDeletedEntityHideCheck:!1}},t)}},{key:"init",value:function(){var t=this.options.data,e=void 0===t?{}:t;e.baseEntityGuid&&(this.guid=e.baseEntityGuid),this._initializeGraph(),this._initGraph()}},{key:"clear",value:function(){this.options.el||(this.svg.remove(),this.svg=null),this.g=null,this.graphOptions={}}},{key:"centerAlign",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.svg.select("g"),n=e.selectAll("g.edgePath");mr.centerNode(Mr(Mr({},this.graphOptions),{},{svgGroupEl:e,edgePathEl:n},t))}},{key:"zoomIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};mr.zoomIn(Mr(Mr({},this.graphOptions),t))}},{key:"zoomOut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};mr.zoomOut(Mr(Mr({},this.graphOptions),t))}},{key:"zoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};mr.zoom(Mr(Mr({},this.graphOptions),t))}},{key:"refresh",value:function(){this.clear(),this._initializeGraph(),this._initGraph({refresh:!0})}},{key:"removeNodeSelection",value:function(){this.svg.selectAll("g.node>circle").classed("node-detail-highlight",!1)}},{key:"searchNode",value:function(t){var e=t.guid,n=t.onSearchNode;this.svg.selectAll(".serach-rect").remove(),this.centerAlign({guid:e,onCenterZoomed:function(t){var e=t.selectedNodeEl;e.select(".label").attr("stroke","#316132"),e.select("circle").classed("wobble",!0),e.insert("rect","circle").attr("class","serach-rect").attr("x",-50).attr("y",-27.5).attr("width",100).attr("height",55),n&&"function"==typeof n&&n(t)}})}},{key:"exportLineage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.downloadFileName;if(void 0===e){var n=this.g._nodes[this.guid];e=n&&n.attributes?"".concat(n.attributes.qualifiedName||n.attributes.name||"lineage_export",".png"):"lineage_export.png"}mr.saveSvg(Mr(Mr({},this.graphOptions),{},{downloadFileName:e,onExportLineage:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(e){t.onExportLineage&&onExportLineage(e)}))}))}},{key:"fullScreen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.el;if(void 0===e)throw new Error("LineageHelper requires el propety to apply fullScreen class");var n=yt(e);return n.classed("fullscreen-mode")?(n.classed("fullscreen-mode",!1),!1):(n.classed("fullscreen-mode",!0),!0)}},{key:"_getValueFromUser",value:function(t){if(void 0!==t)return"function"==typeof t?t():t}},{key:"_initializeGraph",value:function(){var t=this.options,e=t.width,n=void 0===e?"100%":e,r=t.height,o=void 0===r?"100%":r,a=t.el;this.svg=yt(a),a instanceof SVGElement||(this.svg=this.svg.append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr(" xmlns:xlink","http://www.w3.org/1999/xlink").attr("version","1.1").attr("width",n).attr("height",o)),this.g=(new i.a.graphlib.Graph).setGraph(Object.assign({nodesep:50,ranksep:90,rankdir:"LR",marginx:20,marginy:20,transition:function(t){return t.transition().duration(500)}},this.options.dagreOptions)).setDefaultEdgeLabel((function(){return{}}));var s=this.svg.node().getBoundingClientRect();this.actualData={},this.graphOptions={svg:this.svg,g:this.g,dagreD3:i.a,guid:this.guid,width:this.options.width||s.width,height:this.options.height||s.height}}},{key:"_initGraph",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.refresh;this.svg&&this.svg.select("g").remove();var r=this.options.filterObj;if(this.options.getFilterObj){var i=this.options.getFilterObj();if(void 0!==i||null!==i){if("object"!==Pr(i))throw new Error("getFilterObj expect return type `object`,`null` or `Undefined`");r=i}}if(!0!==this.options.setDataManually)return void 0===this.options.data||this.options.data&&0===this.options.data.relations.length?(this.options.beforeRender&&this.options.beforeRender(),this.svg.append("text").attr("x","50%").attr("y","50%").attr("alignment-baseline","middle").attr("text-anchor","middle").text("No lineage data found"),void(this.options.afterRender&&this.options.afterRender())):xr.generateData(Mr(Mr(Mr({},this.options),{},{filterObj:r},this.graphOptions),{},{setGraphNode:this._setGraphNode,setGraphEdge:this._setGraphEdge})).then((function(e){t._createGraph(t.options,t.graphOptions,{refresh:n})}))}},{key:"_createGraph",value:function(t,e,n){var r=this,o=t.data,a=void 0===o?{}:o,s=t.imgBasePath,u=t.isShowTooltip,l=t.isShowHoverPath,c=t.onLabelClick,h=t.onPathClick,f=t.onNodeClick,p=t.zoom,d=t.fitToScreen,g=n.refresh;this.options.beforeRender&&this.options.beforeRender();var v=this,y=e.svg,m=e.g,_=e.width,w=e.height;if(y instanceof vt==0)throw new Error("svg is not initialized or something went wrong while creatig graph instance");if(void 0!==m._nodes&&0!==m._nodes.length){m.nodes().forEach((function(t){var e=m.node(t);e&&(e.rx=e.ry=5)})),y.attr("viewBox","0 0 "+_+" "+w).attr("enable-background","new 0 0 "+_+" "+w);var b=y.append("g"),x=y.append("defs"),E=new i.a.render;E.arrows().arrowPoint=function(){return mr.arrowPointRender.apply(mr,Array.prototype.slice.call(arguments).concat([Mr({},e)]))},E.shapes().img=function(){return mr.imgShapeRender.apply(mr,Array.prototype.slice.call(arguments).concat([Mr(Mr({},e),{},{imgBasePath:v._getValueFromUser(s),defsEl:x})]))};var k=function(){var t=function(){return"n"},e=function(){return[0,0]},n=function(){return" "},r=document.body,i=h(),o=null,a=null,s=null;function u(t){(o=function(t){var e=t.node();return e?"svg"===e.tagName.toLowerCase()?e:e.ownerSVGElement:null}(t))&&(a=o.createSVGPoint(),r.appendChild(i))}u.show=function(){var i=Array.prototype.slice.call(arguments);i[i.length-1]instanceof SVGElement&&(s=i.pop());var o,a=n.apply(this,i),h=e.apply(this,i),p=t.apply(this,i),d=f(),g=c.length,v=document.documentElement.scrollTop||r.scrollTop,y=document.documentElement.scrollLeft||r.scrollLeft;for(d.html(a).style("opacity",1).style("pointer-events","all");g--;)d.classed(c[g],!1);return o=l.get(p).apply(this),d.classed(p,!0).style("top",o.top+h[0]+v+"px").style("left",o.left+h[1]+y+"px"),u},u.hide=function(){return f().style("opacity",0).style("pointer-events","none"),u},u.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return f().attr(t);var n=Array.prototype.slice.call(arguments);return vt.prototype.attr.apply(f(),n),u},u.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return f().style(t);var n=Array.prototype.slice.call(arguments);return vt.prototype.style.apply(f(),n),u},u.direction=function(e){return arguments.length?(t=null==e?e:d(e),u):t},u.offset=function(t){return arguments.length?(e=null==t?t:d(t),u):e},u.html=function(t){return arguments.length?(n=null==t?t:d(t),u):n},u.rootElement=function(t){return arguments.length?(r=null==t?t:d(t),u):r},u.destroy=function(){return i&&(f().remove(),i=null),u};var l=Tr({n:function(){var t=p(this);return{top:t.n.y-i.offsetHeight,left:t.n.x-i.offsetWidth/2}},s:function(){var t=p(this);return{top:t.s.y,left:t.s.x-i.offsetWidth/2}},e:function(){var t=p(this);return{top:t.e.y-i.offsetHeight/2,left:t.e.x}},w:function(){var t=p(this);return{top:t.w.y-i.offsetHeight/2,left:t.w.x-i.offsetWidth}},nw:function(){var t=p(this);return{top:t.nw.y-i.offsetHeight,left:t.nw.x-i.offsetWidth}},ne:function(){var t=p(this);return{top:t.ne.y-i.offsetHeight,left:t.ne.x}},sw:function(){var t=p(this);return{top:t.sw.y,left:t.sw.x-i.offsetWidth}},se:function(){var t=p(this);return{top:t.se.y,left:t.se.x}}}),c=l.keys();function h(){var t=yt(document.createElement("div"));return t.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),t.node()}function f(){return null==i&&(i=h(),r.appendChild(i)),yt(i)}function p(t){for(var e=s||t;null==e.getScreenCTM&&null!=e.parentNode;)e=e.parentNode;var n={},r=e.getScreenCTM(),i=e.getBBox(),o=i.width,u=i.height,l=i.x,c=i.y;return a.x=l,a.y=c,n.nw=a.matrixTransform(r),a.x+=o,n.ne=a.matrixTransform(r),a.y+=u,n.se=a.matrixTransform(r),a.x-=o,n.sw=a.matrixTransform(r),a.y-=u/2,n.w=a.matrixTransform(r),a.x+=o,n.e=a.matrixTransform(r),a.x-=o/2,a.y-=u/2,n.n=a.matrixTransform(r),a.y+=u,n.s=a.matrixTransform(r),n}function d(t){return"function"==typeof t?t:function(){return t}}return u}().attr("class","d3-tip").offset([10,0]).html((function(t){var e=m.node(t),n="";return e.id!==r.guid&&(n="<h5 style='text-align: center;'>"+(e.isLineage?"Lineage":"Impact")+"</h5>"),n+="<h5 class='text-center'><span style='color:#359f89'>"+e.toolTipLabel+"</span></h5> ",e.typeName&&(n+="<h5 class='text-center'><span>("+e.typeName+")</span></h5> "),e.queryText&&(n+="<h5>Query: <span style='color:#359f89'>"+e.queryText+"</span></h5> "),"<div class='tip-inner-scroll'>"+n+"</div>"}));y.call(k),E(b,m),b.selectAll("g.nodes g.label").attr("transform","translate(2,-35)").on("mouseenter",(function(t){rt.preventDefault(),yt(this).classed("highlight",!0)})).on("mouseleave",(function(t){rt.preventDefault(),yt(this).classed("highlight",!1)})).on("click",(function(t){rt.preventDefault(),c&&"function"==typeof c&&c({clickedData:t}),k.hide(t)})),b.selectAll("g.nodes g.node circle").on("mouseenter",(function(t,n,r){if(v.activeNode=!0,this.getScreenCTM().translate(+this.getAttribute("cx"),+this.getAttribute("cy")),v.svg.selectAll(".node").classed("active",!1),yt(this).classed("active",!0),v._getValueFromUser(u)){var i=mr.getToolTipDirection({el:this});k.direction(i).show(t,this)}!1!==v._getValueFromUser(l)&&mr.onHoverFade(Mr({opacity:.3,mouseenter:!0,hoveredNode:t},e))})).on("mouseleave",(function(t){v.activeNode=!1;var n=this;setTimeout((function(e){v.activeTip||v.activeNode||(yt(n).classed("active",!1),v._getValueFromUser(u)&&k.hide(t))}),150),!1!==v._getValueFromUser(l)&&mr.onHoverFade(Mr({mouseenter:!1,hoveredNode:t},e))})).on("click",(function(t){rt.defaultPrevented||(rt.preventDefault(),k.hide(t),y.selectAll("g.node>circle").classed("node-detail-highlight",!1),yt(this).classed("node-detail-highlight",!0),f&&"function"==typeof f&&f({clickedData:t,el:this}))}));var T=b.selectAll("g.edgePath");T.selectAll("path.path").on("click",(function(t){if(h&&"function"==typeof h){var e=a.relations.find((function(e){if(e.fromEntityId===t.v&&e.toEntityId===t.w)return!0}));h({pathRelationObj:e,clickedData:t})}})),!1!==p&&mr.centerNode(Mr(Mr({},e),{},{fitToScreen:d,svgGroupEl:b,edgePathEl:T})),mr.dragNode(Mr(Mr({},e),{},{edgePathEl:T})),!0!==g&&this._addLegend(),this.options.afterRender&&this.options.afterRender()}else y.html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relations to display</text>')}},{key:"_addLegend",value:function(){if(!1!==this.options.legends){var t=yt(this.options.legendsEl||this.options.el).insert("div",":first-child").classed("legends",!0),e=t.append("span").style("color","#fb4200");e.append("i").classed("fa fa-circle-o fa-fw",!0),e.append("span").html("Current Entity"),(e=t.append("span").style("color","#686868")).append("i").classed("fa fa-hourglass-half fa-fw",!0),e.append("span").html("In Progress"),(e=t.append("span").style("color","#df9b00")).append("i").classed("fa fa-long-arrow-right fa-fw",!0),e.append("span").html("Lineage"),(e=t.append("span").style("color","#fb4200")).append("i").classed("fa fa-long-arrow-right fa-fw",!0),e.append("span").html("Impact")}}}])&&jr(e.prototype,n),r&&jr(e,r),t}()}])}));
\ No newline at end of file
.node{cursor:pointer}.node text{font-size:10px;font-family:sans-serif}.node rect{stroke:#999;fill:#fff;stroke-width:1.5px}.node rect.serach-rect{stroke:#37bb9b;fill:transparent;stroke-width:2.5px}.node .label{fill:#868686}.node .label.highlight{cursor:pointer;fill:#4a90e2;text-decoration:underline}.node .label.highlight tspan{font-weight:400}.node circle{-moz-transition:all 0.3s;-webkit-transition:all 0.3s;transition:all 0.3s;stroke-width:1.5px}.node circle.node-detail-highlight{stroke:#4a90e2;stroke-width:2px}.node circle.nodeImage.green:hover{stroke:#ffb203}.node circle.nodeImage.blue:hover{stroke:#4b91e2}.node circle.nodeImage.currentNode{stroke:#fb4200}.node circle.nodeImage:hover{-moz-transform:scale(1.4);-webkit-transform:scale(1.4);transform:scale(1.4)}.node.active circle{-moz-transform:scale(1.4);-webkit-transform:scale(1.4);transform:scale(1.4)}.node.active circle.nodeImage.green{stroke:#ffb203}.node.active circle.nodeImage.blue{stroke:#4b91e2}.legends>span{margin-right:8px;font-family:Source Sans Pro}svg.hover g.node{opacity:0.1 !important}svg.hover g.edgePath{opacity:0 !important}svg.hover g.node.hover-active-node,svg.hover g.edgePath.hover-active-path{opacity:1 !important}.invisible .node circle{transition:all 0s}.edgePath .path{cursor:pointer}.link{fill:none;stroke:#ccc;stroke-width:1.5px}.text-center{text-align:center}.d3-tip{line-height:1;font-weight:bold;padding:12px;background:rgba(0,0,0,0.8);color:#fff;z-index:999;max-width:300px;border-radius:2px}.d3-tip .tip-inner-scroll{overflow:auto;max-height:300px}.d3-tip .tip-inner-scroll h5{margin:7px 0px}.d3-tip:after{box-sizing:border-box;display:inline;font-size:10px;width:100%;line-height:1;color:rgba(0,0,0,0.8);position:absolute}.d3-tip.n:after{content:"\25BC";margin:-1px 0 0 0;top:100%;left:0;text-align:center}.d3-tip.e:after{content:"\25C0";margin:-4px 0 0 0;top:50%;left:-8px}.d3-tip.s:after{content:"\25B2";margin:0 0 1px 0;top:-8px;left:0;text-align:center}.d3-tip.w:after{content:"\25B6";margin:-4px 0 0 -1px;top:50%;left:100%}g.type-TK>rect{fill:#00ffd0}.fullscreen-mode{position:fixed;height:100% !important;top:0;bottom:0;left:0;width:100%;right:0;padding:0 !important;z-index:9999;overflow:hidden !important}.fullscreen-mode .resizeGraph{position:fixed;height:100% !important}.fullscreen-mode .resizeGraph .ui-resizable-handle{display:none}.fullscreen-mode .lineage-box{padding:10px !important}.fullscreen-mode .box-panel{margin:10px !important}@keyframes zoominoutsinglefeatured{0%{transform:scale(1, 1)}50%{transform:scale(1.2, 1.2)}100%{transform:scale(1, 1)}}.wobble{animation:zoominoutsinglefeatured 1s 5}.hidden-svg{visibility:hidden}@-webkit-keyframes blink{from{opacity:0.2}to{opacity:0.5}}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "atlas-lineage-module",
"version": "1.0.0",
"description": "The module will help to render the lineage graph with the help dagre-d3,d3 js lib",
"main": "dist/index.js",
"scripts": {
"start": "NODE_ENV=development webpack --watch",
"build": "webpack"
},
"repository": {
"type": "git",
"url": "git+https://github.com/apache/atlas.git"
},
"keywords": [
"lineage",
"dagre-d3",
"d3"
],
"author": "kevalbhatt",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/apache/atlas/issues"
},
"homepage": "https://github.com/apache/atlas#readme",
"dependencies": {
"d3-tip": "^0.9.1",
"dagre-d3": "^0.6.4",
"platform": "^1.3.5"
},
"devDependencies": {
"@babel/core": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"babel-loader": "^8.1.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"css-loader": "^3.5.3",
"mini-css-extract-plugin": "^0.9.0",
"path": "^0.12.7",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
}
}
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
entityStateReadOnly: {
ACTIVE: false,
DELETED: true,
STATUS_ACTIVE: false,
STATUS_DELETED: true
}
};
\ No newline at end of file
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Enums from "../Enums";
import { curveBasis } from "d3-shape";
const DataUtils = {
/**
* [getBaseUrl description]
* @param {[type]} url [description]
* @return {[type]} [description]
*/
getBaseUrl: function(url) {
return url.replace(/\/[\w-]+.(jsp|html)|\/+$/gi, "");
},
/**
* [getEntityIconPath description]
* @param {[type]} options.entityData [description]
* @param {Object} options.errorUrl } [description]
* @return {[type]} [description]
*/
getEntityIconPath: function({ entityData, errorUrl } = {}) {
var serviceType,
status,
typeName,
iconBasePath = this.getBaseUrl(window.location.pathname) + Globals.entityImgPath;
if (entityData) {
typeName = entityData.typeName;
serviceType = entityData && entityData.serviceType;
status = entityData && entityData.status;
}
function getImgPath(imageName) {
return iconBasePath + (Enums.entityStateReadOnly[status] ? "disabled/" + imageName : imageName);
}
function getDefaultImgPath() {
if (entityData.isProcess) {
if (Enums.entityStateReadOnly[status]) {
return iconBasePath + "disabled/process.png";
} else {
return iconBasePath + "process.png";
}
} else {
if (Enums.entityStateReadOnly[status]) {
return iconBasePath + "disabled/table.png";
} else {
return iconBasePath + "table.png";
}
}
}
if (entityData) {
if (errorUrl) {
var isErrorInTypeName = errorUrl && errorUrl.match("entity-icon/" + typeName + ".png|disabled/" + typeName + ".png") ? true : false;
if (serviceType && isErrorInTypeName) {
var imageName = serviceType + ".png";
return getImgPath(imageName);
} else {
return getDefaultImgPath();
}
} else if (entityData.typeName) {
var imageName = entityData.typeName + ".png";
return getImgPath(imageName);
} else {
return getDefaultImgPath();
}
}
},
/**
* [isProcess description]
* @param {[type]} options.typeName [description]
* @param {[type]} options.superTypes [description]
* @param {[type]} options.entityDef [description]
* @return {Boolean} [description]
*/
isProcess: function({ typeName, superTypes, entityDef }) {
if (typeName == "Process") {
return true;
}
return superTypes.indexOf("Process") > -1;
},
/**
* [isDeleted description]
* @param {[type]} node [description]
* @return {Boolean} [description]
*/
isDeleted: function(node) {
if (node === undefined) {
return;
}
return Enums.entityStateReadOnly[node.status];
},
isNodeToBeUpdated: function(node, filterObj) {
var isProcessHideCheck = filterObj.isProcessHideCheck,
isDeletedEntityHideCheck = filterObj.isDeletedEntityHideCheck;
var returnObj = {
isProcess: isProcessHideCheck && node.isProcess,
isDeleted: isDeletedEntityHideCheck && node.isDeleted
};
returnObj["update"] = returnObj.isProcess || returnObj.isDeleted;
return returnObj;
},
/**
* [getServiceType description]
* @param {[type]} options.typeName [description]
* @param {[type]} options.entityDef [description]
* @return {[type]} [description]
*/
getServiceType: function({ typeName, entityDef }) {
var serviceType = null;
if (typeName) {
if (entityDef) {
serviceType = entityDef.serviceType || null;
}
}
return serviceType;
},
/**
* [getEntityDef description]
* @param {[type]} options.typeName [description]
* @param {[type]} options.entityDefCollection [description]
* @return {[type]} [description]
*/
getEntityDef: function({ typeName, entityDefCollection }) {
var entityDef = null;
if (typeName) {
entityDef = entityDefCollection.find(function(obj) {
return obj.name == typeName;
});
}
return entityDef;
},
/**
* [getNestedSuperTypes description]
* @param {[type]} options.entityDef [description]
* @param {[type]} options.entityDefCollection [description]
* @return {[type]} [description]
*/
getNestedSuperTypes: function({ entityDef, entityDefCollection }) {
var data = entityDef,
collection = entityDefCollection,
superTypes = new Set();
var getData = function(data, collection) {
if (data) {
if (data.superTypes && data.superTypes.length) {
data.superTypes.forEach(function(superTypeName) {
superTypes.add(superTypeName);
var collectionData = collection.find(function(obj) {
obj.name === superTypeName;
});
if (collectionData) {
getData(collectionData, collection);
}
});
}
}
};
getData(data, collection);
return Array.from(superTypes);
},
generateData: function({ data = {}, filterObj, entityDefCollection, g, guid, setGraphEdge, setGraphNode }) {
return new Promise((resolve, reject) => {
try {
var relations = data.relations || {},
guidEntityMap = data.guidEntityMap || {},
isHideFilterOn = filterObj.isProcessHideCheck || filterObj.isDeletedEntityHideCheck,
newHashMap = {},
styleObj = {
fill: "none",
stroke: "#ffb203",
width: 3
},
makeNodeData = (relationObj) => {
if (relationObj) {
if (relationObj.updatedValues) {
return relationObj;
}
var obj = Object.assign(relationObj, {
shape: "img",
updatedValues: true,
label: relationObj.displayText.trunc(18),
toolTipLabel: relationObj.displayText,
id: relationObj.guid,
isLineage: true,
isIncomplete: relationObj.isIncomplete,
entityDef: this.getEntityDef({ typeName: relationObj.typeName, entityDefCollection })
});
obj["serviceType"] = this.getServiceType(obj);
obj["superTypes"] = this.getNestedSuperTypes({
...obj,
entityDefCollection: entityDefCollection
});
obj["isProcess"] = this.isProcess(obj);
obj["isDeleted"] = this.isDeleted(obj);
return obj;
}
},
crateLineageRelationshipHashMap = function({ relations } = {}) {
var newHashMap = {};
relations.forEach(function(obj) {
if (newHashMap[obj.fromEntityId]) {
newHashMap[obj.fromEntityId].push(obj.toEntityId);
} else {
newHashMap[obj.fromEntityId] = [obj.toEntityId];
}
});
return newHashMap;
},
getStyleObjStr = function(styleObj) {
return "fill:" + styleObj.fill + ";stroke:" + styleObj.stroke + ";stroke-width:" + styleObj.width;
},
getNewToNodeRelationship = (toNodeGuid, filterObj) => {
if (toNodeGuid && relationshipMap[toNodeGuid]) {
var newRelationship = [];
relationshipMap[toNodeGuid].forEach((guid) => {
var nodeToBeUpdated = this.isNodeToBeUpdated(makeNodeData(guidEntityMap[guid]), filterObj);
if (nodeToBeUpdated.update) {
var newRelation = getNewToNodeRelationship(guid, filterObj);
if (newRelation) {
newRelationship = newRelationship.concat(newRelation);
}
} else {
newRelationship.push(guid);
}
});
return newRelationship;
} else {
return null;
}
},
getToNodeRelation = (toNodes, fromNodeToBeUpdated, filterObj) => {
var toNodeRelationship = [];
toNodes.forEach((toNodeGuid) => {
var toNodeToBeUpdated = this.isNodeToBeUpdated(makeNodeData(guidEntityMap[toNodeGuid]), filterObj);
if (toNodeToBeUpdated.update) {
// To node need to updated
if (pendingFromRelationship[toNodeGuid]) {
toNodeRelationship = toNodeRelationship.concat(pendingFromRelationship[toNodeGuid]);
} else {
var newToNodeRelationship = getNewToNodeRelationship(toNodeGuid, filterObj);
if (newToNodeRelationship) {
toNodeRelationship = toNodeRelationship.concat(newToNodeRelationship);
}
}
} else {
//when bothe node not to be updated.
toNodeRelationship.push(toNodeGuid);
}
});
return toNodeRelationship;
},
setNode = (guid) => {
if (!g._nodes[guid]) {
var nodeData = makeNodeData(guidEntityMap[guid]);
setGraphNode(guid, nodeData);
return nodeData;
} else {
return g._nodes[guid];
}
},
setEdge = function(fromNodeGuid, toNodeGuid, opt = {}) {
setGraphEdge(fromNodeGuid, toNodeGuid, {
arrowhead: "arrowPoint",
curve: curveBasis,
style: getStyleObjStr(styleObj),
styleObj: styleObj,
...opt
});
},
setGraphData = function(fromEntityId, toEntityId) {
setNode(fromEntityId);
setNode(toEntityId);
setEdge(fromEntityId, toEntityId);
},
pendingFromRelationship = {};
if (isHideFilterOn) {
var relationshipMap = crateLineageRelationshipHashMap(data);
Object.keys(relationshipMap).forEach((fromNodeGuid) => {
var toNodes = relationshipMap[fromNodeGuid],
fromNodeToBeUpdated = this.isNodeToBeUpdated(makeNodeData(guidEntityMap[fromNodeGuid]), filterObj),
toNodeList = getToNodeRelation(toNodes, fromNodeToBeUpdated, filterObj);
if (fromNodeToBeUpdated.update) {
if (pendingFromRelationship[fromNodeGuid]) {
pendingFromRelationship[fromNodeGuid] = pendingFromRelationship[fromNodeGuid].concat(toNodeList);
} else {
pendingFromRelationship[fromNodeGuid] = toNodeList;
}
} else {
toNodeList.forEach(function(toNodeGuid) {
setGraphData(fromNodeGuid, toNodeGuid);
});
}
});
} else {
relations.forEach(function(obj) {
setGraphData(obj.fromEntityId, obj.toEntityId);
});
}
if (g._nodes[guid]) {
if (g._nodes[guid]) {
g._nodes[guid]["isLineage"] = false;
}
this.findImpactNodeAndUpdateData({
guid,
g,
setEdge,
getStyleObjStr
});
}
resolve(g);
} catch (e) {
reject(e);
}
});
},
findImpactNodeAndUpdateData: function({ guid, getStyleObjStr, g, setEdge }) {
var that = this,
traversedMap = {},
styleObj = {
fill: "none",
stroke: "#fb4200",
width: 3
},
traversed = function(toNodeList = {}, fromNodeGuid) {
let toNodeKeyList = Object.keys(toNodeList);
if (toNodeKeyList.length) {
if (!traversedMap[fromNodeGuid]) {
traversedMap[fromNodeGuid] = true;
toNodeKeyList.forEach(function(toNodeGuid) {
if (g._nodes[toNodeGuid]) {
g._nodes[toNodeGuid]["isLineage"] = false;
}
setEdge(fromNodeGuid, toNodeGuid, {
style: getStyleObjStr(styleObj),
styleObj: styleObj
});
traversed(g._sucs[toNodeGuid], toNodeGuid);
});
}
}
};
traversed(g._sucs[guid], guid);
}
};
export default DataUtils;
\ No newline at end of file
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { select, event } from "d3-selection";
import { zoom, zoomIdentity } from "d3-zoom";
import { drag } from "d3-drag";
import { line, curveBasis } from "d3-shape";
import platform from "platform";
import Enums from "../Enums";
const LineageUtils = {
/**
* [nodeArrowDistance variable use to define the distance between arrow and node]
* @type {Number}
*/
nodeArrowDistance: 24,
refreshGraphForSafari: function (options) {
var edgePathEl = options.edgeEl,
IEGraphRenderDone = 0;
edgePathEl.each(function (argument) {
var eleRef = this,
childNode = $(this).find("pattern");
setTimeout(function (argument) {
$(eleRef).find("defs").append(childNode);
}, 500);
});
},
refreshGraphForIE: function ({ edgePathEl }) {
var IEGraphRenderDone = 0;
edgePathEl.each(function (argument) {
var childNode = $(this).find("marker");
$(this).find("marker").remove();
var eleRef = this;
++IEGraphRenderDone;
setTimeout(function (argument) {
$(eleRef).find("defs").append(childNode);
--IEGraphRenderDone;
if (IEGraphRenderDone === 0) {
this.$(".fontLoader").hide();
this.$("svg").fadeTo(1000, 1);
}
}, 1000);
});
},
/**
* [dragNode description]
* @param {[type]} options.g [description]
* @param {[type]} options.svg [description]
* @param {[type]} options.guid [description]
* @param {[type]} options.edgePathEl [description]
* @return {[type]} [description]
*/
dragNode: function ({ g, svg, guid, edgePathEl }) {
var dragHelper = {
dragmove: function (el, d) {
var node = select(el),
selectedNode = g.node(d),
prevX = selectedNode.x,
prevY = selectedNode.y;
selectedNode.x += event.dx;
selectedNode.y += event.dy;
node.attr("transform", "translate(" + selectedNode.x + "," + selectedNode.y + ")");
var dx = selectedNode.x - prevX,
dy = selectedNode.y - prevY;
g.edges().forEach((e) => {
if (e.v == d || e.w == d) {
var edge = g.edge(e.v, e.w);
this.translateEdge(edge, dx, dy);
select(edge.elem).select("path").attr("d", this.calcPoints(e));
}
});
//LineageUtils.refreshGraphForIE({ edgePathEl: edgePathEl });
},
translateEdge: function (e, dx, dy) {
e.points.forEach(function (p) {
p.x = p.x + dx;
p.y = p.y + dy;
});
},
calcPoints: function (e) {
var edge = g.edge(e.v, e.w),
tail = g.node(e.v),
head = g.node(e.w),
points = edge.points.slice(1, edge.points.length - 1),
afterslice = edge.points.slice(1, edge.points.length - 1);
points.unshift(this.intersectRect(tail, points[0]));
points.push(this.intersectRect(head, points[points.length - 1]));
return line()
.x(function (d) {
return d.x;
})
.y(function (d) {
return d.y;
})
.curve(curveBasis)(points);
},
intersectRect: (node, point) => {
var x = node.x,
y = node.y,
dx = point.x - x,
dy = point.y - y,
nodeDistance = guid ? this.nodeArrowDistance + 3 : this.nodeArrowDistance,
w = nodeDistance,
h = nodeDistance,
sx = 0,
sy = 0;
if (Math.abs(dy) * w > Math.abs(dx) * h) {
// Intersection is top or bottom of rect.
if (dy < 0) {
h = -h;
}
sx = dy === 0 ? 0 : (h * dx) / dy;
sy = h;
} else {
// Intersection is left or right of rect.
if (dx < 0) {
w = -w;
}
sx = w;
sy = dx === 0 ? 0 : (w * dy) / dx;
}
return {
x: x + sx,
y: y + sy
};
}
};
var dragNodeHandler = drag().on("drag", function (d) {
dragHelper.dragmove.call(dragHelper, this, d);
}),
dragEdgePathHandler = drag().on("drag", function (d) {
dragHelper.translateEdge(g.edge(d.v, d.w), event.dx, event.dy);
var edgeObj = g.edge(d.v, d.w);
select(edgeObj.elem).select("path").attr("d", dragHelper.calcPoints(d));
});
dragNodeHandler(svg.selectAll("g.node"));
dragEdgePathHandler(svg.selectAll("g.edgePath"));
},
zoomIn: function ({ svg, scaleFactor = 1.3 }) {
this.d3Zoom.scaleBy(svg.transition().duration(750), scaleFactor);
},
zoomOut: function ({ svg, scaleFactor = 0.8 }) {
this.d3Zoom.scaleBy(svg.transition().duration(750), scaleFactor);
},
zoom: function ({ svg, xa, ya, scale }) {
svg.transition().duration(750).call(this.d3Zoom.transform, zoomIdentity.translate(xa, ya).scale(scale));
},
fitToScreen: function ({ svg }) {
var node = svg.node();
var bounds = node.getBBox();
var parent = node.parentElement,
fullWidth = parent.clientWidth,
fullHeight = parent.clientHeight;
var width = bounds.width,
height = bounds.height;
var midX = bounds.x + width / 2,
midY = bounds.y + height / 2;
var scale = (scale || 0.95) / Math.max(width / fullWidth, height / fullHeight),
xa = fullWidth / 2 - scale * midX,
ya = fullHeight / 2 - scale * midY;
this.zoom({ svg, xa, ya, scale });
},
/**
* [centerNode description]
* @param {[type]} options.guid [description]
* @param {[type]} options.g [description]
* @param {[type]} options.svg [description]
* @param {[type]} options.svgGroupEl [description]
* @param {[type]} options.edgePathEl [description]
* @param {[type]} options.width [description]
* @param {[type]} options.height [description]
* @param {[type]} options.onCenterZoomed [description]
* @return {[type]} [description]
*/
centerNode: function ({ guid, g, svg, svgGroupEl, edgePathEl, width, height, fitToScreen, onCenterZoomed }) {
this.d3Zoom = zoom();
svg.call(this.d3Zoom).on("dblclick.zoom", null);
// restrict events
let selectedNodeEl = svg.selectAll("g.nodes>g[id='" + guid + "']"),
zoomListener = this.d3Zoom.scaleExtent([0.01, 50]).on("zoom", function () {
svgGroupEl.attr("transform", event.transform);
}),
x = null,
y = null,
scale = 1.2;
if (selectedNodeEl.empty()) {
if (fitToScreen) {
this.fitToScreen({ svg });
return;
} else {
x = g.graph().width / 2;
y = g.graph().height / 2;
}
} else {
var matrix = selectedNodeEl
.attr("transform")
.replace(/[^0-9\-.,]/g, "")
.split(",");
// if (platform.name === "IE" || platform.name === "Microsoft Edge") {
// var matrix = selectedNode
// .attr("transform")
// .replace(/[a-z\()]/g, "")
// .split(" ");
// }
x = matrix[0];
y = matrix[1];
}
var xa = -(x * scale - width / 2),
ya = -(y * scale - height / 2);
this.zoom({ svg, xa, ya, scale });
svg.transition().duration(750).call(this.d3Zoom.transform, zoomIdentity.translate(xa, ya).scale(scale));
if (onCenterZoomed) {
onCenterZoomed({ newScale: scale, newTranslate: [xa, ya], d3Zoom: this.d3Zoom, selectedNodeEl });
}
// if (platform.name === "IE") {
// LineageUtils.refreshGraphForIE({ edgePathEl: edgePathEl });
// }
},
/**
* [getToolTipDirection description]
* @param {[type]} options.el [description]
* @return {[type]} [description]
*/
getToolTipDirection: function ({ el }) {
var width = select("body").node().getBoundingClientRect().width,
currentELWidth = select(el).node().getBoundingClientRect(),
direction = "e";
if (width - currentELWidth.left < 330) {
direction = width - currentELWidth.left < 330 && currentELWidth.top < 400 ? "sw" : "w";
if (width - currentELWidth.left < 330 && currentELWidth.top > 600) {
direction = "nw";
}
} else if (currentELWidth.top > 600) {
direction = width - currentELWidth.left < 330 && currentELWidth.top > 600 ? "nw" : "n";
if (currentELWidth.left < 50) {
direction = "ne";
}
} else if (currentELWidth.top < 400) {
direction = currentELWidth.left < 50 ? "se" : "s";
}
return direction;
},
/**
* [onHoverFade description]
* @param {[type]} options.svg [description]
* @param {[type]} options.g [description]
* @param {[type]} options.mouseenter [description]
* @param {[type]} options.opacity [description]
* @param {[type]} options.nodesToHighlight [description]
* @param {[type]} options.hoveredNode [description]
* @return {[type]} [description]
*/
onHoverFade: function ({ svg, g, mouseenter, nodesToHighlight, hoveredNode }) {
var node = svg.selectAll(".node"),
path = svg.selectAll(".edgePath"),
isConnected = function (a, b, o) {
if (a === o || (b && b.length && b.indexOf(o) != -1)) {
return true;
}
};
if (mouseenter) {
svg.classed("hover", true);
var nextNode = g.successors(hoveredNode),
previousNode = g.predecessors(hoveredNode),
nodesToHighlight = nextNode.concat(previousNode);
node.classed("hover-active-node", function (currentNode, i, nodes) {
if (isConnected(hoveredNode, nodesToHighlight, currentNode)) {
return true;
} else {
return false;
}
});
path.classed("hover-active-path", function (c) {
var _thisOpacity = c.v === hoveredNode || c.w === hoveredNode ? 1 : 0;
if (_thisOpacity) {
return true;
} else {
return false;
}
});
} else {
svg.classed("hover", false);
node.classed("hover-active-node", false);
path.classed("hover-active-path", false);
}
},
/**
* [getBaseUrl description]
* @param {[type]} path [description]
* @return {[type]} [description]
*/
getBaseUrl: function (url = window.location.pathname) {
return url.replace(/\/[\w-]+.(jsp|html)|\/+$/gi, "");
},
getEntityIconPath: function ({ entityData, errorUrl, imgBasePath }) {
var iconBasePath = this.getBaseUrl() + (imgBasePath || "/img/entity-icon/");
if (entityData) {
let { typeName, serviceType, status, isProcess } = entityData;
function getImgPath(imageName) {
return iconBasePath + (Enums.entityStateReadOnly[status] ? "disabled/" + imageName : imageName);
}
function getDefaultImgPath() {
if (isProcess) {
if (Enums.entityStateReadOnly[status]) {
return iconBasePath + "disabled/process.png";
} else {
return iconBasePath + "process.png";
}
} else {
if (Enums.entityStateReadOnly[status]) {
return iconBasePath + "disabled/table.png";
} else {
return iconBasePath + "table.png";
}
}
}
if (errorUrl) {
// Check if the default img path has error, if yes then stop recursion.
if (errorUrl.indexOf("table.png") > -1 || errorUrl.indexOf("process.png") > -1) {
return null;
}
var isErrorInTypeName = errorUrl && errorUrl.match("entity-icon/" + typeName + ".png|disabled/" + typeName + ".png") ? true : false;
if (serviceType && isErrorInTypeName) {
var imageName = serviceType + ".png";
return getImgPath(imageName);
} else {
return getDefaultImgPath();
}
} else if (typeName) {
var imageName = typeName + ".png";
return getImgPath(imageName);
} else if (serviceType) {
var imageName = serviceType + ".png";
return getImgPath(imageName);
} else {
return getDefaultImgPath();
}
}
},
base64Encode: function (file, callback) {
const reader = new FileReader();
reader.addEventListener("load", () => callback(reader.result));
reader.readAsDataURL(file);
},
imgShapeRender: function (parent, bbox, node, { dagreD3, defsEl, imgBasePath, guid }) {
var that = this,
viewGuid = guid,
imageIconPath = this.getEntityIconPath({ entityData: node, imgBasePath }),
imgName = imageIconPath.split("/").pop();
if (this.imageObject === undefined) {
this.imageObject = {};
}
if (node.isDeleted) {
imgName = "deleted_" + imgName;
}
if (node.id == viewGuid) {
var currentNode = true;
}
var shapeSvg = parent
.append("circle")
.attr("fill", "url(#img_" + imgName + ")")
.attr("r", "24px")
.attr("data-stroke", node.id)
.attr("stroke-width", "2px")
.attr("class", "nodeImage " + (currentNode ? "currentNode" : node.isProcess ? "process" : "node"));
if (currentNode) {
shapeSvg.attr("stroke", "#fb4200");
}
if (node.isIncomplete === true) {
parent.attr("class", "node isIncomplete show");
parent
.insert("foreignObject")
.attr("x", "-25")
.attr("y", "-25")
.attr("width", "50")
.attr("height", "50")
.append("xhtml:div")
.insert("i")
.attr("class", "fa fa-hourglass-half");
}
if (defsEl.select('pattern[id="img_' + imgName + '"]').empty()) {
defsEl
.append("pattern")
.attr("x", "0%")
.attr("y", "0%")
.attr("patternUnits", "objectBoundingBox")
.attr("id", "img_" + imgName)
.attr("width", "100%")
.attr("height", "100%")
.append("image")
.attr("href", function (d) {
var imgEl = this;
if (node) {
var getImageData = function (options) {
var imagePath = options.imagePath,
ajaxOptions = {
url: imagePath,
method: "GET",
cache: true
};
// if (platform.name !== "IE") {
// ajaxOptions["mimeType"] = "text/plain; charset=x-user-defined";
// }
shapeSvg.attr("data-iconpath", imagePath);
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
if (platform.name !== "IE") {
that.base64Encode(this.response, (url) => {
that.imageObject[imageIconPath] = url;
select(imgEl).attr("xlink:href", url);
});
} else {
that.imageObject[imageIconPath] = imagePath;
}
if (imageIconPath !== shapeSvg.attr("data-iconpath")) {
shapeSvg.attr("data-iconpathorigin", imageIconPath);
}
} else if (xhr.status === 404) {
const imgPath = that.getEntityIconPath({ entityData: node, errorUrl: imagePath });
if (imgPath === null) {
const patternEL = select(imgEl.parentElement);
patternEL.select("image").remove();
patternEL
.attr("patternContentUnits", "objectBoundingBox")
.append("circle")
.attr("r", "24px")
.attr("fill", "#e8e8e8");
} else {
getImageData({
imagePath: imgPath
});
}
}
}
};
xhr.responseType = "blob";
xhr.open(ajaxOptions.method, ajaxOptions.url, true);
xhr.send(null);
};
getImageData({
imagePath: imageIconPath
});
}
})
.attr("x", "4")
.attr("y", currentNode ? "3" : "4")
.attr("width", "40")
.attr("height", "40");
}
node.intersect = function (point) {
return dagreD3.intersect.circle(node, currentNode ? that.nodeArrowDistance + 3 : that.nodeArrowDistance, point);
};
return shapeSvg;
},
/**
* [arrowPointRender description]
* @param {[type]} {parent, id, edge, type, viewOptions [description]
* @return {[type]} [description]
*/
arrowPointRender: function (parent, id, edge, type, { dagreD3 }) {
var node = parent.node(),
parentNode = node ? node.parentNode : parent;
select(parentNode)
.select("path.path")
.attr("marker-end", "url(#" + id + ")");
var marker = parent
.append("marker")
.attr("id", id)
.attr("viewBox", "0 0 10 10")
.attr("refX", 8)
.attr("refY", 5)
.attr("markerUnits", "strokeWidth")
.attr("markerWidth", 4)
.attr("markerHeight", 4)
.attr("orient", "auto");
var path = marker.append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").style("fill", edge.styleObj.stroke);
dagreD3.util.applyStyle(path, edge[type + "Style"]);
},
/**
* [saveSvg description]
* @param {[type]} options.svg [description]
* @param {[type]} options.width [description]
* @param {[type]} options.height [description]
* @param {[type]} options.downloadFileName [description]
* @param {[type]} options.onExportLineage [description]
* @return {[type]} [description]
*/
saveSvg: function ({ svg, width, height, downloadFileName, onExportLineage }) {
var that = this,
svgClone = svg.clone(true).node(),
scaleFactor = 1;
setTimeout(function () {
if (platform.name === "Firefox") {
svgClone.setAttribute("width", width);
svgClone.setAttribute("height", height);
}
const hiddenSvgEl = select("body").append("div");
hiddenSvgEl.classed("hidden-svg", true);
hiddenSvgEl.node().appendChild(svgClone);
const svgCloneEl = select(".hidden-svg svg");
svgCloneEl.select("g").attr("transform", "scale(" + scaleFactor + ")");
svgCloneEl.select("foreignObject").remove();
var canvasOffset = { x: 150, y: 150 },
setWidth = svgClone.getBBox().width + canvasOffset.x,
setHeight = svgClone.getBBox().height + canvasOffset.y,
xAxis = svgClone.getBBox().x,
yAxis = svgClone.getBBox().y;
svgClone.attributes.viewBox.value = xAxis + "," + yAxis + "," + setWidth + "," + setHeight;
var canvas = document.createElement("canvas");
canvas.id = "canvas";
canvas.style.display = "none";
canvas.width = svgClone.getBBox().width * scaleFactor + canvasOffset.x;
canvas.height = svgClone.getBBox().height * scaleFactor + canvasOffset.y;
// Append Canvas in DOM
select("body").node().appendChild(canvas);
var ctx = canvas.getContext("2d"),
data = new XMLSerializer().serializeToString(svgClone),
DOMURL = window.URL || window.webkitURL || window;
ctx.fillStyle = "#FFFFFF";
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.strokeRect(0, 0, canvas.width, canvas.height);
ctx.restore();
var img = new Image(canvas.width, canvas.height);
var svgBlob = new Blob([data], { type: "image/svg+xml;base64" });
if (platform.name === "Safari") {
svgBlob = new Blob([data], { type: "image/svg+xml" });
}
var url = DOMURL.createObjectURL(svgBlob);
img.onload = function () {
try {
var a = document.createElement("a");
a.download = downloadFileName;
document.body.appendChild(a);
ctx.drawImage(img, 50, 50, canvas.width, canvas.height);
canvas.toBlob(function (blob) {
if (!blob) {
onExportLineage({ status: "failed", message: "There was an error in downloading Lineage!" });
return;
}
a.href = DOMURL.createObjectURL(blob);
if (blob.size > 10000000) {
onExportLineage({ status: "failed", message: "The Image size is huge, please open the image in a browser!" });
}
a.click();
onExportLineage({ status: "Success", message: "Successful" });
if (platform.name === "Safari") {
that.refreshGraphForSafari({
edgeEl: that.$("svg g.node")
});
}
}, "image/png");
hiddenSvgEl.remove();
canvas.remove();
} catch (err) {
onExportLineage({ status: "failed", message: "There was an error in downloading Lineage!" });
}
};
img.src = url;
}, 0);
}
};
export default LineageUtils;
\ No newline at end of file
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import LineageUtils from "./LineageUtils";
import DataUtils from "./DataUtils";
String.prototype.trunc =
String.prototype.trunc ||
function(n) {
return this.length > n ? this.substr(0, n - 1) + "..." : this;
};
export { LineageUtils, DataUtils };
\ No newline at end of file
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import dagreD3 from "dagre-d3";
import { select, selection, event } from "d3-selection";
import { curveBasis } from "d3-shape";
import { LineageUtils, DataUtils } from "./Utils";
import d3Tip from "d3-tip";
import "./styles/style.scss";
export default class LineageHelper {
constructor(options) {
this._updateOptions(options);
const { el, manualTrigger = false } = this.options;
if (el === undefined) {
throw new Error("LineageHelper requires el propety to render the graph");
}
this.initReturnObj = {
init: (arg) => this.init(arg),
createGraph: (opt = {}) => this._createGraph(this.options, this.graphOptions, opt),
clear: (arg) => this.clear(arg),
refresh: (arg) => this.refresh(arg),
centerAlign: (arg) => this.centerAlign(arg),
exportLineage: (arg) => this.exportLineage(arg),
zoomIn: (arg) => this.zoomIn(arg),
zoomOut: (arg) => this.zoomOut(arg),
zoom: (arg) => this.zoom(arg),
fullScreen: (arg) => this.fullScreen(arg),
searchNode: (arg) => this.searchNode(arg),
removeNodeSelection: (arg) => this.removeNodeSelection(arg),
getGraphOptions: () => this.graphOptions,
getNode: (guid, actual) => {
let rObj = null;
if (actual) {
rObj = this.actualData[guid];
} else {
rObj = this.g._nodes[guid];
}
if (rObj) {
rObj = Object.assign({}, rObj);
}
return rObj;
},
getNodes: (guid, actual) => {
let rObj = null;
if (actual) {
rObj = this.actualData;
} else {
rObj = this.g._nodes;
}
if (rObj) {
rObj = Object.assign({}, rObj);
}
return rObj;
},
setNode: this._setGraphNode,
setEdge: this._setGraphEdge
};
if (manualTrigger === false) {
this.init();
}
return this.initReturnObj;
}
/**
* [updateOptions get the options from user and appedn add it in this,option context]
* @param {[Object]} options [lib options from user]
* @return {[null]} [null]
*/
_updateOptions(options) {
this.options = {};
Object.assign(this.options, { filterObj: { isProcessHideCheck: false, isDeletedEntityHideCheck: false } }, options);
}
/**
* [init Start the graph build process]
* @return {[null]} [null]
*/
init() {
const { data = {} } = this.options;
if (data.baseEntityGuid) {
this.guid = data.baseEntityGuid;
}
// Call the initializeGraph method to initlize dagreD3 graphlib
this._initializeGraph();
this._initGraph();
}
/**
* [clear Allows user to clear the graph refrence and dom]
* @return {[type]} [description]
*/
clear() {
if (!this.options.el) {
this.svg.remove();
this.svg = null;
}
this.g = null;
this.graphOptions = {};
}
/**
* [centerAlign Allows user to center the lineage position, without rerender]
* @return {[type]} [description]
*/
centerAlign(opt = {}) {
var svgGroupEl = this.svg.select("g"),
edgePathEl = svgGroupEl.selectAll("g.edgePath");
LineageUtils.centerNode({
...this.graphOptions,
svgGroupEl,
edgePathEl,
...opt
});
}
/**
* [zoomIn description]
* @return {[type]} [description]
*/
zoomIn(opt = {}) {
LineageUtils.zoomIn({ ...this.graphOptions, ...opt });
}
/**
* [zoomOut description]
* @return {[type]} [description]
*/
zoomOut(opt = {}) {
LineageUtils.zoomOut({ ...this.graphOptions, ...opt });
}
/**
* [zoom description]
* @return {[type]} [description]
*/
zoom(opt = {}) {
LineageUtils.zoom({ ...this.graphOptions, ...opt });
}
/**
* [refresh Allows user to rerender the lineage]
* @return {[type]} [description]
*/
refresh() {
this.clear();
this._initializeGraph();
this._initGraph({ refresh: true });
}
/**
* [removeNodeSelection description]
* @return {[type]} [description]
*/
removeNodeSelection() {
this.svg.selectAll("g.node>circle").classed("node-detail-highlight", false);
}
/**
* [searchNode description]
* @return {[type]} [description]
*/
searchNode({ guid, onSearchNode }) {
this.svg.selectAll(".serach-rect").remove();
this.centerAlign({
guid: guid,
onCenterZoomed: function (opts) {
const { selectedNodeEl } = opts;
selectedNodeEl.select(".label").attr("stroke", "#316132");
selectedNodeEl.select("circle").classed("wobble", true);
selectedNodeEl
.insert("rect", "circle")
.attr("class", "serach-rect")
.attr("x", -50)
.attr("y", -27.5)
.attr("width", 100)
.attr("height", 55);
if (onSearchNode && typeof onSearchNode === "function") {
onSearchNode(opts);
}
}
});
}
/**
* [exportLineage description]
* @param {Object} options [description]
* @return {[type]} [description]
*/
exportLineage(options = {}) {
let downloadFileName = options.downloadFileName;
if (downloadFileName === undefined) {
let node = this.g._nodes[this.guid];
if (node && node.attributes) {
downloadFileName = `${node.attributes.qualifiedName || node.attributes.name || "lineage_export"}.png`;
} else {
downloadFileName = "lineage_export.png";
}
}
LineageUtils.saveSvg({
...this.graphOptions,
downloadFileName: downloadFileName,
onExportLineage: (opt) => {
if (options.onExportLineage) {
onExportLineage(opt);
}
}
});
}
/**
* [fullScreen description]
* @param {Object} options.el } [description]
* @return {[type]} [description]
*/
fullScreen({ el } = {}) {
if (el === undefined) {
throw new Error("LineageHelper requires el propety to apply fullScreen class");
}
const fullScreenEl = select(el);
if (fullScreenEl.classed("fullscreen-mode")) {
fullScreenEl.classed("fullscreen-mode", false);
return false;
} else {
fullScreenEl.classed("fullscreen-mode", true);
return true;
}
}
/**
* [_getValueFromUser description]
* @param {[type]} ref [description]
* @return {[type]} [description]
*/
_getValueFromUser(ref) {
if (ref !== undefined) {
if (typeof ref === "function") {
return ref();
} else {
return ref;
}
}
return;
}
/**
* [initializeGraph initlize the dagreD3 graphlib]
* @return {[null]} [null]
*/
_initializeGraph() {
const { width = "100%", height = "100%", el } = this.options;
// Append the svg using d3.
this.svg = select(el);
if (!(el instanceof SVGElement)) {
this.svg = this.svg
.append("svg")
.attr("xmlns", "http://www.w3.org/2000/svg")
.attr(" xmlns:xlink", "http://www.w3.org/1999/xlink")
.attr("version", "1.1")
.attr("width", width)
.attr("height", height);
}
// initlize the dagreD3 graphlib
this.g = new dagreD3.graphlib.Graph()
.setGraph(
Object.assign(
{
nodesep: 50,
ranksep: 90,
rankdir: "LR",
marginx: 20,
marginy: 20,
transition: function transition(selection) {
return selection.transition().duration(500);
}
},
this.options.dagreOptions
)
)
.setDefaultEdgeLabel(function () {
return {};
});
// Create graphOptions for common use
var svgRect = this.svg.node().getBoundingClientRect();
this.actualData = {};
this.graphOptions = {
svg: this.svg,
g: this.g,
dagreD3: dagreD3,
guid: this.guid,
width: this.options.width || svgRect.width,
height: this.options.height || svgRect.height
};
}
/**
* [_initGraph description]
* @return {[type]} [description]
*/
_initGraph({ refresh } = {}) {
if (this.svg) {
this.svg.select("g").remove();
}
let filterObj = this.options.filterObj;
if (this.options.getFilterObj) {
let filterObjVal = this.options.getFilterObj();
if (filterObjVal !== undefined || filterObjVal !== null) {
if (typeof filterObjVal === "object") {
filterObj = filterObjVal;
} else {
throw new Error("getFilterObj expect return type `object`,`null` or `Undefined`");
}
}
}
if (this.options.setDataManually === true) {
return;
} else if (this.options.data === undefined || (this.options.data && this.options.data.relations.length === 0)) {
if (this.options.beforeRender) {
this.options.beforeRender();
}
this.svg
.append("text")
.attr("x", "50%")
.attr("y", "50%")
.attr("alignment-baseline", "middle")
.attr("text-anchor", "middle")
.text("No lineage data found");
if (this.options.afterRender) {
this.options.afterRender();
}
return;
}
return DataUtils.generateData({
...this.options,
filterObj: filterObj,
...this.graphOptions,
setGraphNode: this._setGraphNode,
setGraphEdge: this._setGraphEdge
}).then((graphObj) => {
this._createGraph(this.options, this.graphOptions, { refresh });
});
}
/**
* [description]
* @param {[type]} guid [description]
* @param {[type]} nodeData [description]
* @return {[type]} [description]
*/
_setGraphNode = (guid, nodeData) => {
this.actualData[guid] = Object.assign({}, nodeData);
this.g.setNode(guid, nodeData);
};
/**
* [description]
* @param {[type]} fromGuid [description]
* @param {[type]} toGuid [description]
* @param {[type]} opts [description]
* @return {[type]} [description]
*/
_setGraphEdge = (fromGuid, toGuid, opts) => {
this.g.setEdge(fromGuid, toGuid, {
curve: curveBasis,
...opts
});
};
/**
* [_createGraph description]
* @param {Object} options.data [description]
* @param {Boolean} isShowTooltip [description]
* @param {Boolean} isShowHoverPath [description]
* @param {[type]} onLabelClick [description]
* @param {[type]} onPathClick [description]
* @param {[type]} onNodeClick } [description]
* @param {[type]} graphOptions [description]
* @return {[type]} [description]
*/
_createGraph(
{ data = {}, imgBasePath, isShowTooltip, isShowHoverPath, onLabelClick, onPathClick, onNodeClick, zoom, fitToScreen },
graphOptions,
{ refresh }
) {
if (this.options.beforeRender) {
this.options.beforeRender();
}
const that = this,
{ svg, g, width, height } = graphOptions;
if (svg instanceof selection === false) {
throw new Error("svg is not initialized or something went wrong while creatig graph instance");
return;
}
if (g._nodes === undefined || g._nodes.length === 0) {
svg.html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relations to display</text>');
return;
}
g.nodes().forEach(function (v) {
var node = g.node(v);
// Round the corners of the nodes
if (node) {
node.rx = node.ry = 5;
}
});
svg.attr("viewBox", "0 0 " + width + " " + height).attr("enable-background", "new 0 0 " + width + " " + height);
var svgGroupEl = svg.append("g");
// Append defs
var defsEl = svg.append("defs");
// Create the renderer
var render = new dagreD3.render();
// Add our custom arrow (a hollow-point)
render.arrows().arrowPoint = function () {
return LineageUtils.arrowPointRender(...arguments, { ...graphOptions });
};
// Render custom img inside shape
render.shapes().img = function () {
return LineageUtils.imgShapeRender(...arguments, {
...graphOptions,
imgBasePath: that._getValueFromUser(imgBasePath),
defsEl
});
};
var tooltip = d3Tip()
.attr("class", "d3-tip")
.offset([10, 0])
.html((d) => {
var value = g.node(d);
var htmlStr = "";
if (value.id !== this.guid) {
htmlStr = "<h5 style='text-align: center;'>" + (value.isLineage ? "Lineage" : "Impact") + "</h5>";
}
htmlStr += "<h5 class='text-center'><span style='color:#359f89'>" + value.toolTipLabel + "</span></h5> ";
if (value.typeName) {
htmlStr += "<h5 class='text-center'><span>(" + value.typeName + ")</span></h5> ";
}
if (value.queryText) {
htmlStr += "<h5>Query: <span style='color:#359f89'>" + value.queryText + "</span></h5> ";
}
return "<div class='tip-inner-scroll'>" + htmlStr + "</div>";
});
svg.call(tooltip);
// if (platform.name !== "IE") {
// this.$(".fontLoader").hide();
// }
render(svgGroupEl, g);
//change text postion
svgGroupEl
.selectAll("g.nodes g.label")
.attr("transform", "translate(2,-35)")
.on("mouseenter", function (d) {
event.preventDefault();
select(this).classed("highlight", true);
})
.on("mouseleave", function (d) {
event.preventDefault();
select(this).classed("highlight", false);
})
.on("click", function (d) {
event.preventDefault();
if (onLabelClick && typeof onLabelClick === "function") {
onLabelClick({ clickedData: d });
}
tooltip.hide(d);
});
svgGroupEl
.selectAll("g.nodes g.node circle")
.on("mouseenter", function (d, index, element) {
that.activeNode = true;
var matrix = this.getScreenCTM().translate(+this.getAttribute("cx"), +this.getAttribute("cy"));
that.svg.selectAll(".node").classed("active", false);
select(this).classed("active", true);
if (that._getValueFromUser(isShowTooltip)) {
var direction = LineageUtils.getToolTipDirection({ el: this });
tooltip.direction(direction).show(d, this);
}
if (that._getValueFromUser(isShowHoverPath) === false) {
return;
}
LineageUtils.onHoverFade({
opacity: 0.3,
mouseenter: true,
hoveredNode: d,
...graphOptions
});
})
.on("mouseleave", function (d) {
that.activeNode = false;
var nodeEL = this;
setTimeout(function (argument) {
if (!(that.activeTip || that.activeNode)) {
select(nodeEL).classed("active", false);
if (that._getValueFromUser(isShowTooltip)) {
tooltip.hide(d);
}
}
}, 150);
if (that._getValueFromUser(isShowHoverPath) === false) {
return;
}
LineageUtils.onHoverFade({
mouseenter: false,
hoveredNode: d,
...graphOptions
});
})
.on("click", function (d) {
if (event.defaultPrevented) return; // ignore drag
event.preventDefault();
tooltip.hide(d);
svg.selectAll("g.node>circle").classed("node-detail-highlight", false);
select(this).classed("node-detail-highlight", true);
if (onNodeClick && typeof onNodeClick === "function") {
onNodeClick({ clickedData: d, el: this });
}
});
// Bind event on edgePath
var edgePathEl = svgGroupEl.selectAll("g.edgePath");
edgePathEl.selectAll("path.path").on("click", function (d) {
if (onPathClick && typeof onPathClick === "function") {
var pathRelationObj = data.relations.find(function (obj) {
if (obj.fromEntityId === d.v && obj.toEntityId === d.w) {
return true;
}
});
onPathClick({ pathRelationObj, clickedData: d });
}
});
// tooltip hover handle to fix node hover conflict
// select("body").on("mouseover", ".d3-tip", function(el) {
// that.activeTip = true;
// });
// select("body").on("mouseleave", ".d3-tip", function(el) {
// that.activeTip = false;
// svg.selectAll(".node").classed("active", false);
// //tooltip.hide();
// });
// Center the graph
if (zoom !== false) {
LineageUtils.centerNode({
...graphOptions,
fitToScreen,
svgGroupEl,
edgePathEl
});
}
// if (platform.name === "IE") {
// LineageUtils.refreshGraphForIE({
// edgeEl: this.$("svg .edgePath")
// });
// }
LineageUtils.dragNode({
...graphOptions,
edgePathEl
});
if (refresh !== true) {
this._addLegend();
}
if (this.options.afterRender) {
this.options.afterRender();
}
}
_addLegend() {
if (this.options.legends === false) {
return;
}
var container = select(this.options.legendsEl || this.options.el)
.insert("div", ":first-child")
.classed("legends", true);
let span = container.append("span").style("color", "#fb4200");
span.append("i").classed("fa fa-circle-o fa-fw", true);
span.append("span").html("Current Entity");
span = container.append("span").style("color", "#686868");
span.append("i").classed("fa fa-hourglass-half fa-fw", true);
span.append("span").html("In Progress");
span = container.append("span").style("color", "#df9b00");
span.append("i").classed("fa fa-long-arrow-right fa-fw", true);
span.append("span").html("Lineage");
span = container.append("span").style("color", "#fb4200");
span.append("i").classed("fa fa-long-arrow-right fa-fw", true);
span.append("span").html("Impact");
}
}
\ No newline at end of file
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//fonts
$font_0: Source Sans Pro;
$font_1: sans-serif;
//Colors
$white: #fff;
$dark_gray: #666;
$light_gray: #e8e8e8;
$black_80: rgba(0, 0, 0, 0.8);
$color_mountain_mist_approx: #999;
$color_keppel_approx: #37bb9b;
$color_suva_gray_approx: #868686;
$color_havelock_blue_approx: #4a90e2;
$color_celeste_approx: #ccc;
$color_bright_turquoise_approx: #00ffd0;
$color_jungle_green_approx: #38bb9b;
$delete_link: #bb5838;
\ No newline at end of file
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/* graph.scss */
.node {
cursor: pointer;
text {
font-size: 10px;
font-family: $font_1;
}
//transition: opacity 0.3s linear;
rect {
stroke: $color_mountain_mist_approx;
fill: $white;
stroke-width: 1.5px;
&.serach-rect {
stroke: $color_keppel_approx;
fill: transparent;
stroke-width: 2.5px;
}
}
.label {
fill: $color_suva_gray_approx;
&.highlight {
cursor: pointer;
fill: $color_havelock_blue_approx;
text-decoration: underline;
tspan {
font-weight: 400;
}
}
}
circle {
-moz-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
stroke-width: 1.5px;
&.node-detail-highlight {
stroke: $color_havelock_blue_approx;
stroke-width: 2px;
}
&.nodeImage {
&.green:hover {
stroke: #ffb203;
}
&.blue:hover {
stroke: #4b91e2;
}
&.currentNode {
stroke: #fb4200;
}
&:hover {
-moz-transform: scale(1.4);
-webkit-transform: scale(1.4);
transform: scale(1.4);
}
}
}
&.active {
circle {
-moz-transform: scale(1.4);
-webkit-transform: scale(1.4);
transform: scale(1.4);
&.nodeImage {
&.green {
stroke: #ffb203;
}
&.blue {
stroke: #4b91e2;
}
}
}
}
}
.legends {
> span {
margin-right: 8px;
font-family: $font_0;
}
}
svg.hover {
g.node {
opacity: 0.1 !important;
}
g.edgePath {
opacity: 0 !important;
}
g.node.hover-active-node,
g.edgePath.hover-active-path {
opacity: 1 !important;
}
}
.invisible {
.node circle {
transition: all 0s;
}
}
.edgePath {
.path {
cursor: pointer;
}
}
.link {
fill: none;
stroke: $color_celeste_approx;
stroke-width: 1.5px;
}
.text-center {
text-align: center;
}
.d3-tip {
line-height: 1;
font-weight: bold;
padding: 12px;
background: $black_80;
color: $white;
z-index: 999;
max-width: 300px; //Instead of the line below you could use @include border-radius($radius, $vertical-radius)
border-radius: 2px;
.tip-inner-scroll {
overflow: auto;
max-height: 300px;
h5 {
margin: 7px 0px;
}
}
/* Creates a small triangle extender for the tooltip */
&:after {
box-sizing: border-box;
display: inline;
font-size: 10px;
width: 100%;
line-height: 1;
color: rgba(0, 0, 0, 0.8);
position: absolute;
}
/* Nrthward tooltips */
&.n:after {
content: "\25BC";
margin: -1px 0 0 0;
top: 100%;
left: 0;
text-align: center;
}
/* Eastward tooltips */
&.e:after {
content: "\25C0";
margin: -4px 0 0 0;
top: 50%;
left: -8px;
}
/* Southward tooltips */
&.s:after {
content: "\25B2";
margin: 0 0 1px 0;
top: -8px;
left: 0;
text-align: center;
}
/* Westward tooltips */
&.w:after {
content: "\25B6";
margin: -4px 0 0 -1px;
top: 50%;
left: 100%;
}
}
g.type-TK > rect {
fill: $color_bright_turquoise_approx;
}
.fullscreen-mode {
position: fixed;
height: 100% !important;
top: 0;
bottom: 0;
left: 0;
width: 100%;
right: 0;
padding: 0 !important;
z-index: 9999;
overflow: hidden !important;
.resizeGraph {
position: fixed;
height: 100% !important;
.ui-resizable-handle {
display: none;
}
}
.lineage-box {
padding: 10px !important;
}
.box-panel {
margin: 10px !important;
}
}
@keyframes zoominoutsinglefeatured {
0% {
transform: scale(1, 1);
}
50% {
transform: scale(1.2, 1.2);
}
100% {
transform: scale(1, 1);
}
}
.wobble {
animation: zoominoutsinglefeatured 1s 5;
}
.hidden-svg {
visibility: hidden;
}
@-webkit-keyframes blink {
from {
opacity: 0.2;
}
to {
opacity: 0.5;
}
}
\ No newline at end of file
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
@import "./__varibale.scss";
@import "./graph.scss";
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const distPath = path.resolve(__dirname, "dist");
const node_env = process.env.NODE_ENV ? process.env.NODE_ENV : 'production';
const config = {
mode: node_env,
entry: "./src/index.js",
output: {
library: "LineageHelper",
libraryTarget: "umd",
path: distPath,
filename: "index.js"
},
plugins: [new MiniCssExtractPlugin({ filename: "styles.css" })],
externals: {
//don't bundle the 'react' npm package with our bundle.js
//but get it from a global 'React' variable
d3: "d3",
"dagre-d3": "dagreD3",
platform: "platform",
dagre: "dagre",
graphlib: "graphlib"
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"],
plugins: ["transform-class-properties"]
}
}
},
{
test: /\.s[ac]ss$/i,
use: [
MiniCssExtractPlugin.loader,
// Translates CSS into CommonJS
"css-loader",
// Compiles Sass to CSS
"sass-loader"
]
}
]
}
};
if (process.env.NODE_ENV === "development") {
config.devtool = "inline-source-map";
}
module.exports = config;
\ No newline at end of file
...@@ -128,10 +128,20 @@ require.config({ ...@@ -128,10 +128,20 @@ require.config({
'deps': ['d3'], 'deps': ['d3'],
'exports': ['d3-tip'] 'exports': ['d3-tip']
}, },
'LineageHelper': {
'deps': ['d3'],
},
'dagreD3': { 'dagreD3': {
'deps': ['d3'], 'deps': ['d3'],
'exports': ['dagreD3'] 'exports': ['dagreD3']
}, },
'nvd3': {
'deps': ['d3']
},
'sparkline': {
'deps': ['jquery'],
'exports': ['sparkline']
},
'pnotify': { 'pnotify': {
'exports': ['pnotify'] 'exports': ['pnotify']
}, },
...@@ -150,13 +160,6 @@ require.config({ ...@@ -150,13 +160,6 @@ require.config({
'moment': { 'moment': {
'exports': ['moment'] 'exports': ['moment']
}, },
'nvd3': {
'deps': ['d3']
},
'sparkline': {
'deps': ['jquery'],
'exports': ['sparkline']
},
'jstree': { 'jstree': {
'deps': ['jquery'] 'deps': ['jquery']
}, },
...@@ -183,12 +186,15 @@ require.config({ ...@@ -183,12 +186,15 @@ require.config({
'asBreadcrumbs': 'libs/jquery-asBreadcrumbs/js/jquery-asBreadcrumbs.min', 'asBreadcrumbs': 'libs/jquery-asBreadcrumbs/js/jquery-asBreadcrumbs.min',
'd3': 'libs/d3/d3.min', 'd3': 'libs/d3/d3.min',
'd3-tip': 'libs/d3/index', 'd3-tip': 'libs/d3/index',
'LineageHelper': 'external_lib/atlas-lineage/dist/index',
'dagreD3': 'libs/dagre-d3/dagre-d3.min',
'nvd3': 'libs/nvd3/nv.d3.min',
'sparkline': 'libs/sparkline/jquery.sparkline.min',
'tmpl': 'templates', 'tmpl': 'templates',
'requirejs.text': 'libs/requirejs-text/text', 'requirejs.text': 'libs/requirejs-text/text',
'handlebars': 'external_lib/require-handlebars-plugin/js/handlebars', 'handlebars': 'external_lib/require-handlebars-plugin/js/handlebars',
'hbs': 'external_lib/require-handlebars-plugin/js/hbs', 'hbs': 'external_lib/require-handlebars-plugin/js/hbs',
'i18nprecompile': 'external_lib/require-handlebars-plugin/js/i18nprecompile', 'i18nprecompile': 'external_lib/require-handlebars-plugin/js/i18nprecompile',
'dagreD3': 'libs/dagre-d3/dagre-d3.min',
'select2': 'libs/select2/select2.full.min', 'select2': 'libs/select2/select2.full.min',
'backgrid-select-all': 'libs/backgrid-select-all/backgrid-select-all.min', 'backgrid-select-all': 'libs/backgrid-select-all/backgrid-select-all.min',
'moment': 'libs/moment/js/moment.min', 'moment': 'libs/moment/js/moment.min',
...@@ -201,8 +207,6 @@ require.config({ ...@@ -201,8 +207,6 @@ require.config({
'platform': 'libs/platform/platform', 'platform': 'libs/platform/platform',
'query-builder': 'libs/jQueryQueryBuilder/js/query-builder.standalone.min', 'query-builder': 'libs/jQueryQueryBuilder/js/query-builder.standalone.min',
'daterangepicker': 'libs/bootstrap-daterangepicker/js/daterangepicker', 'daterangepicker': 'libs/bootstrap-daterangepicker/js/daterangepicker',
'nvd3': 'libs/nvd3/nv.d3.min',
'sparkline': 'libs/sparkline/jquery.sparkline.min',
'table-dragger': 'libs/table-dragger/table-dragger', 'table-dragger': 'libs/table-dragger/table-dragger',
'jstree': 'libs/jstree/jstree.min', 'jstree': 'libs/jstree/jstree.min',
'jquery-steps': 'libs/jquery-steps/jquery.steps.min', 'jquery-steps': 'libs/jquery-steps/jquery.steps.min',
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<li role="businessMetadata" class="tab active"><a href="#tab-businessMetadata" aria-controls="tab-businessMetadata" role="tab" data-toggle="tab">Business Metadata</a></li> <li role="businessMetadata" class="tab active"><a href="#tab-businessMetadata" aria-controls="tab-businessMetadata" role="tab" data-toggle="tab">Business Metadata</a></li>
<li role="enum"><a href="#tab-enum" aria-controls="tab-enum" role="tab" data-toggle="tab">Enumerations</a></li> <li role="enum"><a href="#tab-enum" aria-controls="tab-enum" role="tab" data-toggle="tab">Enumerations</a></li>
<li role="audit"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li> <li role="audit"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li>
<li role="typeSystem"><a href="#tab-typeSystem" aria-controls="tab-typeSystem" role="tab" data-toggle="tab">Type System</a></li>
</ul> </ul>
</div> </div>
</div> </div>
...@@ -36,5 +37,9 @@ ...@@ -36,5 +37,9 @@
<div id="r_adminTableLayoutView"> <div id="r_adminTableLayoutView">
</div> </div>
</div> </div>
<div id="tab-typeSystem" role="typeSystem" class="tab-pane animated fadeIn" style="position: relative;">
<div id="r_typeSystemTreeLayoutView">
</div>
</div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -100,7 +100,9 @@ ...@@ -100,7 +100,9 @@
</button> </button>
</div> </div>
<div> <div>
<button type="button" data-id="setting-toggler" title="Settings" class="btn btn-action btn-gray btn-sm"><i class="fa fa-gear"></i></button> <button type="button" data-id="setting-toggler" title="Settings" class="btn btn-action btn-gray btn-sm">
<i class="fa fa-gear"></i>
</button>
</div> </div>
<div> <div>
<button type="button" data-id="filter-toggler" title="Filter" class="btn btn-action btn-gray btn-sm"><i class="fa fa-filter"></i></button> <button type="button" data-id="filter-toggler" title="Filter" class="btn btn-action btn-gray btn-sm"><i class="fa fa-filter"></i></button>
...@@ -109,11 +111,17 @@ ...@@ -109,11 +111,17 @@
<button type="button" data-id="search-toggler" title="Search" class="btn btn-action btn-gray btn-sm"><i class="fa fa-search"></i></button> <button type="button" data-id="search-toggler" title="Search" class="btn btn-action btn-gray btn-sm"><i class="fa fa-search"></i></button>
</div> </div>
<div class="btn-group"> <div class="btn-group">
<button type="button" id="zoom_in" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom In" data-id="refreshBtn"> <i class="fa fa-search-plus"></i></button> <button type="button" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom In" data-id="zoom-in">
<button type="button" id="zoom_out" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom Out" data-id="refreshBtn"> <i class="fa fa-search-minus"></i></button> <i class="fa fa-search-plus"></i>
</button>
<button type="button" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom Out" data-id="zoom-out">
<i class="fa fa-search-minus"></i>
</button>
</div> </div>
<div> <div>
<button type="button" data-id="fullScreen-toggler" title="Full screen" class="btn btn-action btn-gray btn-sm fullscreen_lineage"><i class="fa fa-expand"></i></button> <button type="button" data-id="fullScreen-toggler" title="Full screen" class="btn btn-action btn-gray btn-sm fullscreen_lineage">
<i class="fa fa-expand"></i>
</button>
</div> </div>
</div> </div>
<div class="box-panel size-lg node-details slide-from-left lineage-node-detail"> <div class="box-panel size-lg node-details slide-from-left lineage-node-detail">
...@@ -123,7 +131,7 @@ ...@@ -123,7 +131,7 @@
<span data-id="box-close" class="btn btn-sm btn-close lineage-node-detail-close"><i class="fa fa-close"></i></span> <span data-id="box-close" class="btn btn-sm btn-close lineage-node-detail-close"><i class="fa fa-close"></i></span>
</div> </div>
<div class="body"> <div class="body">
<table class='table bold-key'> <table class="table bold-key">
<tbody data-id="nodeDetailTable"></tbody> <tbody data-id="nodeDetailTable"></tbody>
</table> </table>
</div> </div>
...@@ -131,11 +139,7 @@ ...@@ -131,11 +139,7 @@
<div class="fontLoader"> <div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </div>
<div class="legends pull-left" style="height: 25px; padding: 2px;"> <div class="legends pull-left" style="height: 25px; padding: 2px;"></div>
<span style="margin-right: 8px; color:#fb4200;"><i class="fa fa-circle-o fa-fw"></i>Current Entity</span> <div class="svg" style="height: 100%; width: 100%"></div>
<span style="margin-right: 8px; color:#df9b00;"><i class="fa fa-long-arrow-right fa-fw"></i>Lineage</span>
<span style="margin-right: 8px; color:#fb4200;"><i class="fa fa-long-arrow-right fa-fw"></i>Impact</span>
</div>
<svg width="{{width}}" height="{{height}}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"></svg>
</div> </div>
<div class="hidden-svg"></div> <div class="hidden-svg"></div>
\ No newline at end of file
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div id="typeSystemTreeViewPage" data-id="typeSystemTreeViewPage" class="systemTypeTree" style="height: calc(100vh - 180px); width: 100%; position: relative;overflow: hidden;">
<div class="box-panel size-lg node-details slide-from-left lineage-node-detail">
<div class="header clearfix">
<h4><span data-id="typeName"></span></h4>
<span data-id="box-close" class="btn btn-sm btn-close lineage-node-detail-close"><i class="fa fa-close"></i></span>
<span data-id="box-close" class="btn btn-sm btn-close lineage-node-detail-close"><i class="fa fa-close"></i></span>
</div>
<div class="body">
<table class="table bold-key">
<tbody data-id="nodeDetailTable"></tbody>
</table>
</div>
</div>
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div class="box-panel filter-box">
<div class="header clearfix">
<h4>Filters</h4>
<span data-id="box-close" class="btn btn-sm btn-close"><i class="fa fa-close"></i></span>
</div>
<div class="body">
<div class="form-group text-left col-sm-12">
<select data-id="filterServiceType"></select>
</div>
</div>
</div>
<div class="box-panel search-box">
<div class="header clearfix">
<h4>Search</h4>
<span data-id="box-close" class="btn btn-sm btn-close"><i class="fa fa-close"></i></span>
</div>
<div class="body">
<div class="col-sm-12 no-padding">
<div class="srchType clearfix">
<label class="srchTitle">Search Lineage Entity: </label>
<div class="">
<div class="col-sm-12 no-padding temFilter">
<select data-id="typeSearch"></select>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="graph-button-group pull-right">
<div>
<button data-id="reset" class="btn btn-action btn-gray btn-sm" title="Realign Lineage">
<i class="fa fa-retweet"></i>
</button>
</div>
<div>
<button type="button" data-id="filter-toggler" title="Filter" class="btn btn-action btn-gray btn-sm"><i class="fa fa-filter"></i></button>
</div>
<div>
<button type="button" data-id="search-toggler" title="Search" class="btn btn-action btn-gray btn-sm"><i class="fa fa-search"></i></button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom In" data-id="zoom-in">
<i class="fa fa-search-plus"></i>
</button>
<button type="button" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom Out" data-id="zoom-out">
<i class="fa fa-search-minus"></i>
</button>
</div>
<div>
<button type="button" data-id="fullScreen-toggler" title="Full screen" class="btn btn-action btn-gray btn-sm fullscreen_lineage">
<i class="fa fa-expand"></i>
</button>
</div>
</div>
<svg class="main" width="100%" height="100%">
</svg>
<!-- <div id="mini" class="mini-map-type-system">
<svg class="mini" width="100%" height="100%">
</svg>
</div> -->
</div>
\ No newline at end of file
...@@ -143,7 +143,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -143,7 +143,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
id = data.guid; id = data.guid;
} }
if (value.length > 0) { if (value.length > 0) {
scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/' + id + '">' + getValue(value, key) + '</a>'); scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/' + id + '">' + getValue(value) + '</a>');
} else { } else {
scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/' + id + '">' + _.escape(id) + '</a>'); scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/' + id + '">' + _.escape(id) + '</a>');
} }
......
...@@ -39,7 +39,9 @@ define(['require', ...@@ -39,7 +39,9 @@ define(['require',
regions: { regions: {
RBusinessMetadataTableLayoutView: "#r_businessMetadataTableLayoutView", RBusinessMetadataTableLayoutView: "#r_businessMetadataTableLayoutView",
REnumTableLayoutView: '#r_enumTableLayoutView', REnumTableLayoutView: '#r_enumTableLayoutView',
RAdminTableLayoutView: '#r_adminTableLayoutView' RAdminTableLayoutView: '#r_adminTableLayoutView',
RTypeSystemTreeLayoutView: '#r_typeSystemTreeLayoutView',
}, },
/** ui selector cache */ /** ui selector cache */
...@@ -81,6 +83,7 @@ define(['require', ...@@ -81,6 +83,7 @@ define(['require',
bindEvents: function() { bindEvents: function() {
this.renderEnumLayoutView(); this.renderEnumLayoutView();
this.renderAdminLayoutView(); this.renderAdminLayoutView();
this.renderTypeSystemTreeLayoutView();
}, },
onRender: function() { onRender: function() {
this.renderBusinessMetadataLayoutView(); this.renderBusinessMetadataLayoutView();
...@@ -112,6 +115,15 @@ define(['require', ...@@ -112,6 +115,15 @@ define(['require',
}); });
that.RAdminTableLayoutView.show(view); that.RAdminTableLayoutView.show(view);
}); });
},
renderTypeSystemTreeLayoutView: function(obj) {
var that = this;
require(["views/graph/TypeSystemTreeView"], function(TypeSystemTreeView) {
var view = new TypeSystemTreeView({
entityDefCollection: that.entityDefCollection
});
that.RTypeSystemTreeLayoutView.show(view);
});
} }
}); });
return AdministratorLayoutView; return AdministratorLayoutView;
......
...@@ -22,7 +22,8 @@ define(['require', ...@@ -22,7 +22,8 @@ define(['require',
'collection/VLineageList', 'collection/VLineageList',
'models/VEntity', 'models/VEntity',
'utils/Utils', 'utils/Utils',
'views/graph/LineageUtils', 'LineageHelper',
'd3',
'dagreD3', 'dagreD3',
'd3-tip', 'd3-tip',
'utils/Enums', 'utils/Enums',
...@@ -31,7 +32,7 @@ define(['require', ...@@ -31,7 +32,7 @@ define(['require',
'utils/CommonViewFunction', 'utils/CommonViewFunction',
'platform', 'platform',
'jquery-ui' 'jquery-ui'
], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, Utils, LineageUtils, dagreD3, d3Tip, Enums, UrlLinks, Globals, CommonViewFunction, platform) { ], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, Utils, LineageHelper, d3, dagreD3, d3Tip, Enums, UrlLinks, Globals, CommonViewFunction, platform) {
'use strict'; 'use strict';
var LineageLayoutView = Backbone.Marionette.LayoutView.extend( var LineageLayoutView = Backbone.Marionette.LayoutView.extend(
...@@ -65,7 +66,9 @@ define(['require', ...@@ -65,7 +66,9 @@ define(['require',
showOnlyHoverPath: '[data-id="showOnlyHoverPath"]', showOnlyHoverPath: '[data-id="showOnlyHoverPath"]',
showTooltip: '[data-id="showTooltip"]', showTooltip: '[data-id="showTooltip"]',
saveSvg: '[data-id="saveSvg"]', saveSvg: '[data-id="saveSvg"]',
resetLineage: '[data-id="resetLineage"]' resetLineage: '[data-id="resetLineage"]',
onZoomIn: '[data-id="zoom-in"]',
onZoomOut: '[data-id="zoom-out"]'
}, },
templateHelpers: function() { templateHelpers: function() {
return { return {
...@@ -86,6 +89,8 @@ define(['require', ...@@ -86,6 +89,8 @@ define(['require',
events["click " + this.ui.searchToggler] = 'onClickSearchToggler'; events["click " + this.ui.searchToggler] = 'onClickSearchToggler';
events["click " + this.ui.saveSvg] = 'onClickSaveSvg'; events["click " + this.ui.saveSvg] = 'onClickSaveSvg';
events["click " + this.ui.resetLineage] = 'onClickResetLineage'; events["click " + this.ui.resetLineage] = 'onClickResetLineage';
events["click " + this.ui.onZoomIn] = 'onClickZoomIn';
events["click " + this.ui.onZoomOut] = 'onClickZoomOut';
return events; return events;
}, },
...@@ -96,7 +101,6 @@ define(['require', ...@@ -96,7 +101,6 @@ define(['require',
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'processCheck', 'guid', 'entity', 'entityName', 'entityDefCollection', 'actionCallBack', 'fetchCollection', 'attributeDefs')); _.extend(this, _.pick(options, 'processCheck', 'guid', 'entity', 'entityName', 'entityDefCollection', 'actionCallBack', 'fetchCollection', 'attributeDefs'));
this.collection = new VLineageList(); this.collection = new VLineageList();
this.lineageData = null;
this.typeMap = {}; this.typeMap = {};
this.apiGuid = {}; this.apiGuid = {};
this.edgeCall; this.edgeCall;
...@@ -109,42 +113,18 @@ define(['require', ...@@ -109,42 +113,18 @@ define(['require',
selectedNode: '' selectedNode: ''
} }
}, },
initializeGraph: function() {
this.g = {};
this.g = new dagreD3.graphlib.Graph()
.setGraph({
nodesep: 50,
ranksep: 90,
rankdir: "LR",
marginx: 20,
marginy: 20,
transition: function transition(selection) {
return selection.transition().duration(500);
}
})
.setDefaultEdgeLabel(function() {
return {};
});
},
onRender: function() { onRender: function() {
var that = this; var that = this;
this.ui.searchToggler.prop("disabled", true); this.ui.searchToggler.prop("disabled", true);
this.$graphButtonsEl = this.$(".graph-button-group button,select[data-id='selectDepth']") this.$graphButtonsEl = this.$(".graph-button-group button,select[data-id='selectDepth']")
this.fetchGraphData(); this.fetchGraphData();
if (platform.name === "IE") {
this.$('svg').css('opacity', '0');
}
if (platform.name === "Microsoft Edge" || platform.name === "IE") {
$(that.ui.saveSvg).hide();
}
if (this.layoutRendered) { if (this.layoutRendered) {
this.layoutRendered(); this.layoutRendered();
} }
if (this.processCheck) { if (this.processCheck) {
this.hideCheckForProcess(); this.hideCheckForProcess();
} }
this.initializeGraph(); //this.initializeGraph();
this.ui.selectDepth.select2({ this.ui.selectDepth.select2({
data: _.sortBy([3, 6, 9, 12, 15, 18, 21]), data: _.sortBy([3, 6, 9, 12, 15, 18, 21]),
tags: true, tags: true,
...@@ -175,21 +155,13 @@ define(['require', ...@@ -175,21 +155,13 @@ define(['require',
}, },
onCheckUnwantedEntity: function(e) { onCheckUnwantedEntity: function(e) {
var that = this; var that = this;
this.initializeGraph(); //this.initializeGraph();
if ($(e.target).data("id") === "checkHideProcess") { if ($(e.target).data("id") === "checkHideProcess") {
this.filterObj.isProcessHideCheck = e.target.checked; this.filterObj.isProcessHideCheck = e.target.checked;
} else { } else {
this.filterObj.isDeletedEntityHideCheck = e.target.checked; this.filterObj.isDeletedEntityHideCheck = e.target.checked;
} }
that.toggleDisableState({ this.LineageHelperRef.refresh();
"el": that.$graphButtonsEl
});
this.generateData(this.lineageData).then(function() {
that.createGraph();
that.toggleDisableState({
"el": that.$graphButtonsEl
});
});
}, },
toggleBoxPanel: function(options) { toggleBoxPanel: function(options) {
var el = options && options.el, var el = options && options.el,
...@@ -201,6 +173,24 @@ define(['require', ...@@ -201,6 +173,24 @@ define(['require',
} }
this.$('circle.node-detail-highlight').removeClass("node-detail-highlight"); this.$('circle.node-detail-highlight').removeClass("node-detail-highlight");
}, },
toggleLoader: function(element) {
if ((element).hasClass('fa-camera')) {
(element).removeClass('fa-camera').addClass("fa-spin-custom fa-refresh");
} else {
(element).removeClass("fa-spin-custom fa-refresh").addClass('fa-camera');
}
},
toggleDisableState: function(options) {
var el = options.el,
disabled = options.disabled;
if (el && el.prop) {
if (disabled) {
el.prop("disabled", disabled);
} else {
el.prop("disabled", !el.prop("disabled"));
}
}
},
onClickNodeToggler: function(options) { onClickNodeToggler: function(options) {
this.toggleBoxPanel({ el: this.$('.lineage-node-detail'), nodeDetailToggler: true }); this.toggleBoxPanel({ el: this.$('.lineage-node-detail'), nodeDetailToggler: true });
}, },
...@@ -214,17 +204,30 @@ define(['require', ...@@ -214,17 +204,30 @@ define(['require',
this.toggleBoxPanel({ el: this.ui.searchBox }); this.toggleBoxPanel({ el: this.ui.searchBox });
}, },
onSelectDepthChange: function(e, options) { onSelectDepthChange: function(e, options) {
this.initializeGraph(); //this.initializeGraph();
this.filterObj.depthCount = e.currentTarget.value; this.filterObj.depthCount = e.currentTarget.value;
this.fetchGraphData({ queryParam: { 'depth': this.filterObj.depthCount } }); this.fetchGraphData({ queryParam: { 'depth': this.filterObj.depthCount } });
}, },
onClickResetLineage: function() {
this.LineageHelperRef.refresh();
},
onClickSaveSvg: function(e, a) {
this.LineageHelperRef.exportLineage();
},
onClickZoomIn: function() {
this.LineageHelperRef.zoomIn();
},
onClickZoomOut: function() {
this.LineageHelperRef.zoomOut();
},
fetchGraphData: function(options) { fetchGraphData: function(options) {
var that = this, var that = this,
queryParam = options && options.queryParam || {}; queryParam = options && options.queryParam || {};
this.$('.fontLoader').show(); this.$('.fontLoader').show();
this.$('svg>g').hide(); this.$('svg>g').hide();
this.toggleDisableState({ this.toggleDisableState({
"el": that.$(".graph-button-group button,select[data-id='selectDepth']") "el": that.$graphButtonsEl,
disabled: true
}); });
this.collection.getLineage(this.guid, { this.collection.getLineage(this.guid, {
queryParam: queryParam, queryParam: queryParam,
...@@ -232,24 +235,11 @@ define(['require', ...@@ -232,24 +235,11 @@ define(['require',
if (that.isDestroyed) { if (that.isDestroyed) {
return; return;
} }
if (data.relations.length) {
that.lineageData = $.extend(true, {}, data); that.createGraph(data);
that.generateData(that.lineageData).then(function(graphObj) { that.renderLineageTypeSearch(data);
that.createGraph();
that.toggleDisableState({
"el": that.$graphButtonsEl
});
});
that.renderLineageTypeSearch().then(function() {
that.ui.searchToggler.prop("disabled", false);
});
} else {
that.noLineage();
that.hideCheckForProcess();
}
}, },
cust_error: function(model, response) { cust_error: function(model, response) {
that.lineageData = [];
that.noLineage(); that.noLineage();
}, },
complete: function() { complete: function() {
...@@ -258,524 +248,99 @@ define(['require', ...@@ -258,524 +248,99 @@ define(['require',
} }
}) })
}, },
noLineage: function() { createGraph: function(data) {
this.$('.fontLoader').hide(); // if (_.isEmpty(this.g._nodes)) {
this.$('.depth-container').hide(); // this.$('svg').html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relations to display</text>');
this.$('svg').html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No lineage data found</text>'); // return;
if (this.actionCallBack) { // }
this.actionCallBack(); var that = this;
} $('.resizeGraph').css("height", this.$('.svg').height() + "px");
},
hideCheckForProcess: function() { this.LineageHelperRef = new LineageHelper.default({
this.$('.hideProcessContainer').hide(); entityDefCollection: this.entityDefCollection.fullCollection.toJSON(),
}, data: data,
isProcess: function(node) { el: this.$('.svg')[0],
var typeName = node.typeName, legendsEl: this.$('.legends')[0],
superTypes = node.superTypes, getFilterObj: function() {
entityDef = node.entityDef; return {
if (typeName == "Process") { isProcessHideCheck: that.filterObj.isProcessHideCheck,
return true; isDeletedEntityHideCheck: that.filterObj.isDeletedEntityHideCheck
}
return _.contains(superTypes, "Process");
},
isDeleted: function(node) {
if (_.isUndefined(node)) {
return
}
return Enums.entityStateReadOnly[node.status];
},
isNodeToBeUpdated: function(node) {
var isProcessHideCheck = this.filterObj.isProcessHideCheck,
isDeletedEntityHideCheck = this.filterObj.isDeletedEntityHideCheck
var returnObj = {
isProcess: (isProcessHideCheck && node.isProcess),
isDeleted: (isDeletedEntityHideCheck && node.isDeleted)
};
returnObj["update"] = returnObj.isProcess || returnObj.isDeleted;
return returnObj;
},
getNestedSuperTypes: function(options) {
var entityDef = options.entityDef;
return Utils.getNestedSuperTypes({ data: entityDef, collection: this.entityDefCollection })
},
getEntityDef: function(typeName) {
var entityDef = null;
if (typeName) {
entityDef = this.entityDefCollection.fullCollection.find({ name: typeName });
entityDef = entityDef ? entityDef.toJSON() : entityDef;
}
return entityDef;
},
getServiceType: function(options) {
if (!options) {
return;
}
var typeName = options.typeName,
entityDef = options.entityDef,
serviceType = null;
if (typeName) {
if (entityDef) {
serviceType = entityDef.serviceType || null;
}
}
return serviceType;
},
generateData: function(options) {
return new Promise(function(resolve, reject) {
try {
var that = this,
relations = options && options.relations || {},
guidEntityMap = options && options.guidEntityMap || {},
isHideFilterOn = this.filterObj.isProcessHideCheck || this.filterObj.isDeletedEntityHideCheck,
newHashMap = {},
styleObj = {
fill: 'none',
stroke: '#ffb203',
width: 3
},
makeNodeData = function(relationObj) {
if (relationObj) {
if (relationObj.updatedValues) {
return relationObj;
}
var obj = _.extend(relationObj, {
shape: "img",
updatedValues: true,
label: relationObj.displayText.trunc(18),
toolTipLabel: relationObj.displayText,
id: relationObj.guid,
isLineage: true,
isIncomplete: relationObj.isIncomplete,
entityDef: that.getEntityDef(relationObj.typeName)
});
obj["serviceType"] = that.getServiceType({ typeName: relationObj.typeName, entityDef: obj.entityDef });
obj["superTypes"] = that.getNestedSuperTypes({ entityDef: obj.entityDef });
obj['isProcess'] = that.isProcess(obj);
obj['isDeleted'] = that.isDeleted(obj);
return obj;
}
},
crateLineageRelationshipHashMap = function(data) {
var that = this,
relations = data && data.relations,
newHashMap = {};
_.each(relations, function(obj) {
if (newHashMap[obj.fromEntityId]) {
newHashMap[obj.fromEntityId].push(obj.toEntityId);
} else {
newHashMap[obj.fromEntityId] = [obj.toEntityId];
}
});
return newHashMap;
},
getStyleObjStr = function(styleObj) {
return 'fill:' + styleObj.fill + ';stroke:' + styleObj.stroke + ';stroke-width:' + styleObj.width;
},
getNewToNodeRelationship = function(toNodeGuid) {
if (toNodeGuid && relationshipMap[toNodeGuid]) {
var newRelationship = [];
_.each(relationshipMap[toNodeGuid], function(guid) {
var nodeToBeUpdated = that.isNodeToBeUpdated(makeNodeData(guidEntityMap[guid]));
if (nodeToBeUpdated.update) {
var newRelation = getNewToNodeRelationship(guid);
if (newRelation) {
newRelationship = newRelationship.concat(newRelation);
}
} else {
newRelationship.push(guid);
}
});
return newRelationship;
} else {
return null;
}
},
getToNodeRelation = function(toNodes, fromNodeToBeUpdated) {
var toNodeRelationship = [];
_.each(toNodes, function(toNodeGuid) {
var toNodeToBeUpdated = that.isNodeToBeUpdated(makeNodeData(guidEntityMap[toNodeGuid]));
if (toNodeToBeUpdated.update) {
// To node need to updated
if (pendingFromRelationship[toNodeGuid]) {
toNodeRelationship = toNodeRelationship.concat(pendingFromRelationship[toNodeGuid]);
} else {
var newToNodeRelationship = getNewToNodeRelationship(toNodeGuid);
if (newToNodeRelationship) {
toNodeRelationship = toNodeRelationship.concat(newToNodeRelationship);
}
}
} else {
//when bothe node not to be updated.
toNodeRelationship.push(toNodeGuid);
}
});
return toNodeRelationship;
},
setNode = function(guid) {
if (!that.g._nodes[guid]) {
var nodeData = makeNodeData(guidEntityMap[guid]);
that.g.setNode(guid, nodeData);
return nodeData;
} else {
return that.g._nodes[guid];
}
},
setEdge = function(fromNodeGuid, toNodeGuid) {
that.g.setEdge(fromNodeGuid, toNodeGuid, {
"arrowhead": 'arrowPoint',
"curve": LineageUtils.BezierCurve,
"style": getStyleObjStr(styleObj),
"styleObj": styleObj
});
},
setGraphData = function(fromEntityId, toEntityId) {
setNode(fromEntityId);
setNode(toEntityId);
setEdge(fromEntityId, toEntityId);
},
pendingFromRelationship = {};
if (isHideFilterOn) {
var relationshipMap = crateLineageRelationshipHashMap(options)
_.each(relationshipMap, function(toNodes, fromNodeGuid) {
var fromNodeToBeUpdated = that.isNodeToBeUpdated(makeNodeData(guidEntityMap[fromNodeGuid])),
toNodeList = getToNodeRelation(toNodes, fromNodeToBeUpdated);
if (fromNodeToBeUpdated.update) {
if (pendingFromRelationship[fromNodeGuid]) {
pendingFromRelationship[fromNodeGuid] = pendingFromRelationship[fromNodeGuid].concat(toNodeList);
} else {
pendingFromRelationship[fromNodeGuid] = toNodeList;
}
} else {
_.each(toNodeList, function(toNodeGuid) {
setGraphData(fromNodeGuid, toNodeGuid);
});
}
})
} else {
_.each(relations, function(obj) {
setGraphData(obj.fromEntityId, obj.toEntityId);
});
}
if (this.g._nodes[this.guid]) {
if (this.g._nodes[this.guid]) {
this.g._nodes[this.guid]['isLineage'] = false;
}
this.findImpactNodeAndUpdateData({ "guid": this.guid, "getStyleObjStr": getStyleObjStr });
} }
resolve(this.g);
} catch (e) {
reject(e)
}
}.bind(this));
},
findImpactNodeAndUpdateData: function(options) {
var that = this,
guid = options.guid,
getStyleObjStr = options.getStyleObjStr,
traversedMap = {},
styleObj = {
fill: 'none',
stroke: '#fb4200',
width: 3
}, },
traversed = function(toNodeList, fromNodeGuid) { isShowHoverPath: function() { return that.ui.showOnlyHoverPath.prop('checked') },
if (!_.isEmpty(toNodeList)) { isShowTooltip: function() { return that.ui.showTooltip.prop('checked') },
if (!traversedMap[fromNodeGuid]) { onPathClick: function(d) {
traversedMap[fromNodeGuid] = true; console.log("Path Clicked");
_.each(toNodeList, function(val, toNodeGuid) { if (d.pathRelationObj) {
if (that.g._nodes[toNodeGuid]) { var relationshipId = d.pathRelationObj.relationshipId;
that.g._nodes[toNodeGuid]['isLineage'] = false; require(['views/graph/PropagationPropertyModal'], function(PropagationPropertyModal) {
} var view = new PropagationPropertyModal({
that.g.setEdge(fromNodeGuid, toNodeGuid, { edgeInfo: d.pathRelationObj,
"arrowhead": 'arrowPoint', relationshipId: relationshipId,
"curve": LineageUtils.BezierCurve, lineageData: data,
"style": getStyleObjStr(styleObj), apiGuid: that.apiGuid,
'styleObj': styleObj detailPageFetchCollection: that.fetchCollection
});
traversed(that.g._sucs[toNodeGuid], toNodeGuid);
}); });
} });
}
};
traversed(this.g._sucs[guid], guid)
},
zoomed: function(that) {
this.$('svg').find('>g').attr("transform",
"translate(" + this.zoom.translate() + ")" +
"scale(" + this.zoom.scale() + ")"
);
if (platform.name === "IE") {
LineageUtils.refreshGraphForIE({
edgeEl: this.$('svg .edgePath')
});
}
},
interpolateZoom: function(translate, scale, that, zoom) {
return d3.transition().duration(350).tween("zoom", function() {
var iTranslate = d3.interpolate(zoom.translate(), translate),
iScale = d3.interpolate(zoom.scale(), scale);
return function(t) {
zoom
.scale(iScale(t))
.translate(iTranslate(t));
that.zoomed();
};
});
},
createGraph: function() {
if (_.isEmpty(this.g._nodes)) {
this.$('svg').html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relations to display</text>');
return;
}
var that = this,
width = this.$('svg').width(),
height = this.$('svg').height(),
imageObject = {};
$('.resizeGraph').css("height", height + "px");
this.g.nodes().forEach(function(v) {
var node = that.g.node(v);
// Round the corners of the nodes
if (node) {
node.rx = node.ry = 5;
}
});
// Create the renderer
var render = new dagreD3.render();
// Add our custom arrow (a hollow-point)
render.arrows().arrowPoint = function(parent, id, edge, type) {
return LineageUtils.arrowPointRender(parent, id, edge, type, { guid: that.guid, dagreD3: dagreD3 });
};
// Render custom img inside shape
render.shapes().img = function(parent, bbox, node) {
return LineageUtils.imgShapeRender(parent, bbox, node, { guid: that.guid, dagreD3: dagreD3, imageObject: imageObject, $defs: that.svg.select('defs') });
};
// Set up an SVG group so that we can translate the final graph.
if (this.$("svg").find('.output').length) {
this.$("svg").find('.output').parent('g').remove();
}
var svg = this.svg = d3.select(this.$("svg")[0])
.attr("viewBox", "0 0 " + width + " " + height)
.attr("enable-background", "new 0 0 " + width + " " + height),
svgGroup = svg.append("g");
// Append defs
svg.append("defs");
var zoom = this.zoom = d3.behavior.zoom()
.center([width / 2, height / 2])
.scaleExtent([0.01, 50])
.on("zoom", that.zoomed.bind(this));
function zoomClick() {
var clicked = d3.event.target,
direction = 1,
factor = 0.5,
target_zoom = 1,
center = [width / 2, height / 2],
translate = zoom.translate(),
translate0 = [],
l = [],
view = { x: translate[0], y: translate[1], k: zoom.scale() };
d3.event.preventDefault();
direction = (this.id === 'zoom_in') ? 1 : -1;
target_zoom = zoom.scale() * (1 + factor * direction);
translate0 = [(center[0] - view.x) / view.k, (center[1] - view.y) / view.k];
view.k = target_zoom;
l = [translate0[0] * view.k + view.x, translate0[1] * view.k + view.y];
view.x += center[0] - l[0];
view.y += center[1] - l[1];
that.interpolateZoom([view.x, view.y], view.k, that, zoom);
}
d3.selectAll(this.$('.lineageZoomButton')).on('click', zoomClick);
var tooltip = d3Tip()
.attr('class', 'd3-tip')
.offset([10, 0])
.html(function(d) {
var value = that.g.node(d);
var htmlStr = "";
if (value.id !== that.guid) {
htmlStr = "<h5 style='text-align: center;'>" + (value.isLineage ? "Lineage" : "Impact") + "</h5>";
}
htmlStr += "<h5 class='text-center'><span style='color:#359f89'>" + value.toolTipLabel + "</span></h5> ";
if (value.typeName) {
htmlStr += "<h5 class='text-center'><span>(" + value.typeName + ")</span></h5> ";
}
if (value.queryText) {
htmlStr += "<h5>Query: <span style='color:#359f89'>" + value.queryText + "</span></h5> ";
} }
return "<div class='tip-inner-scroll'>" + htmlStr + "</div>"; },
}); onNodeClick: function(d) {
that.onClickNodeToggler();
svg.call(zoom) that.updateRelationshipDetails({ guid: d.clickedData });
.call(tooltip); },
if (platform.name !== "IE") { onLabelClick: function(d) {
this.$('.fontLoader').hide(); var guid = d.clickedData;
} if (that.guid == guid) {
render(svgGroup, this.g);
svg.on("dblclick.zoom", null)
// .on("wheel.zoom", null);
//change text postion
svgGroup.selectAll("g.nodes g.label")
.attr("transform", "translate(2,-35)")
.on('mouseenter', function(d) {
d3.select(this).classed("highlight", true);
})
.on('mouseleave', function(d) {
d3.select(this).classed("highlight", false);
})
.on('click', function(d) {
d3.event.preventDefault();
tooltip.hide(d);
if (that.guid == d) {
Utils.notifyInfo({ Utils.notifyInfo({
html: true, html: true,
content: "You are already on " + "<b>" + that.entityName + "</b> detail page." content: "You are already on " + "<b>" + that.entityName + "</b> detail page."
}); });
} else { } else {
Utils.setUrl({ Utils.setUrl({
url: '#!/detailPage/' + d + '?tabActive=lineage', url: '#!/detailPage/' + guid + '?tabActive=lineage',
mergeBrowserUrl: false, mergeBrowserUrl: false,
trigger: true trigger: true
}); });
} }
}); },
svgGroup.selectAll("g.nodes g.node") beforeRender: function() {
.on('mouseenter', function(d) { that.$('.fontLoader').show();
that.activeNode = true; that.toggleDisableState({
var matrix = this.getScreenCTM() "el": that.$graphButtonsEl,
.translate(+this.getAttribute("cx"), +this.getAttribute("cy")); disabled: true
that.$('svg').find('.node').removeClass('active');
$(this).addClass('active');
// Fix
var width = $('body').width();
var currentELWidth = $(this).offset();
var direction = 'e';
if (((width - currentELWidth.left) < 330)) {
direction = (((width - currentELWidth.left) < 330) && ((currentELWidth.top) < 400)) ? 'sw' : 'w';
if (((width - currentELWidth.left) < 330) && ((currentELWidth.top) > 600)) {
direction = 'nw';
}
} else if (((currentELWidth.top) > 600)) {
direction = (((width - currentELWidth.left) < 330) && ((currentELWidth.top) > 600)) ? 'nw' : 'n';
if ((currentELWidth.left) < 50) {
direction = 'ne'
}
} else if ((currentELWidth.top) < 400) {
direction = ((currentELWidth.left) < 50) ? 'se' : 's';
}
if (that.ui.showTooltip.prop('checked')) {
tooltip.direction(direction).show(d);
}
if (!that.ui.showOnlyHoverPath.prop('checked')) {
return;
}
that.$('svg').addClass('hover');
var nextNode = that.g.successors(d),
previousNode = that.g.predecessors(d),
nodesToHighlight = nextNode.concat(previousNode);
LineageUtils.onHoverFade({
opacity: 0.3,
selectedNode: d,
highlight: nodesToHighlight,
svg: that.svg
}).init();
})
.on('mouseleave', function(d) {
that.activeNode = false;
var nodeEL = this;
setTimeout(function(argument) {
if (!(that.activeTip || that.activeNode)) {
$(nodeEL).removeClass('active');
if (that.ui.showTooltip.prop('checked')) {
tooltip.hide(d);
}
}
}, 150);
if (!that.ui.showOnlyHoverPath.prop('checked')) {
return;
}
that.$('svg').removeClass('hover');
that.$('svg').removeClass('hover-active');
LineageUtils.onHoverFade({
opacity: 1,
selectedNode: d,
svg: that.svg
}).init();
})
.on('click', function(d) {
var el = this;
if (d3.event.defaultPrevented) return; // ignore drag
d3.event.preventDefault();
tooltip.hide(d);
that.onClickNodeToggler({ obj: d });
$(el).find('circle').addClass('node-detail-highlight');
that.updateRelationshipDetails({ guid: d });
});
svgGroup.selectAll("g.edgePath path.path").on('click', function(d) {
var data = { obj: _.find(that.lineageData.relations, { "fromEntityId": d.v, "toEntityId": d.w }) };
if (data.obj) {
var relationshipId = data.obj.relationshipId;
require(['views/graph/PropagationPropertyModal'], function(PropagationPropertyModal) {
var view = new PropagationPropertyModal({
edgeInfo: data,
relationshipId: relationshipId,
lineageData: that.lineageData,
apiGuid: that.apiGuid,
detailPageFetchCollection: that.fetchCollection
});
}); });
},
afterRender: function() {
// Remove Loader
that.$('.fontLoader').hide();
if (data.relations.length) {
that.toggleDisableState({
"el": that.$graphButtonsEl,
disabled: false
});
}
} }
})
$('body').on('mouseover', '.d3-tip', function(el) {
that.activeTip = true;
}); });
$('body').on('mouseleave', '.d3-tip', function(el) { },
that.activeTip = false; noLineage: function() {
that.$('svg').find('.node').removeClass('active'); this.$('.fontLoader').hide();
tooltip.hide(); this.$('.depth-container').hide();
}); this.$('svg').html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No lineage data found</text>');
if (this.actionCallBack) {
// Center the graph this.actionCallBack();
LineageUtils.centerNode({
guid: that.guid,
svg: that.$('svg'),
g: this.g,
edgeEl: $('svg .edgePath'),
afterCenterZoomed: function(options) {
var newScale = options.newScale,
newTranslate = options.newTranslate;
that.zoom.scale(newScale);
that.zoom.translate(newTranslate);
}
}).init();
zoom.event(svg);
if (platform.name === "IE") {
LineageUtils.refreshGraphForIE({
edgeEl: this.$('svg .edgePath')
});
} }
LineageUtils.DragNode({
svg: this.svg,
g: this.g,
guid: this.guid,
edgeEl: this.$('svg .edgePath')
}).init();
}, },
renderLineageTypeSearch: function() { hideCheckForProcess: function() {
this.$('.hideProcessContainer').hide();
},
renderLineageTypeSearch: function(data) {
var that = this; var that = this;
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
try { try {
var data = [], var typeStr = '<option></option>';
typeStr = '<option></option>'; if (!_.isEmpty(data)) {
if (!_.isEmpty(that.lineageData)) { _.each(data.guidEntityMap, function(obj, index) {
_.each(that.lineageData.guidEntityMap, function(obj, index) { var nodeData = that.LineageHelperRef.getNode(obj.guid);
var nodeData = that.g._nodes[obj.guid];
if ((that.filterObj.isProcessHideCheck || that.filterObj.isDeletedEntityHideCheck) && nodeData && (nodeData.isProcess || nodeData.isDeleted)) { if ((that.filterObj.isProcessHideCheck || that.filterObj.isDeletedEntityHideCheck) && nodeData && (nodeData.isProcess || nodeData.isDeleted)) {
return; return;
} }
...@@ -799,42 +364,9 @@ define(['require', ...@@ -799,42 +364,9 @@ define(['require',
}).on('change.select2', function(e) { }).on('change.select2', function(e) {
e.stopPropagation(); e.stopPropagation();
e.stopImmediatePropagation(); e.stopImmediatePropagation();
d3.selectAll(".serach-rect").remove();
var selectedNode = $('[data-id="typeSearch"]').val(); var selectedNode = $('[data-id="typeSearch"]').val();
that.searchNodeObj.selectedNode = selectedNode; that.searchNodeObj.selectedNode = selectedNode;
LineageUtils.centerNode({ that.LineageHelperRef.searchNode({ guid: selectedNode });
guid: selectedNode,
svg: $(that.svg[0]),
g: that.g,
edgeEl: $('svg .edgePath'),
afterCenterZoomed: function(options) {
var newScale = options.newScale,
newTranslate = options.newTranslate;
that.zoom.scale(newScale);
that.zoom.translate(newTranslate);
}
}).init();
that.svg.selectAll('.nodes g.label').attr('stroke', function(c, d) {
if (c == selectedNode) {
return "#316132";
} else {
return 'none';
}
});
// Using jquery for selector because d3 select is not working for few process entities.
d3.select($(".node#" + selectedNode)[0]).insert("rect", "circle")
.attr("class", "serach-rect")
.attr("x", -50)
.attr("y", -27.5)
.attr("width", 100)
.attr("height", 55);
d3.selectAll(".nodes circle").classed("wobble", function(d, i, nodes) {
if (d == selectedNode) {
return true;
} else {
return false;
}
});
}); });
if (this.searchNodeObj.selectedNode) { if (this.searchNodeObj.selectedNode) {
this.ui.lineageTypeSearch.val(this.searchNodeObj.selectedNode); this.ui.lineageTypeSearch.val(this.searchNodeObj.selectedNode);
...@@ -844,8 +376,11 @@ define(['require', ...@@ -844,8 +376,11 @@ define(['require',
updateRelationshipDetails: function(options) { updateRelationshipDetails: function(options) {
var that = this, var that = this,
guid = options.guid, guid = options.guid,
initialData = that.g._nodes[guid], initialData = that.LineageHelperRef.getNode(guid);
typeName = initialData.typeName || guid, if (initialData === undefined) {
return;
}
var typeName = initialData.typeName || guid,
attributeDefs = initialData && initialData.entityDef ? initialData.entityDef.attributeDefs : null; attributeDefs = initialData && initialData.entityDef ? initialData.entityDef.attributeDefs : null;
this.$("[data-id='typeName']").text(typeName); this.$("[data-id='typeName']").text(typeName);
this.entityModel = new VEntity({}); this.entityModel = new VEntity({});
...@@ -876,46 +411,6 @@ define(['require', ...@@ -876,46 +411,6 @@ define(['require',
"attributeDefs": attributeDefs, "attributeDefs": attributeDefs,
"sortBy": false "sortBy": false
})); }));
},
onClickSaveSvg: function(e, a) {
var that = this,
loaderTargetDiv = $(e.currentTarget).find('>i');
if (loaderTargetDiv.hasClass('fa-refresh')) {
Utils.notifyWarn({
content: "Please wait while the lineage gets downloaded"
});
return false; // return if the lineage is not loaded.
}
this.toggleLoader(loaderTargetDiv);
Utils.notifyInfo({
content: "Lineage will be downloaded in a moment."
});
var entityAttributes = that.entity && that.entity.attributes;
LineageUtils.SaveSvg(e, {
svg: that.$('svg')[0],
svgWidth: that.$('svg').width(),
svgHeight: that.$('svg').height(),
toggleLoader: function() {
that.toggleLoader(loaderTargetDiv);
},
downloadFileName: ((entityAttributes && (entityAttributes.qualifiedName || entityAttributes.name) || "lineage_export") + ".png")
})
},
toggleLoader: function(element) {
if ((element).hasClass('fa-camera')) {
(element).removeClass('fa-camera').addClass("fa-spin-custom fa-refresh");
} else {
(element).removeClass("fa-spin-custom fa-refresh").addClass('fa-camera');
}
},
onClickResetLineage: function() {
this.createGraph()
},
toggleDisableState: function(options) {
var el = options.el;
if (el && el.prop) {
el.prop("disabled", !el.prop("disabled"));
}
} }
}); });
return LineageLayoutView; return LineageLayoutView;
......
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(['require', 'utils/Utils'], function(require, Utils) {
'use strict';
var LineageUtils = {};
LineageUtils.DragNode = function(options) {
var that = this,
g = options.g,
svg = options.svg,
guid = options.guid,
edgePathEl = options.edgeEl;
return {
init: function() {
var that = this;
//give IDs to each of the nodes so that they can be accessed
svg.selectAll("g.node rect")
.attr("id", function(d) {
return "node" + d;
});
svg.selectAll("g.edgePath path")
.attr("id", function(e) {
return e.v + "-" + e.w;
});
svg.selectAll("g.edgeLabel g")
.attr("id", function(e) {
return 'label_' + e.v + "-" + e.w;
});
g.nodes().forEach(function(v) {
var node = g.node(v);
node.customId = "node" + v;
})
g.edges().forEach(function(e) {
var edge = g.edge(e.v, e.w);
edge.customId = e.v + "-" + e.w
});
var nodeDrag = d3.behavior.drag()
.on("dragstart", this.dragstart)
.on("drag", function(d) { that.dragmove(this, d) });
var edgeDrag = d3.behavior.drag()
.on("dragstart", this.dragstart)
.on('drag', function(d) {
that.translateEdge(g.edge(d.v, d.w), d3.event.dx, d3.event.dy);
$('#' + g.edge(d.v, d.w).customId).attr('d', that.calcPoints(d));
});
nodeDrag.call(svg.selectAll("g.node"));
edgeDrag.call(svg.selectAll("g.edgePath"));
},
dragstart: function(d) {
d3.event.sourceEvent.stopPropagation();
},
dragmove: function(elem, d) {
var that = this,
node = d3.select(elem),
selectedNode = g.node(d),
prevX = selectedNode.x,
prevY = selectedNode.y;
selectedNode.x += d3.event.dx;
selectedNode.y += d3.event.dy;
node.attr('transform', 'translate(' + selectedNode.x + ',' + selectedNode.y + ')');
var dx = selectedNode.x - prevX,
dy = selectedNode.y - prevY;
g.edges().forEach(function(e) {
if (e.v == d || e.w == d) {
var edge = g.edge(e.v, e.w);
that.translateEdge(g.edge(e.v, e.w), dx, dy);
$('#' + edge.customId).attr('d', that.calcPoints(e));
var label = $('#label_' + edge.customId);
var xforms = label.attr('transform');
if (xforms != "") {
var parts = /translate\(\s*([^\s,)]+)[ ,]?([^\s,)]+)?/.exec(xforms),
X = parseInt(parts[1]) + dx,
Y = parseInt(parts[2]) + dy;
if (isNaN(Y)) {
Y = dy;
}
label.attr('transform', 'translate(' + X + ',' + Y + ')');
}
}
});
LineageUtils.refreshGraphForIE({ "edgeEl": edgePathEl })
},
translateEdge: function(e, dx, dy) {
e.points.forEach(function(p) {
p.x = p.x + dx;
p.y = p.y + dy;
});
},
calcPoints: function(e) {
var edge = g.edge(e.v, e.w),
tail = g.node(e.v),
head = g.node(e.w),
points = edge.points.slice(1, edge.points.length - 1),
afterslice = edge.points.slice(1, edge.points.length - 1);
points.unshift(this.intersectRect(tail, points[0]));
points.push(this.intersectRect(head, points[points.length - 1]));
return d3.svg.line()
.x(function(d) {
return d.x;
})
.y(function(d) {
return d.y;
})
.interpolate("basis")
(points);
},
intersectRect: function(node, point) {
var that = this,
x = node.x,
y = node.y,
dx = point.x - x,
dy = point.y - y,
w = node.id == guid ? 24 : 21,
h = node.id == guid ? 24 : 21,
sx = 0,
sy = 0;
if (Math.abs(dy) * w > Math.abs(dx) * h) {
// Intersection is top or bottom of rect.
if (dy < 0) {
h = -h;
}
sx = dy === 0 ? 0 : h * dx / dy;
sy = h;
} else {
// Intersection is left or right of rect.
if (dx < 0) {
w = -w;
}
sx = w;
sy = dx === 0 ? 0 : w * dy / dx;
}
return {
x: x + sx,
y: y + sy
};
},
}
}
LineageUtils.refreshGraphForSafari = function(options) {
var edgePathEl = options.edgeEl,
IEGraphRenderDone = 0;
edgePathEl.each(function(argument) {
var eleRef = this,
childNode = $(this).find('pattern');
setTimeout(function(argument) {
$(eleRef).find('defs').append(childNode);
}, 500);
});
}
LineageUtils.refreshGraphForIE = function(options) {
var edgePathEl = options.edgeEl,
IEGraphRenderDone = 0;
edgePathEl.each(function(argument) {
var childNode = $(this).find('marker');
$(this).find('marker').remove();
var eleRef = this;
++IEGraphRenderDone;
setTimeout(function(argument) {
$(eleRef).find('defs').append(childNode);
--IEGraphRenderDone;
if (IEGraphRenderDone === 0) {
this.$('.fontLoader').hide();
this.$('svg').fadeTo(1000, 1)
}
}, 1000);
});
}
LineageUtils.centerNode = function(options) {
var nodeID = options.guid,
svg = options.svg,
g = options.g,
afterCenterZoomed = options.afterCenterZoomed,
zoom = d3.behavior.zoom(),
svgGroup = svg.find("g"),
edgePathEl = options.edgeEl,
zoomBind = function() {
svgGroup.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")");
},
selectedNode = $(svg).find("g.nodes").find('>g#' + nodeID);
return {
init: function() {
if (selectedNode.length > 0) {
selectedNode = selectedNode;
var matrix = selectedNode.attr('transform').replace(/[^0-9\-.,]/g, '').split(',');
if (platform.name === "IE" || platform.name === "Microsoft Edge") {
var matrix = selectedNode.attr('transform').replace(/[a-z\()]/g, '').split(' ');
}
var x = matrix[0],
y = matrix[1];
} else {
selectedNode = $(svg).find("g.nodes").find('g').eq(1);
var x = g.graph().width / 2,
y = g.graph().height / 2;
}
var viewerWidth = $(svg).width(),
viewerHeight = $(svg).height(),
gBBox = d3.select('g').node().getBBox(),
zoomListener = zoom.scaleExtent([0.01, 50]).on("zoom", zoomBind),
scale = 1.2,
xa = -((x * scale) - (viewerWidth / 2)),
ya = -((y * scale) - (viewerHeight / 2));
zoom.translate([xa, ya]);
d3.select('g').transition()
.duration(350)
.attr("transform", "translate(" + xa + "," + ya + ")scale(" + scale + ")");
zoomListener.scale(scale);
zoomListener.translate([xa, ya]);
zoom.scale(scale);
afterCenterZoomed({ newScale: scale, newTranslate: [xa, ya] });
if (platform.name === "IE") {
LineageUtils.refreshGraphForIE({ "edgeEl": edgePathEl })
}
}
}
}
LineageUtils.onHoverFade = function(options) {
var opacity = options.opacity,
d = options.selectedNode,
nodesToHighlight = options.highlight,
svg = options.svg,
isConnected = function(a, b, o) {
if (a === o || (b && b.length && b.indexOf(o) != -1)) {
return true;
}
},
node = svg.selectAll('.node'),
path = svg.selectAll('.edgePath');
return {
init: function() {
node.classed("hover-active", function(selectedNode, i, nodes) {
if (isConnected(d, nodesToHighlight, selectedNode)) {
return true;
} else {
return false;
}
});
path.classed('hover-active-node', function(c) {
var _thisOpacity = c.v === d || c.w === d ? 1 : 0;
if (_thisOpacity) {
return true;
} else {
return false;
}
});
}
}
}
LineageUtils.base64Encode = function(options) {
var str = options.data,
CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
out = "",
i = 0,
len = str.length,
c1, c2, c3;
while (i < len) {
c1 = str.charCodeAt(i++) & 0xff;
if (i == len) {
out += CHARS.charAt(c1 >> 2);
out += CHARS.charAt((c1 & 0x3) << 4);
out += "==";
break;
}
c2 = str.charCodeAt(i++);
if (i == len) {
out += CHARS.charAt(c1 >> 2);
out += CHARS.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
out += CHARS.charAt((c2 & 0xF) << 2);
out += "=";
break;
}
c3 = str.charCodeAt(i++);
out += CHARS.charAt(c1 >> 2);
out += CHARS.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
out += CHARS.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
out += CHARS.charAt(c3 & 0x3F);
}
return out;
}
LineageUtils.imgShapeRender = function(parent, bbox, node, viewOptions) {
var LineageUtilsRef = this,
imageIconPath = Utils.getEntityIconPath({ entityData: node }),
imgName = imageIconPath.split("/").pop(),
viewGuid = viewOptions.guid,
dagreD3 = viewOptions.dagreD3,
imageObject = viewOptions.imageObject,
$defs = viewOptions.$defs;
if (node.isDeleted) {
imgName = "deleted_" + imgName;
}
if (node.id == viewGuid) {
var currentNode = true
}
var shapeSvg = parent.append('circle')
.attr('fill', 'url(#img_' + imgName + ')')
.attr('r', '24px')
.attr('data-stroke', node.id)
.attr('stroke-width', "2px")
.attr("class", "nodeImage " + (currentNode ? "currentNode" : (node.isProcess ? "process" : "node")));
if (currentNode) {
shapeSvg.attr("stroke", "#fb4200")
}
if ($defs.select('pattern[id="img_' + imgName + '"]').empty()) {
var $pattern = $defs.append("pattern")
.attr("x", "0%")
.attr("y", "0%")
.attr("patternUnits", "objectBoundingBox")
.attr("id", "img_" + imgName)
.attr("width", "100%")
.attr("height", "100%")
.append('image')
.attr("href", function(d) {
var that = this;
if (node) {
var getImageData = function(options) {
var imagePath = options.imagePath,
ajaxOptions = {
"url": imagePath,
"method": "get",
"cache": true
}
if (platform.name !== "IE") {
ajaxOptions["mimeType"] = "text/plain; charset=x-user-defined";
}
shapeSvg.attr("data-iconpath", imagePath);
$.ajax(ajaxOptions)
.always(function(data, status, xhr) {
if (data.status == 404) {
getImageData({
"imagePath": Utils.getEntityIconPath({ entityData: node, errorUrl: imagePath })
});
} else if (data) {
if (platform.name !== "IE") {
imageObject[imageIconPath] = 'data:image/png;base64,' + LineageUtilsRef.base64Encode({ "data": data });
} else {
imageObject[imageIconPath] = imagePath;
}
d3.select(that).attr("xlink:href", imageObject[imageIconPath]);
if (imageIconPath !== shapeSvg.attr("data-iconpath")) {
shapeSvg.attr("data-iconpathorigin", imageIconPath);
}
}
});
}
getImageData({
"imagePath": imageIconPath
});
}
})
.attr("x", "4")
.attr("y", currentNode ? "3" : "4").attr("width", "40")
.attr("height", "40");
}
node.intersect = function(point) {
return dagreD3.intersect.circle(node, currentNode ? 24 : 21, point);
};
return shapeSvg;
}
LineageUtils.arrowPointRender = function(parent, id, edge, type, viewOptions) {
var node = parent.node(),
parentNode = node ? node.parentNode : parent,
dagreD3 = viewOptions.dagreD3;
d3.select(parentNode).select('path.path').attr('marker-end', "url(#" + id + ")");
var marker = parent.append("marker")
.attr("id", id)
.attr("viewBox", "0 0 10 10")
.attr("refX", 8)
.attr("refY", 5)
.attr("markerUnits", "strokeWidth")
.attr("markerWidth", 4)
.attr("markerHeight", 4)
.attr("orient", "auto");
var path = marker.append("path")
.attr("d", "M 0 0 L 10 5 L 0 10 z")
.style("fill", edge.styleObj.stroke);
dagreD3.util.applyStyle(path, edge[type + "Style"]);
}
LineageUtils.BezierCurve = function(context) {
return {
lineStart: function() {
this.data = [];
},
point: function(x, y) {
this.data.push([x, y]);
},
lineEnd: function() {
var x0 = this.data[0][0],
y0 = this.data[0][1],
cp1x = this.data[1][0],
cp1y = this.data[1][1],
cp2Obj = this.data[this.data.length - 2],
cp2x = cp2Obj[0],
cp2y = cp2Obj[1],
axisObj = this.data[this.data.length - 1],
x1 = axisObj[0],
y1 = axisObj[1];
context.moveTo(x0, y0);
context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x1, y1);
}
}
}
LineageUtils.SaveSvg = function(e, viewOptions) {
var that = this,
svg = viewOptions.svg,
svgWidth = viewOptions.svgWidth,
svgHeight = viewOptions.svgHeight,
downloadFileName = viewOptions.downloadFileName,
toggleLoader = viewOptions.toggleLoader,
svgClone = svg.cloneNode(true),
scaleFactor = 1;
setTimeout(function() {
if (platform.name === "Firefox") {
svgClone.setAttribute('width', svgWidth);
svgClone.setAttribute('height', svgHeight);
}
$('.hidden-svg').html(svgClone);
$(svgClone).find('>g').attr("transform", "scale(" + scaleFactor + ")");
$(svgClone).find("foreignObject").remove();
var canvasOffset = { x: 150, y: 150 },
setWidth = (svgClone.getBBox().width + (canvasOffset.x)),
setHeight = (svgClone.getBBox().height + (canvasOffset.y)),
xAxis = svgClone.getBBox().x,
yAxis = svgClone.getBBox().y;
svgClone.attributes.viewBox.value = xAxis + "," + yAxis + "," + setWidth + "," + setHeight;
var createCanvas = document.createElement('canvas');
createCanvas.id = "canvas";
createCanvas.style.display = 'none';
var body = $('body').append(createCanvas),
canvas = $('canvas')[0];
canvas.width = (svgClone.getBBox().width * scaleFactor) + canvasOffset.x;
canvas.height = (svgClone.getBBox().height * scaleFactor) + canvasOffset.y;
var ctx = canvas.getContext('2d'),
data = (new XMLSerializer()).serializeToString(svgClone),
DOMURL = window.URL || window.webkitURL || window;
ctx.fillStyle = "#FFFFFF";
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.strokeRect(0, 0, canvas.width, canvas.height);
ctx.restore();
var img = new Image(canvas.width, canvas.height);
var svgBlob = new Blob([data], { type: 'image/svg+xml;base64' });
if (platform.name === "Safari") {
svgBlob = new Blob([data], { type: 'image/svg+xml' });
}
var url = DOMURL.createObjectURL(svgBlob);
img.onload = function() {
try {
var a = document.createElement("a");
a.download = downloadFileName;
document.body.appendChild(a);
ctx.drawImage(img, 50, 50, canvas.width, canvas.height);
canvas.toBlob(function(blob) {
if (!blob) {
Utils.notifyError({
content: "There was an error in downloading Lineage!"
});
toggleLoader();
return;
}
a.href = DOMURL.createObjectURL(blob);
if (blob.size > 10000000) {
Utils.notifyWarn({
content: "The Image size is huge, please open the image in a browser!"
});
}
a.click();
toggleLoader();
if (platform.name === 'Safari') {
that.refreshGraphForSafari({
edgeEl: that.$('svg g.node')
});
}
}, 'image/png');
$('.hidden-svg').html('');
createCanvas.remove();
} catch (err) {
Utils.notifyError({
content: "There was an error in downloading Lineage!"
});
toggleLoader();
}
};
img.src = url;
}, 0);
}
return LineageUtils;
});
\ No newline at end of file
...@@ -147,7 +147,7 @@ define(['require', ...@@ -147,7 +147,7 @@ define(['require',
onRender: function() {}, onRender: function() {},
updateEdgeView: function(options) { updateEdgeView: function(options) {
var obj = options.obj, var obj = options,
fromEntity = this.lineageData.guidEntityMap[obj.fromEntityId], fromEntity = this.lineageData.guidEntityMap[obj.fromEntityId],
toEntity = this.lineageData.guidEntityMap[obj.toEntityId]; toEntity = this.lineageData.guidEntityMap[obj.toEntityId];
if (fromEntity && toEntity) { if (fromEntity && toEntity) {
...@@ -183,9 +183,9 @@ define(['require', ...@@ -183,9 +183,9 @@ define(['require',
that.ui.propagationOptions.find('.both').show(); that.ui.propagationOptions.find('.both').show();
} else { } else {
that.ui.propagationOptions.find('.both').hide(); that.ui.propagationOptions.find('.both').hide();
if (that.edgeInfo.obj.fromEntityId != relationshipObj.end1.guid && relationshipObj.propagateTags == "ONE_TO_TWO") { if (that.edgeInfo.fromEntityId != relationshipObj.end1.guid && relationshipObj.propagateTags == "ONE_TO_TWO") {
isTwoToOne = true; isTwoToOne = true;
} else if (that.edgeInfo.obj.fromEntityId == relationshipObj.end1.guid && relationshipObj.propagateTags == "TWO_TO_ONE") { } else if (that.edgeInfo.fromEntityId == relationshipObj.end1.guid && relationshipObj.propagateTags == "TWO_TO_ONE") {
isTwoToOne = true; isTwoToOne = true;
} }
if (isTwoToOne) { if (isTwoToOne) {
...@@ -241,7 +241,7 @@ define(['require', ...@@ -241,7 +241,7 @@ define(['require',
relationshipProp = { relationshipProp = {
"propagateTags": that.getPropagationFlow({ "propagateTags": that.getPropagationFlow({
"relationshipData": _.extend({}, this.apiGuid[entityId].relationship, { 'propagateTags': PropagationValue }), "relationshipData": _.extend({}, this.apiGuid[entityId].relationship, { 'propagateTags': PropagationValue }),
"graphData": { from: { guid: this.edgeInfo.obj.fromEntityId } } "graphData": { from: { guid: this.edgeInfo.fromEntityId } }
}) })
} }
} else { } else {
......
...@@ -16,24 +16,26 @@ ...@@ -16,24 +16,26 @@
* limitations under the License. * limitations under the License.
*/ */
define(['require', define([
'backbone', "require",
'hbs!tmpl/graph/RelationshipLayoutView_tmpl', "backbone",
'collection/VLineageList', "hbs!tmpl/graph/RelationshipLayoutView_tmpl",
'models/VEntity', "collection/VLineageList",
'utils/Utils', "models/VEntity",
'utils/CommonViewFunction', "utils/Utils",
'd3-tip', "utils/CommonViewFunction",
'utils/Enums', "d3",
'utils/UrlLinks', "d3-tip",
'platform' "utils/Enums",
], function(require, Backbone, RelationshipLayoutViewtmpl, VLineageList, VEntity, Utils, CommonViewFunction, d3Tip, Enums, UrlLinks, platform) { "utils/UrlLinks",
'use strict'; "platform"
], function(require, Backbone, RelationshipLayoutViewtmpl, VLineageList, VEntity, Utils, CommonViewFunction, d3, d3Tip, Enums, UrlLinks, platform) {
"use strict";
var RelationshipLayoutView = Backbone.Marionette.LayoutView.extend( var RelationshipLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends RelationshipLayoutView */ /** @lends RelationshipLayoutView */
{ {
_viewName: 'RelationshipLayoutView', _viewName: "RelationshipLayoutView",
template: RelationshipLayoutViewtmpl, template: RelationshipLayoutViewtmpl,
className: "resizeGraph", className: "resizeGraph",
...@@ -61,15 +63,15 @@ define(['require', ...@@ -61,15 +63,15 @@ define(['require',
events["click " + this.ui.relationshipDetailClose] = function() { events["click " + this.ui.relationshipDetailClose] = function() {
this.toggleInformationSlider({ close: true }); this.toggleInformationSlider({ close: true });
}; };
events["keyup " + this.ui.searchNode] = 'searchNode'; events["keyup " + this.ui.searchNode] = "searchNode";
events["click " + this.ui.boxClose] = 'toggleBoxPanel'; events["click " + this.ui.boxClose] = "toggleBoxPanel";
events["change " + this.ui.relationshipViewToggle] = function(e) { events["change " + this.ui.relationshipViewToggle] = function(e) {
this.relationshipViewToggle(e.currentTarget.checked) this.relationshipViewToggle(e.currentTarget.checked);
}; };
events["click " + this.ui.noValueToggle] = function(e) { events["click " + this.ui.noValueToggle] = function(e) {
Utils.togglePropertyRelationshipTableEmptyValues({ Utils.togglePropertyRelationshipTableEmptyValues({
"inputType": this.ui.noValueToggle, inputType: this.ui.noValueToggle,
"tableEl": this.ui.relationshipDetailValue tableEl: this.ui.relationshipDetailValue
}); });
}; };
return events; return events;
...@@ -80,7 +82,7 @@ define(['require', ...@@ -80,7 +82,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'entity', 'entityName', 'guid', 'actionCallBack', 'attributeDefs')); _.extend(this, _.pick(options, "entity", "entityName", "guid", "actionCallBack", "attributeDefs"));
this.graphData = this.createData(this.entity); this.graphData = this.createData(this.entity);
}, },
createData: function(entity) { createData: function(entity) {
...@@ -91,14 +93,14 @@ define(['require', ...@@ -91,14 +93,14 @@ define(['require',
_.each(entity.relationshipAttributes, function(obj, key) { _.each(entity.relationshipAttributes, function(obj, key) {
if (!_.isEmpty(obj)) { if (!_.isEmpty(obj)) {
links.push({ links.push({
"source": nodes[that.entity.typeName] || source: nodes[that.entity.typeName] ||
(nodes[that.entity.typeName] = _.extend({ "name": that.entity.typeName }, { value: entity })), (nodes[that.entity.typeName] = _.extend({ name: that.entity.typeName }, { value: entity })),
"target": nodes[key] || target: nodes[key] ||
(nodes[key] = _.extend({ (nodes[key] = _.extend({
"name": key name: key
}, { value: obj })), }, { value: obj })),
"value": obj value: obj
}) });
} }
}); });
} }
...@@ -106,7 +108,7 @@ define(['require', ...@@ -106,7 +108,7 @@ define(['require',
}, },
onRender: function() { onRender: function() {
this.ui.zoomControl.hide(); this.ui.zoomControl.hide();
this.$el.addClass('auto-height'); this.$el.addClass("auto-height");
}, },
onShow: function(argument) { onShow: function(argument) {
if (this.graphData && _.isEmpty(this.graphData.links)) { if (this.graphData && _.isEmpty(this.graphData.links)) {
...@@ -122,26 +124,26 @@ define(['require', ...@@ -122,26 +124,26 @@ define(['require',
//this.$('svg').html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relationship data found</text>'); //this.$('svg').html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relationship data found</text>');
}, },
toggleInformationSlider: function(options) { toggleInformationSlider: function(options) {
if (options.open && !this.$('.relationship-details').hasClass("open")) { if (options.open && !this.$(".relationship-details").hasClass("open")) {
this.$('.relationship-details').addClass('open'); this.$(".relationship-details").addClass("open");
} else if (options.close && this.$('.relationship-details').hasClass("open")) { } else if (options.close && this.$(".relationship-details").hasClass("open")) {
d3.selectAll('circle').attr("stroke", "none"); d3.selectAll("circle").attr("stroke", "none");
this.$('.relationship-details').removeClass('open'); this.$(".relationship-details").removeClass("open");
} }
}, },
toggleBoxPanel: function(options) { toggleBoxPanel: function(options) {
var el = options && options.el, var el = options && options.el,
nodeDetailToggler = options && options.nodeDetailToggler, nodeDetailToggler = options && options.nodeDetailToggler,
currentTarget = options.currentTarget; currentTarget = options.currentTarget;
this.$el.find('.show-box-panel').removeClass('show-box-panel'); this.$el.find(".show-box-panel").removeClass("show-box-panel");
if (el && el.addClass) { if (el && el.addClass) {
el.addClass('show-box-panel'); el.addClass("show-box-panel");
} }
this.$('circle.node-detail-highlight').removeClass("node-detail-highlight"); this.$("circle.node-detail-highlight").removeClass("node-detail-highlight");
}, },
searchNode: function(e) { searchNode: function(e) {
var $el = $(e.currentTarget); var $el = $(e.currentTarget);
this.updateRelationshipDetails(_.extend({}, $el.data(), { searchString: $el.val() })) this.updateRelationshipDetails(_.extend({}, $el.data(), { searchString: $el.val() }));
}, },
updateRelationshipDetails: function(options) { updateRelationshipDetails: function(options) {
var data = options.obj.value, var data = options.obj.value,
...@@ -151,17 +153,17 @@ define(['require', ...@@ -151,17 +153,17 @@ define(['require',
getEntityTypelist = function(options) { getEntityTypelist = function(options) {
var activeEntityColor = "#4a90e2", var activeEntityColor = "#4a90e2",
deletedEntityColor = "#BB5838", deletedEntityColor = "#BB5838",
entityTypeHtml = '<pre>', entityTypeHtml = "<pre>",
getdefault = function(obj) { getdefault = function(obj) {
var options = obj.options, var options = obj.options,
status = (Enums.entityStateReadOnly[options.entityStatus || options.status] ? " deleted-relation" : ''), status = Enums.entityStateReadOnly[options.entityStatus || options.status] ? " deleted-relation" : "",
guid = options.guid, guid = options.guid,
entityColor = obj.color, entityColor = obj.color,
name = obj.name, name = obj.name,
typeName = options.typeName; typeName = options.typeName;
if (typeName === "AtlasGlossaryTerm") { if (typeName === "AtlasGlossaryTerm") {
return '<li class=' + status + '>' + return '<li class=' + status + '>' +
'<a style="color:' + entityColor + '" href="#!/glossary/' + guid + '?guid=' + guid + '&gType=term&viewType=term">' + name + ' (' + typeName + ')</a>' + '<a style="color:' + entityColor + '" href="#!/glossary/' + guid + '?guid=' + guid + '&gType=term&viewType=term&fromView=entity">' + name + ' (' + typeName + ')</a>' +
'</li>'; '</li>';
} else { } else {
return "<li class=" + status + ">" + return "<li class=" + status + ">" +
...@@ -171,7 +173,7 @@ define(['require', ...@@ -171,7 +173,7 @@ define(['require',
}, },
getWithButton = function(obj) { getWithButton = function(obj) {
var options = obj.options, var options = obj.options,
status = (Enums.entityStateReadOnly[options.entityStatus || options.status] ? " deleted-relation" : ''), status = Enums.entityStateReadOnly[options.entityStatus || options.status] ? " deleted-relation" : "",
guid = options.guid, guid = options.guid,
entityColor = obj.color, entityColor = obj.color,
name = obj.name, name = obj.name,
...@@ -182,7 +184,7 @@ define(['require', ...@@ -182,7 +184,7 @@ define(['require',
title = "Deleted"; title = "Deleted";
if (relationship) { if (relationship) {
icon = '<i class="fa fa-long-arrow-right"></i>'; icon = '<i class="fa fa-long-arrow-right"></i>';
status = (Enums.entityStateReadOnly[options.relationshipStatus || options.status] ? "deleted-relation" : ''); status = Enums.entityStateReadOnly[options.relationshipStatus || options.status] ? "deleted-relation" : "";
title = "Relationship Deleted"; title = "Relationship Deleted";
} }
return "<li class=" + status + ">" + return "<li class=" + status + ">" +
...@@ -195,33 +197,33 @@ define(['require', ...@@ -195,33 +197,33 @@ define(['require',
if (options.entityStatus == "ACTIVE") { if (options.entityStatus == "ACTIVE") {
if (options.relationshipStatus == "ACTIVE") { if (options.relationshipStatus == "ACTIVE") {
entityTypeHtml = getdefault({ entityTypeHtml = getdefault({
"color": activeEntityColor, color: activeEntityColor,
"options": options, options: options,
"name": name name: name
}); });
} else if (options.relationshipStatus == "DELETED") { } else if (options.relationshipStatus == "DELETED") {
entityTypeHtml = getWithButton({ entityTypeHtml = getWithButton({
"color": activeEntityColor, color: activeEntityColor,
"options": options, options: options,
"name": name, name: name,
"relationship": true relationship: true
}) });
} }
} else if (options.entityStatus == "DELETED") { } else if (options.entityStatus == "DELETED") {
entityTypeHtml = getWithButton({ entityTypeHtml = getWithButton({
"color": deletedEntityColor, color: deletedEntityColor,
"options": options, options: options,
"name": name, name: name,
"entity": true entity: true
}) });
} else { } else {
entityTypeHtml = getdefault({ entityTypeHtml = getdefault({
"color": activeEntityColor, color: activeEntityColor,
"options": options, options: options,
"name": name name: name
}); });
} }
return entityTypeHtml + '</pre>'; return entityTypeHtml + "</pre>";
}; };
this.ui.searchNode.hide(); this.ui.searchNode.hide();
this.$("[data-id='typeName']").text(typeName); this.$("[data-id='typeName']").text(typeName);
...@@ -229,7 +231,7 @@ define(['require', ...@@ -229,7 +231,7 @@ define(['require',
var name = options.entityName ? options.entityName : Utils.getName(options, "displayText"); var name = options.entityName ? options.entityName : Utils.getName(options, "displayText");
var entityTypeButton = getEntityTypelist(options); var entityTypeButton = getEntityTypelist(options);
return entityTypeButton; return entityTypeButton;
} };
if (_.isArray(data)) { if (_.isArray(data)) {
if (data.length > 1) { if (data.length > 1) {
this.ui.searchNode.show(); this.ui.searchNode.show();
...@@ -253,318 +255,304 @@ define(['require', ...@@ -253,318 +255,304 @@ define(['require',
this.$("[data-id='entityList']").html(listString); this.$("[data-id='entityList']").html(listString);
}, },
createGraph: function(data) { createGraph: function(data) {
//Ref - http://bl.ocks.org/fancellu/2c782394602a93921faff74e594d1bb1
var that = this, var that = this,
width = this.$('svg').width(), width = this.$("svg").width(),
height = this.$('svg').height(); height = this.$("svg").height(),
nodes = d3.values(data.nodes),
links = data.links;
var scale = 1.0, var activeEntityColor = "#00b98b",
activeEntityColor = "#00b98b",
deletedEntityColor = "#BB5838", deletedEntityColor = "#BB5838",
defaultEntityColor = "#e0e0e0", defaultEntityColor = "#e0e0e0",
selectedNodeColor = "#4a90e2"; selectedNodeColor = "#4a90e2";
var force = d3.layout.force() var svg = d3
.nodes(d3.values(data.nodes)) .select(this.$("svg")[0])
.links(data.links)
.size([width, height])
.linkDistance(200)
.gravity(0.5)
.friction(0.1)
.charge(function(d) {
var charge = -2000;
if (d.index === 0) charge = 100
return charge;
})
.on("tick", tick)
.start();
var zoom = d3.behavior.zoom()
.scale(scale)
.scaleExtent([1, 5])
.on("zoom", zoomed);
function zoomed() {
container.attr("transform",
"translate(" + zoom.translate() + ")" +
"scale(" + zoom.scale() + ")"
);
}
function interpolateZoom(translate, scale) {
var self = this;
return d3.transition().duration(350).tween("zoom", function() {
var iTranslate = d3.interpolate(zoom.translate(), translate),
iScale = d3.interpolate(zoom.scale(), scale);
return function(t) {
zoom
.scale(iScale(t))
.translate(iTranslate(t));
zoomed();
};
});
}
function zoomClick() {
var clicked = d3.event.target,
direction = 1,
factor = 0.5,
target_zoom = 1,
center = [width / 2, height / 2],
extent = zoom.scaleExtent(),
translate = zoom.translate(),
translate0 = [],
l = [],
view = { x: translate[0], y: translate[1], k: zoom.scale() };
d3.event.preventDefault();
direction = (this.id === 'zoom_in') ? 1 : -1;
target_zoom = zoom.scale() * (1 + factor * direction);
if (target_zoom < extent[0] || target_zoom > extent[1]) { return false; }
translate0 = [(center[0] - view.x) / view.k, (center[1] - view.y) / view.k];
view.k = target_zoom;
l = [translate0[0] * view.k + view.x, translate0[1] * view.k + view.y];
view.x += center[0] - l[0];
view.y += center[1] - l[1];
interpolateZoom([view.x, view.y], view.k);
}
d3.selectAll(this.$('.lineageZoomButton')).on('click', zoomClick);
var svg = d3.select(this.$("svg")[0])
.attr("viewBox", "0 0 " + width + " " + height) .attr("viewBox", "0 0 " + width + " " + height)
.attr("enable-background", "new 0 0 " + width + " " + height) .attr("enable-background", "new 0 0 " + width + " " + height),
.call(zoom) node,
.on("dblclick.zoom", null), path;
drag = force.drag()
.on("dragstart", dragstart);
var container = svg.append("g") var container = svg
.append("g")
.attr("id", "container") .attr("id", "container")
.attr("transform", "translate(0,0)scale(1,1)"); .attr("transform", "translate(0,0)scale(1,1)");
var zoom = d3
.zoom()
.scaleExtent([0.1, 4])
.on("zoom", function() {
container.attr("transform", d3.event.transform);
});
svg.call(zoom).on("dblclick.zoom", null);
// build the arrow. container
container.append("svg:defs").selectAll("marker") .append("svg:defs")
.selectAll("marker")
.data(["deletedLink", "activeLink"]) // Different link/path types can be defined here .data(["deletedLink", "activeLink"]) // Different link/path types can be defined here
.enter().append("svg:marker") // This section adds in the arrows .enter()
.append("svg:marker") // This section adds in the arrows
.attr("id", String) .attr("id", String)
.attr("viewBox", "0 -5 10 10") .attr("viewBox", "-0 -5 10 10")
.attr("refX", 10) .attr("refX", 10)
.attr("refY", -0.5) .attr("refY", -0.5)
.attr("orient", "auto")
.attr("markerWidth", 6) .attr("markerWidth", 6)
.attr("markerHeight", 6) .attr("markerHeight", 6)
.attr("orient", "auto")
.append("svg:path") .append("svg:path")
.attr("d", "M0,-5L10,0L0,5") .attr("d", "M 0,-5 L 10 ,0 L 0,5")
.attr("fill", function(d) { .attr("fill", function(d) {
return d == "deletedLink" ? deletedEntityColor : activeEntityColor; return d == "deletedLink" ? deletedEntityColor : activeEntityColor;
}); })
.style("stroke", "none");
function getPathColor(options) {
return isAllEntityRelationDeleted(options) ? deletedEntityColor : activeEntityColor
}
function isAllEntityRelationDeleted(options) {
var data = options.data,
type = options.type;
var d = $.extend(true, {}, data);
if (d && !_.isArray(d.value)) {
d.value = [d.value];
}
return (_.findIndex(d.value, function(val) {
if (type == "node") {
return (val.entityStatus || val.status) == "ACTIVE"
} else {
return val.relationshipStatus == "ACTIVE"
}
}) == -1);
}
// add the links and the arrows
var path = container.append("svg:g").selectAll("path")
.data(force.links())
.enter().append("svg:path")
// .attr("class", function(d) { return "link " + d.type; })
.attr("class", "relatioship-link")
.attr("stroke", function(d) { return getPathColor({ data: d, type: 'path' }) })
.attr("marker-end", function(d) {
return "url(#" + (isAllEntityRelationDeleted({ data: d }) ? "deletedLink" : "activeLink") + ")";
});
// define the nodes var forceLink = d3
var node = container.selectAll(".node") .forceLink()
.data(force.nodes()) .id(function(d) {
.enter().append("g") return d.id;
.attr("class", "node")
.on('touchstart', function(d) {
if (d && d.value && d.value.guid != that.guid) {
d3.event.stopPropagation();
}
}) })
.on('mousedown', function(d) { .distance(function(d) {
if (d && d.value && d.value.guid != that.guid) { return 100;
d3.event.stopPropagation();
}
}) })
.on('click', function(d) { .strength(1);
if (d3.event.defaultPrevented) return; // ignore drag
if (d && d.value && d.value.guid == that.guid) { var simulation = d3
that.ui.boxClose.trigger('click'); .forceSimulation()
return; .force("link", forceLink)
} .force("charge", d3.forceManyBody())
that.toggleBoxPanel({ el: that.$('.relationship-node-details') }); .force("center", d3.forceCenter(width / 2, height / 2));
that.ui.searchNode.data({ obj: d });
$(this).find('circle').addClass("node-detail-highlight"); update();
that.updateRelationshipDetails({ obj: d });
function update() {
}).call(force.drag); path = container
.append("svg:g")
// add the nodes .selectAll("path")
var circleContainer = node.append("g"); .data(links)
circleContainer.on("dblclick", function(d) { .enter()
if ((_.isArray(d.value) && d.value.length == 1) || d.value.guid) { .append("svg:path")
var guid = _.isArray(d.value) ? _.first(d.value).guid : d.value.guid; .attr("class", "relatioship-link")
Utils.setUrl({ .attr("stroke", function(d) {
url: '#!/detailPage/' + guid, return getPathColor({ data: d, type: "path" });
mergeBrowserUrl: false, })
urlParams: { tabActive: 'relationship' }, .attr("marker-end", function(d) {
trigger: true return "url(#" + (isAllEntityRelationDeleted({ data: d }) ? "deletedLink" : "activeLink") + ")";
}); });
}
})
circleContainer.append("circle") node = container
.attr("cx", 0) .selectAll(".node")
.attr("cy", 0) .data(nodes)
.attr("r", function(d) { .enter()
d.radius = 25; .append("g")
return d.radius; .attr("class", "node")
}) .on("mousedown", function() {
.attr("fill", function(d) { console.log(d3.event);
if (d && d.value && d.value.guid == that.guid) { d3.event.preventDefault();
if (isAllEntityRelationDeleted({ data: d, type: 'node' })) { })
.on("click", function(d) {
if (d3.event.defaultPrevented) return; // ignore drag
if (d && d.value && d.value.guid == that.guid) {
that.ui.boxClose.trigger("click");
return;
}
that.toggleBoxPanel({ el: that.$(".relationship-node-details") });
that.ui.searchNode.data({ obj: d });
$(this)
.find("circle")
.addClass("node-detail-highlight");
that.updateRelationshipDetails({ obj: d });
})
.call(
d3
.drag()
.on("start", dragstarted)
.on("drag", dragged)
);
var circleContainer = node.append("g");
circleContainer
.append("circle")
.attr("cx", 0)
.attr("cy", 0)
.attr("r", function(d) {
d.radius = 25;
return d.radius;
})
.attr("fill", function(d) {
if (d && d.value && d.value.guid == that.guid) {
if (isAllEntityRelationDeleted({ data: d, type: "node" })) {
return deletedEntityColor;
} else {
return selectedNodeColor;
}
} else if (isAllEntityRelationDeleted({ data: d, type: "node" })) {
return deletedEntityColor; return deletedEntityColor;
} else { } else {
return selectedNodeColor; return activeEntityColor;
} }
} else if (isAllEntityRelationDeleted({ data: d, type: 'node' })) { })
return deletedEntityColor; .attr("typename", function(d) {
} else { return d.name;
return activeEntityColor; });
}
}) circleContainer
.attr("typename", function(d) { .append("text")
return d.name; .attr("x", 0)
}) .attr("y", 0)
circleContainer.append("text") .attr("dy", 25 - 17)
.attr('x', 0) .attr("text-anchor", "middle")
.attr('y', 0) .style("font-family", "FontAwesome")
.attr('dy', (25 - 17)) .style("font-size", function(d) {
.attr("text-anchor", "middle") return "25px";
.style("font-family", "FontAwesome") })
.style('font-size', function(d) { return '25px'; }) .text(function(d) {
.text(function(d) { var iconObj = Enums.graphIcon[d.name];
var iconObj = Enums.graphIcon[d.name]; if (iconObj && iconObj.textContent) {
if (iconObj && iconObj.textContent) { return iconObj.textContent;
return iconObj.textContent;
} else {
if (d && _.isArray(d.value) && d.value.length > 1) {
return '\uf0c5';
} else { } else {
return '\uf016'; if (d && _.isArray(d.value) && d.value.length > 1) {
return "\uf0c5";
} else {
return "\uf016";
}
} }
} })
}) .attr("fill", function(d) {
.attr("fill", function(d) { return "#fff";
return "#fff"; });
});
var countBox = circleContainer.append('g')
countBox.append("circle")
.attr("cx", 18)
.attr("cy", -20)
.attr("r", function(d) {
if (_.isArray(d.value) && d.value.length > 1) {
return 10;
}
});
countBox.append("text") var countBox = circleContainer.append("g");
.attr('dx', 18)
.attr('dy', -16) countBox
.attr("text-anchor", "middle") .append("circle")
.attr("fill", defaultEntityColor) .attr("cx", 18)
.text(function(d) { .attr("cy", -20)
if (_.isArray(d.value) && d.value.length > 1) { .attr("r", function(d) {
return d.value.length; if (_.isArray(d.value) && d.value.length > 1) {
} return 10;
}); }
});
countBox
.append("text")
.attr("dx", 18)
.attr("dy", -16)
.attr("text-anchor", "middle")
.attr("fill", defaultEntityColor)
.text(function(d) {
if (_.isArray(d.value) && d.value.length > 1) {
return d.value.length;
}
});
node.append("text")
.attr("x", -15)
.attr("y", "35")
.text(function(d) {
return d.name;
});
// add the text simulation.nodes(nodes).on("tick", ticked);
node.append("text")
.attr("x", -15)
.attr("y", "35")
.text(function(d) { return d.name; });
// add the curvy lines simulation.force("link").links(links);
function tick() { }
function ticked() {
path.attr("d", function(d) { path.attr("d", function(d) {
var diffX = d.target.x - d.source.x, var diffX = d.target.x - d.source.x,
diffY = d.target.y - d.source.y, diffY = d.target.y - d.source.y,
// Length of path from center of source node to center of target node // Length of path from center of source node to center of target node
pathLength = Math.sqrt((diffX * diffX) + (diffY * diffY)), pathLength = Math.sqrt(diffX * diffX + diffY * diffY),
// x and y distances from center to outside edge of target node // x and y distances from center to outside edge of target node
offsetX = (diffX * d.target.radius) / pathLength, offsetX = (diffX * d.target.radius) / pathLength,
offsetY = (diffY * d.target.radius) / pathLength; offsetY = (diffY * d.target.radius) / pathLength;
return "M" + d.source.x + "," + d.source.y + "A" + pathLength + "," + pathLength + " 0 0,1 " + (d.target.x - offsetX) + "," + (d.target.y - offsetY) return "M" + d.source.x + "," + d.source.y + "A" + pathLength + "," + pathLength + " 0 0,1 " + (d.target.x - offsetX) + "," + (d.target.y - offsetY);
}); });
node.attr("transform", function(d) { node.attr("transform", function(d) {
if (d && d.value && d.value.guid == that.guid) {
d.x = (width / 2)
d.y = (height / 2)
}
return "translate(" + d.x + "," + d.y + ")"; return "translate(" + d.x + "," + d.y + ")";
}); });
} }
function dragstart(d) { function dragstarted(d) {
d3.select(this).classed("fixed", d.fixed = true); d3.event.sourceEvent.stopPropagation();
if (d && d.value && d.value.guid != that.guid) {
if (!d3.event.active) simulation.alphaTarget(0.3).restart();
d.fx = d.x;
d.fy = d.y;
}
}
function dragged(d) {
if (d && d.value && d.value.guid != that.guid) {
d.fx = d3.event.x;
d.fy = d3.event.y;
}
}
function getPathColor(options) {
return isAllEntityRelationDeleted(options) ? deletedEntityColor : activeEntityColor;
}
function isAllEntityRelationDeleted(options) {
var data = options.data,
type = options.type;
var d = $.extend(true, {}, data);
if (d && !_.isArray(d.value)) {
d.value = [d.value];
}
return (
_.findIndex(d.value, function(val) {
if (type == "node") {
return (val.entityStatus || val.status) == "ACTIVE";
} else {
return val.relationshipStatus == "ACTIVE";
}
}) == -1
);
}
var zoomClick = function() {
var scaleFactor = 0.8;
if (this.id === 'zoom_in') {
scaleFactor = 1.3;
}
zoom.scaleBy(svg.transition().duration(750), scaleFactor);
} }
d3.selectAll(this.$('.lineageZoomButton')).on('click', zoomClick);
}, },
createTable: function() { createTable: function() {
this.entityModel = new VEntity({}); this.entityModel = new VEntity({});
var table = CommonViewFunction.propertyTable({ scope: this, valueObject: this.entity.relationshipAttributes, attributeDefs: this.attributeDefs }); var table = CommonViewFunction.propertyTable({
scope: this,
valueObject: this.entity.relationshipAttributes,
attributeDefs: this.attributeDefs
});
this.ui.relationshipDetailValue.html(table); this.ui.relationshipDetailValue.html(table);
Utils.togglePropertyRelationshipTableEmptyValues({ Utils.togglePropertyRelationshipTableEmptyValues({
"inputType": this.ui.noValueToggle, inputType: this.ui.noValueToggle,
"tableEl": this.ui.relationshipDetailValue tableEl: this.ui.relationshipDetailValue
}); });
}, },
relationshipViewToggle: function(checked) { relationshipViewToggle: function(checked) {
this.ui.relationshipDetailTable.toggleClass('visible invisible'); this.ui.relationshipDetailTable.toggleClass("visible invisible");
this.ui.relationshipSVG.toggleClass('visible invisible'); this.ui.relationshipSVG.toggleClass("visible invisible");
if (checked) { if (checked) {
this.ui.zoomControl.hide(); this.ui.zoomControl.hide();
this.$el.addClass('auto-height'); this.$el.addClass("auto-height");
} else { } else {
this.ui.zoomControl.show(); this.ui.zoomControl.show();
this.$el.removeClass('auto-height'); this.$el.removeClass("auto-height");
} }
} }
}); }
);
return RelationshipLayoutView; return RelationshipLayoutView;
}); });
\ No newline at end of file
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define([
"require",
"backbone",
"hbs!tmpl/graph/TypeSystemTreeView_tmpl",
"collection/VLineageList",
"models/VEntity",
"LineageHelper",
"d3",
"dagreD3",
"d3-tip",
"utils/CommonViewFunction",
"utils/Utils",
"platform",
"jquery-ui"
], function(require, Backbone, TypeSystemTreeViewTmpl, VLineageList, VEntity, LineageHelper, d3, dagreD3, d3Tip, CommonViewFunction, Utils, platform) {
"use strict";
/** @lends TypeSystemTreeView */
var TypeSystemTreeView = Backbone.Marionette.LayoutView.extend({
_viewName: "TypeSystemTreeViewTmpl",
template: TypeSystemTreeViewTmpl,
templateHelpers: function() {
return {
modalID: this.viewId,
width: "100%",
height: "300px"
};
},
/** Layout sub regions */
regions: {
RTypeSystemTreeViewPage: "#r_typeSystemTreeViewPage"
},
/** ui selector cache */
ui: {
typeSystemTreeViewPage: "[data-id='typeSystemTreeViewPage']",
boxClose: '[data-id="box-close"]',
nodeDetailTable: '[data-id="nodeDetailTable"]',
typeSearch: '[data-id="typeSearch"]',
filterServiceType: '[data-id="filterServiceType"]',
onZoomIn: '[data-id="zoom-in"]',
onZoomOut: '[data-id="zoom-out"]',
filterBox: ".filter-box",
searchBox: ".search-box",
filterToggler: '[data-id="filter-toggler"]',
searchToggler: '[data-id="search-toggler"]',
reset: '[data-id="reset"]',
fullscreenToggler: '[data-id="fullScreen-toggler"]'
},
/** ui events hash */
events: function() {
var events = {};
events["click " + this.ui.boxClose] = "toggleBoxPanel";
events["click " + this.ui.onZoomIn] = "onClickZoomIn";
events["click " + this.ui.onZoomOut] = "onClickZoomOut";
events["click " + this.ui.filterToggler] = "onClickFilterToggler";
events["click " + this.ui.searchToggler] = "onClickSearchToggler";
events["click " + this.ui.fullscreenToggler] = "onClickFullscreenToggler";
events["click " + this.ui.reset] = "onClickReset";
return events;
},
/**
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, "entityDefCollection"));
},
onShow: function() {
this.$(".fontLoader").show();
this.initializeGraph();
this.fetchGraphData();
},
onRender: function() {},
fetchGraphData: function(options) {
var that = this;
var entityTypeDef = that.entityDefCollection.fullCollection.toJSON();
this.$(".fontLoader").show();
this.$("svg").empty();
if (that.isDestroyed) {
return;
}
if (entityTypeDef.length) {
that.generateData($.extend(true, {}, { data: entityTypeDef }, options)).then(function(graphObj) {
that.createGraph();
});
}
},
generateData: function(options) {
return new Promise(
function(resolve, reject) {
try {
var that = this,
newHashMap = {},
styleObj = {
fill: "none",
stroke: "#ffb203",
width: 3
},
makeNodeData = function(relationObj) {
if (relationObj) {
if (relationObj.updatedValues) {
return relationObj;
}
var obj = _.extend(relationObj, {
shape: "img",
updatedValues: true,
label: relationObj.name.trunc(18),
toolTipLabel: relationObj.name,
id: relationObj.guid,
isLineage: true,
isIncomplete: false
});
return obj;
}
},
getStyleObjStr = function(styleObj) {
return "fill:" + styleObj.fill + ";stroke:" + styleObj.stroke + ";stroke-width:" + styleObj.width;
},
setNode = function(guid, obj) {
var node = that.LineageHelperRef.getNode(guid);
if (!node) {
var nodeData = makeNodeData(obj);
that.LineageHelperRef.setNode(guid, nodeData);
return nodeData;
} else {
return node;
}
},
setEdge = function(fromNodeGuid, toNodeGuid) {
that.LineageHelperRef.setEdge(fromNodeGuid, toNodeGuid, {
arrowhead: "arrowPoint",
style: getStyleObjStr(styleObj),
styleObj: styleObj
});
},
setGraphData = function(fromEntityId, toEntityId) {
setNode(fromEntityId);
setNode(toEntityId);
setEdge(fromEntityId, toEntityId);
};
if (options.data) {
if (options.filter) {
var pendingSubList = {},
pendingSuperList = {},
temp = {},
doneList = {},
traveseSubSuper = function(obj, ignoreSubTypes) {
var fromEntityId = obj.guid;
if (!ignoreSubTypes && obj.subTypes.length) {
_.each(obj.subTypes, function(subType) {
var tempObj = doneList[subType] || temp[subType];
if (tempObj) {
setNode(tempObj.guid, tempObj);
setEdge(fromEntityId, tempObj.guid);
} else {
if (pendingSubList[subType]) {
pendingSubList[subType].push(fromEntityId);
} else {
pendingSubList[subType] = [fromEntityId];
}
}
});
}
if (obj.superTypes.length) {
_.each(obj.superTypes, function(superType) {
var tempObj = doneList[superType] || temp[superType];
if (tempObj) {
setNode(tempObj.guid, tempObj);
setEdge(tempObj.guid, fromEntityId);
if (tempObj.superTypes.length) {
traveseSubSuper(tempObj, true);
}
} else {
if (pendingSuperList[superType]) {
pendingSuperList[superType].push(fromEntityId);
} else {
pendingSuperList[superType] = [fromEntityId];
}
}
});
}
};
_.each(options.data, function(obj) {
var fromEntityId = obj.guid;
if (obj.serviceType === options.filter) {
doneList[obj.name] = obj;
setNode(fromEntityId, obj);
if (pendingSubList[obj.name]) {
_.map(pendingSubList[obj.name], function(guid) {
setEdge(guid, fromEntityId);
});
delete pendingSubList[obj.name];
}
if (pendingSuperList[obj.name]) {
_.map(pendingSuperList[obj.name], function(guid) {
setEdge(fromEntityId, guid);
});
delete pendingSuperList[obj.name];
}
traveseSubSuper(obj);
} else {
if (pendingSubList[obj.name]) {
setNode(fromEntityId, obj);
doneList[obj.name] = obj;
_.map(pendingSubList[obj.name], function(guid) {
setEdge(guid, fromEntityId);
});
delete pendingSubList[obj.name];
}
if (pendingSuperList[obj.name]) {
var fromEntityId = obj.guid;
setNode(fromEntityId, obj);
doneList[obj.name] = obj;
_.map(pendingSuperList[obj.name], function(guid) {
setEdge(fromEntityId, guid);
});
delete pendingSuperList[obj.name];
}
if (!doneList[obj.name]) {
temp[obj.name] = obj;
}
}
});
pendingSubList = null;
pendingSuperList = null;
doneList = null;
} else {
var pendingList = {},
doneList = {};
_.each(options.data, function(obj) {
var fromEntityId = obj.guid;
doneList[obj.name] = obj;
setNode(fromEntityId, obj);
if (pendingList[obj.name]) {
_.map(pendingList[obj.name], function(guid) {
setEdge(guid, fromEntityId);
});
delete pendingList[obj.name];
}
if (obj.subTypes.length) {
_.each(obj.subTypes, function(subTypes) {
//var subTypesObj = _.find(options.data({ name: superTypes });
//setNode(superTypeObj.attributes.guid, superTypeObj.attributes);
if (doneList[subTypes]) {
setEdge(fromEntityId, doneList[subTypes].guid);
} else {
if (pendingList[subTypes]) {
pendingList[subTypes].push(fromEntityId);
} else {
pendingList[subTypes] = [fromEntityId];
}
}
});
}
});
pendingList = null;
doneList = null;
}
}
resolve(this.g);
} catch (e) {
reject(e);
}
}.bind(this)
);
},
toggleBoxPanel: function(options) {
var el = options && options.el,
nodeDetailToggler = options && options.nodeDetailToggler,
currentTarget = options.currentTarget;
this.$el.find(".show-box-panel").removeClass("show-box-panel");
if (el && el.addClass) {
el.addClass("show-box-panel");
}
this.$("circle.node-detail-highlight").removeClass("node-detail-highlight");
},
onClickNodeToggler: function(options) {
this.toggleBoxPanel({ el: this.$(".lineage-node-detail"), nodeDetailToggler: true });
},
onClickZoomIn: function() {
this.LineageHelperRef.zoomIn();
},
onClickZoomOut: function() {
this.LineageHelperRef.zoomOut();
},
onClickFilterToggler: function() {
this.toggleBoxPanel({ el: this.ui.filterBox });
},
onClickSearchToggler: function() {
this.toggleBoxPanel({ el: this.ui.searchBox });
},
onClickReset: function() {
this.fetchGraphData({ refresh: true });
},
onClickFullscreenToggler: function(e) {
var icon = $(e.currentTarget).find("i"),
panel = $(e.target).parents(".tab-pane").first();
icon.toggleClass("fa-expand fa-compress");
if (icon.hasClass("fa-expand")) {
icon.parent("button").attr("data-original-title", "Full Screen");
} else {
icon.parent("button").attr("data-original-title", "Default View");
}
panel.toggleClass("fullscreen-mode");
},
updateDetails: function(data) {
this.$("[data-id='typeName']").text(Utils.getName(data));
delete data.id;
//atttributes
data["atttributes"] = (data.attributeDefs || []).map(function(obj) {
return obj.name;
});
delete data.attributeDefs;
//businessAttributes
data["businessAttributes"] = _.keys(data.businessAttributeDefs);
delete data.businessAttributeDefs;
//relationshipAttributes
data["relationshipAttributes"] = (data.relationshipAttributeDefs || []).map(function(obj) {
return obj.name;
});
delete data.relationshipAttributeDefs;
console.log(data);
this.ui.nodeDetailTable.html(
CommonViewFunction.propertyTable({
scope: this,
guidHyperLink: false,
getEmptyString: function(key) {
if (key === "subTypes" || key === "superTypes" || key === "atttributes" || key === "relationshipAttributes") {
return "[]";
}
return "N/A";
},
valueObject: _.omit(data, ["isLineage", "isIncomplete", "label", "shape", "toolTipLabel", "updatedValues"]),
sortBy: true
})
);
},
createGraph: function(refresh) {
this.LineageHelperRef.createGraph();
},
filterData: function(value) {
this.LineageHelperRef.refresh();
this.fetchGraphData({ filter: value });
},
initializeGraph: function() {
//ref - https://bl.ocks.org/seemantk/80613e25e9804934608ac42440562168
var that = this,
node = this.$("svg.main").parent()[0].getBoundingClientRect();
this.$("svg").attr("viewBox", "0 0 " + node.width + " " + node.height);
this.LineageHelperRef = new LineageHelper.default({
el: this.$("svg.main")[0],
legends: false,
setDataManually: true,
width: node.width,
height: node.height,
isShowHoverPath: true,
zoom: true,
fitToScreen: true,
dagreOptions: {
rankdir: "tb"
},
onNodeClick: function(d) {
that.onClickNodeToggler();
that.updateDetails(that.LineageHelperRef.getNode(d.clickedData, true));
},
beforeRender: function() {
that.$(".fontLoader").show();
},
afterRender: function() {
that.graphOptions = that.LineageHelperRef.getGraphOptions();
that.renderTypeFilterSearch();
that.$(".fontLoader").hide();
return;
}
});
},
renderTypeFilterSearch: function(data) {
var that = this;
var searchStr = "<option></option>",
filterStr = "<option></option>",
tempFilteMap = {};
var nodes = that.LineageHelperRef.getNodes();
if (!_.isEmpty(nodes)) {
_.each(nodes, function(obj) {
searchStr += '<option value="' + obj.guid + '">' + obj.name + "</option>";
if (obj.serviceType && !tempFilteMap[obj.serviceType]) {
tempFilteMap[obj.serviceType] = obj.serviceType;
filterStr += '<option value="' + obj.serviceType + '">' + obj.serviceType + "</option>";
}
});
}
this.ui.typeSearch.html(searchStr);
if (!this.ui.filterServiceType.data("select2")) {
this.ui.filterServiceType.html(filterStr);
}
this.initilizeTypeFilterSearch();
},
initilizeTypeFilterSearch: function() {
var that = this;
this.ui.typeSearch
.select2({
closeOnSelect: true,
placeholder: "Select Node"
})
.on("change.select2", function(e) {
e.stopPropagation();
e.stopImmediatePropagation();
var selectedNode = $('[data-id="typeSearch"]').val();
//that.searchNodeObj.selectedNode = selectedNode;
that.LineageHelperRef.searchNode({ guid: selectedNode });
});
if (!this.ui.filterServiceType.data("select2")) {
this.ui.filterServiceType
.select2({
closeOnSelect: true,
placeholder: "Select ServiceType"
})
.on("change.select2", function(e) {
e.stopPropagation();
e.stopImmediatePropagation();
var selectedNode = $('[data-id="filterServiceType"]').val();
that.filterData(selectedNode);
//that.searchNodeObj.selectedNode = selectedNode;
//that.LineageHelperRef.searchNode({ guid: selectedNode });
});
// if (this.searchNodeObj.selectedNode) {
// this.ui.typeSearch.val(this.searchNodeObj.selectedNode);
// this.ui.typeSearch.trigger("change.select2");
// }
}
}
});
return TypeSystemTreeView;
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment