diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 778e7ec..1574962 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -31,11 +31,11 @@ jobs: node-version: 20 cache: 'npm' - name: Install dependencies - run: npm install + run: npm install && sudo apt-get install chromium-browser - name: Test run: npm run test - name: Archive test artifacst - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test images path: | diff --git a/package-lock.json b/package-lock.json index 9835981..77653f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,7 +58,7 @@ "prettier": "^3.2.5", "prismjs": "^1.29.0", "pug": "^3.0.2", - "puppeteer": "^21.6.1", + "puppeteer": "^24.2.1", "standard": "^17.0.0", "standardx": "^7.0.0", "storybook": "^7.0.20", @@ -3485,24 +3485,24 @@ } }, "node_modules/@puppeteer/browsers": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.9.1.tgz", - "integrity": "sha512-PuvK6xZzGhKPvlx3fpfdM2kYY3P/hB1URtK8wA7XUJ6prn6pp22zvJHu48th0SGcHL9SutbPHrFuQgfXTFobWA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.7.1.tgz", + "integrity": "sha512-MK7rtm8JjaxPN7Mf1JdZIZKPD2Z+W7osvrC1vjpvfOX1K0awDIHYbNi89f7eotp7eMUn2shWnt03HwVbriXtKQ==", "dev": true, "dependencies": { - "debug": "4.3.4", - "extract-zip": "2.0.1", - "progress": "2.0.3", - "proxy-agent": "6.3.1", - "tar-fs": "3.0.4", - "unbzip2-stream": "1.4.3", - "yargs": "17.7.2" + "debug": "^4.4.0", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.5.0", + "semver": "^7.7.0", + "tar-fs": "^3.0.8", + "yargs": "^17.7.2" }, "bin": { "browsers": "lib/cjs/main-cli.js" }, "engines": { - "node": ">=16.3.0" + "node": ">=18" } }, "node_modules/@puppeteer/browsers/node_modules/extract-zip": { @@ -3540,15 +3540,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@puppeteer/browsers/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@puppeteer/browsers/node_modules/tar-fs": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", - "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.8.tgz", + "integrity": "sha512-ZoROL70jptorGAlgAYiLoBLItEKw/fUxg9BSYK/dF/GAGYFJOJJJMvjPAKDJraCXFwadD456FCuvLWgfhMsPwg==", "dev": true, "dependencies": { - "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^4.0.1", + "bare-path": "^3.0.0" } }, "node_modules/@puppeteer/browsers/node_modules/tar-stream": { @@ -5414,13 +5429,10 @@ } }, "node_modules/agent-base": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", - "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", "dev": true, - "dependencies": { - "debug": "^4.3.4" - }, "engines": { "node": ">= 14" } @@ -5840,9 +5852,9 @@ } }, "node_modules/b4a": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", - "integrity": "sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", "dev": true }, "node_modules/babel-core": { @@ -6147,12 +6159,69 @@ "license": "MIT" }, "node_modules/bare-events": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.2.0.tgz", - "integrity": "sha512-Yyyqff4PIFfSuthCZqLlPISTWHmnQxoPuAvkmgzsJEmG3CesdIv6Xweayl0JkCZJSB2yYIdJyEz97tpxNhgjbg==", + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.4.tgz", + "integrity": "sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA==", "dev": true, "optional": true }, + "node_modules/bare-fs": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.0.1.tgz", + "integrity": "sha512-ilQs4fm/l9eMfWY2dY0WCIUplSUp7U0CT1vrqMg1MUdeZl4fypu5UP0XcDBK5WBQPJAKP1b7XEodISmekH/CEg==", + "dev": true, + "optional": true, + "dependencies": { + "bare-events": "^2.0.0", + "bare-path": "^3.0.0", + "bare-stream": "^2.0.0" + }, + "engines": { + "bare": ">=1.7.0" + } + }, + "node_modules/bare-os": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.4.0.tgz", + "integrity": "sha512-9Ous7UlnKbe3fMi7Y+qh0DwAup6A1JkYgPnjvMDNOlmnxNRQvQ/7Nst+OnUQKzk0iAT0m9BisbDVp9gCv8+ETA==", + "dev": true, + "optional": true, + "engines": { + "bare": ">=1.6.0" + } + }, + "node_modules/bare-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz", + "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==", + "dev": true, + "optional": true, + "dependencies": { + "bare-os": "^3.0.1" + } + }, + "node_modules/bare-stream": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.5.tgz", + "integrity": "sha512-jSmxKJNJmHySi6hC42zlZnq00rga4jjxcgNZjY9N5WlOe/iOoGRtdwGsHzQv2RlH2KOYMwGUXhf2zXd32BA9RA==", + "dev": true, + "optional": true, + "dependencies": { + "streamx": "^2.21.0" + }, + "peerDependencies": { + "bare-buffer": "*", + "bare-events": "*" + }, + "peerDependenciesMeta": { + "bare-buffer": { + "optional": true + }, + "bare-events": { + "optional": true + } + } + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -6174,9 +6243,9 @@ ] }, "node_modules/basic-ftp": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.4.tgz", - "integrity": "sha512-8PzkB0arJFV4jJWSGOYR+OEic6aeKMu/osRhBULN6RY0ykby6LKhbmuQ5ublvaas5BOwboah5D87nrHyuh8PPA==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", + "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", "dev": true, "engines": { "node": ">=10.0.0" @@ -6654,13 +6723,13 @@ } }, "node_modules/chromium-bidi": { - "version": "0.5.8", - "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.5.8.tgz", - "integrity": "sha512-blqh+1cEQbHBKmok3rVJkBlBxt9beKBgOsxbFgs7UJcoVbbeZ+K7+6liAsjgpc8l1Xd55cQUy14fXZdGSb4zIw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-1.3.0.tgz", + "integrity": "sha512-G3x1bkST13kmbL7+dT/oRkNH/7C4UqG+0YQpmySrzXspyOhYgDNc6lhSGpj3cuexvH25WTENhTYq2Tt9JRXtbw==", "dev": true, "dependencies": { - "mitt": "3.0.1", - "urlpattern-polyfill": "10.0.0" + "mitt": "^3.0.1", + "zod": "^3.24.1" }, "peerDependencies": { "devtools-protocol": "*" @@ -7074,15 +7143,6 @@ "optional": true, "peer": true }, - "node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dev": true, - "dependencies": { - "node-fetch": "^2.6.12" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "dev": true, @@ -7311,20 +7371,21 @@ "license": "BSD-2-Clause" }, "node_modules/data-uri-to-buffer": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.1.tgz", - "integrity": "sha512-MZd3VlchQkp8rdend6vrx7MmVDJzSNTBvghvKjirLkD+WTChA3KUf0jkE68Q4UyctNqI11zZO9/x2Yx+ub5Cvg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", "dev": true, "engines": { "node": ">= 14" } }, "node_modules/debug": { - "version": "4.3.4", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, - "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -7596,9 +7657,9 @@ } }, "node_modules/devtools-protocol": { - "version": "0.0.1232444", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1232444.tgz", - "integrity": "sha512-pM27vqEfxSxRkTMnF+XCmxSEb6duO5R+t8A9DEEJgy4Wz2RVanje2mmj99B6A3zv2r/qGfYlOvYznUhuokizmg==", + "version": "0.0.1402036", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1402036.tgz", + "integrity": "sha512-JwAYQgEvm3yD45CHB+RmF5kMbWtXBaOGwuxa87sZogHcLCv8c/IqnThaoQ1y60d7pXWjSKWQphPEc+1rAScVdg==", "dev": true }, "node_modules/diff": { @@ -9824,52 +9885,19 @@ } }, "node_modules/get-uri": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.2.tgz", - "integrity": "sha512-5KLucCJobh8vBY1K07EFV4+cPZH3mrV9YeAruUseCQKHB58SGjjT2l9/eA9LD082IiuMjSlFJEcdJ27TXvbZNw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.4.tgz", + "integrity": "sha512-E1b1lFFLvLgak2whF2xDBcOy6NLVGZBqqjJjsIhvopKfWWEi64pLVTWWehV8KlLerZkfNTA95sTe2OdJKm1OzQ==", "dev": true, "dependencies": { "basic-ftp": "^5.0.2", - "data-uri-to-buffer": "^6.0.0", - "debug": "^4.3.4", - "fs-extra": "^8.1.0" + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4" }, "engines": { "node": ">= 14" } }, - "node_modules/get-uri/node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/get-uri/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/get-uri/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/gh-pages": { "version": "4.0.0", "dev": true, @@ -10489,9 +10517,9 @@ } }, "node_modules/http-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", - "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, "dependencies": { "agent-base": "^7.1.0", @@ -10525,12 +10553,12 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", - "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" }, "engines": { @@ -10770,6 +10798,25 @@ "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==", "dev": true }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ip-address/node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "dev": true + }, "node_modules/ipaddr.js": { "version": "1.9.1", "dev": true, @@ -11730,8 +11777,9 @@ }, "node_modules/jest-image-snapshot": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/jest-image-snapshot/-/jest-image-snapshot-6.4.0.tgz", + "integrity": "sha512-IWGtSOnelwaVPd09STbJuLmnAwlBC/roJtTLGLb8M3TA0vfku3MRNEXmljTa1EMXqdRbA0oIWiqHFB1ttTGazQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "chalk": "^4.0.0", "get-stdin": "^5.0.1", @@ -12200,6 +12248,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true + }, "node_modules/jscodeshift": { "version": "0.15.1", "resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-0.15.1.tgz", @@ -12842,9 +12896,10 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "dev": true, - "license": "MIT" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true }, "node_modules/multicast-dns": { "version": "7.2.5", @@ -13284,44 +13339,37 @@ } }, "node_modules/pac-proxy-agent": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.1.tgz", - "integrity": "sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz", + "integrity": "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==", "dev": true, "dependencies": { "@tootallnate/quickjs-emscripten": "^0.23.0", - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", "get-uri": "^6.0.1", "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.2", - "pac-resolver": "^7.0.0", - "socks-proxy-agent": "^8.0.2" + "https-proxy-agent": "^7.0.6", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.5" }, "engines": { "node": ">= 14" } }, "node_modules/pac-resolver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.0.tgz", - "integrity": "sha512-Fd9lT9vJbHYRACT8OhCbZBbxr6KRSawSovFpy8nDGshaK99S/EBhVIHp9+crhxrsZOuvLpgL1n23iyPg6Rl2hg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", "dev": true, "dependencies": { "degenerator": "^5.0.0", - "ip": "^1.1.8", "netmask": "^2.0.2" }, "engines": { "node": ">= 14" } }, - "node_modules/pac-resolver/node_modules/ip": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.9.tgz", - "integrity": "sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ==", - "dev": true - }, "node_modules/pako": { "version": "0.2.9", "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", @@ -13845,19 +13893,19 @@ } }, "node_modules/proxy-agent": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.3.1.tgz", - "integrity": "sha512-Rb5RVBy1iyqOtNl15Cw/llpeLH8bsb37gM1FUfKQ+Wck6xHlbAhWGUFiTRHtkjqGTA5pSHz6+0hrPW/oECihPQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", + "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", "dev": true, "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.2", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.6", "lru-cache": "^7.14.1", - "pac-proxy-agent": "^7.0.1", + "pac-proxy-agent": "^7.1.0", "proxy-from-env": "^1.1.0", - "socks-proxy-agent": "^8.0.2" + "socks-proxy-agent": "^8.0.5" }, "engines": { "node": ">= 14" @@ -14075,21 +14123,24 @@ } }, "node_modules/puppeteer": { - "version": "21.11.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-21.11.0.tgz", - "integrity": "sha512-9jTHuYe22TD3sNxy0nEIzC7ZrlRnDgeX3xPkbS7PnbdwYjl2o/z/YuCrRBwezdKpbTDTJ4VqIggzNyeRcKq3cg==", + "version": "24.2.1", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-24.2.1.tgz", + "integrity": "sha512-Euno62ou0cd0dTkOYTNioSOsFF4VpSnz4ldD38hi9ov9xCNtr8DbhmoJRUx+V9OuPgecueZbKOohRrnrhkbg3Q==", "dev": true, "hasInstallScript": true, "dependencies": { - "@puppeteer/browsers": "1.9.1", - "cosmiconfig": "9.0.0", - "puppeteer-core": "21.11.0" + "@puppeteer/browsers": "2.7.1", + "chromium-bidi": "1.3.0", + "cosmiconfig": "^9.0.0", + "devtools-protocol": "0.0.1402036", + "puppeteer-core": "24.2.1", + "typed-query-selector": "^2.12.0" }, "bin": { - "puppeteer": "lib/esm/puppeteer/node/cli.js" + "puppeteer": "lib/cjs/puppeteer/node/cli.js" }, "engines": { - "node": ">=16.13.2" + "node": ">=18" } }, "node_modules/puppeteer-core": { @@ -14233,20 +14284,20 @@ } }, "node_modules/puppeteer/node_modules/puppeteer-core": { - "version": "21.11.0", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-21.11.0.tgz", - "integrity": "sha512-ArbnyA3U5SGHokEvkfWjW+O8hOxV1RSJxOgriX/3A4xZRqixt9ZFHD0yPgZQF05Qj0oAqi8H/7stDorjoHY90Q==", + "version": "24.2.1", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.2.1.tgz", + "integrity": "sha512-bCypUh3WXzETafv1TCFAjIUnI8BiQ/d+XvEfEXDLcIMm9CAvROqnBmbt79yBjwasoDZsgfXnUmIJU7Y27AalVQ==", "dev": true, "dependencies": { - "@puppeteer/browsers": "1.9.1", - "chromium-bidi": "0.5.8", - "cross-fetch": "4.0.0", - "debug": "4.3.4", - "devtools-protocol": "0.0.1232444", - "ws": "8.16.0" + "@puppeteer/browsers": "2.7.1", + "chromium-bidi": "1.3.0", + "debug": "^4.4.0", + "devtools-protocol": "0.0.1402036", + "typed-query-selector": "^2.12.0", + "ws": "^8.18.0" }, "engines": { - "node": ">=16.13.2" + "node": ">=18" } }, "node_modules/pure-rand": { @@ -14298,12 +14349,6 @@ ], "license": "MIT" }, - "node_modules/queue-tick": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", - "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", - "dev": true - }, "node_modules/ramda": { "version": "0.29.0", "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.29.0.tgz", @@ -14938,11 +14983,6 @@ "dev": true, "license": "MIT" }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "dev": true, - "license": "MIT" - }, "node_modules/serialize-javascript": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", @@ -15240,28 +15280,28 @@ } }, "node_modules/socks": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", - "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.4.tgz", + "integrity": "sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==", "dev": true, "dependencies": { - "ip": "^2.0.0", + "ip-address": "^9.0.5", "smart-buffer": "^4.2.0" }, "engines": { - "node": ">= 10.13.0", + "node": ">= 10.0.0", "npm": ">= 3.0.0" } }, "node_modules/socks-proxy-agent": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.2.tgz", - "integrity": "sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==", + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", "dev": true, "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", - "socks": "^2.7.1" + "socks": "^2.8.3" }, "engines": { "node": ">= 14" @@ -16178,13 +16218,13 @@ "dev": true }, "node_modules/streamx": { - "version": "2.15.8", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.8.tgz", - "integrity": "sha512-6pwMeMY/SuISiRsuS8TeIrAzyFbG5gGPHFQsYjUr/pbBadaL1PCWmzKw+CHZSwainfvcF6Si6cVLq4XTEwswFQ==", + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.22.0.tgz", + "integrity": "sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw==", "dev": true, "dependencies": { - "fast-fifo": "^1.1.0", - "queue-tick": "^1.0.1" + "fast-fifo": "^1.3.2", + "text-decoder": "^1.1.0" }, "optionalDependencies": { "bare-events": "^2.2.0" @@ -16769,17 +16809,20 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/text-decoder": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", + "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "dev": true, + "dependencies": { + "b4a": "^1.6.4" + } + }, "node_modules/text-table": { "version": "0.2.0", "dev": true, "license": "MIT" }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true - }, "node_modules/through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", @@ -17299,6 +17342,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typed-query-selector": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.12.0.tgz", + "integrity": "sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==", + "dev": true + }, "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -17391,16 +17440,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/unbzip2-stream": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", - "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", - "dev": true, - "dependencies": { - "buffer": "^5.2.1", - "through": "^2.3.8" - } - }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -17519,12 +17558,6 @@ "punycode": "^2.1.0" } }, - "node_modules/urlpattern-polyfill": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz", - "integrity": "sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==", - "dev": true - }, "node_modules/util": { "version": "0.12.5", "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", @@ -18244,9 +18277,9 @@ } }, "node_modules/ws": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", - "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", "dev": true, "engines": { "node": ">=10.0.0" @@ -18360,6 +18393,15 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zod": { + "version": "3.24.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", + "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/package.json b/package.json index 6075a2a..614619d 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "prettier": "^3.2.5", "prismjs": "^1.29.0", "pug": "^3.0.2", - "puppeteer": "^21.6.1", + "puppeteer": "^24.2.1", "standard": "^17.0.0", "standardx": "^7.0.0", "storybook": "^7.0.20", diff --git a/src/chart.ts b/src/chart.ts index 6594c02..e07a5b3 100644 --- a/src/chart.ts +++ b/src/chart.ts @@ -15,6 +15,7 @@ import helpers from './helpers/index.js' import datumDefaults from './datum-defaults.js' import datumValidation from './datum-validation.js' import globals from './globals.mjs' +import { randomId } from './utils.mjs' export interface ChartMetaMargin { left?: number @@ -82,8 +83,6 @@ export class Chart extends EventEmitter.EventEmitter { private readonly id: string - readonly markerId: string - public meta: ChartMeta /** * options are the input options sent to function plot. @@ -131,12 +130,9 @@ export class Chart extends EventEmitter.EventEmitter { constructor(options: FunctionPlotOptions) { super() - const n = Math.random() - const letter = String.fromCharCode(Math.floor(n * 26) + 97) this.options = options - this.id = letter + n.toString(16).substring(2) + this.id = randomId() this.options.id = this.id - this.markerId = this.id + '-marker' Chart.cache[this.id] = this this.linkedGraphs = [this] this.meta = {} @@ -409,22 +405,6 @@ export class Chart extends EventEmitter.EventEmitter { .selectAll('.clip') .attr('width', this.meta.width) .attr('height', this.meta.height) - - // marker clip (for vectors) - defs - .append('clipPath') - .append('marker') - .attr('id', this.markerId) - .attr('viewBox', '0 -5 10 10') - .attr('refX', 10) - .attr('markerWidth', 5) - .attr('markerHeight', 5) - .attr('orient', 'auto') - .append('svg:path') - .attr('d', 'M0,-5L10,0L0,5L0,0') - .attr('stroke-width', '0px') - .attr('fill-opacity', 1) - .attr('fill', '#777') } private buildAxis() { diff --git a/src/datum-defaults.ts b/src/datum-defaults.ts index e7f5529..5abae75 100644 --- a/src/datum-defaults.ts +++ b/src/datum-defaults.ts @@ -1,6 +1,11 @@ import { FunctionPlotDatum } from './types.js' +import { randomId } from './utils.mjs' export default function datumDefaults(d: FunctionPlotDatum): FunctionPlotDatum { + if (!('id' in d)) { + d.id = randomId() + } + // default graphType uses boxes i.e. 2d intervals if (!('graphType' in d)) { d.graphType = 'interval' diff --git a/src/graph-types/polyline.ts b/src/graph-types/polyline.ts index 0a235ad..06d671b 100644 --- a/src/graph-types/polyline.ts +++ b/src/graph-types/polyline.ts @@ -44,6 +44,36 @@ export default function polyline(chart: Chart) { .y0(chart.meta.yScale(0)) .y1(y) + const vectorMarkerId = `${d.id}-vector-marker` + if (d.fnType === 'vector') { + // vector + const vectorInnerSelection = el.selectAll(':scope > defs').data(evaluatedData) + // enter + vectorInnerSelection + .enter() + .append('defs') + .append('clipPath') + .append('marker') + .attr('id', vectorMarkerId) + .attr('viewBox', '0 -5 10 10') + .attr('refX', 10) + .attr('markerWidth', 5) + .attr('markerHeight', 5) + .attr('orient', 'auto') + .append('path') + .attr('d', 'M0,-5L10,0L0,5L0,0') + .attr('stroke-width', '0px') + .attr('fill-opacity', 1) + + // enter + update + vectorInnerSelection.merge(vectorInnerSelection.enter().selectAll('defs')).each(function () { + d3Select(this).selectAll('path').attr('fill', computedColor) + }) + + // exit + vectorInnerSelection.exit().remove() + } + // join const innerSelection = el.selectAll(':scope > path.line').data(evaluatedData) @@ -71,7 +101,7 @@ export default function polyline(chart: Chart) { .attr('stroke', computedColor) .attr('marker-end', function () { // special marker for vectors - return d.fnType === 'vector' ? 'url(#' + chart.markerId + ')' : null + return d.fnType === 'vector' ? `url(#${vectorMarkerId})` : null }) .attr('d', pathD) diff --git a/src/types.ts b/src/types.ts index 004ee89..dd331d5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -209,6 +209,12 @@ export interface AbstractFunctionDatum { */ range?: [number, number] + /** + * @private + * The id of the graph to render, a random id is assigned during the setup. + */ + id?: string + /** * @private * The datum index diff --git a/src/utils.mjs b/src/utils.mjs index 456b527..44308e5 100644 --- a/src/utils.mjs +++ b/src/utils.mjs @@ -99,6 +99,15 @@ export function infinity() { return 9007199254740991 } +/* + * randomId returns a random string. + */ +export function randomId() { + const n = Math.random() + const letter = String.fromCharCode(Math.floor(n * 26) + 97) + return letter + n.toString(16).substring(2) +} + /** * asserts makes an simple assertion and throws `Error(message)` if the assertion failed */ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-destroy-the-svg-node-on-destroy-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-destroy-the-svg-node-on-destroy-1-snap.png index 6a6b345..3eda993 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-destroy-the-svg-node-on-destroy-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-destroy-the-svg-node-on-destroy-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-evaluate-with-multiple-samples-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-evaluate-with-multiple-samples-1-snap.png index 56274cd..bc2fe88 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-evaluate-with-multiple-samples-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-evaluate-with-multiple-samples-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-multiple-graphs-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-multiple-graphs-1-snap.png index 65511a6..f424506 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-multiple-graphs-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-multiple-graphs-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-a-grid-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-a-grid-1-snap.png index 9e97d3f..73b3388 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-a-grid-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-a-grid-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-a-parametric-function-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-a-parametric-function-1-snap.png index b4b1322..47acf0e 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-a-parametric-function-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-a-parametric-function-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-a-polar-function-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-a-polar-function-1-snap.png index 3a4583e..5829be2 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-a-polar-function-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-a-polar-function-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-an-implicit-function-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-an-implicit-function-1-snap.png index 78c45ef..e8f6140 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-an-implicit-function-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-an-implicit-function-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-an-x-2-graph-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-an-x-2-graph-1-snap.png index 4a7508a..d4bc23f 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-an-x-2-graph-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-an-x-2-graph-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-annotations-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-annotations-1-snap.png index ea6c99a..f321ba6 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-annotations-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-annotations-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-closed-paths-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-closed-paths-1-snap.png index 827dbfa..2ffb081 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-closed-paths-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-closed-paths-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-derivative-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-derivative-1-snap.png index 6bb0bb6..3cf619f 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-derivative-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-derivative-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-different-graph-types-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-different-graph-types-1-snap.png index c191c1f..2d3c960 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-different-graph-types-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-different-graph-types-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-distinct-domains-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-distinct-domains-1-snap.png index c3f5300..98465fc 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-distinct-domains-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-distinct-domains-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-logarithmic-scales-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-logarithmic-scales-1-snap.png index 009473a..06829b9 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-logarithmic-scales-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-logarithmic-scales-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-nth-root-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-nth-root-1-snap.png index ca9373e..510c9da 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-nth-root-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-nth-root-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-points-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-points-1-snap.png index 0da7591..7ed9d1b 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-points-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-points-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-secants-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-secants-1-snap.png index 9686463..1fff414 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-secants-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-secants-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-text-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-text-1-snap.png index d1d485a..e46b265 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-text-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-text-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-vectors-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-vectors-1-snap.png index 82c4165..fd43d1c 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-vectors-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-vectors-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-with-additional-options-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-with-additional-options-1-snap.png index 3355f76..02508cc 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-with-additional-options-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-with-additional-options-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-with-sticky-axes-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-with-sticky-axes-1-snap.png index c9ce249..c379d61 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-with-sticky-axes-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-with-sticky-axes-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-x-2-async-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-x-2-async-1-snap.png index 19d71e0..be5a78e 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-x-2-async-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-should-render-x-2-async-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-update-the-graph-using-multiple-renders-1-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-update-the-graph-using-multiple-renders-1-snap.png index 1d20309..d4bc23f 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-update-the-graph-using-multiple-renders-1-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-update-the-graph-using-multiple-renders-1-snap.png differ diff --git a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-update-the-graph-using-multiple-renders-2-snap.png b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-update-the-graph-using-multiple-renders-2-snap.png index 89d291a..8c2bd04 100644 Binary files a/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-update-the-graph-using-multiple-renders-2-snap.png and b/test/e2e/__image_snapshots__/graphs-test-ts-function-plot-update-the-graph-using-multiple-renders-2-snap.png differ diff --git a/test/e2e/graphs.test.ts b/test/e2e/graphs.test.ts index 725ca3f..29d20cc 100644 --- a/test/e2e/graphs.test.ts +++ b/test/e2e/graphs.test.ts @@ -13,7 +13,7 @@ const matchSnapshotConfig = { } async function getPage() { - const browser = await puppeteer.launch({ headless: 'new' }) + const browser = await puppeteer.launch({ args: ['--no-sandbox', '--disable-setuid-sandbox'] }) const page = await browser.newPage() await page.setViewport({ width: 1000, @@ -49,7 +49,7 @@ describe('Function Plot', () => { }) } - const image = await page.screenshot() + const image = await page.screenshot({ encoding: 'base64' }) // @ts-ignore expect(image).toMatchImageSnapshot(matchSnapshotConfig) }) @@ -64,7 +64,7 @@ describe('Function Plot', () => { functionPlot(dualRender) ` await page.evaluate(firstRender.toString()) - const firstImage = await page.screenshot() + const firstImage = await page.screenshot({ encoding: 'base64' }) // @ts-ignore expect(firstImage).toMatchImageSnapshot(matchSnapshotConfig) @@ -73,7 +73,7 @@ describe('Function Plot', () => { functionPlot(dualRender) ` await page.evaluate(secondRender.toString()) - const secondImage = await page.screenshot() + const secondImage = await page.screenshot({ encoding: 'base64' }) // @ts-ignore expect(secondImage).toMatchImageSnapshot(matchSnapshotConfig) })