Loading js-apps/meep-frontend/package-lock.json +83 −27 Original line number Diff line number Diff line Loading @@ -878,6 +878,29 @@ } } }, "@elastic/elasticsearch": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/@elastic/elasticsearch/-/elasticsearch-7.1.0.tgz", "integrity": "sha512-evfs+W6hrC0wu11w/0xL1ZXADHiCbWnVBUbAhZe3xjaFKDfOGioHkPULaEE8uALe7PPPNAMuFErWzutAwwcU9g==", "requires": { "debug": "^4.1.1", "decompress-response": "^4.2.0", "into-stream": "^5.1.0", "ms": "^2.1.1", "once": "^1.4.0", "pump": "^3.0.0" }, "dependencies": { "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "requires": { "ms": "^2.1.1" } } } }, "@material-ui/core": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-1.5.1.tgz", Loading Loading @@ -5651,8 +5674,7 @@ "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "cosmiconfig": { "version": "4.0.0", Loading Loading @@ -6309,6 +6331,14 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, "decompress-response": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.0.tgz", "integrity": "sha512-MHebOkORCgLW1ramLri5vzfR4r7HgXXrVkVr/eaPVRCtYWFUp9hNAuqsBxhpABbpqd7zY2IrjxXfTuaVrW0Z2A==", "requires": { "mimic-response": "^2.0.0" } }, "deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", Loading Loading @@ -6634,7 +6664,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { "once": "^1.4.0" } Loading Loading @@ -7395,7 +7424,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", "dev": true, "requires": { "inherits": "^2.0.1", "readable-stream": "^2.0.0" Loading Loading @@ -8646,6 +8674,15 @@ "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", "dev": true }, "into-stream": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-5.1.0.tgz", "integrity": "sha512-cbDhb8qlxKMxPBk/QxTtYg1DQ4CwXmadu7quG3B7nrJsgSncEreF2kwWKZFdnjc/lSNNIkFPsjI7SM0Cx/QXPw==", "requires": { "from2": "^2.3.0", "p-is-promise": "^2.0.0" } }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", Loading Loading @@ -8957,8 +8994,7 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "isexe": { "version": "2.0.0", Loading Loading @@ -12645,6 +12681,11 @@ "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, "mimic-response": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.0.0.tgz", "integrity": "sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ==" }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", Loading Loading @@ -13532,8 +13573,7 @@ "p-is-promise": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", "dev": true "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==" }, "p-limit": { "version": "1.3.0", Loading Loading @@ -14331,8 +14371,7 @@ "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, "promise": { "version": "7.3.1", Loading Loading @@ -14411,7 +14450,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" Loading Loading @@ -14557,14 +14595,25 @@ } }, "react": { "version": "16.4.1", "resolved": "https://registry.npmjs.org/react/-/react-16.4.1.tgz", "integrity": "sha512-3GEs0giKp6E0Oh/Y9ZC60CmYgUPnp7voH9fbjWsvXtYFb4EWtgQub0ADSq0sJR0BbHc4FThLLtzlcFaFXIorwg==", "version": "16.8.6", "resolved": "https://registry.npmjs.org/react/-/react-16.8.6.tgz", "integrity": "sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==", "requires": { "fbjs": "^0.8.16", "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.0" "prop-types": "^15.6.2", "scheduler": "^0.13.6" }, "dependencies": { "scheduler": { "version": "0.13.6", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.6.tgz", "integrity": "sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" } } } }, "react-d3-graph": { Loading @@ -14573,14 +14622,25 @@ "integrity": "sha512-H+mHQkuSdKvL2wGN7TZU29wD56Lqd2mmwmtwbpXj0TJ7IIC98OylEXkFEYeWtlgCVI2rjrbuDT9EhbeIWKqYkQ==" }, "react-dom": { "version": "16.4.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.4.1.tgz", "integrity": "sha512-1Gin+wghF/7gl4Cqcvr1DxFX2Osz7ugxSwl6gBqCMpdrxHjIFUS7GYxrFftZ9Ln44FHw0JxCFD9YtZsrbR5/4A==", "version": "16.8.6", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.8.6.tgz", "integrity": "sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA==", "requires": { "fbjs": "^0.8.16", "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.0" "prop-types": "^15.6.2", "scheduler": "^0.13.6" }, "dependencies": { "scheduler": { "version": "0.13.6", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.6.tgz", "integrity": "sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" } } } }, "react-event-listener": { Loading Loading @@ -14744,7 +14804,6 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", Loading Loading @@ -16112,8 +16171,7 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safe-regex": { "version": "1.1.0", Loading Loading @@ -17128,7 +17186,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" } Loading Loading @@ -17947,8 +18004,7 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "util.promisify": { "version": "1.0.0", js-apps/meep-frontend/package.json +3 −2 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ "webpack-serve": "^0.3.1" }, "dependencies": { "@elastic/elasticsearch": "^7.1.0", "@material-ui/core": "^1.5.1", "@material-ui/icons": "^1.1.1", "axios": "^0.18.0", Loading @@ -50,9 +51,9 @@ "material-components-web": "0.38.1", "material-design-icons": "3.0.1", "prop-types": "15.6.2", "react": "16.4.1", "react": "^16.8.6", "react-d3-graph": "^2.0.2", "react-dom": "16.4.1", "react-dom": "^16.8.6", "react-iframe": "^1.5.0", "react-redux": "^5.1.1", "react-split-pane": "^0.1.87", Loading js-apps/meep-frontend/src/img/phone.svg 0 → 100644 +2.81 KiB File added.No diff preview for this file type. View file js-apps/meep-frontend/src/img/software-icon.svg 0 → 100644 +1 −0 Original line number Diff line number Diff line <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" height="512" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M701.626825 218.662115c-16.525372 0-29.978778 13.453407-29.978778 29.978778s13.453407 29.978778 29.978778 29.978779 29.978778-13.453407 29.978778-29.978779-13.453407-29.978778-29.978778-29.978778zM631.392204 218.662115c-16.525372 0-29.978778 13.453407-29.978778 29.978778s13.453407 29.978778 29.978778 29.978779 29.978778-13.453407 29.978778-29.978779-13.452383-29.978778-29.978778-29.978778zM104.3363 705.136765V311.514873h513.342578v126.413108h27.429722V311.514873h106.005313v77.254501h27.443025V220.544998c0-19.179828-15.610536-34.790364-34.790364-34.790364H111.683638c-19.179828 0-34.790364 15.610536-34.790364 34.790364v484.591767c0 19.179828 15.610536 34.777061 34.790364 34.777061h428.085822v-27.429722H111.683638c-4.053316 0.001023-7.347339-3.294023-7.347338-7.347339z m0-421.051615v-63.540152c0-4.053316 3.295046-7.347339 7.347338-7.347338h632.08089c4.053316 0 7.347339 3.295046 7.347338 7.347338v63.540152H104.3363zM561.158606 218.662115c-16.525372 0-29.978778 13.453407-29.978778 29.978778s13.453407 29.978778 29.978778 29.978779 29.978778-13.453407 29.978779-29.978779-13.453407-29.978778-29.978779-29.978778zM729.72272 550.954197c-38.542828 0-69.907163 31.365358-69.907163 69.907163s31.364335 69.89386 69.907163 69.89386 69.89386-31.352055 69.89386-69.89386-31.351032-69.907163-69.89386-69.907163z m42.465161 69.907163c0 23.415292-19.048845 42.465161-42.465161 42.465161-23.428595 0-42.47744-19.048845-42.47744-42.465161 0-23.428595 19.048845-42.47744 42.47744-42.47744 23.416316 0 42.465161 19.048845 42.465161 42.47744zM912.316362 572.029188H873.682459c-5.988388 0-10.864442-4.877077-10.864442-10.864442 0-3.5038 1.713015-6.824429 4.576226-8.863878l25.978674-26.030863c13.557784-13.571087 13.557784-35.639708 0-49.197492l-19.872606-19.859304c-13.125949-13.152555-36.044938-13.152555-49.197492 0l-23.141047 23.15435-0.627286-0.11768-2.496868 3.242857h-0.013302l-2.013867 2.026146a10.81123 10.81123 0 0 1-6.589069 2.235924c-5.988388 0-10.864442-4.877077-10.864442-10.864442v-38.633902c0-19.179828-15.610536-34.790364-34.790364-34.790364h-28.095895c-19.179828 0-34.790364 15.610536-34.790364 34.790364v35.116799l0.065492 1.608637a31.654954 31.654954 0 0 0-0.065492 1.908466c0 5.988388-4.863774 10.864442-10.851139 10.864442a10.783601 10.783601 0 0 1-8.616238-4.248767l-3.059686-3.15076-0.575098 0.104377-8.275477-8.275477 0.300852-0.300852-14.669094-14.669094c-13.113669-13.139252-36.058241-13.165858-49.197492 0l-19.859304 19.859303c-13.557784 13.557784-13.557784 35.627429 0 49.197492l14.669095 14.669095 0.287549-0.287549 8.40646 8.40646 2.588965 3.255137c2.915399 2.066055 4.576225 5.294586 4.576225 8.851599 0 5.988388-4.877077 10.864442-10.864442 10.864442h-38.633902c-19.179828 0-34.790364 15.610536-34.790364 34.790364v28.083615c0 19.179828 15.610536 34.790364 34.790364 34.790364l35.051307-0.013303 3.582595 0.013303c5.988388 0 10.864442 4.877077 10.864442 10.864442 0 3.5038-1.713015 6.811126-4.576225 8.851599l-25.978675 26.043142c-13.571087 13.557784-13.571087 35.639708 0 49.197492l19.872607 19.859304c13.571087 13.571087 35.614126 13.571087 49.185212 0l23.167653-23.167652 0.615007 0.11768 4.562922-5.294587a10.861372 10.861372 0 0 1 6.563486-2.196015c5.988388 0 10.864442 4.877077 10.864442 10.864442v38.6206c0 19.179828 15.597233 34.790364 34.777061 34.790364h28.095895c19.179828 0 34.790364-15.610536 34.790364-34.790364v-35.116799l-0.065492-1.595335c0.038886-0.64059 0.065492-1.281179 0.065492-1.908466 0-5.988388 4.877077-10.864442 10.864442-10.864442 3.399423 0 6.53688 1.543146 8.602935 4.236488l3.059686 3.15076 0.575098-0.104377 8.28878 8.28878-0.300852 0.314155 14.669094 14.669094c13.544481 13.571087 35.627429 13.544481 49.197492 0l19.859304-19.859303c13.557784-13.571087 13.557784-35.639708 0.013303-49.197492l-14.669095-14.695701-0.287549 0.300852-8.419763-8.419763-2.575662-3.242857c-2.915399-2.078335-4.588505-5.307889-4.588505-8.863879 0-5.988388 4.877077-10.864442 10.864442-10.864442H912.332734c19.179828 0 34.777061-15.610536 34.777062-34.790364v-28.083615c-0.00307-19.180851-15.613606-34.779108-34.793434-34.779108z m-38.346354 173.232437l-19.872606 19.859303a7.287987 7.287987 0 0 1-5.190209 2.143826h-0.013303a7.257288 7.257288 0 0 1-5.176906-2.143826l-6.4192-6.4192 0.196475-0.196475-19.467377-19.48068-4.915963-4.549619-0.156566 0.156566c-6.681166-5.203512-14.956643-8.105608-23.532973-8.105609-20.042475 0-36.555567 15.479553-38.176484 35.116799l-0.130983 41.811268c0 4.053316-3.295046 7.360641-7.347339 7.360642h-28.095895c-4.053316 0-7.347339-3.307326-7.347338-7.360642v-35.116799l-0.078795-1.725294c0.038886-0.588401 0.078795-1.176802 0.078795-1.778506 0-21.128203-17.179264-38.307468-38.294165-38.307468a38.015825 38.015825 0 0 0-24.684192 9.073656l-0.052189-0.052188-0.87595 0.87595c-0.941442 0.849344-1.830695 1.7519-2.693342 2.693342l-4.61511 4.615111-3.164063-0.601704 1.882883 1.882883-20.107967 20.107967a7.373944 7.373944 0 0 1-10.393721 0l-19.872606-19.859303c-2.863211-2.863211-2.863211-7.543813 0-10.407024l24.854061-24.840758 1.398859-1.503237c7.870248-7.281847 12.328793-17.310248 12.328794-27.952632 0-20.055778-15.479553-36.555567-35.116799-38.176485l-41.811268-0.130983a7.353478 7.353478 0 0 1-7.347339-7.347338v-28.083616c0-4.053316 3.295046-7.360641 7.347339-7.360641h35.116799l1.713014-0.091074c0.601704 0.052189 1.190105 0.091074 1.804089 0.091074 21.1149 0 38.294165-17.179264 38.294165-38.294165 0-8.524141-2.915399-16.774035-8.1711-23.468504l0.405229-0.405229-24.213471-24.213472-0.183172 0.183172-6.393617-6.405897c-1.385557-1.385557-2.157129-3.229554-2.15713-5.190209s0.771573-3.804652 2.15713-5.203512l19.846-19.846a7.354502 7.354502 0 0 1 10.407024 0l6.393617 6.393617-0.196475 0.196475 19.48068 19.48068 4.915963 4.549619 0.156566-0.156566a38.341237 38.341237 0 0 0 23.546276 8.105609c20.042475 0 36.542264-15.479553 38.163181-35.116799l0.130983-41.811268c0-4.053316 3.295046-7.347339 7.347339-7.347338h28.095895c4.053316 0 7.347339 3.295046 7.347338 7.347338v35.116799l0.078795 1.738597c-0.038886 0.575098-0.078795 1.176802-0.078795 1.778506 0 21.1149 17.179264 38.294165 38.307468 38.294165a37.918611 37.918611 0 0 0 24.657586-9.073656l0.065492 0.065491 1.137916-1.137916a33.510208 33.510208 0 0 0 2.15713-2.15713l4.90266-4.90266 3.347234 0.64059-2.000563-1.98726 20.029172-20.029173c1.385557-1.385557 3.229554-2.157129 5.190209-2.157129s3.817955 0.771573 5.203512 2.157129l19.859303 19.859304c1.385557 1.39886 2.157129 3.242857 2.15713 5.203512s-0.771573 3.804652-2.15713 5.190209l-24.840758 24.840758-1.425465 1.529842c-7.857968 7.281847-12.30321 17.323551-12.303211 27.93933 0 20.042475 15.479553 36.542264 35.116799 38.163181l41.811268 0.130983c4.053316 0 7.347339 3.307326 7.347339 7.360642v28.083615c0 4.053316-3.295046 7.347339-7.347339 7.347338h-35.116799l-1.738597 0.091075a20.030196 20.030196 0 0 0-1.778506-0.091075c-21.1149 0-38.294165 17.179264-38.294165 38.307468 0 8.576329 2.954285 16.865109 8.263198 23.572882l-0.379647 0.405229 24.095791 24.109094 0.196475-0.183172 6.393617 6.393617c2.863211 2.861164 2.863211 7.541767 0 10.404978zM288.119023 424.867524l-87.675851 85.909625 1.268899 1.242294-1.242294 1.228991 87.649246 85.897345 18.080798-17.715477-70.860885-69.437465 70.860885-69.423139zM333.341994 600.727811l39.025829-172.030052-24.827455-5.42557-39.000246 172.029029zM398.765029 424.867524l-18.068517 17.702174 70.861907 69.423139-70.848604 69.437465 18.055214 17.715477L486.453161 513.221828l-1.228991-1.202385 1.254573-1.215688z" /></svg> No newline at end of file js-apps/meep-frontend/src/js/containers/dashboard-container.js 0 → 100644 +223 −0 Original line number Diff line number Diff line import _ from 'lodash'; import { connect } from 'react-redux'; import React, { Component } from 'react'; import { Grid, GridCell, GridInner } from '@rmwc/grid'; import { Graph } from 'react-d3-graph'; import ReactDOM from 'react-dom'; import { Button } from '@rmwc/button'; import * as d3 from 'd3'; import IDCAreaChart from './idc-area-chart'; import IDCGraph from './idc-graph'; import { getScenarioNodeChildren, isApp } from '../util/scenario-utils'; import { execFakeChangeSelectedDestination } from '../state/exec'; const newDataPoint = (date) => { const newDate = date || new Date(); const secs = newDate.getSeconds(); const newDateString = newDate.toString(); return { 'date':newDate, 'AR':Math.abs(Math.random()*Math.sin(0.05*secs)), 'DJ':Math.abs(Math.random()*Math.cos(0.05*secs)), 'MS':Math.abs(Math.random()*Math.sin(0.5*secs)), 'RC':Math.abs(Math.random()*Math.cos(0.1*secs)), 'CG':Math.abs(Math.random()*Math.sin(0.2*secs)), 'RI':Math.abs(Math.random()*Math.sin(3.0*secs)) }; }; function colorArray(dataLength) { const colorScale = d3.interpolateInferno; // const colorScale = d3.interpolateMagma; // const colorScale = d3.interpolateCool; // const colorScale = d3.interpolateWarm; // const colorScale = d3.interpolateCubehelixDefault; // interpolateViridis // const colorScale = d3.interpolateCubehelixDefault; let colorArray = []; const colorStart = 0.2; const colorEnd = 0.8; const colorRange = colorEnd - colorStart; var intervalSize = colorRange / dataLength; for (let i = 0; i < dataLength; i++) { const colorPoint = colorStart + i*intervalSize; colorArray.push(colorScale(colorPoint)); } return colorArray; } // const dataStr = '[{"date":"01/08/13","AR":0.1,"DJ":0.35,"MS":0.21,"RC":0.1,"CG":0.1,"RI":0.1},{"date":"01/09/13","AR":0.15,"DJ":0.36,"MS":0.25,"RC":0.15,"CG":0.15,"RI":0.15},{"date":"01/10/13","AR":0.35,"DJ":0.37,"MS":0.27,"RC":0.35,"CG":0.35,"RI":0.35},{"date":"01/11/13","AR":0.38,"DJ":0.22,"MS":0.23,"RC":0.38,"CG":0.38,"RI":0.38},{"date":"01/12/13","AR":0.22,"DJ":0.24,"MS":0.24,"RC":0.22,"CG":0.22,"RI":0.22},{"date":"01/13/13","AR":0.16,"DJ":0.26,"MS":0.21,"RC":0.16,"CG":0.16,"RI":0.16},{"date":"01/14/13","AR":0.07,"DJ":0.34,"MS":0.35,"RC":0.07,"CG":0.07,"RI":0.07},{"date":"01/15/13","AR":0.02,"DJ":0.21,"MS":0.39,"RC":0.02,"CG":0.02,"RI":0.02},{"date":"01/16/13","AR":0.17,"DJ":0.18,"MS":0.4,"RC":0.17,"CG":0.17,"RI":0.17},{"date":"01/17/13","AR":0.33,"DJ":0.45,"MS":0.36,"RC":0.33,"CG":0.33,"RI":0.33},{"date":"01/18/13","AR":0.4,"DJ":0.32,"MS":0.33,"RC":0.4,"CG":0.4,"RI":0.4},{"date":"01/19/13","AR":0.32,"DJ":0.35,"MS":0.43,"RC":0.32,"CG":0.32,"RI":0.32},{"date":"01/20/13","AR":0.26,"DJ":0.3,"MS":0.4,"RC":0.26,"CG":0.26,"RI":0.26},{"date":"01/21/13","AR":0.35,"DJ":0.28,"MS":0.34,"RC":0.35,"CG":0.35,"RI":0.35},{"date":"01/22/13","AR":0.4,"DJ":0.27,"MS":0.28,"RC":0.4,"CG":0.4,"RI":0.4},{"date":"01/23/13","AR":0.32,"DJ":0.26,"MS":0.26,"RC":0.32,"CG":0.32,"RI":0.32},{"date":"01/24/13","AR":0.26,"DJ":0.15,"MS":0.37,"RC":0.26,"CG":0.26,"RI":0.26},{"date":"01/25/13","AR":0.22,"DJ":0.3,"MS":0.41,"RC":0.22,"CG":0.22,"RI":0.22},{"date":"01/26/13","AR":0.16,"DJ":0.35,"MS":0.46,"RC":0.16,"CG":0.16,"RI":0.16},{"date":"01/27/13","AR":0.22,"DJ":0.42,"MS":0.47,"RC":0.22,"CG":0.22,"RI":0.22},{"date":"01/28/13","AR":0.1,"DJ":0.42,"MS":0.41,"RC":0.1,"CG":0.1,"RI":0.1}]'; // const theData = JSON.parse(dataStr); // const timeParse = d3.timeParse('%m/%d/%y'); // const startingTime = new Date(); // theData.forEach(function(d, i) { // const interval = 1000; // d.date = new Date(startingTime.getTime() + i*interval); // }); // const recentData = end => start => dataPoint => { // const dataPointMilli = dataPoint.date.getTime(); // return start.getTime() <= dataPointMilli && dataPointMilli <= end.getTime(); // }; const updateData = (data) => { let newData; if (!data.length) { newData = [newDataPoint()]; } else { newData = data.slice(1).concat([newDataPoint()]); } return newData; }; const dataPointFromBucket = keys => b => { let dp = { date: b.date }; const accessor = p => p.delay; const avgForKey = pings => acc => key => { const pingsForKeyDestination = pings.filter(p => p.dest === key); const avg = d3.mean(pingsForKeyDestination, acc); return avg; }; keys.forEach(k => { dp[k] = avgForKey(b.pings)(accessor)(k) || 0; }); return dp; }; const pingBucketsToData = pingBuckets => nb => keys => { const buckets = pingBuckets.slice(-nb); const dataPoints = buckets.map(dataPointFromBucket(keys)); return dataPoints; }; const maxValue = pingBuckets => { const max = d3.max(pingBuckets, b => { return d3.max(b.pings, p => p.delay); }); return max; }; const minValue = pingBuckets => { const min = d3.min(pingBuckets, b => { return d3.min(b.pings, p => p.delay); }); return min; }; class DashboardContainer extends Component { constructor(props) { super(props); this.state = { }; } componentDidMount() { // Initial data // let theData = []; // const initialNbPoints = 25; // const now = new Date(); // for (let i=0; i< initialNbPoints; i++) { // theData.push(newDataPoint(new Date(now.getTime() + (i - initialNbPoints)*1000))); // } // this.setState({data: theData}); // const that = this; // this.timer = setInterval(() => { // that.setState({ // data: updateData(that.state.data) // }); // }, 1000); } componentWillUnmount() { clearInterval(this.timer); } calculateDestinations() { this.root = this.props.displayedScenario; const data = this.root; // || this.props.displayedScenario; this.root = d3.hierarchy(data, getScenarioNodeChildren); const apps = this.root.descendants().filter(isApp); return apps.map(a => a.data.id); } render() { const destinations = this.calculateDestinations(); const nbBuckets = this.props.nbBuckets || 25; const max = maxValue(this.props.pingBuckets); const min = minValue(this.props.pingBuckets); const dataPoints = pingBucketsToData(this.props.pingBuckets)(nbBuckets)(destinations); const colorRange = colorArray(destinations.length); return ( <Grid> <GridCell span={6}> <IDCGraph width={700} height={600} renderApps={true} colorRange={colorRange} /> </GridCell> <GridCell span={6}> <IDCAreaChart data={dataPoints} width={700} height={600} destinations={destinations} colorRange={colorRange} onKeySelected={(dest) => this.props.changeSelectedDestination(dest)} min={min} max={max} /> </GridCell> </Grid> ); } } const mapStateToProps = state => { return { pingBuckets: state.exec.fakeData.pingBuckets, displayedScenario: state.exec.displayedScenario }; }; const mapDispatchToProps = dispatch => { return { changeSelectedDestination: (dest) => dispatch(execFakeChangeSelectedDestination(dest)) }; }; const ConnectedDashboardContainer = connect( mapStateToProps, mapDispatchToProps )(DashboardContainer); export default ConnectedDashboardContainer; No newline at end of file Loading
js-apps/meep-frontend/package-lock.json +83 −27 Original line number Diff line number Diff line Loading @@ -878,6 +878,29 @@ } } }, "@elastic/elasticsearch": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/@elastic/elasticsearch/-/elasticsearch-7.1.0.tgz", "integrity": "sha512-evfs+W6hrC0wu11w/0xL1ZXADHiCbWnVBUbAhZe3xjaFKDfOGioHkPULaEE8uALe7PPPNAMuFErWzutAwwcU9g==", "requires": { "debug": "^4.1.1", "decompress-response": "^4.2.0", "into-stream": "^5.1.0", "ms": "^2.1.1", "once": "^1.4.0", "pump": "^3.0.0" }, "dependencies": { "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "requires": { "ms": "^2.1.1" } } } }, "@material-ui/core": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-1.5.1.tgz", Loading Loading @@ -5651,8 +5674,7 @@ "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "cosmiconfig": { "version": "4.0.0", Loading Loading @@ -6309,6 +6331,14 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, "decompress-response": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.0.tgz", "integrity": "sha512-MHebOkORCgLW1ramLri5vzfR4r7HgXXrVkVr/eaPVRCtYWFUp9hNAuqsBxhpABbpqd7zY2IrjxXfTuaVrW0Z2A==", "requires": { "mimic-response": "^2.0.0" } }, "deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", Loading Loading @@ -6634,7 +6664,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { "once": "^1.4.0" } Loading Loading @@ -7395,7 +7424,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", "dev": true, "requires": { "inherits": "^2.0.1", "readable-stream": "^2.0.0" Loading Loading @@ -8646,6 +8674,15 @@ "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", "dev": true }, "into-stream": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-5.1.0.tgz", "integrity": "sha512-cbDhb8qlxKMxPBk/QxTtYg1DQ4CwXmadu7quG3B7nrJsgSncEreF2kwWKZFdnjc/lSNNIkFPsjI7SM0Cx/QXPw==", "requires": { "from2": "^2.3.0", "p-is-promise": "^2.0.0" } }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", Loading Loading @@ -8957,8 +8994,7 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "isexe": { "version": "2.0.0", Loading Loading @@ -12645,6 +12681,11 @@ "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, "mimic-response": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.0.0.tgz", "integrity": "sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ==" }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", Loading Loading @@ -13532,8 +13573,7 @@ "p-is-promise": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", "dev": true "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==" }, "p-limit": { "version": "1.3.0", Loading Loading @@ -14331,8 +14371,7 @@ "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, "promise": { "version": "7.3.1", Loading Loading @@ -14411,7 +14450,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" Loading Loading @@ -14557,14 +14595,25 @@ } }, "react": { "version": "16.4.1", "resolved": "https://registry.npmjs.org/react/-/react-16.4.1.tgz", "integrity": "sha512-3GEs0giKp6E0Oh/Y9ZC60CmYgUPnp7voH9fbjWsvXtYFb4EWtgQub0ADSq0sJR0BbHc4FThLLtzlcFaFXIorwg==", "version": "16.8.6", "resolved": "https://registry.npmjs.org/react/-/react-16.8.6.tgz", "integrity": "sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==", "requires": { "fbjs": "^0.8.16", "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.0" "prop-types": "^15.6.2", "scheduler": "^0.13.6" }, "dependencies": { "scheduler": { "version": "0.13.6", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.6.tgz", "integrity": "sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" } } } }, "react-d3-graph": { Loading @@ -14573,14 +14622,25 @@ "integrity": "sha512-H+mHQkuSdKvL2wGN7TZU29wD56Lqd2mmwmtwbpXj0TJ7IIC98OylEXkFEYeWtlgCVI2rjrbuDT9EhbeIWKqYkQ==" }, "react-dom": { "version": "16.4.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.4.1.tgz", "integrity": "sha512-1Gin+wghF/7gl4Cqcvr1DxFX2Osz7ugxSwl6gBqCMpdrxHjIFUS7GYxrFftZ9Ln44FHw0JxCFD9YtZsrbR5/4A==", "version": "16.8.6", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.8.6.tgz", "integrity": "sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA==", "requires": { "fbjs": "^0.8.16", "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.0" "prop-types": "^15.6.2", "scheduler": "^0.13.6" }, "dependencies": { "scheduler": { "version": "0.13.6", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.6.tgz", "integrity": "sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" } } } }, "react-event-listener": { Loading Loading @@ -14744,7 +14804,6 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", Loading Loading @@ -16112,8 +16171,7 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safe-regex": { "version": "1.1.0", Loading Loading @@ -17128,7 +17186,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" } Loading Loading @@ -17947,8 +18004,7 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "util.promisify": { "version": "1.0.0",
js-apps/meep-frontend/package.json +3 −2 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ "webpack-serve": "^0.3.1" }, "dependencies": { "@elastic/elasticsearch": "^7.1.0", "@material-ui/core": "^1.5.1", "@material-ui/icons": "^1.1.1", "axios": "^0.18.0", Loading @@ -50,9 +51,9 @@ "material-components-web": "0.38.1", "material-design-icons": "3.0.1", "prop-types": "15.6.2", "react": "16.4.1", "react": "^16.8.6", "react-d3-graph": "^2.0.2", "react-dom": "16.4.1", "react-dom": "^16.8.6", "react-iframe": "^1.5.0", "react-redux": "^5.1.1", "react-split-pane": "^0.1.87", Loading
js-apps/meep-frontend/src/img/phone.svg 0 → 100644 +2.81 KiB File added.No diff preview for this file type. View file
js-apps/meep-frontend/src/img/software-icon.svg 0 → 100644 +1 −0 Original line number Diff line number Diff line <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" height="512" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M701.626825 218.662115c-16.525372 0-29.978778 13.453407-29.978778 29.978778s13.453407 29.978778 29.978778 29.978779 29.978778-13.453407 29.978778-29.978779-13.453407-29.978778-29.978778-29.978778zM631.392204 218.662115c-16.525372 0-29.978778 13.453407-29.978778 29.978778s13.453407 29.978778 29.978778 29.978779 29.978778-13.453407 29.978778-29.978779-13.452383-29.978778-29.978778-29.978778zM104.3363 705.136765V311.514873h513.342578v126.413108h27.429722V311.514873h106.005313v77.254501h27.443025V220.544998c0-19.179828-15.610536-34.790364-34.790364-34.790364H111.683638c-19.179828 0-34.790364 15.610536-34.790364 34.790364v484.591767c0 19.179828 15.610536 34.777061 34.790364 34.777061h428.085822v-27.429722H111.683638c-4.053316 0.001023-7.347339-3.294023-7.347338-7.347339z m0-421.051615v-63.540152c0-4.053316 3.295046-7.347339 7.347338-7.347338h632.08089c4.053316 0 7.347339 3.295046 7.347338 7.347338v63.540152H104.3363zM561.158606 218.662115c-16.525372 0-29.978778 13.453407-29.978778 29.978778s13.453407 29.978778 29.978778 29.978779 29.978778-13.453407 29.978779-29.978779-13.453407-29.978778-29.978779-29.978778zM729.72272 550.954197c-38.542828 0-69.907163 31.365358-69.907163 69.907163s31.364335 69.89386 69.907163 69.89386 69.89386-31.352055 69.89386-69.89386-31.351032-69.907163-69.89386-69.907163z m42.465161 69.907163c0 23.415292-19.048845 42.465161-42.465161 42.465161-23.428595 0-42.47744-19.048845-42.47744-42.465161 0-23.428595 19.048845-42.47744 42.47744-42.47744 23.416316 0 42.465161 19.048845 42.465161 42.47744zM912.316362 572.029188H873.682459c-5.988388 0-10.864442-4.877077-10.864442-10.864442 0-3.5038 1.713015-6.824429 4.576226-8.863878l25.978674-26.030863c13.557784-13.571087 13.557784-35.639708 0-49.197492l-19.872606-19.859304c-13.125949-13.152555-36.044938-13.152555-49.197492 0l-23.141047 23.15435-0.627286-0.11768-2.496868 3.242857h-0.013302l-2.013867 2.026146a10.81123 10.81123 0 0 1-6.589069 2.235924c-5.988388 0-10.864442-4.877077-10.864442-10.864442v-38.633902c0-19.179828-15.610536-34.790364-34.790364-34.790364h-28.095895c-19.179828 0-34.790364 15.610536-34.790364 34.790364v35.116799l0.065492 1.608637a31.654954 31.654954 0 0 0-0.065492 1.908466c0 5.988388-4.863774 10.864442-10.851139 10.864442a10.783601 10.783601 0 0 1-8.616238-4.248767l-3.059686-3.15076-0.575098 0.104377-8.275477-8.275477 0.300852-0.300852-14.669094-14.669094c-13.113669-13.139252-36.058241-13.165858-49.197492 0l-19.859304 19.859303c-13.557784 13.557784-13.557784 35.627429 0 49.197492l14.669095 14.669095 0.287549-0.287549 8.40646 8.40646 2.588965 3.255137c2.915399 2.066055 4.576225 5.294586 4.576225 8.851599 0 5.988388-4.877077 10.864442-10.864442 10.864442h-38.633902c-19.179828 0-34.790364 15.610536-34.790364 34.790364v28.083615c0 19.179828 15.610536 34.790364 34.790364 34.790364l35.051307-0.013303 3.582595 0.013303c5.988388 0 10.864442 4.877077 10.864442 10.864442 0 3.5038-1.713015 6.811126-4.576225 8.851599l-25.978675 26.043142c-13.571087 13.557784-13.571087 35.639708 0 49.197492l19.872607 19.859304c13.571087 13.571087 35.614126 13.571087 49.185212 0l23.167653-23.167652 0.615007 0.11768 4.562922-5.294587a10.861372 10.861372 0 0 1 6.563486-2.196015c5.988388 0 10.864442 4.877077 10.864442 10.864442v38.6206c0 19.179828 15.597233 34.790364 34.777061 34.790364h28.095895c19.179828 0 34.790364-15.610536 34.790364-34.790364v-35.116799l-0.065492-1.595335c0.038886-0.64059 0.065492-1.281179 0.065492-1.908466 0-5.988388 4.877077-10.864442 10.864442-10.864442 3.399423 0 6.53688 1.543146 8.602935 4.236488l3.059686 3.15076 0.575098-0.104377 8.28878 8.28878-0.300852 0.314155 14.669094 14.669094c13.544481 13.571087 35.627429 13.544481 49.197492 0l19.859304-19.859303c13.557784-13.571087 13.557784-35.639708 0.013303-49.197492l-14.669095-14.695701-0.287549 0.300852-8.419763-8.419763-2.575662-3.242857c-2.915399-2.078335-4.588505-5.307889-4.588505-8.863879 0-5.988388 4.877077-10.864442 10.864442-10.864442H912.332734c19.179828 0 34.777061-15.610536 34.777062-34.790364v-28.083615c-0.00307-19.180851-15.613606-34.779108-34.793434-34.779108z m-38.346354 173.232437l-19.872606 19.859303a7.287987 7.287987 0 0 1-5.190209 2.143826h-0.013303a7.257288 7.257288 0 0 1-5.176906-2.143826l-6.4192-6.4192 0.196475-0.196475-19.467377-19.48068-4.915963-4.549619-0.156566 0.156566c-6.681166-5.203512-14.956643-8.105608-23.532973-8.105609-20.042475 0-36.555567 15.479553-38.176484 35.116799l-0.130983 41.811268c0 4.053316-3.295046 7.360641-7.347339 7.360642h-28.095895c-4.053316 0-7.347339-3.307326-7.347338-7.360642v-35.116799l-0.078795-1.725294c0.038886-0.588401 0.078795-1.176802 0.078795-1.778506 0-21.128203-17.179264-38.307468-38.294165-38.307468a38.015825 38.015825 0 0 0-24.684192 9.073656l-0.052189-0.052188-0.87595 0.87595c-0.941442 0.849344-1.830695 1.7519-2.693342 2.693342l-4.61511 4.615111-3.164063-0.601704 1.882883 1.882883-20.107967 20.107967a7.373944 7.373944 0 0 1-10.393721 0l-19.872606-19.859303c-2.863211-2.863211-2.863211-7.543813 0-10.407024l24.854061-24.840758 1.398859-1.503237c7.870248-7.281847 12.328793-17.310248 12.328794-27.952632 0-20.055778-15.479553-36.555567-35.116799-38.176485l-41.811268-0.130983a7.353478 7.353478 0 0 1-7.347339-7.347338v-28.083616c0-4.053316 3.295046-7.360641 7.347339-7.360641h35.116799l1.713014-0.091074c0.601704 0.052189 1.190105 0.091074 1.804089 0.091074 21.1149 0 38.294165-17.179264 38.294165-38.294165 0-8.524141-2.915399-16.774035-8.1711-23.468504l0.405229-0.405229-24.213471-24.213472-0.183172 0.183172-6.393617-6.405897c-1.385557-1.385557-2.157129-3.229554-2.15713-5.190209s0.771573-3.804652 2.15713-5.203512l19.846-19.846a7.354502 7.354502 0 0 1 10.407024 0l6.393617 6.393617-0.196475 0.196475 19.48068 19.48068 4.915963 4.549619 0.156566-0.156566a38.341237 38.341237 0 0 0 23.546276 8.105609c20.042475 0 36.542264-15.479553 38.163181-35.116799l0.130983-41.811268c0-4.053316 3.295046-7.347339 7.347339-7.347338h28.095895c4.053316 0 7.347339 3.295046 7.347338 7.347338v35.116799l0.078795 1.738597c-0.038886 0.575098-0.078795 1.176802-0.078795 1.778506 0 21.1149 17.179264 38.294165 38.307468 38.294165a37.918611 37.918611 0 0 0 24.657586-9.073656l0.065492 0.065491 1.137916-1.137916a33.510208 33.510208 0 0 0 2.15713-2.15713l4.90266-4.90266 3.347234 0.64059-2.000563-1.98726 20.029172-20.029173c1.385557-1.385557 3.229554-2.157129 5.190209-2.157129s3.817955 0.771573 5.203512 2.157129l19.859303 19.859304c1.385557 1.39886 2.157129 3.242857 2.15713 5.203512s-0.771573 3.804652-2.15713 5.190209l-24.840758 24.840758-1.425465 1.529842c-7.857968 7.281847-12.30321 17.323551-12.303211 27.93933 0 20.042475 15.479553 36.542264 35.116799 38.163181l41.811268 0.130983c4.053316 0 7.347339 3.307326 7.347339 7.360642v28.083615c0 4.053316-3.295046 7.347339-7.347339 7.347338h-35.116799l-1.738597 0.091075a20.030196 20.030196 0 0 0-1.778506-0.091075c-21.1149 0-38.294165 17.179264-38.294165 38.307468 0 8.576329 2.954285 16.865109 8.263198 23.572882l-0.379647 0.405229 24.095791 24.109094 0.196475-0.183172 6.393617 6.393617c2.863211 2.861164 2.863211 7.541767 0 10.404978zM288.119023 424.867524l-87.675851 85.909625 1.268899 1.242294-1.242294 1.228991 87.649246 85.897345 18.080798-17.715477-70.860885-69.437465 70.860885-69.423139zM333.341994 600.727811l39.025829-172.030052-24.827455-5.42557-39.000246 172.029029zM398.765029 424.867524l-18.068517 17.702174 70.861907 69.423139-70.848604 69.437465 18.055214 17.715477L486.453161 513.221828l-1.228991-1.202385 1.254573-1.215688z" /></svg> No newline at end of file
js-apps/meep-frontend/src/js/containers/dashboard-container.js 0 → 100644 +223 −0 Original line number Diff line number Diff line import _ from 'lodash'; import { connect } from 'react-redux'; import React, { Component } from 'react'; import { Grid, GridCell, GridInner } from '@rmwc/grid'; import { Graph } from 'react-d3-graph'; import ReactDOM from 'react-dom'; import { Button } from '@rmwc/button'; import * as d3 from 'd3'; import IDCAreaChart from './idc-area-chart'; import IDCGraph from './idc-graph'; import { getScenarioNodeChildren, isApp } from '../util/scenario-utils'; import { execFakeChangeSelectedDestination } from '../state/exec'; const newDataPoint = (date) => { const newDate = date || new Date(); const secs = newDate.getSeconds(); const newDateString = newDate.toString(); return { 'date':newDate, 'AR':Math.abs(Math.random()*Math.sin(0.05*secs)), 'DJ':Math.abs(Math.random()*Math.cos(0.05*secs)), 'MS':Math.abs(Math.random()*Math.sin(0.5*secs)), 'RC':Math.abs(Math.random()*Math.cos(0.1*secs)), 'CG':Math.abs(Math.random()*Math.sin(0.2*secs)), 'RI':Math.abs(Math.random()*Math.sin(3.0*secs)) }; }; function colorArray(dataLength) { const colorScale = d3.interpolateInferno; // const colorScale = d3.interpolateMagma; // const colorScale = d3.interpolateCool; // const colorScale = d3.interpolateWarm; // const colorScale = d3.interpolateCubehelixDefault; // interpolateViridis // const colorScale = d3.interpolateCubehelixDefault; let colorArray = []; const colorStart = 0.2; const colorEnd = 0.8; const colorRange = colorEnd - colorStart; var intervalSize = colorRange / dataLength; for (let i = 0; i < dataLength; i++) { const colorPoint = colorStart + i*intervalSize; colorArray.push(colorScale(colorPoint)); } return colorArray; } // const dataStr = '[{"date":"01/08/13","AR":0.1,"DJ":0.35,"MS":0.21,"RC":0.1,"CG":0.1,"RI":0.1},{"date":"01/09/13","AR":0.15,"DJ":0.36,"MS":0.25,"RC":0.15,"CG":0.15,"RI":0.15},{"date":"01/10/13","AR":0.35,"DJ":0.37,"MS":0.27,"RC":0.35,"CG":0.35,"RI":0.35},{"date":"01/11/13","AR":0.38,"DJ":0.22,"MS":0.23,"RC":0.38,"CG":0.38,"RI":0.38},{"date":"01/12/13","AR":0.22,"DJ":0.24,"MS":0.24,"RC":0.22,"CG":0.22,"RI":0.22},{"date":"01/13/13","AR":0.16,"DJ":0.26,"MS":0.21,"RC":0.16,"CG":0.16,"RI":0.16},{"date":"01/14/13","AR":0.07,"DJ":0.34,"MS":0.35,"RC":0.07,"CG":0.07,"RI":0.07},{"date":"01/15/13","AR":0.02,"DJ":0.21,"MS":0.39,"RC":0.02,"CG":0.02,"RI":0.02},{"date":"01/16/13","AR":0.17,"DJ":0.18,"MS":0.4,"RC":0.17,"CG":0.17,"RI":0.17},{"date":"01/17/13","AR":0.33,"DJ":0.45,"MS":0.36,"RC":0.33,"CG":0.33,"RI":0.33},{"date":"01/18/13","AR":0.4,"DJ":0.32,"MS":0.33,"RC":0.4,"CG":0.4,"RI":0.4},{"date":"01/19/13","AR":0.32,"DJ":0.35,"MS":0.43,"RC":0.32,"CG":0.32,"RI":0.32},{"date":"01/20/13","AR":0.26,"DJ":0.3,"MS":0.4,"RC":0.26,"CG":0.26,"RI":0.26},{"date":"01/21/13","AR":0.35,"DJ":0.28,"MS":0.34,"RC":0.35,"CG":0.35,"RI":0.35},{"date":"01/22/13","AR":0.4,"DJ":0.27,"MS":0.28,"RC":0.4,"CG":0.4,"RI":0.4},{"date":"01/23/13","AR":0.32,"DJ":0.26,"MS":0.26,"RC":0.32,"CG":0.32,"RI":0.32},{"date":"01/24/13","AR":0.26,"DJ":0.15,"MS":0.37,"RC":0.26,"CG":0.26,"RI":0.26},{"date":"01/25/13","AR":0.22,"DJ":0.3,"MS":0.41,"RC":0.22,"CG":0.22,"RI":0.22},{"date":"01/26/13","AR":0.16,"DJ":0.35,"MS":0.46,"RC":0.16,"CG":0.16,"RI":0.16},{"date":"01/27/13","AR":0.22,"DJ":0.42,"MS":0.47,"RC":0.22,"CG":0.22,"RI":0.22},{"date":"01/28/13","AR":0.1,"DJ":0.42,"MS":0.41,"RC":0.1,"CG":0.1,"RI":0.1}]'; // const theData = JSON.parse(dataStr); // const timeParse = d3.timeParse('%m/%d/%y'); // const startingTime = new Date(); // theData.forEach(function(d, i) { // const interval = 1000; // d.date = new Date(startingTime.getTime() + i*interval); // }); // const recentData = end => start => dataPoint => { // const dataPointMilli = dataPoint.date.getTime(); // return start.getTime() <= dataPointMilli && dataPointMilli <= end.getTime(); // }; const updateData = (data) => { let newData; if (!data.length) { newData = [newDataPoint()]; } else { newData = data.slice(1).concat([newDataPoint()]); } return newData; }; const dataPointFromBucket = keys => b => { let dp = { date: b.date }; const accessor = p => p.delay; const avgForKey = pings => acc => key => { const pingsForKeyDestination = pings.filter(p => p.dest === key); const avg = d3.mean(pingsForKeyDestination, acc); return avg; }; keys.forEach(k => { dp[k] = avgForKey(b.pings)(accessor)(k) || 0; }); return dp; }; const pingBucketsToData = pingBuckets => nb => keys => { const buckets = pingBuckets.slice(-nb); const dataPoints = buckets.map(dataPointFromBucket(keys)); return dataPoints; }; const maxValue = pingBuckets => { const max = d3.max(pingBuckets, b => { return d3.max(b.pings, p => p.delay); }); return max; }; const minValue = pingBuckets => { const min = d3.min(pingBuckets, b => { return d3.min(b.pings, p => p.delay); }); return min; }; class DashboardContainer extends Component { constructor(props) { super(props); this.state = { }; } componentDidMount() { // Initial data // let theData = []; // const initialNbPoints = 25; // const now = new Date(); // for (let i=0; i< initialNbPoints; i++) { // theData.push(newDataPoint(new Date(now.getTime() + (i - initialNbPoints)*1000))); // } // this.setState({data: theData}); // const that = this; // this.timer = setInterval(() => { // that.setState({ // data: updateData(that.state.data) // }); // }, 1000); } componentWillUnmount() { clearInterval(this.timer); } calculateDestinations() { this.root = this.props.displayedScenario; const data = this.root; // || this.props.displayedScenario; this.root = d3.hierarchy(data, getScenarioNodeChildren); const apps = this.root.descendants().filter(isApp); return apps.map(a => a.data.id); } render() { const destinations = this.calculateDestinations(); const nbBuckets = this.props.nbBuckets || 25; const max = maxValue(this.props.pingBuckets); const min = minValue(this.props.pingBuckets); const dataPoints = pingBucketsToData(this.props.pingBuckets)(nbBuckets)(destinations); const colorRange = colorArray(destinations.length); return ( <Grid> <GridCell span={6}> <IDCGraph width={700} height={600} renderApps={true} colorRange={colorRange} /> </GridCell> <GridCell span={6}> <IDCAreaChart data={dataPoints} width={700} height={600} destinations={destinations} colorRange={colorRange} onKeySelected={(dest) => this.props.changeSelectedDestination(dest)} min={min} max={max} /> </GridCell> </Grid> ); } } const mapStateToProps = state => { return { pingBuckets: state.exec.fakeData.pingBuckets, displayedScenario: state.exec.displayedScenario }; }; const mapDispatchToProps = dispatch => { return { changeSelectedDestination: (dest) => dispatch(execFakeChangeSelectedDestination(dest)) }; }; const ConnectedDashboardContainer = connect( mapStateToProps, mapDispatchToProps )(DashboardContainer); export default ConnectedDashboardContainer; No newline at end of file