From 5748ab8920f52a7cbce87ef83daea9ebd20ef467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Fri, 29 Mar 2019 15:30:55 -0400 Subject: [PATCH 1/3] bump karma to 4.0.1 --- package-lock.json | 322 +++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 177 insertions(+), 147 deletions(-) diff --git a/package-lock.json b/package-lock.json index 29eebd34cd1..e4eed908eae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -501,12 +501,6 @@ "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", "dev": true }, - "array-slice": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", - "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", - "dev": true - }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", @@ -589,6 +583,15 @@ "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, + "async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", + "dev": true, + "requires": { + "lodash": "^4.17.11" + } + }, "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", @@ -1576,24 +1579,31 @@ } }, "chokidar": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.4.tgz", - "integrity": "sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz", + "integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==", "dev": true, "requires": { "anymatch": "^2.0.0", - "async-each": "^1.0.0", - "braces": "^2.3.0", - "fsevents": "^1.2.2", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", "glob-parent": "^3.1.0", - "inherits": "^2.0.1", + "inherits": "^2.0.3", "is-binary-path": "^1.0.0", "is-glob": "^4.0.0", - "lodash.debounce": "^4.0.8", - "normalize-path": "^2.1.1", + "normalize-path": "^3.0.0", "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0", - "upath": "^1.0.5" + "readdirp": "^2.2.1", + "upath": "^1.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + } } }, "chttps": { @@ -1826,15 +1836,6 @@ "integrity": "sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ==", "dev": true }, - "combine-lists": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/combine-lists/-/combine-lists-1.0.1.tgz", - "integrity": "sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y=", - "dev": true, - "requires": { - "lodash": "^4.5.0" - } - }, "combine-source-map": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", @@ -2070,9 +2071,9 @@ "dev": true }, "core-js": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.1.tgz", - "integrity": "sha512-L72mmmEayPJBejKIWe2pYtGis5r0tQ5NaJekdhyXgeMQTpJoBsH0NL4ElY2LfSoV15xeQWKQ+XTTOZdyero5Xg==", + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", + "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==", "dev": true }, "core-util-is": { @@ -3589,34 +3590,6 @@ "safe-buffer": "^5.1.1" } }, - "expand-braces": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/expand-braces/-/expand-braces-0.1.2.tgz", - "integrity": "sha1-SIsdHSRRyz06axks/AMPRMWFX+o=", - "dev": true, - "requires": { - "array-slice": "^0.2.3", - "array-unique": "^0.2.1", - "braces": "^0.1.2" - }, - "dependencies": { - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "braces": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-0.1.5.tgz", - "integrity": "sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY=", - "dev": true, - "requires": { - "expand-range": "^0.1.0" - } - } - } - }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -3652,30 +3625,6 @@ } } }, - "expand-range": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-0.1.1.tgz", - "integrity": "sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ=", - "dev": true, - "requires": { - "is-number": "^0.1.1", - "repeat-string": "^0.2.2" - }, - "dependencies": { - "is-number": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-0.1.1.tgz", - "integrity": "sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY=", - "dev": true - }, - "repeat-string": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-0.2.2.tgz", - "integrity": "sha1-x6jTI2BoNiBZp+RlH8aITosftK4=", - "dev": true - } - } - }, "expect.js": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/expect.js/-/expect.js-0.2.0.tgz", @@ -4005,12 +3954,29 @@ "integrity": "sha512-oXbJGbjDnfJRWPC7Va38EFhd+A8JWE5/hCiKcK8qjCdbLj9DTpsq6MEudwpRTH+V4qq+Jw7d3pUgQdSr3x3mTA==" }, "follow-redirects": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", - "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.7.0.tgz", + "integrity": "sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==", "dev": true, "requires": { - "debug": "=3.1.0" + "debug": "^3.2.6" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } } }, "font-atlas": { @@ -4155,9 +4121,9 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz", + "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==", "dev": true, "optional": true, "requires": { @@ -4184,7 +4150,7 @@ "optional": true }, "are-we-there-yet": { - "version": "1.1.4", + "version": "1.1.5", "bundled": true, "dev": true, "optional": true, @@ -4210,7 +4176,7 @@ } }, "chownr": { - "version": "1.0.1", + "version": "1.1.1", "bundled": true, "dev": true, "optional": true @@ -4249,7 +4215,7 @@ } }, "deep-extend": { - "version": "0.5.1", + "version": "0.6.0", "bundled": true, "dev": true, "optional": true @@ -4298,7 +4264,7 @@ } }, "glob": { - "version": "7.1.2", + "version": "7.1.3", "bundled": true, "dev": true, "optional": true, @@ -4318,12 +4284,12 @@ "optional": true }, "iconv-lite": { - "version": "0.4.21", + "version": "0.4.24", "bundled": true, "dev": true, "optional": true, "requires": { - "safer-buffer": "^2.1.0" + "safer-buffer": ">= 2.1.2 < 3" } }, "ignore-walk": { @@ -4388,17 +4354,17 @@ "optional": true }, "minipass": { - "version": "2.2.4", + "version": "2.3.5", "bundled": true, "dev": true, "optional": true, "requires": { - "safe-buffer": "^5.1.1", + "safe-buffer": "^5.1.2", "yallist": "^3.0.0" } }, "minizlib": { - "version": "1.1.0", + "version": "1.2.1", "bundled": true, "dev": true, "optional": true, @@ -4422,7 +4388,7 @@ "optional": true }, "needle": { - "version": "2.2.0", + "version": "2.2.4", "bundled": true, "dev": true, "optional": true, @@ -4433,18 +4399,18 @@ } }, "node-pre-gyp": { - "version": "0.10.0", + "version": "0.10.3", "bundled": true, "dev": true, "optional": true, "requires": { "detect-libc": "^1.0.2", "mkdirp": "^0.5.1", - "needle": "^2.2.0", + "needle": "^2.2.1", "nopt": "^4.0.1", "npm-packlist": "^1.1.6", "npmlog": "^4.0.2", - "rc": "^1.1.7", + "rc": "^1.2.7", "rimraf": "^2.6.1", "semver": "^5.3.0", "tar": "^4" @@ -4461,13 +4427,13 @@ } }, "npm-bundled": { - "version": "1.0.3", + "version": "1.0.5", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { - "version": "1.1.10", + "version": "1.2.0", "bundled": true, "dev": true, "optional": true, @@ -4544,12 +4510,12 @@ "optional": true }, "rc": { - "version": "1.2.7", + "version": "1.2.8", "bundled": true, "dev": true, "optional": true, "requires": { - "deep-extend": "^0.5.1", + "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" @@ -4579,16 +4545,16 @@ } }, "rimraf": { - "version": "2.6.2", + "version": "2.6.3", "bundled": true, "dev": true, "optional": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" } }, "safe-buffer": { - "version": "5.1.1", + "version": "5.1.2", "bundled": true, "dev": true, "optional": true @@ -4606,7 +4572,7 @@ "optional": true }, "semver": { - "version": "5.5.0", + "version": "5.6.0", "bundled": true, "dev": true, "optional": true @@ -4659,17 +4625,17 @@ "optional": true }, "tar": { - "version": "4.4.1", + "version": "4.4.8", "bundled": true, "dev": true, "optional": true, "requires": { - "chownr": "^1.0.1", + "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", + "safe-buffer": "^5.1.2", "yallist": "^3.0.2" } }, @@ -4680,12 +4646,12 @@ "optional": true }, "wide-align": { - "version": "1.1.2", + "version": "1.1.3", "bundled": true, "dev": true, "optional": true, "requires": { - "string-width": "^1.0.2" + "string-width": "^1.0.2 || 2" } }, "wrappy": { @@ -4695,7 +4661,7 @@ "optional": true }, "yallist": { - "version": "3.0.2", + "version": "3.0.3", "bundled": true, "dev": true, "optional": true @@ -6606,28 +6572,27 @@ } }, "karma": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/karma/-/karma-3.1.4.tgz", - "integrity": "sha512-31Vo8Qr5glN+dZEVIpnPCxEGleqE0EY6CtC2X9TagRV3rRQ3SNrvfhddICkJgUK3AgqpeKSZau03QumTGhGoSw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/karma/-/karma-4.0.1.tgz", + "integrity": "sha512-ind+4s03BqIXas7ZmraV3/kc5+mnqwCd+VDX1FndS6jxbt03kQKX2vXrWxNLuCjVYmhMwOZosAEKMM0a2q7w7A==", "dev": true, "requires": { "bluebird": "^3.3.0", "body-parser": "^1.16.1", + "braces": "^2.3.2", "chokidar": "^2.0.3", "colors": "^1.1.0", - "combine-lists": "^1.0.0", "connect": "^3.6.0", "core-js": "^2.2.0", "di": "^0.0.1", "dom-serialize": "^2.2.0", - "expand-braces": "^0.1.1", "flatted": "^2.0.0", "glob": "^7.1.1", "graceful-fs": "^4.1.2", "http-proxy": "^1.13.0", "isbinaryfile": "^3.0.0", - "lodash": "^4.17.5", - "log4js": "^3.0.0", + "lodash": "^4.17.11", + "log4js": "^4.0.0", "mime": "^2.3.1", "minimatch": "^3.0.2", "optimist": "^0.6.1", @@ -6641,11 +6606,89 @@ "useragent": "2.3.0" }, "dependencies": { + "date-format": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.0.0.tgz", + "integrity": "sha512-M6UqVvZVgFYqZL1SfHsRGIQSz3ZL+qgbsV5Lp1Vj61LZVYuEwcMXYay7DRDtYs2HQQBK5hQtQ0fD9aEJ89V0LA==", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "log4js": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-4.1.0.tgz", + "integrity": "sha512-eDa+zZPeVEeK6QGJAePyXM6pg4P3n3TO5rX9iZMVY48JshsTyLJZLIL5HipI1kQ2qLsSyOpUqNND/C5H4WhhiA==", + "dev": true, + "requires": { + "date-format": "^2.0.0", + "debug": "^4.1.1", + "flatted": "^2.0.0", + "rfdc": "^1.1.2", + "streamroller": "^1.0.4" + } + }, "mime": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==", "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "streamroller": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-1.0.4.tgz", + "integrity": "sha512-Wc2Gm5ygjSX8ZpW9J7Y9FwiSzTlKSvcl0FTTMd3rn7RoxDXpBW+xD9TY5sWL2n0UR61COB0LG1BQvN6nTUQbLQ==", + "dev": true, + "requires": { + "async": "^2.6.1", + "date-format": "^2.0.0", + "debug": "^3.1.0", + "fs-extra": "^7.0.0", + "lodash": "^4.17.10" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } } } }, @@ -6830,12 +6873,6 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", - "dev": true - }, "lodash.memoize": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", @@ -9097,15 +9134,14 @@ } }, "readdirp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "minimatch": "^3.0.2", - "readable-stream": "^2.0.2", - "set-immediate-shim": "^1.0.1" + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" }, "dependencies": { "isarray": { @@ -9809,12 +9845,6 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true - }, "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", @@ -11634,9 +11664,9 @@ } }, "upath": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", - "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", "dev": true }, "update-diff": { diff --git a/package.json b/package.json index b50ff2366c5..731ad93b878 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "into-stream": "^4.0.0", "jasmine-core": "^2.99.1", "jsdom": "^11.12.0", - "karma": "^3.1.4", + "karma": "^4.0.1", "karma-browserify": "^6.0.0", "karma-chrome-launcher": "^2.0.0", "karma-fail-fast-reporter": "^1.0.5", From 4e37602ef5168b8958f98528334ddd787217b4f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Fri, 29 Mar 2019 15:33:28 -0400 Subject: [PATCH 2/3] bump open to 6.0.0 --- package-lock.json | 17 +++++++++++++---- package.json | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e4eed908eae..8f47a5e04e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6386,6 +6386,12 @@ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + }, "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", @@ -8178,10 +8184,13 @@ } }, "open": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/open/-/open-0.0.5.tgz", - "integrity": "sha1-QsPhjslUZra/DcQvOilFw/DK2Pw=", - "dev": true + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/open/-/open-6.0.0.tgz", + "integrity": "sha512-/yb5mVZBz7mHLySMiSj2DcLtMBbFPJk5JBKEkHVZFxZAPzeg3L026O0T+lbdz1B2nyDnkClRSwRQJdeVUIF7zw==", + "dev": true, + "requires": { + "is-wsl": "^1.1.0" + } }, "optical-properties": { "version": "1.0.0", diff --git a/package.json b/package.json index 731ad93b878..340278e7658 100644 --- a/package.json +++ b/package.json @@ -152,7 +152,7 @@ "minimist": "^1.2.0", "node-sass": "^4.11.0", "npm-link-check": "^3.0.0", - "open": "0.0.5", + "open": "^6.0.0", "prepend-file": "^1.3.1", "prettysize": "^2.0.0", "read-last-lines": "^1.7.0", From 63a0fd0a4061d2f536c58ac1c55b5ecf77673224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Fri, 29 Mar 2019 15:40:09 -0400 Subject: [PATCH 3/3] add eslint rule `padded-blocks: [2, "never"]`` --- .eslintrc | 1 + devtools/test_dashboard/devtools.js | 1 - devtools/test_dashboard/server.js | 1 - src/components/annotations/common_defaults.js | 1 - src/components/annotations/draw.js | 1 - src/components/annotations/draw_arrow_head.js | 2 - src/components/fx/hover.js | 1 - src/components/images/defaults.js | 1 - src/components/images/draw.js | 1 - src/components/legend/style.js | 1 - src/components/modebar/modebar.js | 1 - src/components/rangeselector/draw.js | 1 - src/components/rangeslider/draw.js | 1 - src/components/sliders/defaults.js | 1 - src/components/sliders/draw.js | 3 - src/components/updatemenus/defaults.js | 1 - src/components/updatemenus/draw.js | 1 - src/lib/coerce.js | 1 - src/lib/dates.js | 1 - src/lib/events.js | 1 - src/lib/extend.js | 1 - src/lib/index.js | 1 - src/lib/is_plain_object.js | 1 - src/lib/relink_private.js | 3 - src/lib/svg_text_utils.js | 1 - src/plot_api/helpers.js | 5 -- src/plot_api/plot_api.js | 15 ----- src/plot_api/plot_schema.js | 2 - src/plots/cartesian/dragbox.js | 1 - src/plots/cartesian/select.js | 2 - src/plots/command.js | 2 - src/plots/gl2d/convert.js | 1 - src/plots/gl2d/scene2d.js | 2 - src/plots/gl3d/layout/defaults.js | 2 - src/plots/gl3d/scene.js | 14 ----- src/plots/mapbox/layers.js | 1 - src/plots/plots.js | 6 -- src/snapshot/cloneplot.js | 1 - src/snapshot/toimage.js | 2 - src/traces/box/event_data.js | 1 - .../carpet/create_j_derivative_evaluator.js | 1 - src/traces/carpet/create_spline_evaluator.js | 1 - src/traces/carpet/smooth_fill_2d_array.js | 1 - src/traces/contourcarpet/defaults.js | 1 - src/traces/heatmap/plot.js | 1 - src/traces/histogram/bin_label_vals.js | 1 - src/traces/histogram/calc.js | 1 - src/traces/isosurface/calc.js | 1 - src/traces/isosurface/convert.js | 11 ---- src/traces/isosurface/defaults.js | 1 - src/traces/mesh3d/convert.js | 1 - src/traces/parcats/base_plot.js | 1 - src/traces/parcats/calc.js | 4 -- src/traces/parcats/defaults.js | 1 - src/traces/parcats/parcats.js | 30 --------- src/traces/parcoords/axisbrush.js | 1 - src/traces/parcoords/calc.js | 1 - src/traces/parcoords/lines.js | 2 - src/traces/parcoords/parcoords.js | 4 -- src/traces/parcoords/plot.js | 2 - src/traces/pie/plot.js | 3 - src/traces/pointcloud/convert.js | 15 ----- src/traces/sankey/plot.js | 3 - src/traces/sankey/render.js | 1 - src/traces/scatter/arrays_to_calcdata.js | 1 - src/traces/scatter/calc.js | 1 - src/traces/scatter/hover.js | 1 - src/traces/scatter/plot.js | 1 - src/traces/scatter3d/convert.js | 2 - src/traces/scatter3d/defaults.js | 1 - src/traces/scatterpolar/hover.js | 1 - src/traces/sunburst/plot.js | 1 - src/traces/surface/convert.js | 3 - src/traces/surface/defaults.js | 1 - src/traces/table/data_preparation_helper.js | 1 - src/traces/table/plot.js | 11 ---- src/traces/waterfall/calc.js | 1 - src/transforms/filter.js | 1 - tasks/docker.js | 1 - tasks/header.js | 1 - tasks/pretest.js | 1 - tasks/pull_date_format.js | 1 - test/image/compare_pixels_test.js | 1 - test/jasmine/assets/custom_assertions.js | 2 - test/jasmine/assets/timed_click.js | 4 -- test/jasmine/bundle_tests/finance_test.js | 2 - test/jasmine/bundle_tests/ie9_test.js | 1 - test/jasmine/bundle_tests/plotschema_test.js | 2 - test/jasmine/tests/animate_test.js | 4 -- test/jasmine/tests/annotations_test.js | 7 --- test/jasmine/tests/axes_test.js | 14 ----- test/jasmine/tests/bar_test.js | 2 - test/jasmine/tests/box_test.js | 1 - test/jasmine/tests/calcdata_test.js | 43 ------------- test/jasmine/tests/cartesian_interact_test.js | 1 - test/jasmine/tests/cartesian_test.js | 4 -- test/jasmine/tests/click_test.js | 11 ---- test/jasmine/tests/color_test.js | 5 -- test/jasmine/tests/colorscale_test.js | 2 - test/jasmine/tests/command_test.js | 2 - test/jasmine/tests/config_test.js | 6 -- test/jasmine/tests/drawing_test.js | 5 -- test/jasmine/tests/events_test.js | 4 -- test/jasmine/tests/extend_test.js | 2 - test/jasmine/tests/finance_test.js | 5 -- test/jasmine/tests/frame_api_test.js | 1 - test/jasmine/tests/geo_test.js | 3 - test/jasmine/tests/gl2d_click_test.js | 1 - .../tests/gl2d_date_axis_render_test.js | 1 - test/jasmine/tests/gl2d_plot_interact_test.js | 2 - test/jasmine/tests/gl2d_pointcloud_test.js | 1 - .../tests/gl2d_scatterplot_contour_test.js | 1 - test/jasmine/tests/gl3d_plot_interact_test.js | 2 - test/jasmine/tests/gl3dlayout_test.js | 1 - .../tests/gl_plot_interact_basic_test.js | 2 - test/jasmine/tests/heatmap_test.js | 5 -- test/jasmine/tests/histogram2d_test.js | 2 - test/jasmine/tests/histogram_test.js | 2 - test/jasmine/tests/hover_label_test.js | 4 -- test/jasmine/tests/isosurface_test.js | 8 --- test/jasmine/tests/layout_images_test.js | 14 ----- test/jasmine/tests/legend_scroll_test.js | 1 - test/jasmine/tests/lib_date_test.js | 2 - test/jasmine/tests/lib_test.js | 10 --- test/jasmine/tests/mesh3d_test.js | 1 - test/jasmine/tests/modebar_test.js | 9 --- test/jasmine/tests/parcats_test.js | 37 ----------- test/jasmine/tests/parcoords_test.js | 62 ------------------- test/jasmine/tests/plot_api_test.js | 37 ----------- test/jasmine/tests/plot_interact_test.js | 7 --- test/jasmine/tests/plot_promise_test.js | 1 - test/jasmine/tests/plots_test.js | 3 - test/jasmine/tests/polygon_test.js | 1 - test/jasmine/tests/range_selector_test.js | 4 -- test/jasmine/tests/range_slider_test.js | 5 -- test/jasmine/tests/sankey_test.js | 19 ------ test/jasmine/tests/scatter_test.js | 4 -- test/jasmine/tests/scattergeo_test.js | 1 - test/jasmine/tests/scatterternary_test.js | 2 - test/jasmine/tests/select_test.js | 2 - test/jasmine/tests/shapes_test.js | 2 - test/jasmine/tests/snapshot_test.js | 3 - test/jasmine/tests/surface_test.js | 2 - test/jasmine/tests/svg_text_utils_test.js | 2 - test/jasmine/tests/table_test.js | 20 ------ test/jasmine/tests/template_test.js | 2 - test/jasmine/tests/titles_test.js | 2 - test/jasmine/tests/transform_filter_test.js | 6 -- test/jasmine/tests/transform_groupby_test.js | 6 -- test/jasmine/tests/transform_multi_test.js | 5 -- test/jasmine/tests/transition_test.js | 2 - test/jasmine/tests/updatemenus_test.js | 3 - test/jasmine/tests/validate_test.js | 1 - test/jasmine/tests/waterfall_test.js | 2 - 154 files changed, 1 insertion(+), 652 deletions(-) diff --git a/.eslintrc b/.eslintrc index 330c1ef6ffa..302c24a6df4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -46,6 +46,7 @@ "space-in-parens": [2, "never"], "space-before-function-paren": [2, "never"], "space-before-blocks": [2], + "padded-blocks": [2, "never"], "spaced-comment": [2, "always"], "no-tabs": [2], "no-multi-spaces": [2, {"ignoreEOLComments": true}], diff --git a/devtools/test_dashboard/devtools.js b/devtools/test_dashboard/devtools.js index 8dbb9b3ab32..86bfd24f8a1 100644 --- a/devtools/test_dashboard/devtools.js +++ b/devtools/test_dashboard/devtools.js @@ -193,7 +193,6 @@ function debounce(func, wait, immediate) { } function searchMocks(e) { - // Clear results. while(mocksList.firstChild) { mocksList.removeChild(mocksList.firstChild); diff --git a/devtools/test_dashboard/server.js b/devtools/test_dashboard/server.js index 22484b1b91f..ec5511e920c 100644 --- a/devtools/test_dashboard/server.js +++ b/devtools/test_dashboard/server.js @@ -66,7 +66,6 @@ function readFiles(files) { } function createMocksList(files) { - // eliminate pollutants (e.g .DS_Store) that can accumulate in the mock directory var jsonFiles = files.filter(function(file) { return file.name.substr(-5) === '.json'; diff --git a/src/components/annotations/common_defaults.js b/src/components/annotations/common_defaults.js index 599b05ce49b..fa4cd0981d7 100644 --- a/src/components/annotations/common_defaults.js +++ b/src/components/annotations/common_defaults.js @@ -52,7 +52,6 @@ module.exports = function handleAnnotationCommonDefaults(annIn, annOut, fullLayo coerce('arrowwidth', ((borderOpacity && borderWidth) || 1) * 2); coerce('standoff'); coerce('startstandoff'); - } var hoverText = coerce('hovertext'); diff --git a/src/components/annotations/draw.js b/src/components/annotations/draw.js index 96c6008456c..60cbf7e112d 100644 --- a/src/components/annotations/draw.js +++ b/src/components/annotations/draw.js @@ -634,7 +634,6 @@ function drawRaw(gd, options, index, subplotId, xa, ya) { var xUpdate, yUpdate; if(xa) { xUpdate = xa.p2r(xa.r2p(options.x) + dx); - } else { var widthFraction = options._xsize / gs.w; var xLeft = options.x + (options._xshift - options.xshift) / gs.w - widthFraction / 2; diff --git a/src/components/annotations/draw_arrow_head.js b/src/components/annotations/draw_arrow_head.js index a790138a84c..48fba5ac534 100644 --- a/src/components/annotations/draw_arrow_head.js +++ b/src/components/annotations/draw_arrow_head.js @@ -75,7 +75,6 @@ module.exports = function drawArrowHead(el3, ends, options) { end.x += backOffX; end.y += backOffY; el3.attr({x2: end.x, y2: end.y}); - } if(startBackOff) { @@ -89,7 +88,6 @@ module.exports = function drawArrowHead(el3, ends, options) { start.x -= startBackOffX; start.y -= startbackOffY; el3.attr({x1: start.x, y1: start.y}); - } } else if(el.nodeName === 'path') { diff --git a/src/components/fx/hover.js b/src/components/fx/hover.js index 76ada0f47b0..6731db8e483 100644 --- a/src/components/fx/hover.js +++ b/src/components/fx/hover.js @@ -157,7 +157,6 @@ exports.loneHover = function loneHover(hoverItem, opts) { }; exports.multiHovers = function multiHovers(hoverItems, opts) { - if(!Array.isArray(hoverItems)) { hoverItems = [hoverItems]; } diff --git a/src/components/images/defaults.js b/src/components/images/defaults.js index beef5bdf34e..09b84ed83a0 100644 --- a/src/components/images/defaults.js +++ b/src/components/images/defaults.js @@ -26,7 +26,6 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { function imageDefaults(imageIn, imageOut, fullLayout) { - function coerce(attr, dflt) { return Lib.coerce(imageIn, imageOut, attributes, attr, dflt); } diff --git a/src/components/images/draw.js b/src/components/images/draw.js index 53d899a1774..3fe1080fc32 100644 --- a/src/components/images/draw.js +++ b/src/components/images/draw.js @@ -81,7 +81,6 @@ module.exports = function draw(gd) { thisImage.attr('xmlns', xmlnsNamespaces.svg); var imagePromise = new Promise(function(resolve) { - var img = new Image(); this.img = img; diff --git a/src/components/legend/style.js b/src/components/legend/style.js index a48752efc8f..cd373033313 100644 --- a/src/components/legend/style.js +++ b/src/components/legend/style.js @@ -146,7 +146,6 @@ module.exports = function style(s, gd) { trace.colorscale, 'stroke'); } } - } function stylePoints(d) { diff --git a/src/components/modebar/modebar.js b/src/components/modebar/modebar.js index 682780a79b9..679218fadec 100644 --- a/src/components/modebar/modebar.js +++ b/src/components/modebar/modebar.js @@ -270,7 +270,6 @@ proto.updateActiveButton = function(buttonClicked) { button3.classed('active', val === thisval); } - }); }; diff --git a/src/components/rangeselector/draw.js b/src/components/rangeselector/draw.js index 7c7ea766287..79378a4f5fa 100644 --- a/src/components/rangeselector/draw.js +++ b/src/components/rangeselector/draw.js @@ -83,7 +83,6 @@ module.exports = function draw(gd) { reposition(gd, buttons, selectorLayout, axisLayout._name, selector); }); - }; function makeSelectorData(gd) { diff --git a/src/components/rangeslider/draw.js b/src/components/rangeslider/draw.js index be46839d52e..11e1de1f92a 100644 --- a/src/components/rangeslider/draw.js +++ b/src/components/rangeslider/draw.js @@ -254,7 +254,6 @@ function setupDragElement(rangeSlider, gd, axisOpts, opts) { } function setDataRange(rangeSlider, gd, axisOpts, opts) { - function clamp(v) { return axisOpts.l2r(Lib.constrain(v, opts._rl[0], opts._rl[1])); } diff --git a/src/components/sliders/defaults.js b/src/components/sliders/defaults.js index 175ade719cf..ddbf355046d 100644 --- a/src/components/sliders/defaults.js +++ b/src/components/sliders/defaults.js @@ -26,7 +26,6 @@ module.exports = function slidersDefaults(layoutIn, layoutOut) { }; function sliderDefaults(sliderIn, sliderOut, layoutOut) { - function coerce(attr, dflt) { return Lib.coerce(sliderIn, sliderOut, attributes, attr, dflt); } diff --git a/src/components/sliders/draw.js b/src/components/sliders/draw.js index 50342bfa523..53a35a94678 100644 --- a/src/components/sliders/draw.js +++ b/src/components/sliders/draw.js @@ -277,7 +277,6 @@ function drawSlider(gd, sliderGroup, sliderOpts) { sliderGroup.call(setGripPosition, sliderOpts, false); sliderGroup.call(drawCurrentValue, sliderOpts); - } function drawCurrentValue(sliderGroup, sliderOpts, valueOverride) { @@ -409,7 +408,6 @@ function drawLabelGroup(sliderGroup, sliderOpts) { dims.currentValueTotalHeight ); }); - } function handleInput(gd, sliderGroup, sliderOpts, normalizedPosition, doTransition) { @@ -540,7 +538,6 @@ function drawTicks(sliderGroup, sliderOpts) { (isMajor ? constants.tickOffset : constants.minorTickOffset) + dims.currentValueTotalHeight ); }); - } function computeLabelSteps(sliderOpts) { diff --git a/src/components/updatemenus/defaults.js b/src/components/updatemenus/defaults.js index 87221229809..492b9c911a9 100644 --- a/src/components/updatemenus/defaults.js +++ b/src/components/updatemenus/defaults.js @@ -28,7 +28,6 @@ module.exports = function updateMenusDefaults(layoutIn, layoutOut) { }; function menuDefaults(menuIn, menuOut, layoutOut) { - function coerce(attr, dflt) { return Lib.coerce(menuIn, menuOut, attributes, attr, dflt); } diff --git a/src/components/updatemenus/draw.js b/src/components/updatemenus/draw.js index 197472c99fe..d72332f679a 100644 --- a/src/components/updatemenus/draw.js +++ b/src/components/updatemenus/draw.js @@ -133,7 +133,6 @@ module.exports = function draw(gd) { } else { drawButtons(gd, gHeader, null, null, menuOpts); } - }); }; diff --git a/src/lib/coerce.js b/src/lib/coerce.js index 8d66283bd76..13be07d9d72 100644 --- a/src/lib/coerce.js +++ b/src/lib/coerce.js @@ -267,7 +267,6 @@ exports.valObjectMeta = { // either be a matching 1D array or an array of such matching 1D arrays otherOpts: ['dflt', 'freeLength', 'dimensions'], coerceFunction: function(v, propOut, dflt, opts) { - // simplified coerce function just for array items function coercePart(v, opts, dflt) { var out; diff --git a/src/lib/dates.js b/src/lib/dates.js index 2d54c73e37e..5a159a84d3c 100644 --- a/src/lib/dates.js +++ b/src/lib/dates.js @@ -377,7 +377,6 @@ exports.cleanDate = function(v, dflt, calendar) { */ var fracMatch = /%\d?f/g; function modDateFormat(fmt, x, formatter, calendar) { - fmt = fmt.replace(fracMatch, function(match) { var digits = Math.min(+(match.charAt(1)) || 6, 6); var fracSecs = ((x / 1000 % 1) + 2) diff --git a/src/lib/events.js b/src/lib/events.js index 9ec327415bd..0532a8477c7 100644 --- a/src/lib/events.js +++ b/src/lib/events.js @@ -16,7 +16,6 @@ var EventEmitter = require('events').EventEmitter; var Events = { init: function(plotObj) { - /* * If we have already instantiated an emitter for this plot * return early. diff --git a/src/lib/extend.js b/src/lib/extend.js index 45c927c61fe..a9e7c12b810 100644 --- a/src/lib/extend.js +++ b/src/lib/extend.js @@ -68,7 +68,6 @@ function _extend(inputs, isDeep, keepAllKeys, noArrayCopies) { // TODO does this do the right thing for typed arrays? if(length === 2 && isArray(target) && isArray(inputs[1]) && target.length === 0) { - allPrimitives = primitivesLoopSplice(inputs[1], target); if(allPrimitives) { diff --git a/src/lib/index.js b/src/lib/index.js index be6d6707344..9c9ef6094d7 100644 --- a/src/lib/index.js +++ b/src/lib/index.js @@ -843,7 +843,6 @@ lib.objectFromPath = function(path, value) { tmpObj = tmpObj[el]; } else { - if(i === keys.length - 1) { tmpObj[key] = value; } else { diff --git a/src/lib/is_plain_object.js b/src/lib/is_plain_object.js index fb07a2d4c4a..8f33cb6d2be 100644 --- a/src/lib/is_plain_object.js +++ b/src/lib/is_plain_object.js @@ -11,7 +11,6 @@ // more info: http://stackoverflow.com/questions/18531624/isplainobject-thing module.exports = function isPlainObject(obj) { - // We need to be a little less strict in the `imagetest` container because // of how async image requests are handled. // diff --git a/src/lib/relink_private.js b/src/lib/relink_private.js index 01b215ca47c..eb27df034e0 100644 --- a/src/lib/relink_private.js +++ b/src/lib/relink_private.js @@ -28,7 +28,6 @@ module.exports = function relinkPrivateKeys(toContainer, fromContainer) { continue; } if(k.charAt(0) === '_' || typeof fromVal === 'function') { - // if it already exists at this point, it's something // that we recreate each time around, so ignore it if(k in toContainer) continue; @@ -36,7 +35,6 @@ module.exports = function relinkPrivateKeys(toContainer, fromContainer) { toContainer[k] = fromVal; } else if(isArrayOrTypedArray(fromVal) && isArrayOrTypedArray(toVal) && isPlainObject(fromVal[0])) { - // filter out data_array items that can contain user objects // most of the time the toVal === fromVal check will catch these early // but if the user makes new ones we also don't want to recurse in. @@ -51,7 +49,6 @@ module.exports = function relinkPrivateKeys(toContainer, fromContainer) { } } else if(isPlainObject(fromVal) && isPlainObject(toVal)) { - // recurse into objects, but only if they still exist relinkPrivateKeys(toVal, fromVal); diff --git a/src/lib/svg_text_utils.js b/src/lib/svg_text_utils.js index 6f2a45a06d7..b98a165ed3b 100644 --- a/src/lib/svg_text_utils.js +++ b/src/lib/svg_text_utils.js @@ -163,7 +163,6 @@ function cleanEscapesForTex(s) { } function texToSVG(_texString, _config, _callback) { - var originalRenderer, originalConfig, originalProcessSectionDelay, diff --git a/src/plot_api/helpers.js b/src/plot_api/helpers.js index d4f1a2e4f34..5ef7e4bc384 100644 --- a/src/plot_api/helpers.js +++ b/src/plot_api/helpers.js @@ -237,7 +237,6 @@ function cleanAxRef(container, attr) { */ function cleanTitle(titleContainer) { if(titleContainer) { - // title -> title.text // (although title used to be a string attribute, // numbers are accepted as well) @@ -258,7 +257,6 @@ function cleanTitle(titleContainer) { var newAttrSet = titleContainer.title && titleContainer.title[newAttrName]; if(oldAttrSet && !newAttrSet) { - // Ensure title object exists if(!titleContainer.title) { titleContainer.title = {}; @@ -613,7 +611,6 @@ exports.manageArrayContainers = function(np, newVal, undoit) { // delete item if(pLastIsNumber && newVal === null) { - // Clear item in array container when new value is null var contPath = parts.slice(0, pLength - 1).join('.'); var cont = Lib.nestedProperty(obj, contPath).get(); @@ -624,7 +621,6 @@ exports.manageArrayContainers = function(np, newVal, undoit) { } // create item else if(pLastIsNumber && np.get() === undefined) { - // When adding a new item, make sure undo command will remove it if(np.get() === undefined) undoit[np.astr] = null; @@ -632,7 +628,6 @@ exports.manageArrayContainers = function(np, newVal, undoit) { } // update item else { - // If the last part of attribute string isn't a number, // np.set is all we need. np.set(newVal); diff --git a/src/plot_api/plot_api.js b/src/plot_api/plot_api.js index 343689af1e3..b62620c0a7e 100644 --- a/src/plot_api/plot_api.js +++ b/src/plot_api/plot_api.js @@ -733,7 +733,6 @@ function assertIndexArray(gd, indices, arrayName) { * @param newIndices */ function checkMoveTracesArgs(gd, currentIndices, newIndices) { - // check that gd has attribute 'data' and 'data' is array if(!Array.isArray(gd.data)) { throw new Error('gd.data must be an array.'); @@ -759,7 +758,6 @@ function checkMoveTracesArgs(gd, currentIndices, newIndices) { if(typeof newIndices !== 'undefined' && currentIndices.length !== newIndices.length) { throw new Error('current and new indices must be of equal length.'); } - } /** * A private function to reduce the type checking clutter in addTraces. @@ -816,7 +814,6 @@ function checkAddTracesArgs(gd, traces, newIndices) { * @param maxPoints */ function assertExtendTracesArgs(gd, update, indices, maxPoints) { - var maxPointsIsObject = Lib.isPlainObject(maxPoints); if(!Array.isArray(gd.data)) { @@ -833,7 +830,6 @@ function assertExtendTracesArgs(gd, update, indices, maxPoints) { assertIndexArray(gd, indices, 'indices'); for(var key in update) { - /* * Verify that the attribute to be updated contains as many trace updates * as indices. Failure must result in throw and no-op @@ -864,7 +860,6 @@ function assertExtendTracesArgs(gd, update, indices, maxPoints) { * @return {Object[]} */ function getExtendProperties(gd, update, indices, maxPoints) { - var maxPointsIsObject = Lib.isPlainObject(maxPoints); var updateProps = []; var trace, target, prop, insert, maxp; @@ -877,9 +872,7 @@ function getExtendProperties(gd, update, indices, maxPoints) { // loop through all update keys and traces and harvest validated data. for(var key in update) { - for(var j = 0; j < indices.length; j++) { - /* * Choose the trace indexed by the indices map argument and get the prop setter-getter * instance that references the key and value for this particular trace. @@ -1166,12 +1159,10 @@ exports.addTraces = function addTraces(gd, traces, newIndices) { } try { - // this is redundant, but necessary to not catch later possible errors! checkMoveTracesArgs(gd, currentIndices, newIndices); } catch(error) { - // something went wrong, reset gd to be safe and rethrow error gd.data.splice(gd.data.length - traces.length, traces.length); throw error; @@ -1296,7 +1287,6 @@ exports.moveTraces = function moveTraces(gd, currentIndices, newIndices) { // get the traces that aren't being moved around for(i = 0; i < gd.data.length; i++) { - // if index isn't in currentIndices, include it in ignored! if(currentIndices.indexOf(i) === -1) { newData.push(gd.data[i]); @@ -2747,7 +2737,6 @@ exports.react = function(gd, data, layout, config) { plotDone = exports.newPlot(gd, data, layout, config); } else { - if(Lib.isPlainObject(data)) { var obj = data; data = obj.data; @@ -2877,7 +2866,6 @@ exports.react = function(gd, data, layout, config) { return gd; }); - }; function diffData(gd, oldFullData, newFullData, immutable, transition, newDataRevision) { @@ -3099,7 +3087,6 @@ function getDiffFlags(oldContainer, newContainer, outerparts, opts) { } else if(canBeDataArray) { if(wasArray && nowArray) { - // don't try to diff two data arrays. If immutable we know the data changed, // if not, assume it didn't and let `layout.datarevision` tell us if it did if(immutable) { @@ -3394,7 +3381,6 @@ exports.animate = function(gd, frameOrGroupNameOrFrameList, animationOpts) { if(newFrame.onComplete) { newFrame.onComplete(); } - }); gd.emit('plotly_animatingframe', { @@ -3658,7 +3644,6 @@ exports.addFrames = function(gd, frameList, indices) { if(typeof frame.name === 'number') { Lib.warn('Warning: addFrames accepts frames with numeric names, but the numbers are' + 'implicitly cast to strings'); - } if(!frame.name) { diff --git a/src/plot_api/plot_schema.js b/src/plot_api/plot_schema.js index 28da62b3009..da996441d72 100644 --- a/src/plot_api/plot_schema.js +++ b/src/plot_api/plot_schema.js @@ -602,7 +602,6 @@ function formatAttributes(attrs) { } function mergeValTypeAndRole(attrs) { - function makeSrcAttr(attrName) { return { valType: 'string', @@ -638,7 +637,6 @@ function mergeValTypeAndRole(attrs) { } function formatArrayContainers(attrs) { - function callback(attr, attrName, attrs) { if(!attr) return; diff --git a/src/plots/cartesian/dragbox.js b/src/plots/cartesian/dragbox.js index 8ffd84fb657..6096ba389d9 100644 --- a/src/plots/cartesian/dragbox.js +++ b/src/plots/cartesian/dragbox.js @@ -700,7 +700,6 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) { // doubleClickConfig === 'reset' below), we reset. // If they are *all* at their initial ranges, then we autosize. if(doubleClickConfig === 'reset+autosize') { - doubleClickConfig = 'autosize'; for(i = 0; i < axList.length; i++) { diff --git a/src/plots/cartesian/select.js b/src/plots/cartesian/select.js index 7a2e52b1fd3..a051adbe9ad 100644 --- a/src/plots/cartesian/select.js +++ b/src/plots/cartesian/select.js @@ -153,7 +153,6 @@ function prepSelect(e, startX, startY, dragOptions, mode) { 'h-4v' + (2 * MINSELECT) + 'h4Z' + 'M' + (currentPolygon.xmax - 1) + ',' + (y0 - MINSELECT) + 'h4v' + (2 * MINSELECT) + 'h-4Z'); - } else if(direction === 'v') { // vertical motion: make a horizontal box @@ -571,7 +570,6 @@ function extractClickedPtInfo(hoverData, searchTraces) { for(i = 0; i < searchTraces.length; i++) { searchInfo = searchTraces[i]; if(hoverDatum.fullData._expandedIndex === searchInfo.cd[0].trace._expandedIndex) { - // Special case for box (and violin) if(hoverDatum.hoverOnBox === true) { break; diff --git a/src/plots/command.js b/src/plots/command.js index 2cee2babb30..b04897b4cb4 100644 --- a/src/plots/command.js +++ b/src/plots/command.js @@ -58,8 +58,6 @@ exports.manageCommandObserver = function(gd, container, commandList, onchange) { // table should have been updated and check is already attached, // so there's nothing to be done: return ret; - - } } diff --git a/src/plots/gl2d/convert.js b/src/plots/gl2d/convert.js index 41eec41b8ce..0aaaa1fceb1 100644 --- a/src/plots/gl2d/convert.js +++ b/src/plots/gl2d/convert.js @@ -96,7 +96,6 @@ var proto = Axes2DOptions.prototype; var AXES = ['xaxis', 'yaxis']; proto.merge = function(options) { - // titles are rendered in SVG this.titleEnable = false; this.backgroundColor = str2RGBArray(options.plot_bgcolor); diff --git a/src/plots/gl2d/scene2d.js b/src/plots/gl2d/scene2d.js index 789efdfe096..234239fa496 100644 --- a/src/plots/gl2d/scene2d.js +++ b/src/plots/gl2d/scene2d.js @@ -91,7 +91,6 @@ module.exports = Scene2D; var proto = Scene2D.prototype; proto.makeFramework = function() { - // create canvas and gl context if(this.staticPlot) { if(!STATIC_CONTEXT) { @@ -633,7 +632,6 @@ proto.draw = function() { } if(result && result.object._trace.hoverinfo !== 'skip' && fullLayout.hovermode) { - if(nextSelection && ( !this.lastPickResult || this.lastPickResult.traceUid !== nextSelection.trace.uid || diff --git a/src/plots/gl3d/layout/defaults.js b/src/plots/gl3d/layout/defaults.js index fda22c0b83a..da9a5b2805a 100644 --- a/src/plots/gl3d/layout/defaults.js +++ b/src/plots/gl3d/layout/defaults.js @@ -120,12 +120,10 @@ function handleGl3dDefaults(sceneLayoutIn, sceneLayoutOut, coerce, opts) { if(dragmode !== false) { if(!dragmode) { - dragmode = 'orbit'; if(sceneLayoutIn.camera && sceneLayoutIn.camera.up) { - var x = sceneLayoutIn.camera.up.x; var y = sceneLayoutIn.camera.up.y; var z = sceneLayoutIn.camera.up.z; diff --git a/src/plots/gl3d/scene.js b/src/plots/gl3d/scene.js index 35e8fa6a040..31aa1ea2707 100644 --- a/src/plots/gl3d/scene.js +++ b/src/plots/gl3d/scene.js @@ -193,7 +193,6 @@ function render(scene) { } function tryCreatePlot(scene, cameraObject, pixelRatio, canvas, gl) { - var glplotOptions = { canvas: canvas, gl: gl, @@ -239,7 +238,6 @@ function tryCreatePlot(scene, cameraObject, pixelRatio, canvas, gl) { } function initializeGLPlot(scene, pixelRatio, canvas, gl) { - scene.initializeGLCamera(); var success = tryCreatePlot(scene, scene.camera, pixelRatio, canvas, gl); @@ -300,7 +298,6 @@ function initializeGLPlot(scene, pixelRatio, canvas, gl) { } function Scene(options, fullLayout) { - // create sub container for plot var sceneContainer = document.createElement('div'); var plotContainer = options.container; @@ -357,7 +354,6 @@ function Scene(options, fullLayout) { var proto = Scene.prototype; proto.initializeGLCamera = function() { - var cameraData = this.fullSceneLayout.camera; var isOrtho = (cameraData.projection.type === 'orthographic'); @@ -671,32 +667,25 @@ proto.plot = function(sceneData, fullLayout, layout) { var aspectRatio; if(fullSceneLayout.aspectmode === 'auto') { - if(Math.max.apply(null, axesScaleRatio) / Math.min.apply(null, axesScaleRatio) <= axisAutoScaleFactor) { - /* * USE DATA MODE WHEN AXIS RANGE DIMENSIONS ARE RELATIVELY EQUAL */ aspectRatio = axesScaleRatio; } else { - /* * USE EQUAL MODE WHEN AXIS RANGE DIMENSIONS ARE HIGHLY UNEQUAL */ aspectRatio = [1, 1, 1]; } - } else if(fullSceneLayout.aspectmode === 'cube') { aspectRatio = [1, 1, 1]; - } else if(fullSceneLayout.aspectmode === 'data') { aspectRatio = axesScaleRatio; - } else if(fullSceneLayout.aspectmode === 'manual') { var userRatio = fullSceneLayout.aspectratio; aspectRatio = [userRatio.x, userRatio.y, userRatio.z]; - } else { throw new Error('scene.js aspectRatio was not one of the enumerated types'); } @@ -828,7 +817,6 @@ proto.saveCamera = function saveCamera(layout) { if(!cameraDataLastSave.projection || ( cameraData.projection && cameraData.projection.type !== cameraDataLastSave.projection.type)) { - hasChanged = true; } } @@ -854,7 +842,6 @@ proto.updateFx = function(dragmode, hovermode) { if(dragmode === 'orbit') { camera.mode = 'orbit'; camera.keyBindingMode = 'rotate'; - } else if(dragmode === 'turntable') { camera.up = [0, 0, 1]; camera.mode = 'turntable'; @@ -954,7 +941,6 @@ proto.setConvert = function() { }; proto.make4thDimension = function() { - var _this = this; var gd = _this.graphDiv; var fullLayout = gd._fullLayout; diff --git a/src/plots/mapbox/layers.js b/src/plots/mapbox/layers.js index 92b3320f748..914b30ea3a6 100644 --- a/src/plots/mapbox/layers.js +++ b/src/plots/mapbox/layers.js @@ -140,7 +140,6 @@ function convertOpts(opts) { var paint = {}; switch(opts.type) { - case 'circle': Lib.extendFlat(paint, { 'circle-radius': opts.circle.radius, diff --git a/src/plots/plots.js b/src/plots/plots.js index e2ecb04047a..466bd81af14 100644 --- a/src/plots/plots.js +++ b/src/plots/plots.js @@ -76,7 +76,6 @@ plots.resize = function(gd) { gd = Lib.getGraphDiv(gd); return new Promise(function(resolve, reject) { - function isHidden(gd) { var display = window.getComputedStyle(gd).display; return !display || display === 'none'; @@ -339,7 +338,6 @@ plots.supplyDefaults = function(gd, opts) { // first fill in what we can of layout without looking at data // because fullData needs a few things from layout if(oldFullLayout._initialAutoSizeIsDone) { - // coerce the updated layout while preserving width and height var oldWidth = oldFullLayout.width; var oldHeight = oldFullLayout.height; @@ -351,7 +349,6 @@ plots.supplyDefaults = function(gd, opts) { plots.sanitizeMargins(newFullLayout); } else { - // coerce the updated layout and autosize if needed plots.supplyLayoutGlobalDefaults(newLayout, newFullLayout, formatObj); @@ -1847,7 +1844,6 @@ plots.doAutoMargin = function(gd) { var pushMarginIds = fullLayout._pushmarginIds; if(fullLayout.margin.autoexpand !== false) { - for(var k in pushMargin) { if(!pushMarginIds[k]) delete pushMargin[k]; } @@ -1864,7 +1860,6 @@ plots.doAutoMargin = function(gd) { // (and t and b) to find the required margins for(var k1 in pushMargin) { - var pushleft = pushMargin[k1].l || {}; var pushbottom = pushMargin[k1].b || {}; var fl = pushleft.val; @@ -2803,7 +2798,6 @@ plots.doCalcdata = function(gd, traces) { var cd = []; if(trace.visible === true) { - // clear existing ref in case it got relinked delete trace._indexToPoints; // keep ref of index-to-points map object of the *last* enabled transform, diff --git a/src/snapshot/cloneplot.js b/src/snapshot/cloneplot.js index 5a89bba57f2..239ad267dc2 100644 --- a/src/snapshot/cloneplot.js +++ b/src/snapshot/cloneplot.js @@ -58,7 +58,6 @@ function keyIsAxis(keyName) { module.exports = function clonePlot(graphObj, options) { - // Polar plot compatibility if(graphObj.framework && graphObj.framework.isPolar) { graphObj = graphObj.framework.getConfig(); diff --git a/src/snapshot/toimage.js b/src/snapshot/toimage.js index 275fb9e6312..61674fee75f 100644 --- a/src/snapshot/toimage.js +++ b/src/snapshot/toimage.js @@ -24,7 +24,6 @@ var svgToImg = require('./svgtoimg'); * @param opts.format 'jpeg' | 'png' | 'webp' | 'svg' */ function toImage(gd, opts) { - // first clone the GD so we can operate in a clean environment var ev = new EventEmitter(); @@ -57,7 +56,6 @@ function toImage(gd, opts) { ev.clean = function() { if(clonedGd) document.body.removeChild(clonedGd); }; - }, delay); } diff --git a/src/traces/box/event_data.js b/src/traces/box/event_data.js index 420e51ead38..bd2171a5415 100644 --- a/src/traces/box/event_data.js +++ b/src/traces/box/event_data.js @@ -9,7 +9,6 @@ 'use strict'; module.exports = function eventData(out, pt) { - // Note: hoverOnBox property is needed for click-to-select // to ignore when a box was clicked. This is the reason box // implements this custom eventData function. diff --git a/src/traces/carpet/create_j_derivative_evaluator.js b/src/traces/carpet/create_j_derivative_evaluator.js index 175ddfb289c..cb8fab3d910 100644 --- a/src/traces/carpet/create_j_derivative_evaluator.js +++ b/src/traces/carpet/create_j_derivative_evaluator.js @@ -122,5 +122,4 @@ module.exports = function(arrays, asmoothing, bsmoothing) { return out; }; } - }; diff --git a/src/traces/carpet/create_spline_evaluator.js b/src/traces/carpet/create_spline_evaluator.js index 88ef8832c92..8c2fda2b745 100644 --- a/src/traces/carpet/create_spline_evaluator.js +++ b/src/traces/carpet/create_spline_evaluator.js @@ -145,5 +145,4 @@ module.exports = function(arrays, na, nb, asmoothing, bsmoothing) { return out; }; } - }; diff --git a/src/traces/carpet/smooth_fill_2d_array.js b/src/traces/carpet/smooth_fill_2d_array.js index 62909f52d13..54b2a04fe4f 100644 --- a/src/traces/carpet/smooth_fill_2d_array.js +++ b/src/traces/carpet/smooth_fill_2d_array.js @@ -54,7 +54,6 @@ module.exports = function smoothFill2dArray(data, a, b) { sum += val; } return sum / Math.max(1, cnt); - } // This loop iterates over all cells. Any cells that are null will be noted and those diff --git a/src/traces/contourcarpet/defaults.js b/src/traces/contourcarpet/defaults.js index ca34080800b..671b9eb3e7a 100644 --- a/src/traces/contourcarpet/defaults.js +++ b/src/traces/contourcarpet/defaults.js @@ -44,7 +44,6 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout // attribute name to match the property name -- except '_a' !== 'a' so that is not // straightforward. if(traceIn.a && traceIn.b) { - var len = handleXYZDefaults(traceIn, traceOut, coerce, layout, 'a', 'b'); if(!len) { diff --git a/src/traces/heatmap/plot.js b/src/traces/heatmap/plot.js index eb32afd10c4..cb89284139c 100644 --- a/src/traces/heatmap/plot.js +++ b/src/traces/heatmap/plot.js @@ -292,7 +292,6 @@ module.exports = function(gd, plotinfo, cdheatmaps, heatmapLayer) { context.putImageData(imageData, 0, 0); } else { // zsmooth = false -> filling potentially large bricks works fastest with fillRect - // gaps do not need to be exact integers, but if they *are* we will get // cleaner edges by rounding at least one edge var xGap = trace.xgap; diff --git a/src/traces/histogram/bin_label_vals.js b/src/traces/histogram/bin_label_vals.js index d397262c9f2..3499c3f081d 100644 --- a/src/traces/histogram/bin_label_vals.js +++ b/src/traces/histogram/bin_label_vals.js @@ -161,7 +161,6 @@ function didDigitChange(digit, v1, v2, isDate, pa, calendar) { var dateParts2 = dateParts(v2, pa, calendar); var parti = (digit === oneYear) ? 0 : 1; return dateParts1[parti] !== dateParts2[parti]; - } return Math.floor(v2 / digit) - Math.floor(v1 / digit) > 0.1; } diff --git a/src/traces/histogram/calc.js b/src/traces/histogram/calc.js index c99663d6741..179795bbfff 100644 --- a/src/traces/histogram/calc.js +++ b/src/traces/histogram/calc.js @@ -493,7 +493,6 @@ function cdf(size, direction, currentBin) { } if(currentBin === 'half') { - if(direction === 'increasing') { firstHalfPoint(0); for(i = 1; i < size.length; i++) { diff --git a/src/traces/isosurface/calc.js b/src/traces/isosurface/calc.js index 812f14093da..1c428c2ccc9 100644 --- a/src/traces/isosurface/calc.js +++ b/src/traces/isosurface/calc.js @@ -11,7 +11,6 @@ var colorscaleCalc = require('../../components/colorscale/calc'); module.exports = function calc(gd, trace) { - trace._len = Math.min(trace.x.length, trace.y.length, trace.z.length, trace.value.length); var min = Infinity; diff --git a/src/traces/isosurface/convert.js b/src/traces/isosurface/convert.js index 5272cd0187b..d286754e9c8 100644 --- a/src/traces/isosurface/convert.js +++ b/src/traces/isosurface/convert.js @@ -50,7 +50,6 @@ function findNearestOnAxis(w, arr) { proto.handlePick = function(selection) { if(selection.object === this.mesh) { - var rawId = selection.data.index; var x = this.data._x[rawId]; @@ -136,7 +135,6 @@ proto.dispose = function() { }; function generateIsosurfaceMesh(data) { - data._i = []; data._j = []; data._k = []; @@ -287,7 +285,6 @@ function generateIsosurfaceMesh(data) { } function drawTri(style, xyzv, abc) { - beginGroup(); var allXYZVs = [xyzv]; @@ -302,13 +299,11 @@ function generateIsosurfaceMesh(data) { } for(var f = 0; f < allXYZVs.length; f++) { - xyzv = allXYZVs[f]; abc = allABCs[f]; var pnts = []; for(var i = 0; i < 3; i++) { - var x = xyzv[i][0]; var y = xyzv[i][1]; var z = xyzv[i][2]; @@ -396,7 +391,6 @@ function generateIsosurfaceMesh(data) { var MAX_PASS = 3; function tryCreateTri(style, xyzv, abc, min, max, nPass) { - if(!nPass) nPass = 1; abc = [-1, -1, -1]; // Note: for the moment we override indices @@ -478,7 +472,6 @@ function generateIsosurfaceMesh(data) { } function tryCreateTetra(style, abcd, min, max) { - var result = false; var xyzv = getXYZV(abcd); @@ -886,7 +879,6 @@ function generateIsosurfaceMesh(data) { } function drawAll() { - emptyVertices(); // insert grid points @@ -943,9 +935,7 @@ function generateIsosurfaceMesh(data) { var ceilIndices = []; var distRatios = []; if(slice.locations.length) { - for(var q = 0; q < slice.locations.length; q++) { - var near = findNearestOnAxis( slice.locations[q], (e === 'x') ? Xs : @@ -1035,7 +1025,6 @@ function generateIsosurfaceMesh(data) { } function createIsosurfaceTrace(scene, data) { - var gl = scene.glplot.gl; var mesh = createMesh({gl: gl}); var result = new IsosurfaceTrace(scene, mesh, data.uid); diff --git a/src/traces/isosurface/defaults.js b/src/traces/isosurface/defaults.js index 48b19dffa44..b2390159709 100644 --- a/src/traces/isosurface/defaults.js +++ b/src/traces/isosurface/defaults.js @@ -48,7 +48,6 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout); ['x', 'y', 'z'].forEach(function(dim) { - var capDim = 'caps.' + dim; var showCap = coerce(capDim + '.show'); if(showCap) { diff --git a/src/traces/mesh3d/convert.js b/src/traces/mesh3d/convert.js index 7c2cc23d651..dca58ed8355 100644 --- a/src/traces/mesh3d/convert.js +++ b/src/traces/mesh3d/convert.js @@ -117,7 +117,6 @@ proto.update = function(data) { var cells; if(data.i && data.j && data.k) { - if( data.i.length !== data.j.length || data.j.length !== data.k.length || diff --git a/src/traces/parcats/base_plot.js b/src/traces/parcats/base_plot.js index 80cd9dc75d1..76fcb4dbfdb 100644 --- a/src/traces/parcats/base_plot.js +++ b/src/traces/parcats/base_plot.js @@ -15,7 +15,6 @@ var PARCATS = 'parcats'; exports.name = PARCATS; exports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) { - var cdModuleAndOthers = getModuleCalcData(gd.calcdata, PARCATS); if(cdModuleAndOthers.length) { diff --git a/src/traces/parcats/calc.js b/src/traces/parcats/calc.js index fd835b49d57..9310e922040 100644 --- a/src/traces/parcats/calc.js +++ b/src/traces/parcats/calc.js @@ -114,7 +114,6 @@ module.exports = function calc(gd, trace) { var d; for(valueInd = 0; valueInd < numValues; valueInd++) { - // Category inds for this input value across dimensions var categoryIndsPath = []; for(d = 0; d < categoryIndsDims.length; d++) { @@ -148,7 +147,6 @@ module.exports = function calc(gd, trace) { for(valueInd = 0; valueInd < numValues; valueInd++) { - count = counts[valueInd % counts.length]; for(d = 0; d < dimensionModels.length; d++) { @@ -387,7 +385,6 @@ function updatePathModel(pathModel, valueInd, count) { * @return {UniqueInfo} */ function getUniqueInfo(values, uniqueValues) { - // Initialize uniqueValues if not specified if(uniqueValues === undefined || uniqueValues === null) { uniqueValues = []; @@ -464,7 +461,6 @@ function validateDimensionDisplayInds(visibleDims) { * @param {UniqueInfo} uniqueInfoDim */ function validateCategoryProperties(dim, uniqueInfoDim) { - // Update categoryarray dim._categoryarray = uniqueInfoDim.uniqueValues; diff --git a/src/traces/parcats/defaults.js b/src/traces/parcats/defaults.js index 7d22714cab6..e2495572a9b 100644 --- a/src/traces/parcats/defaults.js +++ b/src/traces/parcats/defaults.js @@ -76,7 +76,6 @@ function dimensionDefaults(dimensionIn, dimensionOut) { } module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) { - function coerce(attr, dflt) { return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); } diff --git a/src/traces/parcats/parcats.js b/src/traces/parcats/parcats.js index 96734034ec5..7805a8f0970 100644 --- a/src/traces/parcats/parcats.js +++ b/src/traces/parcats/parcats.js @@ -17,7 +17,6 @@ var tinycolor = require('tinycolor2'); var svgTextUtils = require('../../lib/svg_text_utils'); function performPlot(parcatsModels, graphDiv, layout, svg) { - var viewModels = parcatsModels.map(createParcatsViewModel.bind(0, graphDiv, layout)); // Get (potentially empty) parcatslayer selection with bound data to single element array @@ -388,7 +387,6 @@ function compareRawColor(a, b) { * @param {PathViewModel} d */ function mouseoverPath(d) { - if(!d.parcatsViewModel.dragDimension) { // We're not currently dragging @@ -596,7 +594,6 @@ function styleBandsNoHover(bandsSelection) { * @param {CategoryBandViewModel} catBandViewModel */ function selectPathsThroughCategoryBandColor(catBandViewModel) { - var allPaths = catBandViewModel.parcatsViewModel.pathSelection; var dimInd = catBandViewModel.categoryViewModel.model.dimensionInd; var catInd = catBandViewModel.categoryViewModel.model.categoryInd; @@ -619,7 +616,6 @@ function selectPathsThroughCategoryBandColor(catBandViewModel) { * */ function styleForCategoryHovermode(bandElement) { - // Get all bands in the current category var bandSel = d3.select(bandElement.parentNode).selectAll('rect.bandrect'); @@ -741,7 +737,6 @@ function createHoverLabelForCategoryHovermode(rootBBox, bandElement) { if(parcatsViewModel.dimensions.length > 1 && dimensionModel.displayInd === parcatsViewModel.dimensions.length - 1) { - // right most dimension hoverCenterX = rectBoundingBox.left; hoverLabelIdealAlign = 'left'; @@ -802,7 +797,6 @@ function createHoverLabelForCategoryHovermode(rootBBox, bandElement) { * */ function createHoverLabelForDimensionHovermode(rootBBox, bandElement) { - var allHoverlabels = []; d3.select(bandElement.parentNode.parentNode) @@ -826,7 +820,6 @@ function createHoverLabelForDimensionHovermode(rootBBox, bandElement) { * */ function createHoverLabelForColorHovermode(rootBBox, bandElement) { - var bandBoundingBox = bandElement.getBoundingClientRect(); // Models @@ -993,7 +986,6 @@ function mouseoverCategoryBand(bandViewModel) { * @param {CategoryBandViewModel} bandViewModel */ function mouseoutCategory(bandViewModel) { - var parcatsViewModel = bandViewModel.parcatsViewModel; if(!parcatsViewModel.dragDimension) { @@ -1012,7 +1004,6 @@ function mouseoutCategory(bandViewModel) { // Emit unhover event if(parcatsViewModel.hoverinfoItems.indexOf('skip') === -1) { - var hoveron = bandViewModel.parcatsViewModel.hoveron; var bandElement = this; @@ -1032,7 +1023,6 @@ function mouseoutCategory(bandViewModel) { * @param {DimensionViewModel} d */ function dragDimensionStart(d) { - // Check if dragging is supported if(d.parcatsViewModel.arrangement === 'fixed') { return; @@ -1057,7 +1047,6 @@ function dragDimensionStart(d) { if(-2 <= catMouseX && catMouseX <= catViewModel.width + 2 && -2 <= catMouseY && catMouseY <= catViewModel.height + 2) { - // Save off initial drag indexes for categories d.dragCategoryDisplayInd = catViewModel.model.displayInd; d.initialDragCategoryDisplayInds = d.model.categories.map(function(c) { @@ -1094,7 +1083,6 @@ function dragDimensionStart(d) { * @param {DimensionViewModel} d */ function dragDimension(d) { - // Check if dragging is supported if(d.parcatsViewModel.arrangement === 'fixed') { return; @@ -1115,7 +1103,6 @@ function dragDimension(d) { // Update category if(d.dragCategoryDisplayInd !== null) { - var dragCategory = dragDimension.categories[d.dragCategoryDisplayInd]; // Update dragY by dy @@ -1131,9 +1118,7 @@ function dragDimension(d) { // Check for overlap above if(catAbove !== undefined) { - if(categoryY < (catAbove.y + catAbove.height / 2.0)) { - // Swap display inds dragCategory.model.displayInd = catAbove.model.displayInd; catAbove.model.displayInd = catDisplayInd; @@ -1141,9 +1126,7 @@ function dragDimension(d) { } if(catBelow !== undefined) { - if((categoryY + dragCategory.height) > (catBelow.y + catBelow.height / 2.0)) { - // Swap display inds dragCategory.model.displayInd = catBelow.model.displayInd; catBelow.model.displayInd = catDisplayInd; @@ -1164,7 +1147,6 @@ function dragDimension(d) { if(prevDimension !== undefined) { if(dragDimension.model.dragX < (prevDimension.x + prevDimension.width)) { - // Swap display inds dragDimension.model.displayInd = prevDimension.model.displayInd; prevDimension.model.displayInd = dragDimInd; @@ -1173,7 +1155,6 @@ function dragDimension(d) { if(nextDimension !== undefined) { if((dragDimension.model.dragX + dragDimension.width) > nextDimension.x) { - // Swap display inds dragDimension.model.displayInd = nextDimension.model.displayInd; nextDimension.model.displayInd = d.dragDimensionDisplayInd; @@ -1199,7 +1180,6 @@ function dragDimension(d) { * @param {DimensionViewModel} d */ function dragDimensionEnd(d) { - // Check if dragging is supported if(d.parcatsViewModel.arrangement === 'fixed') { return; @@ -1241,7 +1221,6 @@ function dragDimensionEnd(d) { }); if(anyCatsReordered) { - // Sort a shallow copy of the category models by display index var sortedCategoryModels = d.model.categories.slice().sort( function(a, b) { return a.displayInd - b.displayInd; }); @@ -1330,7 +1309,6 @@ function getTraceIndex(parcatsViewModel) { * @param {boolean} hasTransition Whether to update element with transition */ function updateSvgPaths(parcatsViewModel, hasTransition) { - if(hasTransition === undefined) { hasTransition = false; } @@ -1355,7 +1333,6 @@ function updateSvgPaths(parcatsViewModel, hasTransition) { * @param {boolean} hasTransition Whether to update element with transition */ function updateSvgCategories(parcatsViewModel, hasTransition) { - if(hasTransition === undefined) { hasTransition = false; } @@ -1580,7 +1557,6 @@ function createParcatsViewModel(graphDiv, layout, wrappedParcatsModel) { * @return {string} */ function buildSvgPath(leftXPositions, pathYs, dimWidths, pathHeight, curvature) { - // Compute the x midpoint of each path segment var xRefPoints1 = []; var xRefPoints2 = []; @@ -1601,7 +1577,6 @@ function buildSvgPath(leftXPositions, pathYs, dimWidths, pathHeight, curvature) // Horizontal line to right edge for(d = 1; d < dimWidths.length; d++) { - // Curve to left edge of category svgD += 'C' + xRefPoints1[d - 1] + ',' + pathYs[d - 1] + ' ' + xRefPoints2[d - 1] + ',' + pathYs[d] + @@ -1620,7 +1595,6 @@ function buildSvgPath(leftXPositions, pathYs, dimWidths, pathHeight, curvature) svgD += 'l -' + dimWidths[dimWidths.length - 1] + ',0 '; for(d = dimWidths.length - 2; d >= 0; d--) { - // Curve to right edge of category svgD += 'C' + xRefPoints2[d] + ',' + (pathYs[d + 1] + pathHeight) + ' ' + xRefPoints1[d] + ',' + (pathYs[d] + pathHeight) + @@ -1644,7 +1618,6 @@ function buildSvgPath(leftXPositions, pathYs, dimWidths, pathHeight, curvature) * View model for trace */ function updatePathViewModels(parcatsViewModel) { - // Initialize an array of the y position of the top of the next path to be added to each category. // // nextYPositions[d][c] is the y position of the next path through category with index c of dimension with index d @@ -1696,7 +1669,6 @@ function updatePathViewModels(parcatsViewModel) { // Sort in ascending order by display index array pathModels.sort(function(v1, v2) { - // Build display inds for each path var sortArray1 = pathDisplayCategoryInds(v1); var sortArray2 = pathDisplayCategoryInds(v2); @@ -1824,7 +1796,6 @@ function updatePathViewModels(parcatsViewModel) { * View model for trace */ function updateDimensionViewModels(parcatsViewModel) { - // Compute dimension ordering var dimensionsIndInfo = parcatsViewModel.model.dimensions.map(function(d) { return {displayInd: d.displayInd, dimensionInd: d.dimensionInd}; @@ -1853,7 +1824,6 @@ function updateDimensionViewModels(parcatsViewModel) { * @return {DimensionViewModel} */ function createDimensionViewModel(parcatsViewModel, dimensionModel) { - // Compute dimension x position var categoryLabelPad = 40; var dimWidth = 16; diff --git a/src/traces/parcoords/axisbrush.js b/src/traces/parcoords/axisbrush.js index 85385c85bb8..a978734d528 100644 --- a/src/traces/parcoords/axisbrush.js +++ b/src/traces/parcoords/axisbrush.js @@ -365,7 +365,6 @@ function attachDragBehavior(selection) { function startAsc(a, b) { return a[0] - b[0]; } function renderAxisBrush(axisBrush) { - var background = axisBrush.selectAll('.background').data(repeat); background.enter() diff --git a/src/traces/parcoords/calc.js b/src/traces/parcoords/calc.js index 4f77081877a..8dbdb84d156 100644 --- a/src/traces/parcoords/calc.js +++ b/src/traces/parcoords/calc.js @@ -14,7 +14,6 @@ var Lib = require('../../lib'); var wrap = require('../../lib/gup').wrap; module.exports = function calc(gd, trace) { - for(var i = 0; i < trace.dimensions.length; i++) { trace.dimensions[i].values = convertTypedArray(trace.dimensions[i].values); } diff --git a/src/traces/parcoords/lines.js b/src/traces/parcoords/lines.js index fbd097f6f9f..6536bb42ed5 100644 --- a/src/traces/parcoords/lines.js +++ b/src/traces/parcoords/lines.js @@ -62,11 +62,9 @@ function clear(regl, x, y, width, height) { } function renderBlock(regl, glAes, renderState, blockLineCount, sampleCount, item) { - var rafKey = item.key; function render(blockNumber) { - var count; count = Math.min(blockLineCount, sampleCount - blockNumber * blockLineCount); diff --git a/src/traces/parcoords/parcoords.js b/src/traces/parcoords/parcoords.js index 8e4a23b014d..3c8cd815182 100644 --- a/src/traces/parcoords/parcoords.js +++ b/src/traces/parcoords/parcoords.js @@ -26,7 +26,6 @@ var lineLayerMaker = require('./lines'); function visible(dimension) { return !('visible' in dimension) || dimension.visible; } function dimensionExtent(dimension) { - var lo = dimension.range ? dimension.range[0] : Lib.aggNums(Math.min, null, dimension.values, dimension._length); var hi = dimension.range ? dimension.range[1] : Lib.aggNums(Math.max, null, dimension.values, dimension._length); @@ -102,7 +101,6 @@ function ordinalScale(dimension) { } function unitToColorScale(cscale) { - var colorStops = cscale.map(function(d) { return d[0]; }); var colorTuples = cscale.map(function(d) { return d3.rgb(d[1]); }); var prop = function(n) { return function(o) { return o[n]; }; }; @@ -184,7 +182,6 @@ function model(layout, d, i) { } function viewModel(state, callbacks, model) { - var width = model.width; var height = model.height; var dimensions = model.dimensions; @@ -338,7 +335,6 @@ function parcoordsInteractionState() { } module.exports = function(root, svg, parcoordsLineLayers, styledData, layout, callbacks) { - var state = parcoordsInteractionState(); var vm = styledData diff --git a/src/traces/parcoords/plot.js b/src/traces/parcoords/plot.js index 1644339c150..7d0137a429f 100644 --- a/src/traces/parcoords/plot.js +++ b/src/traces/parcoords/plot.js @@ -36,7 +36,6 @@ module.exports = function plot(gd, cdparcoords) { }); var filterChanged = function(i, originalDimensionIndex, newRanges) { - // Have updated `constraintrange` data on `gd.data` and raise `Plotly.restyle` event // without having to incur heavy UI blocking due to an actual `Plotly.restyle` call @@ -83,7 +82,6 @@ module.exports = function plot(gd, cdparcoords) { }; var axesMoved = function(i, visibleIndices) { - // Have updated order data on `gd.data` and raise `Plotly.restyle` event // without having to incur heavy UI blocking due to an actual `Plotly.restyle` call diff --git a/src/traces/pie/plot.js b/src/traces/pie/plot.js index 8ca0f20f1ba..3fbebb66aef 100644 --- a/src/traces/pie/plot.js +++ b/src/traces/pie/plot.js @@ -103,7 +103,6 @@ function plot(gd, cdpie) { } else slicePath.attr('d', outerCircle); } else { - var outerArc = arc(pt.px0, pt.px1, true, 1); if(hole) { @@ -459,7 +458,6 @@ function determineOutsideTextFont(trace, pt, layoutFont) { function determineInsideTextFont(trace, pt, layoutFont) { var customColor = helpers.castOption(trace.insidetextfont.color, pt.pts); if(!customColor && trace._input.textfont) { - // Why not simply using trace.textfont? Because if not set, it // defaults to layout.font which has a default color. But if // textfont.color and insidetextfont.color don't supply a value, @@ -724,7 +722,6 @@ function scootLabels(quadrants, trace) { newExtraY = otherOuterY - thisInnerY - thisPt.labelExtraY; if(newExtraY * yDiffSign > 0) thisPt.labelExtraY += newExtraY; - } else if((thisOuterY + thisPt.labelExtraY - thisSliceOuterY) * yDiffSign > 0) { // farther from the equator - happens after we've done all the // vertical moving we're going to do diff --git a/src/traces/pointcloud/convert.js b/src/traces/pointcloud/convert.js index 497fcc96c9c..dc774ee82e1 100644 --- a/src/traces/pointcloud/convert.js +++ b/src/traces/pointcloud/convert.js @@ -94,23 +94,18 @@ proto.updateFast = function(options) { var xx, yy, i; if(xy) { - positions = xy; // dividing xy.length by 2 and truncating to integer if xy.length was not even len = xy.length >>> 1; if(userBounds) { - bounds[0] = options.xbounds[0]; bounds[2] = options.xbounds[1]; bounds[1] = options.ybounds[0]; bounds[3] = options.ybounds[1]; - } else { - for(i = 0; i < len; i++) { - xx = positions[i * 2]; yy = positions[i * 2 + 1]; @@ -119,27 +114,18 @@ proto.updateFast = function(options) { if(yy < bounds[1]) bounds[1] = yy; if(yy > bounds[3]) bounds[3] = yy; } - } if(index) { - idToIndex = index; - } else { - idToIndex = new Int32Array(len); for(i = 0; i < len; i++) { - idToIndex[i] = i; - } - } - } else { - len = x.length; positions = new Float32Array(2 * len); @@ -159,7 +145,6 @@ proto.updateFast = function(options) { if(yy < bounds[1]) bounds[1] = yy; if(yy > bounds[3]) bounds[3] = yy; } - } this.idToIndex = idToIndex; diff --git a/src/traces/sankey/plot.js b/src/traces/sankey/plot.js index 6de168a3ed3..c10e0866851 100644 --- a/src/traces/sankey/plot.js +++ b/src/traces/sankey/plot.js @@ -69,7 +69,6 @@ function nodeNonHoveredStyle(sankeyNode, d, sankey) { } function linkHoveredStyle(d, sankey, visitNodes, sankeyLink) { - var label = sankeyLink.datum().link.label; sankeyLink.style('fill-opacity', function(l) { @@ -98,7 +97,6 @@ function linkHoveredStyle(d, sankey, visitNodes, sankeyLink) { } function linkNonHoveredStyle(d, sankey, visitNodes, sankeyLink) { - var label = sankeyLink.datum().link.label; sankeyLink.style('fill-opacity', function(d) {return d.tinyColorAlpha;}); @@ -146,7 +144,6 @@ module.exports = function plot(gd, calcData) { points: [d.link] }); } - }; var sourceLabel = _(gd, 'source:') + ' '; diff --git a/src/traces/sankey/render.js b/src/traces/sankey/render.js index 2c98e761ccf..ab4a330c8f5 100644 --- a/src/traces/sankey/render.js +++ b/src/traces/sankey/render.js @@ -227,7 +227,6 @@ function sankeyModel(layout, d, traceIndex) { // Change node's x position to align it with its column dx = colX - node.x0; node.x0 += dx, node.x1 += dx; - } return columns; } diff --git a/src/traces/scatter/arrays_to_calcdata.js b/src/traces/scatter/arrays_to_calcdata.js index d76634627ab..ee83c3aac31 100644 --- a/src/traces/scatter/arrays_to_calcdata.js +++ b/src/traces/scatter/arrays_to_calcdata.js @@ -14,7 +14,6 @@ var Lib = require('../../lib'); // arrayOk attributes, merge them into calcdata array module.exports = function arraysToCalcdata(cd, trace) { - // so each point knows which index it originally came from for(var i = 0; i < cd.length; i++) cd[i].i = i; diff --git a/src/traces/scatter/calc.js b/src/traces/scatter/calc.js index 28f6f16db70..d9aefebf385 100644 --- a/src/traces/scatter/calc.js +++ b/src/traces/scatter/calc.js @@ -244,7 +244,6 @@ function calcMarkerSize(trace, serieslen) { sizeOut[i] = markerTrans(s[i]); } return sizeOut; - } else { return markerTrans(marker.size); } diff --git a/src/traces/scatter/hover.js b/src/traces/scatter/hover.js index c1c9410eb5e..754e2da0a37 100644 --- a/src/traces/scatter/hover.js +++ b/src/traces/scatter/hover.js @@ -61,7 +61,6 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { // skip the rest (for this trace) if we didn't find a close point if(pointData.index !== false) { - // the closest data point var di = cd[pointData.index]; var xc = xa.c2p(di.x, true); diff --git a/src/traces/scatter/plot.js b/src/traces/scatter/plot.js index 837ade8a9ef..c10567bd30b 100644 --- a/src/traces/scatter/plot.js +++ b/src/traces/scatter/plot.js @@ -183,7 +183,6 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition ownFillEl3 = trace._ownFill; if(subTypes.hasLines(trace) || trace.fill !== 'none') { - if(tonext) { // This tells .style which trace to use for fill information: tonext.datum(cdscatter); diff --git a/src/traces/scatter3d/convert.js b/src/traces/scatter3d/convert.js index a8bb483ffac..92ee32571a4 100644 --- a/src/traces/scatter3d/convert.js +++ b/src/traces/scatter3d/convert.js @@ -127,7 +127,6 @@ function calculateErrorParams(errors) { capSize[i] = e.width / 2; // ballpark rescaling color[i] = str2RgbaArray(e.color); lineWidth[i] = e.thickness; - } return {capSize: capSize, color: color, lineWidth: lineWidth}; @@ -197,7 +196,6 @@ function formatParam(paramIn, len, calculate, dflt, extraFn) { if(paramIn[i] === undefined) paramOut[i] = dflt; else paramOut[i] = calculate(paramIn[i], extraFn); } - } else paramOut = calculate(paramIn, Lib.identity); diff --git a/src/traces/scatter3d/defaults.js b/src/traces/scatter3d/defaults.js index 0b20888395a..14de88e49ad 100644 --- a/src/traces/scatter3d/defaults.js +++ b/src/traces/scatter3d/defaults.js @@ -20,7 +20,6 @@ var handleTextDefaults = require('../scatter/text_defaults'); var attributes = require('./attributes'); module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) { - function coerce(attr, dflt) { return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); } diff --git a/src/traces/scatterpolar/hover.js b/src/traces/scatterpolar/hover.js index ea52df6b1ee..7e1afa92116 100644 --- a/src/traces/scatterpolar/hover.js +++ b/src/traces/scatterpolar/hover.js @@ -37,7 +37,6 @@ function hoverPoints(pointData, xval, yval, hovermode) { } function makeHoverPointText(cdi, trace, subplot, pointData) { - var radialAxis = subplot.radialAxis; var angularAxis = subplot.angularAxis; radialAxis._hovertitle = 'r'; diff --git a/src/traces/sunburst/plot.js b/src/traces/sunburst/plot.js index 63ee8646baa..c6b10d844e1 100644 --- a/src/traces/sunburst/plot.js +++ b/src/traces/sunburst/plot.js @@ -769,7 +769,6 @@ function determineInsideTextFont(trace, pt, layoutFont) { var customColor = Lib.castOption(trace, ptNumber, 'insidetextfont.color'); if(!customColor && trace._input.textfont) { - // Why not simply using trace.textfont? Because if not set, it // defaults to layout.font which has a default color. But if // textfont.color and insidetextfont.color don't supply a value, diff --git a/src/traces/surface/convert.js b/src/traces/surface/convert.js index 74d08837ce3..163a40df78d 100644 --- a/src/traces/surface/convert.js +++ b/src/traces/surface/convert.js @@ -74,7 +74,6 @@ proto.getZat = function(a, b, calendar, axis) { proto.handlePick = function(selection) { if(selection.object === this.surface) { - var xRatio = (selection.data.index[0] - 1) / this.dataScaleX - 1; var yRatio = (selection.data.index[1] - 1) / this.dataScaleY - 1; @@ -318,7 +317,6 @@ proto.estimateScale = function(resSrc, axis) { }; proto.refineCoords = function(coords) { - var scaleW = this.dataScaleX; var scaleH = this.dataScaleY; @@ -334,7 +332,6 @@ proto.refineCoords = function(coords) { var padImg = ndarray(new Float32Array(padWidth * padHeight), [padWidth, padHeight]); for(var i = 0; i < coords.length; ++i) { - this.surface.padField(padImg, coords[i]); var scaledImg = ndarray(new Float32Array(newWidth * newHeight), [newWidth, newHeight]); diff --git a/src/traces/surface/defaults.js b/src/traces/surface/defaults.js index 5f883f8fd65..f99e89fe343 100644 --- a/src/traces/surface/defaults.js +++ b/src/traces/surface/defaults.js @@ -64,7 +64,6 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout var dims = ['x', 'y', 'z']; for(i = 0; i < 3; ++i) { - var contourDim = 'contours.' + dims[i]; var show = coerce(contourDim + '.show'); var highlight = coerce(contourDim + '.highlight'); diff --git a/src/traces/table/data_preparation_helper.js b/src/traces/table/data_preparation_helper.js index 7434762ce01..271a8424be7 100644 --- a/src/traces/table/data_preparation_helper.js +++ b/src/traces/table/data_preparation_helper.js @@ -155,7 +155,6 @@ function makeRowBlock(anchorToRowBlock, auxiliary) { } function makeAnchorToRowBlock(rowHeights, minimumFillHeight) { - var anchorToRowBlock = {}; var currentRowHeight; var currentAnchor = 0; diff --git a/src/traces/table/plot.js b/src/traces/table/plot.js index 22b17ec2c78..10ade457bf5 100644 --- a/src/traces/table/plot.js +++ b/src/traces/table/plot.js @@ -264,7 +264,6 @@ function flatData(selection) { } function renderScrollbarKit(tableControlView, gd, bypassVisibleBar) { - function calcTotalHeight(d) { var blocks = d.rowBlocks; return firstRowAnchor(blocks, blocks.length - 1) + (blocks.length ? rowsHeight(blocks[blocks.length - 1], Infinity) : 1); @@ -418,7 +417,6 @@ function renderColumnCellTree(gd, tableControlView, columnBlock, allColumnBlock) } function renderColumnCells(columnBlock) { - var columnCells = columnBlock.selectAll('.' + c.cn.columnCells) .data(gup.repeat, gup.keyFun); @@ -433,7 +431,6 @@ function renderColumnCells(columnBlock) { } function renderColumnCell(columnCells) { - var columnCell = columnCells.selectAll('.' + c.cn.columnCell) .data(splitData.splitToCells, function(d) {return d.keyWithinBlock;}); @@ -448,7 +445,6 @@ function renderColumnCell(columnCells) { } function renderCellRect(columnCell) { - var cellRect = columnCell.selectAll('.' + c.cn.cellRect) .data(gup.repeat, function(d) {return d.keyWithinBlock;}); @@ -460,7 +456,6 @@ function renderCellRect(columnCell) { } function renderCellText(cellTextHolder) { - var cellText = cellTextHolder.selectAll('.' + c.cn.cellText) .data(gup.repeat, function(d) {return d.keyWithinBlock;}); @@ -474,7 +469,6 @@ function renderCellText(cellTextHolder) { } function renderCellTextHolder(columnCell) { - var cellTextHolder = columnCell.selectAll('.' + c.cn.cellTextHolder) .data(gup.repeat, function(d) {return d.keyWithinBlock;}); @@ -524,7 +518,6 @@ function sizeAndStyleRect(cellRect) { function populateCellText(cellText, tableControlView, allColumnBlock, gd) { cellText .text(function(d) { - var col = d.column.specIndex; var row = d.rowNumber; @@ -567,7 +560,6 @@ function populateCellText(cellText, tableControlView, allColumnBlock, gd) { return d.needsConvertToTspans ? 0 : '0.75em'; }) .each(function(d) { - var element = this; var selection = d3.select(element); @@ -645,12 +637,10 @@ function headerHeight(d) { } function findPagesAndCacheHeights(blocks, scrollY, scrollHeight) { - var pages = []; var pTop = 0; for(var blockIndex = 0; blockIndex < blocks.length; blockIndex++) { - var block = blocks[blockIndex]; var blockRows = block.rows; var rowsHeight = 0; @@ -814,7 +804,6 @@ function updateYPositionMaker(columnBlock, element, tableControlView, gd, d) { var increase = finalHeight - l.rows[rowIndex].rowHeight; if(increase) { - // current row height increased l.rows[rowIndex].rowHeight = finalHeight; diff --git a/src/traces/waterfall/calc.js b/src/traces/waterfall/calc.js index d22c1121a86..6cb7ded67ba 100644 --- a/src/traces/waterfall/calc.js +++ b/src/traces/waterfall/calc.js @@ -45,7 +45,6 @@ module.exports = function calc(gd, trace) { var hasTotals = false; for(var i = 0; i < serieslen; i++) { - var amount = size[i] || 0; var connectToNext = false; diff --git a/src/transforms/filter.js b/src/transforms/filter.js index 245d2b230eb..1d2c62dbf8c 100644 --- a/src/transforms/filter.js +++ b/src/transforms/filter.js @@ -254,7 +254,6 @@ function getFilterFunc(opts, d2c, targetCalendar) { } switch(operation) { - case '=': return function(v) { return d2cTarget(v) === coercedValue; }; diff --git a/tasks/docker.js b/tasks/docker.js index a767caa587c..54663fb7294 100644 --- a/tasks/docker.js +++ b/tasks/docker.js @@ -8,7 +8,6 @@ var arg = process.argv[2]; var msg, cmd, cb, errorCb; switch(arg) { - case 'pull': msg = 'Pulling latest docker image'; cmd = 'docker pull ' + constants.testContainerImage; diff --git a/tasks/header.js b/tasks/header.js index ccb9b41e065..620f330e178 100644 --- a/tasks/header.js +++ b/tasks/header.js @@ -53,7 +53,6 @@ function updateHeadersInSrcFiles() { glob('{' + srcGlob + ',' + libGlob + '}', function(err, files) { files.forEach(function(file) { fs.readFile(file, 'utf-8', function(err, code) { - // parse through code string while keeping track of comments var comments = []; falafel(code, {onComment: comments, locations: true}, function() {}); diff --git a/tasks/pretest.js b/tasks/pretest.js index 28fcf770f96..6a6b724dfef 100644 --- a/tasks/pretest.js +++ b/tasks/pretest.js @@ -21,7 +21,6 @@ function makeCredentialsFile() { // Make artifact folders for image tests function makeTestImageFolders() { - function makeOne(folderPath, info) { if(!common.doesDirExist(folderPath)) { fs.mkdirSync(folderPath); diff --git a/tasks/pull_date_format.js b/tasks/pull_date_format.js index ffda6c1e2e8..fafc9fef35a 100644 --- a/tasks/pull_date_format.js +++ b/tasks/pull_date_format.js @@ -148,7 +148,6 @@ function shortenArrays(s) { var maxLen = 91; // max line length plus one for the initial \n. return s.replace(/(\n.+\[)\n([^\]]+)\n(\s*)\]/g, function(wholeMatch, prefix, arrayStr, bracketSpaces) { - var parts = arrayStr.trim().split(/,\n\s*/); var singleLine = prefix + parts.join(', ') + ']'; diff --git a/test/image/compare_pixels_test.js b/test/image/compare_pixels_test.js index 8ed7fa7ff03..4a75b24c55a 100644 --- a/test/image/compare_pixels_test.js +++ b/test/image/compare_pixels_test.js @@ -206,7 +206,6 @@ function comparePixels(mockName, cb) { } function checkImage() { - // baseline image must be generated first if(!common.doesFileExist(imagePaths.baseline)) { var err = new Error('baseline image not found'); diff --git a/test/jasmine/assets/custom_assertions.js b/test/jasmine/assets/custom_assertions.js index b33cbe3aeea..c6018f02c4c 100644 --- a/test/jasmine/assets/custom_assertions.js +++ b/test/jasmine/assets/custom_assertions.js @@ -125,7 +125,6 @@ exports.assertHoverLabelContent = function(expectation, msg) { expect(g.attr('transform').match(reRotate)) .negateIf(expectation.isRotated) .toBe(null, ptMsg + ' should be rotated'); - } } else if(ptCnt > 1) { if(!Array.isArray(expectation.nums) || !Array.isArray(expectation.name)) { @@ -234,7 +233,6 @@ exports.assertClip = function(sel, isClipped, size, msg) { .toBe(null, msg + ' clip path ' + '(item ' + i + ')'); } }); - }; exports.assertNodeDisplay = function(sel, expectation, msg) { diff --git a/test/jasmine/assets/timed_click.js b/test/jasmine/assets/timed_click.js index b8806f2bd52..f9f4036673c 100644 --- a/test/jasmine/assets/timed_click.js +++ b/test/jasmine/assets/timed_click.js @@ -4,14 +4,10 @@ module.exports = function click(x, y) { mouseEvent('mousemove', x, y, {buttons: 0}); window.setTimeout(function() { - mouseEvent('mousedown', x, y, {buttons: 1}); window.setTimeout(function() { - mouseEvent('mouseup', x, y, {buttons: 0}); - }, 50); - }, 150); }; diff --git a/test/jasmine/bundle_tests/finance_test.js b/test/jasmine/bundle_tests/finance_test.js index 33f26511b92..aaa0fe2ec07 100644 --- a/test/jasmine/bundle_tests/finance_test.js +++ b/test/jasmine/bundle_tests/finance_test.js @@ -28,7 +28,6 @@ describe('Bundle with finance trace type', function() { }); it('should graph ohlc and candlestick traces', function(done) { - Plotly.plot(createGraphDiv(), mock.data, mock.layout).then(function() { var gSubplot = d3.select('g.cartesianlayer'); @@ -38,6 +37,5 @@ describe('Bundle with finance trace type', function() { destroyGraphDiv(); done(); }); - }); }); diff --git a/test/jasmine/bundle_tests/ie9_test.js b/test/jasmine/bundle_tests/ie9_test.js index 1d215fd40af..e35c73bc160 100644 --- a/test/jasmine/bundle_tests/ie9_test.js +++ b/test/jasmine/bundle_tests/ie9_test.js @@ -39,5 +39,4 @@ describe('Bundle with IE9 supported trace types:', function() { Plotly.plot(gd, data).then(done); }); - }); diff --git a/test/jasmine/bundle_tests/plotschema_test.js b/test/jasmine/bundle_tests/plotschema_test.js index e9c090b1ea9..d835f789cfa 100644 --- a/test/jasmine/bundle_tests/plotschema_test.js +++ b/test/jasmine/bundle_tests/plotschema_test.js @@ -71,7 +71,6 @@ describe('plot schema', function() { } } ); - }); it('all attributes should only have valid `role`', function() { @@ -371,7 +370,6 @@ describe('plot schema', function() { it('should prune unsupported global-level trace attributes', function() { expect(Plotly.PlotSchema.get().traces.sankey.attributes.hoverinfo.flags.length).toBe(0); }); - }); describe('getTraceValObject', function() { diff --git a/test/jasmine/tests/animate_test.js b/test/jasmine/tests/animate_test.js index 621378aa67b..933618c4aa3 100644 --- a/test/jasmine/tests/animate_test.js +++ b/test/jasmine/tests/animate_test.js @@ -554,7 +554,6 @@ describe('Test animate API', function() { }).then(function() { expect(frames).toEqual(['frame0', 'frame1', null, null]); }).catch(failTest).then(done); - }); }); @@ -569,7 +568,6 @@ describe('Test animate API', function() { // Transition timing: expect(Plots.transition.calls.argsFor(0)[5].duration).toEqual(50); - }).catch(failTest).then(done); }); @@ -585,7 +583,6 @@ describe('Test animate API', function() { // Transition timing: expect(Plots.transition.calls.argsFor(0)[5].duration).toEqual(50); expect(Plots.transition.calls.argsFor(1)[5].duration).toEqual(40); - }).catch(failTest).then(done); }); }); @@ -782,7 +779,6 @@ describe('non-animatable fallback', function() { }).then(function() { expect(gd.data[0].y).toEqual([6, 4, 5]); }).catch(failTest).then(done); - }); }); diff --git a/test/jasmine/tests/annotations_test.js b/test/jasmine/tests/annotations_test.js index 8859520e5d0..7f52f0e688b 100644 --- a/test/jasmine/tests/annotations_test.js +++ b/test/jasmine/tests/annotations_test.js @@ -22,7 +22,6 @@ describe('Test annotations', function() { 'use strict'; describe('supplyLayoutDefaults', function() { - function _supply(layoutIn, layoutOut) { layoutOut = layoutOut || {}; layoutOut._has = Plots._hasPlotType.bind(layoutOut); @@ -356,7 +355,6 @@ describe('annotations relayout', function() { }) .catch(failTest) .then(done); - }); it('can update several annotations and add and delete in one call', function(done) { @@ -414,7 +412,6 @@ describe('annotations relayout', function() { expect(fullStr.indexOf('the cat')).toBe(-1); expect(Loggers.warn).not.toHaveBeenCalled(); - }) .catch(failTest) .then(done); @@ -605,7 +602,6 @@ describe('annotations log/linear axis changes', function() { .catch(failTest) .then(done); }); - }); describe('annotations autorange', function() { @@ -1384,7 +1380,6 @@ describe('annotation effects', function() { } it('should register clicks and show hover effects on the text box only', function(done) { - function assertHoverLabel(pos, text, msg) { return new Promise(function(resolve) { mouseEvent('mousemove', pos[0], pos[1]); @@ -1590,7 +1585,6 @@ describe('animating annotations', function() { afterEach(destroyGraphDiv); it('updates annotations when no axis update present', function(done) { - function assertAnnotations(expected) { var texts = Plotly.d3.select(gd).selectAll('.annotation .annotation-text'); expect(expected.length).toEqual(texts.size()); @@ -1651,7 +1645,6 @@ describe('animating annotations', function() { 'rgb(172, 172, 172)' ]); assertImages([img2]); - }).catch(failTest).then(done); }); }); diff --git a/test/jasmine/tests/axes_test.js b/test/jasmine/tests/axes_test.js index 1e2b528d3e4..4409fad89b5 100644 --- a/test/jasmine/tests/axes_test.js +++ b/test/jasmine/tests/axes_test.js @@ -1295,7 +1295,6 @@ describe('Test axes', function() { }); describe('categoryorder', function() { - var gd; beforeEach(function() { @@ -1305,7 +1304,6 @@ describe('Test axes', function() { afterEach(destroyGraphDiv); describe('setting, or not setting categoryorder if it is not explicitly declared', function() { - it('should set categoryorder to default if categoryorder and categoryarray are not supplied', function() { Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], {xaxis: {type: 'category'}}); expect(gd._fullLayout.xaxis.categoryorder).toBe('trace'); @@ -1331,11 +1329,9 @@ describe('Test axes', function() { expect(gd._fullLayout.yaxis.categoryorder).toBe('trace'); expect(gd._fullLayout.yaxis.categorarray).toBe(undefined); }); - }); describe('setting categoryorder to "array"', function() { - it('should leave categoryorder on "array" if it is supplied', function() { Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: {type: 'category', categoryorder: 'array', categoryarray: ['b', 'a', 'd', 'e', 'c']} @@ -1359,11 +1355,9 @@ describe('Test axes', function() { expect(gd._fullLayout.xaxis.categoryorder).toBe('trace'); expect(gd._fullLayout.xaxis.categorarray).toBe(undefined); }); - }); describe('do not set categoryorder to "array" if list exists but empty', function() { - it('should switch categoryorder to default if list is not supplied', function() { Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: {type: 'category', categoryorder: 'array', categoryarray: []} @@ -1382,7 +1376,6 @@ describe('Test axes', function() { }); describe('do NOT set categoryorder to "array" if it has some other proper value', function() { - it('should use specified categoryorder if it is supplied even if categoryarray exists', function() { Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: {type: 'category', categoryorder: 'trace', categoryarray: ['b', 'a', 'd', 'e', 'c']} @@ -1406,11 +1399,9 @@ describe('Test axes', function() { expect(gd._fullLayout.xaxis.categoryorder).toBe('category descending'); expect(gd._fullLayout.xaxis.categoryarray).toBe(undefined); }); - }); describe('setting categoryorder to the default if the value is unexpected', function() { - it('should switch categoryorder to "trace" if mode is supplied but invalid', function() { Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: {type: 'category', categoryorder: 'invalid value'} @@ -1426,9 +1417,7 @@ describe('Test axes', function() { expect(gd._fullLayout.xaxis.categoryorder).toBe('array'); expect(gd._fullLayout.xaxis.categoryarray).toEqual(['b', 'a', 'd', 'e', 'c']); }); - }); - }); describe('handleTickDefaults', function() { @@ -1678,7 +1667,6 @@ describe('Test axes', function() { expect(axOut.tick0).toBe(0); expect(axOut.dtick).toBe(1); }); - }); it('should set tickvals and ticktext iff tickmode=array', function() { @@ -1847,7 +1835,6 @@ describe('Test axes', function() { expect(listFunc(gd, 'x')) .toEqual([{ _id: 'x2' }, { _id: 'x', _thisIs3d: true }]); }); - }); describe('getSubplots', function() { @@ -2901,7 +2888,6 @@ describe('Test axes', function() { }); describe('autoBin', function() { - function _autoBin(x, ax, nbins) { ax._categories = []; ax._categoriesMap = {}; diff --git a/test/jasmine/tests/bar_test.js b/test/jasmine/tests/bar_test.js index f30ee24c7cc..7076752053f 100644 --- a/test/jasmine/tests/bar_test.js +++ b/test/jasmine/tests/bar_test.js @@ -2123,7 +2123,6 @@ describe('bar hover', function() { }); describe('text labels', function() { - it('should show \'hovertext\' items when present, \'text\' if not', function(done) { gd = createGraphDiv(); @@ -2186,7 +2185,6 @@ describe('bar hover', function() { }); describe('with special width/offset combinations', function() { - beforeEach(function() { gd = createGraphDiv(); }); diff --git a/test/jasmine/tests/box_test.js b/test/jasmine/tests/box_test.js index 86b2bc6e552..d169d661093 100644 --- a/test/jasmine/tests/box_test.js +++ b/test/jasmine/tests/box_test.js @@ -85,7 +85,6 @@ describe('Test boxes supplyDefaults', function() { }; supplyDefaults(traceIn, traceOut, defaultColor, {}); expect(traceOut.orientation).toBe('h'); - }); it('should inherit layout.calendar', function() { diff --git a/test/jasmine/tests/calcdata_test.js b/test/jasmine/tests/calcdata_test.js index c9dbfd3180b..0f6ae376d68 100644 --- a/test/jasmine/tests/calcdata_test.js +++ b/test/jasmine/tests/calcdata_test.js @@ -5,7 +5,6 @@ var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); describe('calculated data and points', function() { - var gd; beforeEach(function() { @@ -15,7 +14,6 @@ describe('calculated data and points', function() { afterEach(destroyGraphDiv); describe('connectGaps', function() { - it('should exclude null and undefined points when false', function() { Plotly.plot(gd, [{ x: [1, 2, 3, undefined, 5], y: [1, null, 3, 4, 5]}], {}); @@ -32,11 +30,8 @@ describe('calculated data and points', function() { }); describe('category ordering', function() { - describe('default category ordering reified', function() { - it('should output categories in the given order by default', function() { - Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: { type: 'category' }}); @@ -49,7 +44,6 @@ describe('calculated data and points', function() { }); it('should output categories in the given order if `trace` order is explicitly specified', function() { - Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: { type: 'category', categoryorder: 'trace' @@ -68,9 +62,7 @@ describe('calculated data and points', function() { }); describe('domain alphanumerical category ordering', function() { - it('should output categories in ascending domain alphanumerical order', function() { - Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: { type: 'category', categoryorder: 'category ascending' @@ -84,7 +76,6 @@ describe('calculated data and points', function() { }); it('should output categories in descending domain alphanumerical order', function() { - Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: { type: 'category', categoryorder: 'category descending' @@ -98,7 +89,6 @@ describe('calculated data and points', function() { }); it('should output categories in ascending domain alphanumerical order even if categories are all numbers', function() { - Plotly.plot(gd, [{x: [3, 1, 5, 2, 4], y: [15, 11, 12, 13, 14]}], { xaxis: { type: 'category', categoryorder: 'category ascending' @@ -112,7 +102,6 @@ describe('calculated data and points', function() { }); it('should output categories in categoryorder order even if category array is defined', function() { - Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: { type: 'category', categoryorder: 'category ascending', @@ -127,7 +116,6 @@ describe('calculated data and points', function() { }); it('should output categories in ascending domain alphanumerical order, excluding undefined', function() { - Plotly.plot(gd, [{x: ['c', undefined, 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: { type: 'category', categoryorder: 'category ascending' @@ -174,9 +162,7 @@ describe('calculated data and points', function() { }); describe('explicit category ordering', function() { - it('should output categories in explicitly supplied order, independent of trace order', function() { - Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: { type: 'category', categoryorder: 'array', @@ -191,7 +177,6 @@ describe('calculated data and points', function() { }); it('should output categories in explicitly supplied order even if category values are all numbers', function() { - Plotly.plot(gd, [{x: [3, 1, 5, 2, 4], y: [15, 11, 12, 13, 14]}], { xaxis: { type: 'category', categoryorder: 'array', @@ -206,7 +191,6 @@ describe('calculated data and points', function() { }); it('should output categories in explicitly supplied order, independent of trace order, pruned', function() { - Plotly.plot(gd, [{x: ['c', undefined, 'e', 'b', 'd'], y: [15, 11, 12, null, 14]}], { xaxis: { type: 'category', categoryorder: 'array', @@ -221,7 +205,6 @@ describe('calculated data and points', function() { }); it('should output categories in explicitly supplied order even if not all categories are present', function() { - Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: { type: 'category', categoryorder: 'array', @@ -236,7 +219,6 @@ describe('calculated data and points', function() { }); it('should output categories in explicitly supplied order even if some missing categories were at the beginning or end of categoryarray', function() { - Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: { type: 'category', categoryorder: 'array', @@ -259,7 +241,6 @@ describe('calculated data and points', function() { }); it('should output categories in explicitly supplied order even if some missing categories were at the beginning or end of categoryarray', function() { - // The auto-range feature currently eliminates unutilized category ticks on the left/right edge // BUT keeps it if a data point with null is added; test is almost identical to the one above // except that it explicitly adds an axis tick for y @@ -283,7 +264,6 @@ describe('calculated data and points', function() { }); it('should output categories in explicitly supplied order even if not all categories are present, and should interact with a null value orthogonally', function() { - Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, null, 12, 13, 14]}], { xaxis: { type: 'category', categoryorder: 'array', @@ -298,7 +278,6 @@ describe('calculated data and points', function() { }); it('should output categories in explicitly supplied order first, if not all categories are covered', function() { - Plotly.plot(gd, [{x: ['c', 'a', 'e', 'b', 'd'], y: [15, 11, 12, 13, 14]}], { xaxis: { type: 'category', categoryorder: 'array', @@ -319,9 +298,7 @@ describe('calculated data and points', function() { }); describe('ordering tests in the presence of multiple traces - mutually exclusive', function() { - it('baseline testing for the unordered, disjunct case', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Switch', 'Plug', 'Cord', 'Fuse', 'Bulb']; var x3 = ['Pump', 'Leak', 'Seals']; @@ -348,7 +325,6 @@ describe('calculated data and points', function() { }); it('category order follows the trace order (even if categoryarray is specified)', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Switch', 'Plug', 'Cord', 'Fuse', 'Bulb']; var x3 = ['Pump', 'Leak', 'Seals']; @@ -379,7 +355,6 @@ describe('calculated data and points', function() { }); it('category order is category ascending (even if categoryarray is specified)', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Switch', 'Plug', 'Cord', 'Fuse', 'Bulb']; var x3 = ['Pump', 'Leak', 'Seals']; @@ -411,7 +386,6 @@ describe('calculated data and points', function() { }); it('category order is category descending (even if categoryarray is specified)', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Switch', 'Plug', 'Cord', 'Fuse', 'Bulb']; var x3 = ['Pump', 'Leak', 'Seals']; @@ -443,7 +417,6 @@ describe('calculated data and points', function() { }); it('category order follows categoryarray', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Switch', 'Plug', 'Cord', 'Fuse', 'Bulb']; var x3 = ['Pump', 'Leak', 'Seals']; @@ -475,9 +448,7 @@ describe('calculated data and points', function() { }); describe('ordering tests in the presence of multiple traces - partially overlapping', function() { - it('baseline testing for the unordered, partially overlapping case', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Switch', 'Plug', 'Cord', 'Fuse', 'Bulb']; var x3 = ['Pump', 'Leak', 'Bearing', 'Seals']; @@ -505,7 +476,6 @@ describe('calculated data and points', function() { }); it('category order follows the trace order (even if categoryarray is specified)', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Switch', 'Plug', 'Cord', 'Fuse', 'Bulb']; var x3 = ['Pump', 'Leak', 'Bearing', 'Seals']; @@ -537,7 +507,6 @@ describe('calculated data and points', function() { }); it('category order is category ascending (even if categoryarray is specified)', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Switch', 'Plug', 'Cord', 'Fuse', 'Bulb']; var x3 = ['Pump', 'Leak', 'Bearing', 'Seals']; @@ -570,7 +539,6 @@ describe('calculated data and points', function() { }); it('category order is category descending (even if categoryarray is specified)', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Switch', 'Plug', 'Cord', 'Fuse', 'Bulb']; var x3 = ['Pump', 'Leak', 'Bearing', 'Seals']; @@ -603,7 +571,6 @@ describe('calculated data and points', function() { }); it('category order follows categoryarray', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Switch', 'Plug', 'Cord', 'Fuse', 'Bulb']; var x3 = ['Pump', 'Leak', 'Bearing', 'Seals']; @@ -636,9 +603,7 @@ describe('calculated data and points', function() { }); describe('ordering tests in the presence of multiple traces - fully overlapping', function() { - it('baseline testing for the unordered, fully overlapping case', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Bearing', 'Gear', 'Motor']; var x3 = ['Motor', 'Gear', 'Bearing']; @@ -663,7 +628,6 @@ describe('calculated data and points', function() { }); it('category order follows the trace order (even if categoryarray is specified)', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Bearing', 'Gear', 'Motor']; var x3 = ['Motor', 'Gear', 'Bearing']; @@ -692,7 +656,6 @@ describe('calculated data and points', function() { }); it('category order is category ascending (even if categoryarray is specified)', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Bearing', 'Gear', 'Motor']; var x3 = ['Motor', 'Gear', 'Bearing']; @@ -722,7 +685,6 @@ describe('calculated data and points', function() { }); it('category order is category descending (even if categoryarray is specified)', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Bearing', 'Gear', 'Motor']; var x3 = ['Motor', 'Gear', 'Bearing']; @@ -752,7 +714,6 @@ describe('calculated data and points', function() { }); it('category order follows categoryarray', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Bearing', 'Gear', 'Motor']; var x3 = ['Motor', 'Gear', 'Bearing']; @@ -783,7 +744,6 @@ describe('calculated data and points', function() { }); it('category order follows categoryarray even if data is sparse', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Bearing', 'Gear', 'Motor']; var x3 = ['Motor', 'Gear', 'Bearing']; @@ -815,9 +775,7 @@ describe('calculated data and points', function() { }); describe('ordering and stacking combined', function() { - it('partially overlapping category order follows categoryarray and stacking produces expected results', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Switch', 'Plug', 'Cord', 'Fuse', 'Bulb']; var x3 = ['Pump', 'Leak', 'Bearing', 'Seals']; @@ -852,7 +810,6 @@ describe('calculated data and points', function() { }); it('fully overlapping - category order follows categoryarray and stacking produces expected results', function() { - var x1 = ['Gear', 'Bearing', 'Motor']; var x2 = ['Bearing', 'Gear', 'Motor']; var x3 = ['Motor', 'Gear', 'Bearing']; diff --git a/test/jasmine/tests/cartesian_interact_test.js b/test/jasmine/tests/cartesian_interact_test.js index ed33efe04e2..a025a253c34 100644 --- a/test/jasmine/tests/cartesian_interact_test.js +++ b/test/jasmine/tests/cartesian_interact_test.js @@ -660,7 +660,6 @@ describe('axis zoom/pan and main plot zoom', function() { var rotate = (t.split('rotate(')[1] || '').split(')')[0]; var angle = rotate.split(',')[0]; expect(Number(angle)).toBe(exp.angle[i], msg + ' - node ' + i); - }); var tickLabels2 = d3.select(gd).selectAll('.xtick2 > text'); diff --git a/test/jasmine/tests/cartesian_test.js b/test/jasmine/tests/cartesian_test.js index a3194817e48..2c40f7e0bd2 100644 --- a/test/jasmine/tests/cartesian_test.js +++ b/test/jasmine/tests/cartesian_test.js @@ -150,7 +150,6 @@ describe('restyle', function() { }) .catch(failTest) .then(done); - }); it('can legend-hide the second and only scatter trace', function(done) { @@ -208,7 +207,6 @@ describe('restyle', function() { }); describe('relayout', function() { - describe('axis category attributes', function() { var mock = require('@mocks/basic_bar.json'); @@ -257,7 +255,6 @@ describe('relayout', function() { .catch(failTest) .then(done); }); - }); describe('axis ranges', function() { @@ -391,7 +388,6 @@ describe('subplot creation / deletion:', function() { afterEach(destroyGraphDiv); it('should clear orphan subplot when adding traces to blank graph', function(done) { - function assertOrphanSubplot(len) { expect(d3.select('.subplot.xy').size()).toEqual(len); expect(d3.select('.ytitle').size()).toEqual(len); diff --git a/test/jasmine/tests/click_test.js b/test/jasmine/tests/click_test.js index 4f471e5d20a..3ce25fdd9a7 100644 --- a/test/jasmine/tests/click_test.js +++ b/test/jasmine/tests/click_test.js @@ -253,7 +253,6 @@ describe('Test click interactions:', function() { var futureData = null; beforeEach(function(done) { - var modifiedMockCopy = Lib.extendDeep({}, mockCopy); modifiedMockCopy.data[0].hoverinfo = 'skip'; Plotly.plot(gd, modifiedMockCopy.data, modifiedMockCopy.layout) @@ -274,7 +273,6 @@ describe('Test click interactions:', function() { var futureData = null; beforeEach(function(done) { - var modifiedMockCopy = Lib.extendDeep({}, mockCopy); modifiedMockCopy.data[0].hoverinfo = 'skip'; Plotly.plot(gd, modifiedMockCopy.data, modifiedMockCopy.layout) @@ -295,7 +293,6 @@ describe('Test click interactions:', function() { var futureData; beforeEach(function(done) { - var modifiedMockCopy = Lib.extendDeep({}, mockCopy); modifiedMockCopy.data[0].hoverinfo = 'none'; Plotly.plot(gd, modifiedMockCopy.data, modifiedMockCopy.layout) @@ -326,7 +323,6 @@ describe('Test click interactions:', function() { var futureData; beforeEach(function(done) { - var modifiedMockCopy = Lib.extendDeep({}, mockCopy); modifiedMockCopy.data[0].hoverinfo = 'none'; Plotly.plot(gd, modifiedMockCopy.data, modifiedMockCopy.layout) @@ -361,7 +357,6 @@ describe('Test click interactions:', function() { var futureData; beforeEach(function(done) { - var modifiedMockCopy = Lib.extendDeep({}, mockCopy); modifiedMockCopy.data[0].hoverinfo = 'none'; Plotly.plot(gd, modifiedMockCopy.data, modifiedMockCopy.layout) @@ -402,7 +397,6 @@ describe('Test click interactions:', function() { gd.on('plotly_doubleclick', function(data) { futureData = data; }); - }); it('should return null', function(done) { @@ -643,7 +637,6 @@ describe('Test click interactions:', function() { done(); }); }); - }); describe('double click interactions', function() { @@ -1017,13 +1010,11 @@ describe('Test click interactions:', function() { }); describe('scroll zoom interactions', function() { - beforeEach(function(done) { Plotly.plot(gd, mockCopy.data, mockCopy.layout, { scrollZoom: true }).then(done); }); it('zooms in on scroll up', function() { - var plot = gd._fullLayout._plots.xy.plot; mouseEvent('mousemove', 393, 243); @@ -1088,7 +1079,6 @@ describe('Test click interactions:', function() { describe('dragbox', function() { - afterEach(destroyGraphDiv); it('should scale subplot and inverse scale scatter points', function(done) { @@ -1129,5 +1119,4 @@ describe('dragbox', function() { }, DBLCLICKDELAY / 4); }); }); - }); diff --git a/test/jasmine/tests/color_test.js b/test/jasmine/tests/color_test.js index 3f776337bcb..a230cae31f2 100644 --- a/test/jasmine/tests/color_test.js +++ b/test/jasmine/tests/color_test.js @@ -147,7 +147,6 @@ describe('Test color:', function() { }); describe('fill', function() { - it('should call style with both fill and fill-opacity', function() { var mockElement = { style: function(object) { @@ -158,11 +157,9 @@ describe('Test color:', function() { Color.fill(mockElement, 'rgba(255,255,0,0.5'); }); - }); describe('stroke', function() { - it('should call style with both fill and fill-opacity', function() { var mockElement = { style: function(object) { @@ -173,11 +170,9 @@ describe('Test color:', function() { Color.stroke(mockElement, 'rgba(255,255,0,0.5'); }); - }); describe('contrast', function() { - it('should darken light colors', function() { var out = Color.contrast('#eee', 10, 20); diff --git a/test/jasmine/tests/colorscale_test.js b/test/jasmine/tests/colorscale_test.js index 9dd75653cb7..281ab5ff2b9 100644 --- a/test/jasmine/tests/colorscale_test.js +++ b/test/jasmine/tests/colorscale_test.js @@ -92,7 +92,6 @@ describe('Test colorscale:', function() { expect(flipScale(scl)).toEqual( [[0, 'rgb(200, 0, 0)'], [0.5, 'rgb(0, 0, 0)'], [1, 'rgb(0, 0, 200)']] ); - }); }); @@ -367,7 +366,6 @@ describe('Test colorscale:', function() { handleDefaults(traceIn, traceOut, layout, coerce, opts); expect(traceOut.marker.showscale).toBe(true); }); - }); describe('calc', function() { diff --git a/test/jasmine/tests/command_test.js b/test/jasmine/tests/command_test.js index 05d9845370e..d860fe1f68d 100644 --- a/test/jasmine/tests/command_test.js +++ b/test/jasmine/tests/command_test.js @@ -38,7 +38,6 @@ describe('Plots.executeAPICommand', function() { .catch(failTest) .then(done); }); - }); describe('with an unsuccessful command', function() { @@ -60,7 +59,6 @@ describe('Plots.executeAPICommand', function() { .catch(failTest) .then(done); }); - }); describe('with the skip command', function() { diff --git a/test/jasmine/tests/config_test.js b/test/jasmine/tests/config_test.js index cdfaf2d5d7c..004d77c70b5 100644 --- a/test/jasmine/tests/config_test.js +++ b/test/jasmine/tests/config_test.js @@ -13,7 +13,6 @@ var delay = require('../assets/delay'); var RESIZE_DELAY = 300; describe('config argument', function() { - describe('attribute layout.autosize', function() { var layoutWidth = 1111; var relayoutWidth = 555; @@ -197,7 +196,6 @@ describe('config argument', function() { }); describe('showLink attribute', function() { - var gd; beforeEach(function() { @@ -229,7 +227,6 @@ describe('config argument', function() { describe('editable attribute', function() { - var gd; beforeEach(function() { @@ -410,7 +407,6 @@ describe('config argument', function() { .catch(failTest) .then(done); }); - }); describe('axis drag handles attribute', function() { @@ -447,7 +443,6 @@ describe('config argument', function() { testDraggers(0); }); - }); describe('axis range entry attribute', function() { @@ -608,7 +603,6 @@ describe('config argument', function() { var canvases = document.getElementsByTagName('canvas'); checkElementsSize(canvases, elWidth / 2, elHeight / 2); - }) .catch(failTest); } diff --git a/test/jasmine/tests/drawing_test.js b/test/jasmine/tests/drawing_test.js index 34249da0ab4..097ec557aea 100644 --- a/test/jasmine/tests/drawing_test.js +++ b/test/jasmine/tests/drawing_test.js @@ -10,7 +10,6 @@ describe('Drawing', function() { 'use strict'; describe('setClipUrl', function() { - beforeEach(function() { this.svg = d3.select('body').append('svg'); this.g = this.svg.append('g'); @@ -75,7 +74,6 @@ describe('Drawing', function() { }); describe('getTranslate', function() { - it('should work with regular DOM elements', function() { var el = document.createElement('div'); @@ -157,7 +155,6 @@ describe('Drawing', function() { }); describe('setTranslate', function() { - it('should work with regular DOM elements', function() { var el = document.createElement('div'); @@ -194,7 +191,6 @@ describe('Drawing', function() { }); describe('getScale', function() { - it('should work with regular DOM elements', function() { var el = document.createElement('div'); @@ -240,7 +236,6 @@ describe('Drawing', function() { }); describe('setScale', function() { - it('should work with regular DOM elements', function() { var el = document.createElement('div'); diff --git a/test/jasmine/tests/events_test.js b/test/jasmine/tests/events_test.js index 9cb0bfe19b7..f6210d1194b 100644 --- a/test/jasmine/tests/events_test.js +++ b/test/jasmine/tests/events_test.js @@ -20,7 +20,6 @@ describe('Events', function() { }); describe('init', function() { - it('instantiates an emitter on incoming plot object', function() { expect(plotObj._ev).not.toBeDefined(); expect(Events.init(plotObj)._ev).toBeDefined(); @@ -86,7 +85,6 @@ describe('Events', function() { }); describe('triggerHandler', function() { - it('triggers node handlers and returns last value', function() { var eventBaton = 0; @@ -251,7 +249,6 @@ describe('Events', function() { }); describe('when jQuery.noConflict is set, ', function() { - beforeEach(function() { $.noConflict(); }); @@ -261,7 +258,6 @@ describe('Events', function() { }); it('triggers jquery events', function(done) { - Events.init(plotDiv); jQuery(plotDiv).bind('ping', function(event, data) { diff --git a/test/jasmine/tests/extend_test.js b/test/jasmine/tests/extend_test.js index 06d60fdca3f..f0423cafdef 100644 --- a/test/jasmine/tests/extend_test.js +++ b/test/jasmine/tests/extend_test.js @@ -66,7 +66,6 @@ describe('extendFlat', function() { expect(ori).toEqual([1, 'what', new Date(81, 8, 4), 4, 5, 6]); expect(arr).toEqual([1, 'what', new Date(81, 8, 4)]); expect(target).toEqual([1, 'what', new Date(81, 8, 4), 4, 5, 6]); - }); it('extends an array with an array into a clone', function() { @@ -520,5 +519,4 @@ describe('array by reference vs deep-copy', function() { expect(ext.foo.baz).toBe(src.foo.baz); expect(ext.foo.bop).toBe(tar.foo.bop); }); - }); diff --git a/test/jasmine/tests/finance_test.js b/test/jasmine/tests/finance_test.js index 2fee00f27dd..859f60a0ca6 100644 --- a/test/jasmine/tests/finance_test.js +++ b/test/jasmine/tests/finance_test.js @@ -116,7 +116,6 @@ describe('finance charts defaults:', function() { }); it('should not slice data arrays but record minimum supplied length', function() { - function assertDataLength(trace, fullTrace, len) { expect(fullTrace.visible).toBe(true); @@ -810,7 +809,6 @@ describe('finance charts updates:', function() { }) .catch(failTest) .then(done); - }); it('Plotly.extendTraces should work', function(done) { @@ -892,7 +890,6 @@ describe('finance charts updates:', function() { }); it('Plotly.addTraces + Plotly.relayout should update candlestick box position values', function(done) { - function assertBoxPosFields(bPos) { expect(gd.calcdata.length).toEqual(bPos.length); @@ -915,7 +912,6 @@ describe('finance charts updates:', function() { assertBoxPosFields([0]); return Plotly.addTraces(gd, [Lib.extendDeep({}, trace0)]); - }) .then(function() { assertBoxPosFields([-15120000, 15120000]); @@ -1069,7 +1065,6 @@ describe('finance charts *special* handlers:', function() { afterEach(destroyGraphDiv); it('`editable: true` handlers should work', function(done) { - var gd = createGraphDiv(); function editText(itemNumber, newText) { diff --git a/test/jasmine/tests/frame_api_test.js b/test/jasmine/tests/frame_api_test.js index 8818e442904..9f69bd97cc8 100644 --- a/test/jasmine/tests/frame_api_test.js +++ b/test/jasmine/tests/frame_api_test.js @@ -37,7 +37,6 @@ describe('Test frame api', function() { }); describe('#addFrames', function() { - it('issues a warning if a number-named frame would overwrite a frame', function(done) { var warnings = []; spyOn(Lib, 'warn').and.callFake(function(msg) { diff --git a/test/jasmine/tests/geo_test.js b/test/jasmine/tests/geo_test.js index be42d2abc08..42aec715ea8 100644 --- a/test/jasmine/tests/geo_test.js +++ b/test/jasmine/tests/geo_test.js @@ -453,7 +453,6 @@ describe('Test Geo layout defaults', function() { .toEqual(s.latRange, 'lataxis.range'); expect(layoutOut.geo.center.lat) .toEqual(s.centerLat, 'computed center lat'); - }); }); }); @@ -500,7 +499,6 @@ describe('geojson / topojson utils', function() { }); describe('should distinguish between US and US Virgin Island', function() { - // N.B. Virgin Island don't appear at the 'world_110m' resolution var topojsonName = 'world_50m'; var topojson = GeoAssets.topojson[topojsonName]; @@ -801,7 +799,6 @@ describe('Test geo interactions', function() { done(); }); }); - }); describe('deleting traces and geos', function() { diff --git a/test/jasmine/tests/gl2d_click_test.js b/test/jasmine/tests/gl2d_click_test.js index 0d567899011..7854dc85dbe 100644 --- a/test/jasmine/tests/gl2d_click_test.js +++ b/test/jasmine/tests/gl2d_click_test.js @@ -652,7 +652,6 @@ describe('@noCI Test gl2d lasso/select:', function() { {pointNumber: 27, x: 2.22, y: 0.45} ] }); - }) .catch(failTest) .then(done); diff --git a/test/jasmine/tests/gl2d_date_axis_render_test.js b/test/jasmine/tests/gl2d_date_axis_render_test.js index 5f09f7199a6..4e71e04b3a4 100644 --- a/test/jasmine/tests/gl2d_date_axis_render_test.js +++ b/test/jasmine/tests/gl2d_date_axis_render_test.js @@ -4,7 +4,6 @@ var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); describe('date axis', function() { - var gd; beforeEach(function() { diff --git a/test/jasmine/tests/gl2d_plot_interact_test.js b/test/jasmine/tests/gl2d_plot_interact_test.js index 88017a95a75..5895a8b8dfe 100644 --- a/test/jasmine/tests/gl2d_plot_interact_test.js +++ b/test/jasmine/tests/gl2d_plot_interact_test.js @@ -129,7 +129,6 @@ describe('Test gl plot side effects', function() { }); it('@gl should be able to replot from a blank graph', function(done) { - function countCanvases(cnt) { var nodes = d3.selectAll('canvas'); expect(nodes.size()).toEqual(cnt); @@ -876,7 +875,6 @@ describe('Test gl2d plots', function() { }) .then(function() { expect(relayoutCallback).toHaveBeenCalledTimes(1); - }) .catch(failTest) .then(done); diff --git a/test/jasmine/tests/gl2d_pointcloud_test.js b/test/jasmine/tests/gl2d_pointcloud_test.js index 9ef51ffba4e..5106709ef05 100644 --- a/test/jasmine/tests/gl2d_pointcloud_test.js +++ b/test/jasmine/tests/gl2d_pointcloud_test.js @@ -146,7 +146,6 @@ var plotData = { }; describe('pointcloud traces', function() { - var gd; beforeEach(function() { diff --git a/test/jasmine/tests/gl2d_scatterplot_contour_test.js b/test/jasmine/tests/gl2d_scatterplot_contour_test.js index 00cb9219ee4..91355e3a92e 100644 --- a/test/jasmine/tests/gl2d_scatterplot_contour_test.js +++ b/test/jasmine/tests/gl2d_scatterplot_contour_test.js @@ -170,7 +170,6 @@ function makePlot(gd, mock, done) { } describe('contourgl plots', function() { - var gd; beforeEach(function() { diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index 1e85bb92be6..5f1c0fc2f00 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -145,7 +145,6 @@ describe('Test gl3d before/after plot', function() { }) .then(done); }); - }); describe('Test gl3d plots', function() { @@ -916,7 +915,6 @@ describe('Test gl3d plots', function() { expect(gd.layout.yaxis).toBeDefined(); expect(gd._fullLayout._has('gl3d')).toBe(true); expect(gd._fullLayout.scene._scene).toBeDefined(); - }) .then(done); }); diff --git a/test/jasmine/tests/gl3dlayout_test.js b/test/jasmine/tests/gl3dlayout_test.js index 6fb5bc7395d..6957da72adb 100644 --- a/test/jasmine/tests/gl3dlayout_test.js +++ b/test/jasmine/tests/gl3dlayout_test.js @@ -303,5 +303,4 @@ describe('Gl3d layout edge cases', function() { .catch(failTest) .then(done); }); - }); diff --git a/test/jasmine/tests/gl_plot_interact_basic_test.js b/test/jasmine/tests/gl_plot_interact_basic_test.js index b50823bb04e..33658f79069 100644 --- a/test/jasmine/tests/gl_plot_interact_basic_test.js +++ b/test/jasmine/tests/gl_plot_interact_basic_test.js @@ -28,7 +28,6 @@ function addEventCallback(graphDiv) { } function verifyInteractionEffects(tuple) { - // One 'drag': simulating fairly thoroughly as the mouseup event is also needed here mouseEvent('mousemove', 400, 200); mouseEvent('mousedown', 400, 200); @@ -57,7 +56,6 @@ function testEvents(plot) { } describe('gl3d plots', function() { - var gd; beforeEach(function() { diff --git a/test/jasmine/tests/heatmap_test.js b/test/jasmine/tests/heatmap_test.js index 0ae0005be82..961db01764e 100644 --- a/test/jasmine/tests/heatmap_test.js +++ b/test/jasmine/tests/heatmap_test.js @@ -704,7 +704,6 @@ describe('heatmap hover', function() { } describe('for `heatmap_multi-trace`', function() { - beforeAll(function(done) { gd = createGraphDiv(); @@ -732,7 +731,6 @@ describe('heatmap hover', function() { }); describe('for xyz-column traces', function() { - beforeAll(function(done) { gd = createGraphDiv(); @@ -763,11 +761,9 @@ describe('heatmap hover', function() { }) .then(done); }); - }); describe('nonuniform bricks', function() { - beforeAll(function(done) { gd = createGraphDiv(); @@ -798,6 +794,5 @@ describe('heatmap hover', function() { .catch(failTest) .then(done); }); - }); }); diff --git a/test/jasmine/tests/histogram2d_test.js b/test/jasmine/tests/histogram2d_test.js index e879588b53f..5a529fb548f 100644 --- a/test/jasmine/tests/histogram2d_test.js +++ b/test/jasmine/tests/histogram2d_test.js @@ -160,7 +160,6 @@ describe('Test histogram2d', function() { }); describe('restyle / relayout interaction', function() { - var gd; beforeEach(function() { @@ -261,5 +260,4 @@ describe('Test histogram2d', function() { _assert(binSpec, binSpec, binSpec, binSpec); }); }); - }); diff --git a/test/jasmine/tests/histogram_test.js b/test/jasmine/tests/histogram_test.js index 8e83a1530ea..ec0bc331ded 100644 --- a/test/jasmine/tests/histogram_test.js +++ b/test/jasmine/tests/histogram_test.js @@ -114,7 +114,6 @@ describe('Test histogram', function() { }; supplyDefaults(traceIn, traceOut, '', {}); expect(traceOut.orientation).toBe('h'); - }); // coercing bin attributes got moved to calc because it needs @@ -653,7 +652,6 @@ describe('Test histogram', function() { }); }); }); - }); describe('plot / restyle', function() { diff --git a/test/jasmine/tests/hover_label_test.js b/test/jasmine/tests/hover_label_test.js index 973a458e2c0..c113514bab2 100644 --- a/test/jasmine/tests/hover_label_test.js +++ b/test/jasmine/tests/hover_label_test.js @@ -498,7 +498,6 @@ describe('hover info', function() { }); it('render only non-hoverinfo \'none\' hover labels', function(done) { - Plotly.restyle(gd, 'hoverinfo', ['none', 'name']).then(function() { Fx.hover('graph', evt, 'xy'); @@ -2159,7 +2158,6 @@ describe('hover info on overlaid subplots', function() { }); describe('hover after resizing', function() { - var gd; afterEach(destroyGraphDiv); @@ -2530,7 +2528,6 @@ describe('hover updates', function() { } }], { width: 700, height: 450 }) .then(function() { - gd.on('plotly_hover', function(eventData) { hoverCnt++; @@ -2557,7 +2554,6 @@ describe('hover updates', function() { expect(unHoverCnt).toEqual(2); }) .then(done); - }); }); diff --git a/test/jasmine/tests/isosurface_test.js b/test/jasmine/tests/isosurface_test.js index f10f56caa9f..57662ccdbf6 100644 --- a/test/jasmine/tests/isosurface_test.js +++ b/test/jasmine/tests/isosurface_test.js @@ -104,11 +104,9 @@ function createIsosurfaceFig() { } describe('Test isosurface', function() { - var gd; describe('defaults', function() { - function assertVisibility(exp, msg) { expect(gd._fullData[0]).not.toBe(undefined, 'no visibility!'); expect(gd._fullData[0].visible).toBe(exp, msg); @@ -188,11 +186,9 @@ describe('Test isosurface', function() { expect(gd._fullData[0].isomin).not.toBe(null, 'isomin not set'); expect(gd._fullData[0].isomax).not.toBe(null, 'isomax not set'); }); - }); describe('mesh_generation', function() { - var gd; beforeEach(function() { @@ -253,11 +249,9 @@ describe('Test isosurface', function() { .catch(failTest) .then(done); }); - }); describe('restyle', function() { - var gd; beforeEach(function() { @@ -270,7 +264,6 @@ describe('Test isosurface', function() { }); it('@gl should clear *cauto* when restyle *cmin* and/or *cmax*', function(done) { - function _assert(user, full) { var trace = gd.data[0]; var fullTrace = gd._fullData[0]; @@ -314,7 +307,6 @@ describe('Test isosurface', function() { }); describe('hover', function() { - var gd; beforeEach(function() { diff --git a/test/jasmine/tests/layout_images_test.js b/test/jasmine/tests/layout_images_test.js index a665a25ae6d..089a5f1e3d7 100644 --- a/test/jasmine/tests/layout_images_test.js +++ b/test/jasmine/tests/layout_images_test.js @@ -13,9 +13,7 @@ var jsLogo = 'https://images.plot.ly/language-icons/api-home/js-logo.png'; var pythonLogo = 'https://images.plot.ly/language-icons/api-home/python-logo.png'; describe('Layout images', function() { - describe('supplyLayoutDefaults', function() { - var layoutIn, layoutOut; @@ -79,11 +77,9 @@ describe('Layout images', function() { expect(layoutOut.images[0]).toEqual(jasmine.objectContaining(expected)); }); - }); describe('drawing', function() { - var gd; var data = [{ x: [1, 2, 3], y: [1, 2, 3] }]; @@ -108,7 +104,6 @@ describe('Layout images', function() { } it('should draw images on the right layers', function() { - Plotly.plot(gd, data, { images: [{ source: jsLogo, layer: 'above' @@ -163,7 +158,6 @@ describe('Layout images', function() { }); describe('with anchors and sizing', function() { - function testAspectRatio(xAnchor, yAnchor, sizing, expected) { Plotly.plot(gd, data, { images: [{ source: jsLogo, @@ -197,9 +191,7 @@ describe('Layout images', function() { it('should work for fill sizing', function() { testAspectRatio('invalid', 'invalid', 'fill', 'xMinYMin slice'); }); - }); - }); describe('when the plot is dragged', function() { @@ -275,11 +267,9 @@ describe('Layout images', function() { mouseEvent('mouseup', 300, 250); }).then(done); }); - }); describe('when relayout', function() { - var gd; var data = [{ x: [1, 2, 3], y: [1, 2, 3] }]; @@ -328,7 +318,6 @@ describe('Layout images', function() { }); it('should remove the image tag if an invalid source', function(done) { - var selection = Plotly.d3.select('image'); expect(selection.size()).toBe(1); @@ -340,7 +329,6 @@ describe('Layout images', function() { }); describe('when adding/removing images', function() { - afterEach(destroyGraphDiv); it('should properly add and remove image', function(done) { @@ -417,9 +405,7 @@ describe('Layout images', function() { done(); }); }); - }); - }); describe('images log/linear axis changes', function() { diff --git a/test/jasmine/tests/legend_scroll_test.js b/test/jasmine/tests/legend_scroll_test.js index 6f431954c41..9eb9530a25f 100644 --- a/test/jasmine/tests/legend_scroll_test.js +++ b/test/jasmine/tests/legend_scroll_test.js @@ -400,7 +400,6 @@ describe('The legend', function() { done(); }); - }); }); }); diff --git a/test/jasmine/tests/lib_date_test.js b/test/jasmine/tests/lib_date_test.js index 00062d953bd..d99f3ec99b8 100644 --- a/test/jasmine/tests/lib_date_test.js +++ b/test/jasmine/tests/lib_date_test.js @@ -624,7 +624,6 @@ describe('dates', function() { .toBe('1969-12-31 23:59:59.9999'); expect(Lib.formatDate(-0.1, '%Y-%m-%d %H:%M:%S.%f', null, utcFormat, 'coptic')) .toBe('1686-04-22 23:59:59.9999'); - }); it('should remove extra fractional second zeros', function() { @@ -646,6 +645,5 @@ describe('dates', function() { expect(Lib.formatDate(0.1, '%S.%f', null, utcFormat, null, extraFormat)).toBe('00.0001'); expect(Lib.formatDate(0.1, '%S.%3f', null, utcFormat, null, extraFormat)).toBe('00.0'); }); - }); }); diff --git a/test/jasmine/tests/lib_test.js b/test/jasmine/tests/lib_test.js index 25b9e0e1278..cdfe16bf1e1 100644 --- a/test/jasmine/tests/lib_test.js +++ b/test/jasmine/tests/lib_test.js @@ -469,7 +469,6 @@ describe('Test lib.js:', function() { }); describe('objectFromPath', function() { - it('should return an object', function() { var obj = Lib.objectFromPath('test', 'object'); @@ -1097,7 +1096,6 @@ describe('Test lib.js:', function() { }); describe('validate', function() { - function assert(shouldPass, shouldFail, valObject) { shouldPass.forEach(function(v) { var res = Lib.validate(v, valObject); @@ -1351,7 +1349,6 @@ describe('Test lib.js:', function() { }); describe('setCursor', function() { - beforeEach(function() { this.el3 = d3.select(createGraphDiv()); }); @@ -1400,7 +1397,6 @@ describe('Test lib.js:', function() { }); describe('overrideCursor', function() { - beforeEach(function() { this.el3 = d3.select(createGraphDiv()); }); @@ -1450,7 +1446,6 @@ describe('Test lib.js:', function() { }); describe('pushUnique', function() { - beforeEach(function() { this.obj = { a: 'A' }; this.array = ['a', 'b', 'c', this.obj]; @@ -1486,7 +1481,6 @@ describe('Test lib.js:', function() { Lib.pushUnique(this.array, this.obj); expect(this.array).toEqual(['a', 'b', 'c', { a: 'A' }]); - }); it('should recognize matching RegExps', function() { @@ -1503,7 +1497,6 @@ describe('Test lib.js:', function() { }); describe('filterUnique', function() { - it('should return array containing unique values', function() { expect( Lib.filterUnique(['a', 'a', 'b', 'b']) @@ -1530,11 +1523,9 @@ describe('Test lib.js:', function() { ) .toEqual([null, undefined]); }); - }); describe('numSeparate', function() { - it('should work on numbers and strings', function() { expect(Lib.numSeparate(12345.67, '.,')).toBe('12,345.67'); expect(Lib.numSeparate('12345.67', '.,')).toBe('12,345.67'); @@ -2015,7 +2006,6 @@ describe('Test lib.js:', function() { 'styles[1].bar': 'value3', 'styles[2]': null }); - }); }); diff --git a/test/jasmine/tests/mesh3d_test.js b/test/jasmine/tests/mesh3d_test.js index 6ee4d407bb3..5f98c2cf4ac 100644 --- a/test/jasmine/tests/mesh3d_test.js +++ b/test/jasmine/tests/mesh3d_test.js @@ -453,6 +453,5 @@ describe('Test mesh3d', function() { .catch(failTest) .then(done); }); - }); }); diff --git a/test/jasmine/tests/modebar_test.js b/test/jasmine/tests/modebar_test.js index d4b84ed6bb5..29d06f1f218 100644 --- a/test/jasmine/tests/modebar_test.js +++ b/test/jasmine/tests/modebar_test.js @@ -307,7 +307,6 @@ describe('ModeBar', function() { modeBar.destroy(); expect(modeBarParent.querySelector('.modebar')).toBeNull(); - }); }); @@ -315,7 +314,6 @@ describe('ModeBar', function() { function getButtons(list) { for(var i = 0; i < list.length; i++) { for(var j = 0; j < list[i].length; j++) { - // minimal button config object list[i][j] = { name: list[i][j], click: noop }; } @@ -920,7 +918,6 @@ describe('ModeBar', function() { expect(function() { manageModeBar(gd); }).toThrowError(); }); - }); describe('modebar on clicks', function() { @@ -984,11 +981,9 @@ describe('ModeBar', function() { done(); }); }); - }); describe('cartesian handlers', function() { - beforeEach(function(done) { var mockData = [{ type: 'scatter', @@ -1106,7 +1101,6 @@ describe('ModeBar', function() { }); describe('buttons hoverCompareCartesian and hoverClosestCartesian ', function() { - it('should update layout hovermode', function() { expect(gd._fullLayout.hovermode).toBe('x'); assertActive(hovermodeButtons, buttonCompare); @@ -1161,7 +1155,6 @@ describe('ModeBar', function() { }); describe('pie handlers', function() { - beforeEach(function(done) { var mockData = [{ type: 'pie', @@ -1195,7 +1188,6 @@ describe('ModeBar', function() { }); describe('geo handlers', function() { - beforeEach(function(done) { var mockData = [{ type: 'scattergeo', @@ -1226,7 +1218,6 @@ describe('ModeBar', function() { expect(button.isActive()).toBe(true); }); }); - }); describe('@noCI mapbox handlers', function() { diff --git a/test/jasmine/tests/parcats_test.js b/test/jasmine/tests/parcats_test.js index 8570f3ed7e0..5a2aaf75d5a 100644 --- a/test/jasmine/tests/parcats_test.js +++ b/test/jasmine/tests/parcats_test.js @@ -122,7 +122,6 @@ function checkParcatsSvg(gd) { // Check category transforms dimensionSelection.each(function(dimension, dimDisplayInd) { - var categorySelection = d3.select(this).selectAll('g.category'); var nextY = (3 - categorySelection.size()) * catSpacing / 2; @@ -160,7 +159,6 @@ function makeTranslate(x, y) { // Test cases // ========== describe('Basic parcats trace', function() { - // Variable declarations // --------------------- // ### Trace level ### @@ -194,7 +192,6 @@ describe('Basic parcats trace', function() { it('should compute initial model properly', function(done) { Plotly.newPlot(gd, basicMock) .then(function() { - // Var check calc data /** @type {ParcatsModel} */ var calcdata = gd.calcdata[0][0]; @@ -274,7 +271,6 @@ describe('Basic parcats trace', function() { it('should compute initial data properly', function(done) { Plotly.newPlot(gd, mock) .then(function() { - // Check that trace data matches input expect(gd.data[0]).toEqual(mock.data[0]); }) @@ -296,7 +292,6 @@ describe('Basic parcats trace', function() { }); it('should compute initial model views properly', function(done) { - Plotly.newPlot(gd, basicMock) .then(function() { checkParcatsModelView(gd); @@ -317,7 +312,6 @@ describe('Basic parcats trace', function() { }); describe('Dimension reordered parcats trace', function() { - // Variable declarations // --------------------- // ### Trace level ### @@ -338,7 +332,6 @@ describe('Dimension reordered parcats trace', function() { it('should compute initial model properly', function(done) { Plotly.newPlot(gd, mock) .then(function() { - // Var check calc data /** @type {ParcatsModel} */ var calcdata = gd.calcdata[0][0]; @@ -404,13 +397,11 @@ describe('Dimension reordered parcats trace', function() { }); it('should recover from bad display order specification', function(done) { - // Define bad display indexes [0, 2, 0] mock.data[0].dimensions[2].displayindex = 0; Plotly.newPlot(gd, mock) .then(function() { - // Var check calc data /** @type {ParcatsModel} */ var calcdata = gd.calcdata[0][0]; @@ -471,7 +462,6 @@ describe('Dimension reordered parcats trace', function() { }); it('should compute initial model views properly', function(done) { - Plotly.newPlot(gd, mock) .then(function() { checkParcatsModelView(gd); @@ -492,7 +482,6 @@ describe('Dimension reordered parcats trace', function() { }); describe('Drag to reordered dimensions', function() { - // Variable declarations // --------------------- // ### Trace level ### @@ -567,7 +556,6 @@ describe('Drag to reordered dimensions', function() { } it('should support dragging dimension label to reorder dimensions in freeform arrangement', function(done) { - // Set arrangement mock.data[0].arrangement = 'freeform'; @@ -642,7 +630,6 @@ describe('Drag to reordered dimensions', function() { }); it('should support dragging dimension label to reorder dimensions in perpendicular arrangement', function(done) { - // Set arrangement mock.data[0].arrangement = 'perpendicular'; @@ -718,7 +705,6 @@ describe('Drag to reordered dimensions', function() { }); it('should NOT support dragging dimension label to reorder dimensions in fixed arrangement', function(done) { - // Set arrangement mock.data[0].arrangement = 'fixed'; @@ -781,7 +767,6 @@ describe('Drag to reordered dimensions', function() { }); describe('Drag to reordered categories', function() { - // Variable declarations // --------------------- // ### Trace level ### @@ -914,13 +899,11 @@ describe('Drag to reordered categories', function() { } it('should support dragging category to reorder categories and dimensions in freeform arrangement', function(done) { - // Set arrangement mock.data[0].arrangement = 'freeform'; Plotly.newPlot(gd, mock) .then(function() { - restyleCallback = jasmine.createSpy('restyleCallback'); gd.on('plotly_restyle', restyleCallback); @@ -981,7 +964,6 @@ describe('Drag to reordered categories', function() { // Make sure categories in dimension 1 have changed already checkFinalCategories(); - }) .then(delay(CALLBACK_DELAY)) .then(function() { @@ -1004,13 +986,11 @@ describe('Drag to reordered categories', function() { }); it('should support dragging category to reorder categories only in perpendicular arrangement', function(done) { - // Set arrangement mock.data[0].arrangement = 'perpendicular'; Plotly.newPlot(gd, mock) .then(function() { - restyleCallback = jasmine.createSpy('restyleCallback'); gd.on('plotly_restyle', restyleCallback); @@ -1089,13 +1069,11 @@ describe('Drag to reordered categories', function() { }); it('should NOT support dragging category to reorder categories or dimensions in fixed arrangement', function(done) { - // Set arrangement mock.data[0].arrangement = 'fixed'; Plotly.newPlot(gd, mock) .then(function() { - restyleCallback = jasmine.createSpy('restyleCallback'); gd.on('plotly_restyle', restyleCallback); @@ -1162,7 +1140,6 @@ describe('Drag to reordered categories', function() { describe('Click events', function() { - // Variable declarations // --------------------- // ### Trace level ### @@ -1179,7 +1156,6 @@ describe('Click events', function() { afterEach(destroyGraphDiv); it('should fire on category click', function(done) { - var clickData; Plotly.newPlot(gd, mock) .then(function() { @@ -1220,7 +1196,6 @@ describe('Click events', function() { }); it('should NOT fire on category click if hoverinfo is skip', function(done) { - var clickData; mock.data[0].hoverinfo = 'skip'; @@ -1252,7 +1227,6 @@ describe('Click events', function() { }); it('should fire on path click', function(done) { - var clickData; Plotly.newPlot(gd, mock) @@ -1293,7 +1267,6 @@ describe('Click events', function() { }); it('should NOT fire on path click if hoverinfo is skip', function(done) { - var clickData; mock.data[0].hoverinfo = 'skip'; @@ -1326,7 +1299,6 @@ describe('Click events', function() { }); describe('Click events with hoveron color', function() { - // Variable declarations // --------------------- // ### Trace level ### @@ -1343,7 +1315,6 @@ describe('Click events with hoveron color', function() { afterEach(destroyGraphDiv); it('should fire on category click', function(done) { - var clickData; Plotly.newPlot(gd, mock) .then(function() { @@ -1383,7 +1354,6 @@ describe('Click events with hoveron color', function() { it('should fire on path click', function(done) { - var clickData; Plotly.newPlot(gd, mock) @@ -1424,7 +1394,6 @@ describe('Click events with hoveron color', function() { }); describe('Hover events', function() { - // Variable declarations // --------------------- // ### Trace level ### @@ -1441,7 +1410,6 @@ describe('Hover events', function() { afterEach(destroyGraphDiv); it('hover and unhover should fire on category', function(done) { - var hoverData; var unhoverData; var mouseY0; @@ -1512,7 +1480,6 @@ describe('Hover events', function() { }); it('hover and unhover should fire on path', function(done) { - var hoverData; var unhoverData; var mouseY0; @@ -1581,7 +1548,6 @@ describe('Hover events', function() { }); describe('Hover events with hoveron color', function() { - // Variable declarations // --------------------- // ### Trace level ### @@ -1598,7 +1564,6 @@ describe('Hover events with hoveron color', function() { afterEach(destroyGraphDiv); it('hover and unhover should fire on category hoveron color', function(done) { - var hoverData; var unhoverData; var mouseY0; @@ -1665,7 +1630,6 @@ describe('Hover events with hoveron color', function() { }); it('hover and unhover should fire on path hoveron color', function(done) { - var hoverData; var unhoverData; var mouseY0; @@ -1752,7 +1716,6 @@ describe('Parcats hover:', function() { assertHoverLabelContent(s); done(); }, CALLBACK_DELAY); - }) .catch(failTest); } diff --git a/test/jasmine/tests/parcoords_test.js b/test/jasmine/tests/parcoords_test.js index 863fcd1a531..7137e9f4dc7 100644 --- a/test/jasmine/tests/parcoords_test.js +++ b/test/jasmine/tests/parcoords_test.js @@ -63,11 +63,9 @@ function getAvgPixelByChannel(id) { } describe('parcoords initialization tests', function() { - 'use strict'; describe('parcoords global defaults', function() { - it('should not coerce trace opacity', function() { var gd = Lib.extendDeep({}, mock1); @@ -107,7 +105,6 @@ describe('parcoords initialization tests', function() { }); describe('parcoords defaults', function() { - function _supply(traceIn) { var traceOut = { visible: true }; var defaultColor = '#444'; @@ -251,7 +248,6 @@ describe('parcoords initialization tests', function() { }); describe('parcoords calc', function() { - function _calc(trace) { var gd = { data: [trace] }; @@ -265,7 +261,6 @@ describe('parcoords initialization tests', function() { var base = { type: 'parcoords' }; it('\'colorscale\' should assume a default value if the \'color\' array is specified', function() { - var fullTrace = _calc(Lib.extendDeep({}, base, { line: { color: [35, 63, 21, 42] @@ -293,7 +288,6 @@ describe('parcoords initialization tests', function() { }); it('use a singular \'color\' if it is not an array', function() { - var fullTrace = _calc(Lib.extendDeep({}, base, { line: { color: '#444' @@ -310,7 +304,6 @@ describe('parcoords initialization tests', function() { }); it('use a singular \'color\' even if a \'colorscale\' is supplied as \'color\' is not an array', function() { - var fullTrace = _calc(Lib.extendDeep({}, base, { line: { color: '#444', @@ -362,10 +355,8 @@ describe('parcoords edge cases', function() { afterEach(purgeGraphDiv); it('@gl Works fine with one panel only', function(done) { - var mockCopy = Lib.extendDeep({}, mock2); Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].dimensions.length).toEqual(2); expect(document.querySelectorAll('.axis').length).toEqual(2); @@ -382,10 +373,8 @@ describe('parcoords edge cases', function() { }); it('@gl Do something sensible if there is no panel i.e. dimension count is less than 2', function(done) { - var mockCopy = Lib.extendDeep({}, mock1); Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].dimensions.length).toEqual(1); expect(document.querySelectorAll('.axis').length).toEqual(1); // sole axis still shows up @@ -400,11 +389,9 @@ describe('parcoords edge cases', function() { }); it('@gl Does not error with zero dimensions', function(done) { - var mockCopy = Lib.extendDeep({}, mock0); Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].dimensions.length).toEqual(0); expect(document.querySelectorAll('.axis').length).toEqual(0); @@ -414,14 +401,12 @@ describe('parcoords edge cases', function() { }); it('@gl Works with duplicate dimension labels', function(done) { - var mockCopy = Lib.extendDeep({}, mock2); mockCopy.layout.width = 320; mockCopy.data[0].dimensions[1].label = mockCopy.data[0].dimensions[0].label; Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].dimensions.length).toEqual(2); expect(document.querySelectorAll('.axis').length).toEqual(2); @@ -431,7 +416,6 @@ describe('parcoords edge cases', function() { }); it('@gl Works with a single line; also, use a longer color array than the number of lines', function(done) { - var mockCopy = Lib.extendDeep({}, mock2); var dim, i, j; @@ -447,7 +431,6 @@ describe('parcoords edge cases', function() { } Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].dimensions.length).toEqual(2); expect(document.querySelectorAll('.axis').length).toEqual(2); @@ -458,7 +441,6 @@ describe('parcoords edge cases', function() { }); it('@gl Does not raise an error with zero lines and no specified range', function(done) { - var mockCopy = Lib.extendDeep({}, mock2); var dim, i; @@ -471,7 +453,6 @@ describe('parcoords edge cases', function() { } Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].dimensions.length).toEqual(2); expect(document.querySelectorAll('.axis').length).toEqual(0); @@ -482,7 +463,6 @@ describe('parcoords edge cases', function() { }); it('@gl Works with non-finite `values` elements', function(done) { - var mockCopy = Lib.extendDeep({}, mock2); var dim, i, j; var values = [[0, 1, 2, 3, 4], [Infinity, NaN, void(0), null, 1]]; @@ -499,7 +479,6 @@ describe('parcoords edge cases', function() { } Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].dimensions.length).toEqual(2); expect(document.querySelectorAll('.axis').length).toEqual(2); @@ -510,7 +489,6 @@ describe('parcoords edge cases', function() { }); it('@noCI @gl Works with 60 dimensions', function(done) { - var mockCopy = Lib.extendDeep({}, mock1); var newDimension, i, j; @@ -530,7 +508,6 @@ describe('parcoords edge cases', function() { } Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].dimensions.length).toEqual(60); expect(document.querySelectorAll('.axis').length).toEqual(60); @@ -540,7 +517,6 @@ describe('parcoords edge cases', function() { }); it('@noCI @gl Truncates 60+ dimensions to 60', function(done) { - var mockCopy = Lib.extendDeep({}, mock1); var newDimension, i, j; @@ -558,7 +534,6 @@ describe('parcoords edge cases', function() { } Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].dimensions.length).toEqual(60); expect(document.querySelectorAll('.axis').length).toEqual(60); @@ -568,7 +543,6 @@ describe('parcoords edge cases', function() { }); it('@noCI @gl Truncates dimension values to the shortest array, retaining only 3 lines', function(done) { - var mockCopy = Lib.extendDeep({}, mock1); var newDimension, i, j; @@ -587,7 +561,6 @@ describe('parcoords edge cases', function() { } Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].dimensions.length).toEqual(60); expect(document.querySelectorAll('.axis').length).toEqual(60); @@ -597,7 +570,6 @@ describe('parcoords edge cases', function() { }); it('@gl Skip dimensions which are not plain objects or whose `values` is not an array', function(done) { - var mockCopy = Lib.extendDeep({}, mock1); var newDimension, i, j; @@ -620,7 +592,6 @@ describe('parcoords edge cases', function() { mockCopy.data[0].dimensions[1].values = 'This is not an array'; Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].dimensions.length).toEqual(5); // it's still five, but ... expect(document.querySelectorAll('.axis').length).toEqual(3); // only 3 axes shown @@ -636,13 +607,11 @@ describe('parcoords Lifecycle methods', function() { afterEach(purgeGraphDiv); it('Plotly.deleteTraces with one trace removes the plot', function(done) { - var mockCopy = Lib.extendDeep({}, mock); mockCopy.data[0].line.showscale = false; Plotly.plot(gd, mockCopy).then(function() { - expect(gd.data.length).toEqual(1); return Plotly.deleteTraces(gd, 0).then(function() { @@ -655,7 +624,6 @@ describe('parcoords Lifecycle methods', function() { }); it('@gl Plotly.deleteTraces with two traces removes the deleted plot', function(done) { - var mockCopy = Lib.extendDeep({}, mock); var mockCopy2 = Lib.extendDeep({}, mock); mockCopy2.data[0].dimensions.splice(3, 4); @@ -704,7 +672,6 @@ describe('parcoords Lifecycle methods', function() { } it('@gl Calling `Plotly.restyle` with zero panels left should erase lines', function(done) { - var mockCopy = Lib.extendDeep({}, mock2); function restyleDimension(key, dimIndex, setterValue) { @@ -738,9 +705,7 @@ describe('parcoords Lifecycle methods', function() { }); describe('Having two datasets', function() { - it('@gl Two subsequent calls to Plotly.plot should create two parcoords rows', function(done) { - var mockCopy = Lib.extendDeep({}, mock); var mockCopy2 = Lib.extendDeep({}, mock); mockCopy.data[0].domain = {x: [0, 0.45]}; @@ -751,7 +716,6 @@ describe('parcoords Lifecycle methods', function() { Plotly.plot(gd, mockCopy) .then(function() { - expect(1).toEqual(1); expect(document.querySelectorAll('.gl-container').length).toEqual(1); expect(gd.data.length).toEqual(1); @@ -759,7 +723,6 @@ describe('parcoords Lifecycle methods', function() { return Plotly.plot(gd, mockCopy2); }) .then(function() { - expect(1).toEqual(1); expect(document.querySelectorAll('.gl-container').length).toEqual(1); expect(gd.data.length).toEqual(2); @@ -769,7 +732,6 @@ describe('parcoords Lifecycle methods', function() { }); it('@gl Plotly.addTraces should add a new parcoords row', function(done) { - var mockCopy = Lib.extendDeep({}, mock); var mockCopy2 = Lib.extendDeep({}, mock); mockCopy.data[0].domain = {y: [0, 0.35]}; @@ -780,7 +742,6 @@ describe('parcoords Lifecycle methods', function() { Plotly.plot(gd, mockCopy) .then(function() { - expect(document.querySelectorAll('.gl-container').length).toEqual(1); expect(gd.data.length).toEqual(1); @@ -795,7 +756,6 @@ describe('parcoords Lifecycle methods', function() { }); it('@gl Plotly.restyle should update the existing parcoords row', function(done) { - var mockCopy = Lib.extendDeep({}, mock); var mockCopy2 = Lib.extendDeep({}, mock); @@ -823,7 +783,6 @@ describe('parcoords Lifecycle methods', function() { Plotly.plot(gd, mockCopy) .then(function() { - expect(document.querySelectorAll('.gl-container').length).toEqual(1); expect(gd.data.length).toEqual(1); @@ -833,7 +792,6 @@ describe('parcoords Lifecycle methods', function() { }); }) .then(function() { - expect(document.querySelectorAll('.gl-container').length).toEqual(1); expect(gd.data.length).toEqual(1); }) @@ -938,7 +896,6 @@ describe('parcoords basic use', function() { }); it('@gl `Plotly.plot` should have proper fields on `gd.data` on initial rendering', function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].dimensions.length).toEqual(11); expect(document.querySelectorAll('.axis').length).toEqual(10); // one dimension is `visible: false` @@ -952,18 +909,15 @@ describe('parcoords basic use', function() { expect(gd.data[0].dimensions[1].range).toBeDefined(); expect(gd.data[0].dimensions[1].range).toEqual([0, 700000]); expect(gd.data[0].dimensions[1].constraintrange).not.toBeDefined(); - }); it('@gl Calling `Plotly.plot` again should add the new parcoords', function(done) { - var reversedMockCopy = Lib.extendDeep({}, mockCopy); reversedMockCopy.data[0].dimensions = reversedMockCopy.data[0].dimensions.slice().reverse(); reversedMockCopy.data[0].dimensions.forEach(function(d) {d.id = 'R_' + d.id;}); reversedMockCopy.data[0].dimensions.forEach(function(d) {d.label = 'R_' + d.label;}); Plotly.plot(gd, reversedMockCopy.data, reversedMockCopy.layout).then(function() { - expect(gd.data.length).toEqual(2); expect(gd.data[0].dimensions.length).toEqual(11); @@ -982,15 +936,12 @@ describe('parcoords basic use', function() { }) .catch(failTest) .then(done); - }); it('@gl Calling `Plotly.restyle` with a string path to colorscale should amend the preexisting parcoords', function(done) { - expect(gd.data.length).toEqual(1); Plotly.restyle(gd, 'line.colorscale', 'Viridis').then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].line.colorscale).toEqual('Viridis'); @@ -1002,13 +953,10 @@ describe('parcoords basic use', function() { }) .catch(failTest) .then(done); - }); it('@gl Calling `Plotly.restyle` for a dimension should amend the preexisting dimension', function(done) { - function restyleDimension(key, setterValue) { - // array values need to be wrapped in an array; unwrapping here for value comparison var value = Array.isArray(setterValue) ? setterValue[0] : setterValue; @@ -1032,13 +980,11 @@ describe('parcoords basic use', function() { }); it('@gl Calling `Plotly.restyle` with an object should amend the preexisting parcoords', function(done) { - var newStyle = Lib.extendDeep({}, mockCopy.data[0].line); newStyle.colorscale = 'Viridis'; newStyle.reversescale = false; Plotly.restyle(gd, {line: newStyle}).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].line.colorscale).toEqual('Viridis'); @@ -1054,9 +1000,7 @@ describe('parcoords basic use', function() { }); it('@gl Should emit a \'plotly_restyle\' event', function(done) { - var tester = (function() { - var eventCalled = false; return { @@ -1076,7 +1020,6 @@ describe('parcoords basic use', function() { }) .catch(failTest) .then(done); - }); it('@gl Should emit a \'plotly_hover\' event', function(done) { @@ -1105,15 +1048,12 @@ describe('parcoords basic use', function() { }) .catch(failTest) .then(done); - }); it('@gl Calling `Plotly.relayout` with string should amend the preexisting parcoords', function(done) { - expect(gd.layout.width).toEqual(1184); Plotly.relayout(gd, 'width', 500).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.layout.width).toEqual(500); @@ -1129,11 +1069,9 @@ describe('parcoords basic use', function() { }); it('@gl Calling `Plotly.relayout`with object should amend the preexisting parcoords', function(done) { - expect(gd.layout.width).toEqual(1184); Plotly.relayout(gd, {width: 500}).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.layout.width).toEqual(500); diff --git a/test/jasmine/tests/plot_api_test.js b/test/jasmine/tests/plot_api_test.js index 4203043719d..26ed172b9da 100644 --- a/test/jasmine/tests/plot_api_test.js +++ b/test/jasmine/tests/plot_api_test.js @@ -132,7 +132,6 @@ describe('Test plot api', function() { }); it('should update the plot clipPath if the plot is resized', function(done) { - Plotly.plot(gd, [{ x: [1, 2, 3], y: [1, 2, 3] }], { width: 500, height: 500 }) .then(function() { return Plotly.relayout(gd, { width: 400, height: 400 }); @@ -1556,27 +1555,21 @@ describe('Test plot api', function() { }); it('should throw an error when indices are omitted', function() { - expect(function() { Plotly.deleteTraces(gd); }).toThrow(new Error('indices must be an integer or array of integers.')); - }); it('should throw an error when indices are out of bounds', function() { - expect(function() { Plotly.deleteTraces(gd, 10); }).toThrow(new Error('indices must be valid indices for gd.data.')); - }); it('should throw an error when indices are repeated', function() { - expect(function() { Plotly.deleteTraces(gd, [0, 0]); }).toThrow(new Error('each index in indices must be unique.')); - }); it('should work when indices are negative', function() { @@ -1637,7 +1630,6 @@ describe('Test plot api', function() { expect(gd.data).toEqual(expectedData); expect(plotApi.redraw).toHaveBeenCalled(); }); - }); describe('Plotly.addTraces', function() { @@ -1668,11 +1660,9 @@ describe('Test plot api', function() { }); it('should throw an error when traces and newIndices arrays are unequal', function() { - expect(function() { Plotly.addTraces(gd, [{}, {}], 2); }).toThrowError(Error, 'if indices is specified, traces.length must equal indices.length'); - }); it('should throw an error when newIndices are out of bounds', function() { @@ -1813,7 +1803,6 @@ describe('Test plot api', function() { Plotly.moveTraces(gd, 0, 1); expect(gd.data).toEqual(expectedData); expect(plotApi.redraw).toHaveBeenCalled(); - }); it('handle unsorted currentIndices', function() { @@ -1827,7 +1816,6 @@ describe('Test plot api', function() { Plotly.moveTraces(gd, [3, 1], [0, 3]); expect(gd.data).toEqual(expectedData); expect(plotApi.redraw).toHaveBeenCalled(); - }); it('work when newIndices are undefined.', function() { @@ -1841,7 +1829,6 @@ describe('Test plot api', function() { Plotly.moveTraces(gd, [3, 0]); expect(gd.data).toEqual(expectedData); expect(plotApi.redraw).toHaveBeenCalled(); - }); it('accept negative indices.', function() { @@ -1855,7 +1842,6 @@ describe('Test plot api', function() { Plotly.moveTraces(gd, 1, -2); expect(gd.data).toEqual(expectedData); expect(plotApi.redraw).toHaveBeenCalled(); - }); }); @@ -1883,7 +1869,6 @@ describe('Test plot api', function() { }); it('should throw an error when gd.data isn\'t an array.', function() { - expect(function() { Plotly.extendTraces({}, {x: [[1]]}, [0]); }).toThrow(new Error('gd.data must be an array')); @@ -1891,11 +1876,9 @@ describe('Test plot api', function() { expect(function() { Plotly.extendTraces({data: 'meow'}, {x: [[1]]}, [0]); }).toThrow(new Error('gd.data must be an array')); - }); it('should throw an error when update is not an object', function() { - expect(function() { Plotly.extendTraces(gd, undefined, [0], 8); }).toThrow(new Error('update must be a key:value object')); @@ -1903,35 +1886,27 @@ describe('Test plot api', function() { expect(function() { Plotly.extendTraces(gd, null, [0]); }).toThrow(new Error('update must be a key:value object')); - }); it('should throw an error when indices are omitted', function() { - expect(function() { Plotly.extendTraces(gd, {x: [[1]]}); }).toThrow(new Error('indices must be an integer or array of integers')); - }); it('should throw an error when a current index is out of bounds', function() { - expect(function() { Plotly.extendTraces(gd, {x: [[1]]}, [-gd.data.length - 1]); }).toThrow(new Error('indices must be valid indices for gd.data.')); - }); it('should not throw an error when negative index wraps to positive', function() { - expect(function() { Plotly.extendTraces(gd, {x: [[1]]}, [-1]); }).not.toThrow(); - }); it('should throw an error when number of Indices does not match Update arrays', function() { - expect(function() { Plotly.extendTraces(gd, {x: [[1, 2], [2, 3]] }, [0]); }).toThrow(new Error('attribute x must be an array of length equal to indices array length')); @@ -1939,11 +1914,9 @@ describe('Test plot api', function() { expect(function() { Plotly.extendTraces(gd, {x: [[1]]}, [0, 1]); }).toThrow(new Error('attribute x must be an array of length equal to indices array length')); - }); it('should throw an error when maxPoints is an Object but does not match Update', function() { - expect(function() { Plotly.extendTraces(gd, {x: [[1]]}, [0], {y: [1]}); }).toThrow(new Error('when maxPoints is set as a key:value object it must contain a 1:1 ' + @@ -1953,11 +1926,9 @@ describe('Test plot api', function() { Plotly.extendTraces(gd, {x: [[1]]}, [0], {x: [1, 2]}); }).toThrow(new Error('when maxPoints is set as a key:value object it must contain a 1:1 ' + 'corrispondence with the keys and number of traces in the update object')); - }); it('should throw an error when update keys mismatch trace keys', function() { - // lets update y on both traces, but only 1 trace has "y" gd.data[1].y = [1, 2, 3]; @@ -1966,11 +1937,9 @@ describe('Test plot api', function() { y: [[3, 4], [4, 5]], 'marker.size': [[0, -1], [5, 6]] }, [0, 1]); }).toThrow(new Error('cannot extend missing or non-array attribute: y')); - }); it('should extend traces with update keys', function() { - Plotly.extendTraces(gd, { x: [[3, 4], [4, 5]], 'marker.size': [[0, -1], [5, 6]] }, [0, 1]); @@ -2023,7 +1992,6 @@ describe('Test plot api', function() { }); it('should truncate arrays when maxPoints is zero', function() { - Plotly.extendTraces(gd, { x: [[3, 4], [4, 5]], 'marker.size': [[0, -1], [5, 6]] }, [0, 1], 0); @@ -2257,7 +2225,6 @@ describe('Test plot api', function() { }); describe('Plotly.purge', function() { - afterEach(destroyGraphDiv); it('should return the graph div in its original state', function(done) { @@ -2278,7 +2245,6 @@ describe('Test plot api', function() { }); describe('Plotly.redraw', function() { - afterEach(destroyGraphDiv); it('', function(done) { @@ -2563,7 +2529,6 @@ describe('Test plot api', function() { expect(gd.layout.shapes[1]).toEqual(null); expect(gd.layout.shapes[2].xref).toEqual('x3'); expect(gd.layout.shapes[2].yref).toEqual('y'); - }); it('removes direction names and showlegend from finance traces', function() { @@ -2661,7 +2626,6 @@ describe('Test plot api', function() { afterEach(destroyGraphDiv); it('should respect layout.width and layout.height', function(done) { - // See issue https://github.com/plotly/plotly.js/issues/537 var data = [{ x: [1, 2], @@ -2670,7 +2634,6 @@ describe('Test plot api', function() { var height = 50; Plotly.plot(gd, data).then(function() { - return Plotly.newPlot(gd, data, { height: height }); }) .then(function() { diff --git a/test/jasmine/tests/plot_interact_test.js b/test/jasmine/tests/plot_interact_test.js index d9d37aec3df..33cbbd06d31 100644 --- a/test/jasmine/tests/plot_interact_test.js +++ b/test/jasmine/tests/plot_interact_test.js @@ -24,7 +24,6 @@ describe('Test plot structure', function() { afterEach(destroyGraphDiv); describe('cartesian plots', function() { - function countSubplots() { return d3.selectAll('g.subplot').size(); } @@ -384,9 +383,7 @@ describe('Test plot structure', function() { .catch(failTest) .then(done); }); - }); - }); describe('pie traces', function() { @@ -463,7 +460,6 @@ describe('Test plot structure', function() { }) .catch(failTest) .then(done); - }); }); }); @@ -518,7 +514,6 @@ describe('Test plot structure', function() { }); describe('plot svg clip paths', function() { - // plot with all features that rely on clip paths function plot() { return Plotly.plot(createGraphDiv(), [{ @@ -547,7 +542,6 @@ describe('plot svg clip paths', function() { it('should set clip path url to ids (base case)', function(done) { plot().then(function() { - d3.selectAll('[clip-path]').each(function() { var cp = d3.select(this).attr('clip-path'); @@ -572,7 +566,6 @@ describe('plot svg clip paths', function() { var href = window.location.href.split('#')[0]; plot().then(function() { - d3.selectAll('[clip-path]').each(function() { var cp = d3.select(this).attr('clip-path'); diff --git a/test/jasmine/tests/plot_promise_test.js b/test/jasmine/tests/plot_promise_test.js index 82d42343b17..e493a1049df 100644 --- a/test/jasmine/tests/plot_promise_test.js +++ b/test/jasmine/tests/plot_promise_test.js @@ -523,5 +523,4 @@ describe('Plotly.___ methods', function() { .toThrow(new Error('DOM element provided is null or undefined')); }); }); - }); diff --git a/test/jasmine/tests/plots_test.js b/test/jasmine/tests/plots_test.js index 7a7b11960eb..0b4b37ca925 100644 --- a/test/jasmine/tests/plots_test.js +++ b/test/jasmine/tests/plots_test.js @@ -238,7 +238,6 @@ describe('Test Plots', function() { supplyLayoutDefaults(layoutIn, layoutOut); expect(layoutOut.margin).toEqual(expected); }); - }); describe('Plots.supplyTraceDefaults', function() { @@ -441,7 +440,6 @@ describe('Test Plots', function() { }); describe('extendObjectWithContainers', function() { - function assert(dest, src, expected) { Plots.extendObjectWithContainers(dest, src, ['container']); expect(dest).toEqual(expected); @@ -632,7 +630,6 @@ describe('Test Plots', function() { }); describe('Plots.generalUpdatePerTraceModule', function() { - function _update(subplotCalcData, traceHashOld) { var gd = {}; var subplot = { traceHash: traceHashOld || {} }; diff --git a/test/jasmine/tests/polygon_test.js b/test/jasmine/tests/polygon_test.js index 86f11ee3b14..887e4d07a88 100644 --- a/test/jasmine/tests/polygon_test.js +++ b/test/jasmine/tests/polygon_test.js @@ -211,5 +211,4 @@ describe('polygon.filter', function() { for(i = 6; i < pts.length; i++) p.addPt(pts[i]); expect(p.filtered).toEqual(ptsOut); }); - }); diff --git a/test/jasmine/tests/range_selector_test.js b/test/jasmine/tests/range_selector_test.js index c63e17039cf..3e065776128 100644 --- a/test/jasmine/tests/range_selector_test.js +++ b/test/jasmine/tests/range_selector_test.js @@ -452,7 +452,6 @@ describe('range selector getUpdateObject:', function() { 'xaxis5.range[0]': '2015-10-30', 'xaxis5.range[1]': '2015-11-30' }); - }); }); @@ -603,13 +602,11 @@ describe('range selector interactions:', function() { }; Plotly.relayout(gd, update).then(function() { - // '1m' should be active after the relayout checkActiveButton(0, '1m'); return Plotly.relayout(gd, 'xaxis.autorange', true); }).then(function() { - // 'all' should be after an autoscale checkActiveButton(buttons.size() - 1, 'back to all'); }) @@ -663,5 +660,4 @@ describe('range selector automargin', function() { .catch(failTest) .then(done); }); - }); diff --git a/test/jasmine/tests/range_slider_test.js b/test/jasmine/tests/range_slider_test.js index 99941269ce5..36343fd0106 100644 --- a/test/jasmine/tests/range_slider_test.js +++ b/test/jasmine/tests/range_slider_test.js @@ -347,7 +347,6 @@ describe('Visible rangesliders', function() { expect(+maskMin.getAttribute('width')).toBeWithin(9.22, TOL); expect(+maskMax.getAttribute('width')).toBeWithin(71.95, TOL); - }) .catch(failTest) .then(done); @@ -562,7 +561,6 @@ describe('Rangeslider visibility property', function() { }); describe('Rangeslider handleDefaults function', function() { - function _supply(layoutIn, layoutOut, axName) { setConvert(layoutOut[axName]); layoutOut[axName]._id = name2id(axName); @@ -710,7 +708,6 @@ describe('Rangeslider handleDefaults function', function() { }); describe('Rangeslider yaxis options', function() { - it('should be set one yaxis is present', function() { var mock = { layout: { @@ -773,7 +770,6 @@ describe('Rangeslider yaxis options', function() { }); describe('Rangeslider anchored axes fixedrange', function() { - it('should default to *true* when range slider is visible', function() { var mock = { data: [ @@ -819,7 +815,6 @@ describe('Rangeslider anchored axes fixedrange', function() { expect(mock._fullLayout.yaxis2.fixedrange).toBe(false); expect(mock._fullLayout.yaxis3.fixedrange).toBe(false); }); - }); describe('rangesliders in general', function() { diff --git a/test/jasmine/tests/sankey_test.js b/test/jasmine/tests/sankey_test.js index 1d8c3df04c3..892eb950bf7 100644 --- a/test/jasmine/tests/sankey_test.js +++ b/test/jasmine/tests/sankey_test.js @@ -25,7 +25,6 @@ var checkOverlap = require('../assets/check_overlap'); var delay = require('../assets/delay'); describe('sankey tests', function() { - 'use strict'; function _supply(traceIn) { @@ -48,7 +47,6 @@ describe('sankey tests', function() { } describe('don\'t remove nodes if encountering no circularity', function() { - it('removing a single self-pointing node', function() { var fullTrace = _supply({ node: { @@ -73,7 +71,6 @@ describe('sankey tests', function() { // not doing that anymore, it's not really consistent with // the rest of our data processing. it('some nodes are not linked', function() { - var warnings = []; spyOn(Lib, 'warn').and.callFake(function(msg) { warnings.push(msg); @@ -95,7 +92,6 @@ describe('sankey tests', function() { }); describe('sankey global defaults', function() { - it('should not coerce trace opacity', function() { var gd = Lib.extendDeep({}, mock); @@ -103,14 +99,11 @@ describe('sankey tests', function() { expect(gd._fullData[0].opacity).toBeUndefined(); }); - }); describe('sankey defaults', function() { - it('\'Sankey\' specification should have proper arrays where mandatory', function() { - var fullTrace = _supply({}); expect(fullTrace.node.label) @@ -134,7 +127,6 @@ describe('sankey tests', function() { it('\'Sankey\' specification should have proper types', function() { - var fullTrace = _supply({}); expect(fullTrace.orientation) @@ -158,7 +150,6 @@ describe('sankey tests', function() { it('\'Sankey\' layout dependent specification should have proper types', function() { - var fullTrace = _supplyWithLayout({}, {font: {family: 'Arial'}}); expect(fullTrace.textfont) .toEqual({family: 'Arial'}, 'textfont is defined'); @@ -166,7 +157,6 @@ describe('sankey tests', function() { it('\'line\' specifications should yield the default values', function() { - var fullTrace = _supply({}); expect(fullTrace.node.line.color) @@ -181,7 +171,6 @@ describe('sankey tests', function() { }); it('fills \'node\' colors if not specified', function() { - var fullTrace = _supply({ node: { label: ['a', 'b'] @@ -195,11 +184,9 @@ describe('sankey tests', function() { expect(Array.isArray(fullTrace.node.color)).toBe(true, 'set up color array'); expect(fullTrace.node.color).toEqual(['rgba(31, 119, 180, 0.8)', 'rgba(255, 127, 14, 0.8)']); - }); it('respects layout.colorway', function() { - var fullTrace = _supplyWithLayout({ node: { label: ['a', 'b'] @@ -213,11 +200,9 @@ describe('sankey tests', function() { expect(Array.isArray(fullTrace.node.color)).toBe(true, 'set up color array'); expect(fullTrace.node.color).toEqual(['rgba(255, 0, 0, 0.8)', 'rgba(0, 0, 255, 0.8)']); - }); it('does not fill \'link\' labels even if not specified', function() { - var fullTrace = _supply({ node: { label: ['a', 'b'] @@ -234,7 +219,6 @@ describe('sankey tests', function() { }); it('preserves \'link\' labels if specified', function() { - var fullTrace = _supply({ node: { label: ['a', 'b'] @@ -369,7 +353,6 @@ describe('sankey tests', function() { afterEach(destroyGraphDiv); it('Plotly.deleteTraces with two traces removes the deleted plot', function(done) { - var mockCopy = Lib.extendDeep({}, mock); var mockCopy2 = Lib.extendDeep({}, mockDark); @@ -397,7 +380,6 @@ describe('sankey tests', function() { }); it('Plotly.plot does not show Sankey if \'visible\' is false', function(done) { - var mockCopy = Lib.extendDeep({}, mock); Plotly.plot(gd, mockCopy) @@ -419,7 +401,6 @@ describe('sankey tests', function() { }); it('\'node\' remains visible even if \'value\' is very low', function(done) { - var minimock = [{ type: 'sankey', node: { diff --git a/test/jasmine/tests/scatter_test.js b/test/jasmine/tests/scatter_test.js index 1ef16594a3d..ad4bb626314 100644 --- a/test/jasmine/tests/scatter_test.js +++ b/test/jasmine/tests/scatter_test.js @@ -315,7 +315,6 @@ describe('Test scatter', function() { expect(isBubble).toBe(false); }); - }); describe('makeBubbleSizeFn', function() { @@ -592,7 +591,6 @@ describe('Test scatter', function() { ]); }); }); - }); describe('end-to-end scatter tests', function() { @@ -630,7 +628,6 @@ describe('end-to-end scatter tests', function() { points.each(function() { expect(d3.select(this).classed('plotly-customdata')).toBe(false); }); - }).catch(failTest).then(done); }); @@ -1347,7 +1344,6 @@ describe('stacked area', function() { }); describe('scatter hoverPoints', function() { - afterEach(destroyGraphDiv); function _hover(gd, xval, yval, hovermode) { diff --git a/test/jasmine/tests/scattergeo_test.js b/test/jasmine/tests/scattergeo_test.js index fd87caddeac..f92f63ddc5a 100644 --- a/test/jasmine/tests/scattergeo_test.js +++ b/test/jasmine/tests/scattergeo_test.js @@ -88,7 +88,6 @@ describe('Test scattergeo defaults', function() { }); describe('Test scattergeo calc', function() { - function _calc(opts) { var base = { type: 'scattergeo' }; var trace = Lib.extendFlat({}, base, opts); diff --git a/test/jasmine/tests/scatterternary_test.js b/test/jasmine/tests/scatterternary_test.js index a64a19f951a..7a45fa2a4a1 100644 --- a/test/jasmine/tests/scatterternary_test.js +++ b/test/jasmine/tests/scatterternary_test.js @@ -296,7 +296,6 @@ describe('scatterternary calc', function() { return obj[k]; }); } - }); describe('scatterternary plot and hover', function() { @@ -446,7 +445,6 @@ describe('scatterternary hover', function() { .catch(failTest) .then(done); }); - }); describe('Test scatterternary *cliponaxis*', function() { diff --git a/test/jasmine/tests/select_test.js b/test/jasmine/tests/select_test.js index 4da03f92dda..d3c1bd2e15f 100644 --- a/test/jasmine/tests/select_test.js +++ b/test/jasmine/tests/select_test.js @@ -946,7 +946,6 @@ describe('Test select box and lasso in general:', function() { .catch(failTest) .then(done); }); - }); describe('lasso events', function() { @@ -1249,7 +1248,6 @@ describe('Test select box and lasso in general:', function() { }); it('@flaky should select the right data with the corresponding select direction', function(done) { - var gd = createGraphDiv(); // drag around just the center point, but if we have a selectdirection we may diff --git a/test/jasmine/tests/shapes_test.js b/test/jasmine/tests/shapes_test.js index d31b20a10d9..492685e028f 100644 --- a/test/jasmine/tests/shapes_test.js +++ b/test/jasmine/tests/shapes_test.js @@ -458,7 +458,6 @@ describe('shapes axis reference changes', function() { } it('draws the right number of objects and updates clip-path correctly', function(done) { - expect(getShape(0).attr('clip-path') || '').toMatch(/x\)$/); Plotly.relayout(gd, { @@ -1109,7 +1108,6 @@ describe('A fixed size shape', function() { beforeEach(function() { layout.shapes[0].type = 'line'; layout.shapes[0].yanchor = 3; - }); it('@flaky can be moved by dragging the middle', function(done) { diff --git a/test/jasmine/tests/snapshot_test.js b/test/jasmine/tests/snapshot_test.js index 3a094c8133c..62743768fca 100644 --- a/test/jasmine/tests/snapshot_test.js +++ b/test/jasmine/tests/snapshot_test.js @@ -13,7 +13,6 @@ describe('Plotly.Snapshot', function() { 'use strict'; describe('clone', function() { - var data, layout, dummyTrace1, dummyTrace2, @@ -121,7 +120,6 @@ describe('Plotly.Snapshot', function() { }); it('should create a 3D thumbnail with limited attributes', function() { - var figure = { data: [{ type: 'scatter', @@ -230,7 +228,6 @@ describe('Plotly.Snapshot', function() { d3.select(gd).style('visibility', 'inherit'); Plotly.plot(gd, subplotMock.data, subplotMock.layout).then(function() { - d3.select(gd).selectAll('text').each(function() { var thisStyle = window.getComputedStyle(this); expect(thisStyle.visibility).toEqual('visible'); diff --git a/test/jasmine/tests/surface_test.js b/test/jasmine/tests/surface_test.js index 2d77fed1928..6b61ec02184 100644 --- a/test/jasmine/tests/surface_test.js +++ b/test/jasmine/tests/surface_test.js @@ -180,7 +180,6 @@ describe('Test surface', function() { expect(traceOut.ycalendar).toBe('ethiopian'); expect(traceOut.zcalendar).toBe('mayan'); }); - }); describe('Test dimension and expected visibility tests', function() { @@ -292,6 +291,5 @@ describe('Test surface', function() { .catch(failTest) .then(done); }); - }); }); diff --git a/test/jasmine/tests/svg_text_utils_test.js b/test/jasmine/tests/svg_text_utils_test.js index e6e41b201f4..e14e79bdaac 100644 --- a/test/jasmine/tests/svg_text_utils_test.js +++ b/test/jasmine/tests/svg_text_utils_test.js @@ -7,7 +7,6 @@ describe('svg+text utils', function() { 'use strict'; describe('convertToTspans', function() { - var stringFromCodePoint; beforeAll(function() { @@ -70,7 +69,6 @@ describe('svg+text utils', function() { expect(a.attr('style')).toBe(fullStyle, msg); expect(a.attr('onclick')).toBe(expectedAttrs.onclick || null, msg); - } function listAttributes(node) { diff --git a/test/jasmine/tests/table_test.js b/test/jasmine/tests/table_test.js index 6b15eeb37d5..408846a0f76 100644 --- a/test/jasmine/tests/table_test.js +++ b/test/jasmine/tests/table_test.js @@ -30,11 +30,9 @@ mock0.data[0].cells.values = []; var mock = require('@mocks/table_plain_birds.json'); describe('table initialization tests', function() { - 'use strict'; describe('table global defaults', function() { - it('should not coerce trace opacity', function() { var gd = Lib.extendDeep({}, mock1); @@ -67,7 +65,6 @@ describe('table initialization tests', function() { }); describe('table defaults', function() { - function _supply(traceIn) { var traceOut = { visible: true }; var defaultColor = '#777'; @@ -144,13 +141,10 @@ describe('table initialization tests', function() { }); describe('table', function() { - afterEach(destroyGraphDiv); describe('edge cases', function() { - it('Works with more than one column', function(done) { - var mockCopy = Lib.extendDeep({}, mock2); var gd = createGraphDiv(); Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { @@ -163,7 +157,6 @@ describe('table', function() { }); it('Works with one column', function(done) { - var mockCopy = Lib.extendDeep({}, mock1); var gd = createGraphDiv(); Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { @@ -176,7 +169,6 @@ describe('table', function() { }); it('Does not error with zero columns', function(done) { - var mockCopy = Lib.extendDeep({}, mock0); var gd = createGraphDiv(); @@ -190,7 +182,6 @@ describe('table', function() { }); it('Does not raise an error with zero lines', function(done) { - var mockCopy = Lib.extendDeep({}, mock2); mockCopy.layout.width = 320; @@ -199,7 +190,6 @@ describe('table', function() { var gd = createGraphDiv(); Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].header.values.length).toEqual(2); expect(gd.data[0].cells.values.length).toEqual(2); @@ -304,7 +294,6 @@ describe('table', function() { }); it('`Plotly.plot` should have proper fields on `gd.data` on initial rendering', function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].header.values.length).toEqual(7); expect(gd.data[0].cells.values.length).toEqual(7); @@ -312,7 +301,6 @@ describe('table', function() { }); it('Calling `Plotly.plot` again should add the new table trace', function(done) { - var reversedMockCopy = Lib.extendDeep({}, mockCopy); reversedMockCopy.data[0].header.values = reversedMockCopy.data[0].header.values.slice().reverse(); reversedMockCopy.data[0].cells.values = reversedMockCopy.data[0].cells.values.slice().reverse(); @@ -323,15 +311,12 @@ describe('table', function() { expect(document.querySelectorAll('.' + cn.yColumn).length).toEqual(7 * 2); done(); }); - }); it('Calling `Plotly.restyle` with a string path should amend the preexisting table', function(done) { - expect(gd.data.length).toEqual(1); Plotly.restyle(gd, 'header.fill.color', 'magenta').then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].header.fill.color).toEqual('magenta'); @@ -342,13 +327,10 @@ describe('table', function() { done(); }); - }); it('Calling `Plotly.restyle` for a `header.values` change should amend the preexisting one', function(done) { - function restyleValues(what, key, setterValue) { - // array values need to be wrapped in an array; unwrapping here for value comparison var value = Array.isArray(setterValue) ? setterValue[0] : setterValue; @@ -395,9 +377,7 @@ describe('table', function() { }); it('Calling `Plotly.restyle` for a `header.values` change should amend the preexisting one', function(done) { - function restyleValues(what, fun, setterValue) { - var value = Array.isArray(setterValue) ? setterValue[0] : setterValue; return function() { diff --git a/test/jasmine/tests/template_test.js b/test/jasmine/tests/template_test.js index 8a243bc4782..f9ff0c14a67 100644 --- a/test/jasmine/tests/template_test.js +++ b/test/jasmine/tests/template_test.js @@ -298,7 +298,6 @@ describe('template interactions', function() { }); describe('validateTemplate', function() { - function compareOutputs(out1, out2, expected, countToCheck) { expect(out2).toEqual(out1); if(expected) { @@ -424,5 +423,4 @@ describe('validateTemplate', function() { msg: 'The template has no key layout.' }], 1).then(done); }); - }); diff --git a/test/jasmine/tests/titles_test.js b/test/jasmine/tests/titles_test.js index a5c99e9e230..11811126c9b 100644 --- a/test/jasmine/tests/titles_test.js +++ b/test/jasmine/tests/titles_test.js @@ -153,7 +153,6 @@ describe('Plot title', function() { // y 'auto' value it('provides a y \'auto\' value putting title baseline in middle ' + 'of top margin irrespective of `yref`', function() { - // yref: 'container' Plotly.plot(gd, data, extendLayout({ yref: 'container', @@ -1166,5 +1165,4 @@ describe('Editable titles', function() { }) .then(done); }); - }); diff --git a/test/jasmine/tests/transform_filter_test.js b/test/jasmine/tests/transform_filter_test.js index 250ed04b18f..9679e415841 100644 --- a/test/jasmine/tests/transform_filter_test.js +++ b/test/jasmine/tests/transform_filter_test.js @@ -14,7 +14,6 @@ var assertDims = customAssertions.assertDims; var assertStyle = customAssertions.assertStyle; describe('filter transforms defaults:', function() { - var fullLayout = { _transformModules: [], _subplots: {cartesian: ['xy'], xaxis: ['x'], yaxis: ['y']} @@ -650,7 +649,6 @@ describe('filter transforms calc:', function() { _assert(out, [-2, -3], [3, 1], [0.3, 0.4]); }); - }); describe('filters should handle categories', function() { @@ -718,7 +716,6 @@ describe('filter transforms calc:', function() { _assert(out, ['a', 'c'], [1, 3], ['0', '2']); }); - }); describe('filters should handle dates', function() { @@ -845,7 +842,6 @@ describe('filter transforms calc:', function() { _assert(out, ['2015-07-20'], [1], [0.1]); }); - }); it('filters should handle ids', function() { @@ -1176,7 +1172,6 @@ describe('filter transforms interactions', function() { }) .catch(failTest) .then(done); - }); it('toggling trace visibility should work', function(done) { @@ -1296,5 +1291,4 @@ describe('filter transforms interactions', function() { .catch(failTest) .then(done); }); - }); diff --git a/test/jasmine/tests/transform_groupby_test.js b/test/jasmine/tests/transform_groupby_test.js index a1de229e472..1b2269d1705 100644 --- a/test/jasmine/tests/transform_groupby_test.js +++ b/test/jasmine/tests/transform_groupby_test.js @@ -22,7 +22,6 @@ function supplyDataDefaults(dataIn, dataOut) { } describe('groupby', function() { - describe('one-to-many transforms:', function() { 'use strict'; @@ -519,14 +518,12 @@ describe('groupby', function() { afterEach(destroyGraphDiv); function test(mockData) { - return function(done) { var data = Lib.extendDeep([], mockData); var gd = createGraphDiv(); Plotly.plot(gd, data).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].ids).toEqual(['q', 'w', 'r', 't', 'y', 'u', 'i']); expect(gd.data[0].x).toEqual([1, -1, -2, 0, 1, 2, 3]); @@ -688,7 +685,6 @@ describe('groupby', function() { it('passes with no explicit styling for the individual group', test(mockData4)); it('passes with no explicit styling in the group transform at all', test(mockData5)); - }); describe('passes with no `groups`', function() { @@ -697,14 +693,12 @@ describe('groupby', function() { afterEach(destroyGraphDiv); function test(mockData) { - return function(done) { var data = Lib.extendDeep([], mockData); var gd = createGraphDiv(); Plotly.plot(gd, data).then(function() { - expect(gd.data.length).toEqual(1); expect(gd.data[0].ids).toEqual(['q', 'w', 'r', 't', 'y', 'u', 'i']); expect(gd.data[0].x).toEqual([1, -1, -2, 0, 1, 2, 3]); diff --git a/test/jasmine/tests/transform_multi_test.js b/test/jasmine/tests/transform_multi_test.js index 0a8226df907..b99bb812fb5 100644 --- a/test/jasmine/tests/transform_multi_test.js +++ b/test/jasmine/tests/transform_multi_test.js @@ -202,7 +202,6 @@ describe('general transforms:', function() { expect(dataOut[0]._expandedIndex).toEqual(0, msg); expect(dataOut[1]._expandedIndex).toEqual(1, msg); }); - }); describe('user-defined transforms:', function() { @@ -365,7 +364,6 @@ describe('user-defined transforms:', function() { }) .then(done); }); - }); describe('multiple transforms:', function() { @@ -662,7 +660,6 @@ describe('multiple transforms:', function() { var trace2Out = gd._fullData[1]; expect(trace2Out.x).toEqual([4, -5]); expect(trace2Out.y).toEqual([5, 4]); - }) .catch(failTest) .then(done); @@ -930,7 +927,6 @@ describe('multiple traces with transforms:', function() { }) .catch(failTest) .then(done); - }); }); @@ -999,7 +995,6 @@ describe('restyle applied on transforms:', function() { .catch(failTest) .then(done); }); - }); describe('supplyDefaults with groupby + filter', function() { diff --git a/test/jasmine/tests/transition_test.js b/test/jasmine/tests/transition_test.js index f3cc0b3827b..222d8cd397f 100644 --- a/test/jasmine/tests/transition_test.js +++ b/test/jasmine/tests/transition_test.js @@ -91,7 +91,6 @@ function runTests(transitionDuration) { // Ensure both coordinates have moved, i.e. that the annotation has transitioned: expect(p1[0]).not.toEqual(p2[0]); expect(p1[1]).not.toEqual(p2[1]); - }).catch(failTest).then(done); }); @@ -126,7 +125,6 @@ function runTests(transitionDuration) { // Test that the image element identity has not: expect(e1).toBe(e2); - }).catch(failTest).then(done); }); diff --git a/test/jasmine/tests/updatemenus_test.js b/test/jasmine/tests/updatemenus_test.js index 4513e128681..e0f86a5bbcf 100644 --- a/test/jasmine/tests/updatemenus_test.js +++ b/test/jasmine/tests/updatemenus_test.js @@ -436,7 +436,6 @@ describe('update menus interactions', function() { .then(function() { expect(gd.layout.updatemenus).toBeUndefined(); assertPushMargins([false, false, false]); - }) .catch(failTest) .then(done); @@ -603,7 +602,6 @@ describe('update menus interactions', function() { }); it('should update correctly on failed binding comparisons', function(done) { - // See https://github.com/plotly/plotly.js/issues/1169 // for more info. @@ -887,7 +885,6 @@ describe('update menus interaction with other components:', function() { afterEach(destroyGraphDiv); it('draws buttons above sliders', function(done) { - Plotly.plot(createGraphDiv(), [{ x: [1, 2, 3], y: [1, 2, 1] diff --git a/test/jasmine/tests/validate_test.js b/test/jasmine/tests/validate_test.js index aed5c603233..46de7d5cb0e 100644 --- a/test/jasmine/tests/validate_test.js +++ b/test/jasmine/tests/validate_test.js @@ -3,7 +3,6 @@ var Lib = require('@src/lib'); describe('Plotly.validate', function() { - function assertErrorContent(obj, code, cont, trace, path, astr, msg) { expect(obj.code).toEqual(code); expect(obj.container).toEqual(cont); diff --git a/test/jasmine/tests/waterfall_test.js b/test/jasmine/tests/waterfall_test.js index db2e748bf95..3dcac00e3af 100644 --- a/test/jasmine/tests/waterfall_test.js +++ b/test/jasmine/tests/waterfall_test.js @@ -1228,7 +1228,6 @@ describe('waterfall hover', function() { }); describe('text labels', function() { - it('should show \'hovertext\' items when present, \'text\' if not', function(done) { gd = createGraphDiv(); @@ -1291,7 +1290,6 @@ describe('waterfall hover', function() { }); describe('with special width/offset combinations', function() { - beforeEach(function() { gd = createGraphDiv(); });