From d06a1d1eb2619e949abe93bf926283e16f23a165 Mon Sep 17 00:00:00 2001 From: Mauricio Poppe Date: Sun, 10 Dec 2023 18:48:49 -0500 Subject: [PATCH] Install events library from npm Bundlers like vite does not automatically polyfill node modules, functionPlot uses the events library from npm and relies on the bundler to bundle it when needed. The solution is to install events from npm, it has the same API and it tells the bundler that it should install it when functionPlot is used. --- README.md | 2 +- package-lock.json | 2 +- package.json | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc048d2..813499b 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Thanks to [@liuyao12](https://github.com/liuyao12) for the initial version of th npm install function-plot ``` -## Examples +## Usage ```javascript import functionPlot from 'function-plot' diff --git a/package-lock.json b/package-lock.json index 9160b5a..bcfc6f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "d3-selection": "^3.0.0", "d3-shape": "^3.1.0", "d3-zoom": "^3.0.0", + "events": "^3.3.0", "interval-arithmetic-eval": "^0.5.1" }, "devDependencies": { @@ -9812,7 +9813,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, "engines": { "node": ">=0.8.x" } diff --git a/package.json b/package.json index 8bdd01f..cf7b172 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "d3-selection": "^3.0.0", "d3-shape": "^3.1.0", "d3-zoom": "^3.0.0", + "events": "^3.3.0", "interval-arithmetic-eval": "^0.5.1" }, "devDependencies": {