├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── index.js ├── package-lock.json ├── package.json ├── src ├── area-label.js └── fits.js └── test ├── area-label-test.cjs ├── index.html └── smallN.html /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | build/ 3 | node_modules 4 | npm-debug.log 5 | *.swp 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | build/*.zip 2 | test/ 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2017, Curran Kelleher 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the author nor the names of contributors may be used to 15 | endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # d3-area-label 2 | 3 | A library for placing labels in areas. 4 | 5 | [![image](https://user-images.githubusercontent.com/68416/28745722-a5d9e7a4-749b-11e7-92a8-227a56cd3ead.png)](https://vizhub.com/curran/6b0cd8ff5e554d43825c4eb273080b91) 6 | 7 | [![image](https://user-images.githubusercontent.com/68416/28940637-0376ab84-78b3-11e7-858b-7b0320ea9e5a.png)](https://vizhub.com/curran/cc85124d2a7d424b92cd691d4fa3ea4c) 8 | 9 | [![image](https://user-images.githubusercontent.com/68416/44972649-9294e280-af77-11e8-81ac-22e0155a243f.png)](https://www.axios.com/us-nation-of-immigrants-24723a19-892a-4a7d-8298-f48c563f1526.html) 10 | 11 | You can use this to position labels on a [StreamGraph](http://leebyron.com/streamgraph/) or Stacked Area Chart. 12 | 13 | Example usage: 14 | 15 | ```js 16 | const labels = svg.selectAll('text').data(stacked) 17 | labels 18 | .enter().append('text') 19 | .attr('class', 'area-label') 20 | .merge(labels) 21 | .text(d => d.key) 22 | .attr('transform', d3.areaLabel(area)) // <---------- Call the function like this. 23 | ``` 24 | 25 | For more details and context, see [test/index.html](test/index.html) or [run the example on bl.ocks.org](https://bl.ocks.org/curran/2793201c7025c416c471e30d30546c6b). 26 | 27 | ## How it Works 28 | The label placement algorithm works as follows: 29 | 30 | * Measure the width and height of the bounding box of the text. 31 | * Use the [bisection method](https://en.wikipedia.org/wiki/Bisection_method#Algorithm) to search for the maximum size rectangle that fits within the area and has the same aspect ratio as the measured bounding box. 32 | * For each iteration of the bisection method (where a specific size is given for testing), loop through all X coordinates that may potentially be used as the left edge of the label bounding box and perform the following test. 33 | * For a given X coordinate to be used as the left edge of the label, `x0`, find the first X coordinate that falls after the right edge of the label `x1`. For each X coordinate `x` between (and including) `x0` and `x1`, compute the `ceiling` and `floor` to be the lowest Y coordinate of the top curve of the area and the highest Y coordinate of the bottom curve of the area, respectively. 34 | * If at any point `(ceiling - floor) < height`, where `height` is the height of the label bounding box being tested, break out of this iteration and move on to testing the next X coordinate. 35 | * If `(ceiling - floor) >= height` after having checked all `x` between `x0` and `x1`, return the current `x` value as the solution. **Note** Only the first solution found is returned, no attempt is made to optimize this solution, because the optimization occurs at the level of scale choice; the bisection method will converge to a scale for which there is only 1 or very few solutions. 36 | * If no solution was found after having looped through all available X coordinates to be used as the left edge of the label, return `false`. 37 | 38 | The set of possible X coordinate to be used as the left edge of the label depends on how *[interpolate](#interpolate)* and *[interpolateResolution](#interpolateResolution)* are configured. If interpolation is turned off, the original X coordinates from the data points are the only coordinates considered for label placement. For datasets where there are large gaps between X coordinates, we can improve label placement by turning on interpolation, which will generate a certain number (`interpolateResolution`) of evenly spaced X coordinates and use linear interpolation to compute the corresponding Y coordinates for the top and bottom of the area curve. Cranking up the `interpolateResolution` value leads to more optimal label placement at the cost of more computation. 39 | 40 | ## Installing 41 | 42 | If you use NPM, `npm install d3-area-label`. Otherwise, download the [latest release](https://github.com/curran/d3-area-label/releases/latest). 43 | 44 | ## API Reference 45 | 46 | # d3.areaLabel([area]) 47 | 48 | Constructs a new label position generator. 49 | 50 | If *area* is specified, invokes areaLabel.area as well (equivalent to `d3.areaLabel().area(area)`). 51 | 52 | # areaLabel(data) 53 | 54 | Invoke the label position generator with the given *data* array. 55 | 56 | This function computes the optimal position and size for a label and returns an SVG transform string. 57 | 58 | # areaLabel.area(area) 59 | 60 | Sets the *[x](#x)*, *[y0](#y0)*, and *[y1](#y1)* accessors applied to the data array from the given *area*, an instance of [d3.area](https://github.com/d3/d3-shape#area). 61 | 62 | # areaLabel.x(x) 63 | 64 | If *x* is specified, sets the x accessor applied to the data array and returns the label position generator. If *x* is not specified, returns the current x. 65 | 66 | # areaLabel.y0(y0) 67 | 68 | If *y0* is specified, sets the y0 accessor applied to the data array and returns the label position generator. If *y0* is not specified, returns the current y0. 69 | 70 | # areaLabel.y1(y1) 71 | 72 | If *y1* is specified, sets the y1 accessor applied to the data array and returns the label position generator. If *y1* is not specified, returns the current y1. 73 | 74 | # areaLabel.minHeight(minHeight) 75 | 76 | The minimum label bounding box height in pixels. Default is 2. 77 | 78 | # areaLabel.epsilon(epsilon) 79 | 80 | The tolerance within we wish to optimize the bounding box height (in pixels). Default is 0.01; 81 | 82 | # areaLabel.maxIterations(maxIterations) 83 | 84 | The maximum number of iterations for the [bisection method algorithm](https://en.wikipedia.org/wiki/Bisection_method#Algorithm), which is used to find the maximum height rectangle that fits within the area. 85 | 86 | # areaLabel.interpolate(interpolate) 87 | 88 | A boolean value that determines whether or not linear interpolation is used for computing label positions. 89 | 90 | If set to *false*, only X coordinates that correspond to data points are considered for use as the leftmost position of the label bounding box. In cases where there is a high number of evenly spaced data points, a value of *false* works quite well. When there is a low number of data points, a value of *false* leads to embarassingly pathetic label placements. 91 | 92 | If set to *true*, then a fixed number of X coordinates (**[interpolateResolution](#interpolateResolution)** to be exact), not necessarily corresponding to data points, are considered for use as the leftmost position of the label bounding box. The upper and lower Y values for those X values are imputed from the nearest X values from the data using [linear interpolation](https://en.wikipedia.org/wiki/Linear_interpolation). When there is a low number of data points, a value of *true* improves label placement by leaps and bounds. A value of *true* also leads to more expensive computation for placing labels, so if you're encountering performance problems, try setting this to *false*. 93 | 94 | Default is *true*. 95 | 96 | # areaLabel.interpolateResolution(interpolateResolution) 97 | 98 | The integer number of possible X positions to check for placing the leftmost edge of the label bounding box. The X extent of the area is subdivided evenly into this many points. When each point is checked, linear interpolation is used to estimate the data value. Default is 200. 99 | 100 | This only comes into effect if **[interpolate](#interpolate)** is set to *true*. 101 | 102 | # areaLabel.paddingLeft(paddingLeft) 103 | 104 | The left padding for labels. This should be a value between 0 and 1. Default is 0. 105 | 106 | # areaLabel.paddingRight(paddingRight) 107 | 108 | The right padding for labels. This should be a value between 0 and 1. Default is 0. 109 | 110 | # areaLabel.paddingTop(paddingTop) 111 | 112 | The top padding for labels. This should be a value between 0 and 1. Default is 0. 113 | 114 | # areaLabel.paddingBottom(paddingBottom) 115 | 116 | The bottom padding for labels. This should be a value between 0 and 1. Default is 0. 117 | 118 | # areaLabel.paddingX(paddingX) 119 | 120 | A convenience method for simultaneously setting *[paddingLeft](#paddingLeft)* and *[paddingRight](#paddingRight)*. 121 | 122 | # areaLabel.paddingY(paddingY) 123 | 124 | A convenience method for simultaneously setting *[paddingTop](#paddingTop)* and *[paddingBottom](#paddingBottom)*. 125 | 126 | # areaLabel.padding(padding) 127 | 128 | A convenience method for simultaneously setting *[paddingX](#paddingX)* and *[paddingY](#paddingY)*. 129 | 130 | # Thanks 131 | 132 | Many thanks to Lee Byron, Noah Veltman, Philippe Rivière, and Adam Pearce for ideas and input. 133 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | export { default as areaLabel } from "./src/area-label"; 2 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "d3-area-label", 3 | "version": "1.6.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "d3-area-label", 9 | "version": "1.6.0", 10 | "license": "BSD-3-Clause", 11 | "dependencies": { 12 | "d3-array": "^3.2.4", 13 | "d3-scale": "^4.0.2" 14 | }, 15 | "devDependencies": { 16 | "http-server": "^14.1.1", 17 | "rollup": "4.12", 18 | "tape": "5", 19 | "uglify-js": "3" 20 | } 21 | }, 22 | "node_modules/@ljharb/resumer": { 23 | "version": "0.1.2", 24 | "resolved": "https://registry.npmjs.org/@ljharb/resumer/-/resumer-0.1.2.tgz", 25 | "integrity": "sha512-opZnY9WsZ6tjPSpmTEdPY+LpxpEwqg3VsQiGFv+wAaA1ffTghnG019mAD8BKxkcpZx6HtvNj0vdyxDHTxPQlJw==", 26 | "dev": true, 27 | "dependencies": { 28 | "@ljharb/through": "^2.3.12" 29 | }, 30 | "engines": { 31 | "node": ">= 0.4" 32 | } 33 | }, 34 | "node_modules/@ljharb/through": { 35 | "version": "2.3.12", 36 | "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.12.tgz", 37 | "integrity": "sha512-ajo/heTlG3QgC8EGP6APIejksVAYt4ayz4tqoP3MolFELzcH1x1fzwEYRJTPO0IELutZ5HQ0c26/GqAYy79u3g==", 38 | "dev": true, 39 | "dependencies": { 40 | "call-bind": "^1.0.5" 41 | }, 42 | "engines": { 43 | "node": ">= 0.4" 44 | } 45 | }, 46 | "node_modules/@rollup/rollup-android-arm-eabi": { 47 | "version": "4.12.0", 48 | "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", 49 | "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", 50 | "cpu": [ 51 | "arm" 52 | ], 53 | "dev": true, 54 | "optional": true, 55 | "os": [ 56 | "android" 57 | ] 58 | }, 59 | "node_modules/@rollup/rollup-android-arm64": { 60 | "version": "4.12.0", 61 | "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", 62 | "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", 63 | "cpu": [ 64 | "arm64" 65 | ], 66 | "dev": true, 67 | "optional": true, 68 | "os": [ 69 | "android" 70 | ] 71 | }, 72 | "node_modules/@rollup/rollup-darwin-arm64": { 73 | "version": "4.12.0", 74 | "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", 75 | "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", 76 | "cpu": [ 77 | "arm64" 78 | ], 79 | "dev": true, 80 | "optional": true, 81 | "os": [ 82 | "darwin" 83 | ] 84 | }, 85 | "node_modules/@rollup/rollup-darwin-x64": { 86 | "version": "4.12.0", 87 | "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", 88 | "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", 89 | "cpu": [ 90 | "x64" 91 | ], 92 | "dev": true, 93 | "optional": true, 94 | "os": [ 95 | "darwin" 96 | ] 97 | }, 98 | "node_modules/@rollup/rollup-linux-arm-gnueabihf": { 99 | "version": "4.12.0", 100 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", 101 | "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", 102 | "cpu": [ 103 | "arm" 104 | ], 105 | "dev": true, 106 | "optional": true, 107 | "os": [ 108 | "linux" 109 | ] 110 | }, 111 | "node_modules/@rollup/rollup-linux-arm64-gnu": { 112 | "version": "4.12.0", 113 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", 114 | "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", 115 | "cpu": [ 116 | "arm64" 117 | ], 118 | "dev": true, 119 | "optional": true, 120 | "os": [ 121 | "linux" 122 | ] 123 | }, 124 | "node_modules/@rollup/rollup-linux-arm64-musl": { 125 | "version": "4.12.0", 126 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", 127 | "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", 128 | "cpu": [ 129 | "arm64" 130 | ], 131 | "dev": true, 132 | "optional": true, 133 | "os": [ 134 | "linux" 135 | ] 136 | }, 137 | "node_modules/@rollup/rollup-linux-riscv64-gnu": { 138 | "version": "4.12.0", 139 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", 140 | "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", 141 | "cpu": [ 142 | "riscv64" 143 | ], 144 | "dev": true, 145 | "optional": true, 146 | "os": [ 147 | "linux" 148 | ] 149 | }, 150 | "node_modules/@rollup/rollup-linux-x64-gnu": { 151 | "version": "4.12.0", 152 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", 153 | "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", 154 | "cpu": [ 155 | "x64" 156 | ], 157 | "dev": true, 158 | "optional": true, 159 | "os": [ 160 | "linux" 161 | ] 162 | }, 163 | "node_modules/@rollup/rollup-linux-x64-musl": { 164 | "version": "4.12.0", 165 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", 166 | "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", 167 | "cpu": [ 168 | "x64" 169 | ], 170 | "dev": true, 171 | "optional": true, 172 | "os": [ 173 | "linux" 174 | ] 175 | }, 176 | "node_modules/@rollup/rollup-win32-arm64-msvc": { 177 | "version": "4.12.0", 178 | "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", 179 | "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", 180 | "cpu": [ 181 | "arm64" 182 | ], 183 | "dev": true, 184 | "optional": true, 185 | "os": [ 186 | "win32" 187 | ] 188 | }, 189 | "node_modules/@rollup/rollup-win32-ia32-msvc": { 190 | "version": "4.12.0", 191 | "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", 192 | "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", 193 | "cpu": [ 194 | "ia32" 195 | ], 196 | "dev": true, 197 | "optional": true, 198 | "os": [ 199 | "win32" 200 | ] 201 | }, 202 | "node_modules/@rollup/rollup-win32-x64-msvc": { 203 | "version": "4.12.0", 204 | "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", 205 | "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", 206 | "cpu": [ 207 | "x64" 208 | ], 209 | "dev": true, 210 | "optional": true, 211 | "os": [ 212 | "win32" 213 | ] 214 | }, 215 | "node_modules/@types/estree": { 216 | "version": "1.0.5", 217 | "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", 218 | "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", 219 | "dev": true 220 | }, 221 | "node_modules/ansi-styles": { 222 | "version": "4.3.0", 223 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 224 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 225 | "dev": true, 226 | "dependencies": { 227 | "color-convert": "^2.0.1" 228 | }, 229 | "engines": { 230 | "node": ">=8" 231 | }, 232 | "funding": { 233 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 234 | } 235 | }, 236 | "node_modules/array-buffer-byte-length": { 237 | "version": "1.0.1", 238 | "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", 239 | "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", 240 | "dev": true, 241 | "dependencies": { 242 | "call-bind": "^1.0.5", 243 | "is-array-buffer": "^3.0.4" 244 | }, 245 | "engines": { 246 | "node": ">= 0.4" 247 | }, 248 | "funding": { 249 | "url": "https://github.com/sponsors/ljharb" 250 | } 251 | }, 252 | "node_modules/array.prototype.every": { 253 | "version": "1.1.5", 254 | "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.5.tgz", 255 | "integrity": "sha512-FfMQJ+/joFGXpRCltbzV3znaP5QxIhLFySo0fEPn3GuoYlud9LhknMCIxdYKC2qsM/6VHoSp6YGwe3EZXrEcwQ==", 256 | "dev": true, 257 | "dependencies": { 258 | "call-bind": "^1.0.2", 259 | "define-properties": "^1.2.0", 260 | "es-abstract": "^1.22.1", 261 | "is-string": "^1.0.7" 262 | }, 263 | "engines": { 264 | "node": ">= 0.4" 265 | }, 266 | "funding": { 267 | "url": "https://github.com/sponsors/ljharb" 268 | } 269 | }, 270 | "node_modules/arraybuffer.prototype.slice": { 271 | "version": "1.0.3", 272 | "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", 273 | "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", 274 | "dev": true, 275 | "dependencies": { 276 | "array-buffer-byte-length": "^1.0.1", 277 | "call-bind": "^1.0.5", 278 | "define-properties": "^1.2.1", 279 | "es-abstract": "^1.22.3", 280 | "es-errors": "^1.2.1", 281 | "get-intrinsic": "^1.2.3", 282 | "is-array-buffer": "^3.0.4", 283 | "is-shared-array-buffer": "^1.0.2" 284 | }, 285 | "engines": { 286 | "node": ">= 0.4" 287 | }, 288 | "funding": { 289 | "url": "https://github.com/sponsors/ljharb" 290 | } 291 | }, 292 | "node_modules/async": { 293 | "version": "2.6.4", 294 | "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", 295 | "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", 296 | "dev": true, 297 | "dependencies": { 298 | "lodash": "^4.17.14" 299 | } 300 | }, 301 | "node_modules/available-typed-arrays": { 302 | "version": "1.0.7", 303 | "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", 304 | "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", 305 | "dev": true, 306 | "dependencies": { 307 | "possible-typed-array-names": "^1.0.0" 308 | }, 309 | "engines": { 310 | "node": ">= 0.4" 311 | }, 312 | "funding": { 313 | "url": "https://github.com/sponsors/ljharb" 314 | } 315 | }, 316 | "node_modules/balanced-match": { 317 | "version": "1.0.2", 318 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 319 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 320 | "dev": true 321 | }, 322 | "node_modules/basic-auth": { 323 | "version": "2.0.1", 324 | "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", 325 | "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", 326 | "dev": true, 327 | "dependencies": { 328 | "safe-buffer": "5.1.2" 329 | }, 330 | "engines": { 331 | "node": ">= 0.8" 332 | } 333 | }, 334 | "node_modules/brace-expansion": { 335 | "version": "1.1.11", 336 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 337 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 338 | "dev": true, 339 | "dependencies": { 340 | "balanced-match": "^1.0.0", 341 | "concat-map": "0.0.1" 342 | } 343 | }, 344 | "node_modules/call-bind": { 345 | "version": "1.0.7", 346 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", 347 | "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", 348 | "dev": true, 349 | "dependencies": { 350 | "es-define-property": "^1.0.0", 351 | "es-errors": "^1.3.0", 352 | "function-bind": "^1.1.2", 353 | "get-intrinsic": "^1.2.4", 354 | "set-function-length": "^1.2.1" 355 | }, 356 | "engines": { 357 | "node": ">= 0.4" 358 | }, 359 | "funding": { 360 | "url": "https://github.com/sponsors/ljharb" 361 | } 362 | }, 363 | "node_modules/chalk": { 364 | "version": "4.1.2", 365 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 366 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 367 | "dev": true, 368 | "dependencies": { 369 | "ansi-styles": "^4.1.0", 370 | "supports-color": "^7.1.0" 371 | }, 372 | "engines": { 373 | "node": ">=10" 374 | }, 375 | "funding": { 376 | "url": "https://github.com/chalk/chalk?sponsor=1" 377 | } 378 | }, 379 | "node_modules/color-convert": { 380 | "version": "2.0.1", 381 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 382 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 383 | "dev": true, 384 | "dependencies": { 385 | "color-name": "~1.1.4" 386 | }, 387 | "engines": { 388 | "node": ">=7.0.0" 389 | } 390 | }, 391 | "node_modules/color-name": { 392 | "version": "1.1.4", 393 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 394 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 395 | "dev": true 396 | }, 397 | "node_modules/concat-map": { 398 | "version": "0.0.1", 399 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 400 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", 401 | "dev": true 402 | }, 403 | "node_modules/corser": { 404 | "version": "2.0.1", 405 | "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", 406 | "integrity": "sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ==", 407 | "dev": true, 408 | "engines": { 409 | "node": ">= 0.4.0" 410 | } 411 | }, 412 | "node_modules/d3-array": { 413 | "version": "3.2.4", 414 | "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", 415 | "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", 416 | "dependencies": { 417 | "internmap": "1 - 2" 418 | }, 419 | "engines": { 420 | "node": ">=12" 421 | } 422 | }, 423 | "node_modules/d3-color": { 424 | "version": "3.1.0", 425 | "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", 426 | "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", 427 | "engines": { 428 | "node": ">=12" 429 | } 430 | }, 431 | "node_modules/d3-format": { 432 | "version": "3.1.0", 433 | "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz", 434 | "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==", 435 | "engines": { 436 | "node": ">=12" 437 | } 438 | }, 439 | "node_modules/d3-interpolate": { 440 | "version": "3.0.1", 441 | "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", 442 | "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", 443 | "dependencies": { 444 | "d3-color": "1 - 3" 445 | }, 446 | "engines": { 447 | "node": ">=12" 448 | } 449 | }, 450 | "node_modules/d3-scale": { 451 | "version": "4.0.2", 452 | "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", 453 | "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", 454 | "dependencies": { 455 | "d3-array": "2.10.0 - 3", 456 | "d3-format": "1 - 3", 457 | "d3-interpolate": "1.2.0 - 3", 458 | "d3-time": "2.1.1 - 3", 459 | "d3-time-format": "2 - 4" 460 | }, 461 | "engines": { 462 | "node": ">=12" 463 | } 464 | }, 465 | "node_modules/d3-time": { 466 | "version": "3.1.0", 467 | "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", 468 | "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", 469 | "dependencies": { 470 | "d3-array": "2 - 3" 471 | }, 472 | "engines": { 473 | "node": ">=12" 474 | } 475 | }, 476 | "node_modules/d3-time-format": { 477 | "version": "4.1.0", 478 | "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", 479 | "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", 480 | "dependencies": { 481 | "d3-time": "1 - 3" 482 | }, 483 | "engines": { 484 | "node": ">=12" 485 | } 486 | }, 487 | "node_modules/debug": { 488 | "version": "3.2.7", 489 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", 490 | "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", 491 | "dev": true, 492 | "dependencies": { 493 | "ms": "^2.1.1" 494 | } 495 | }, 496 | "node_modules/deep-equal": { 497 | "version": "2.2.3", 498 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", 499 | "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", 500 | "dev": true, 501 | "dependencies": { 502 | "array-buffer-byte-length": "^1.0.0", 503 | "call-bind": "^1.0.5", 504 | "es-get-iterator": "^1.1.3", 505 | "get-intrinsic": "^1.2.2", 506 | "is-arguments": "^1.1.1", 507 | "is-array-buffer": "^3.0.2", 508 | "is-date-object": "^1.0.5", 509 | "is-regex": "^1.1.4", 510 | "is-shared-array-buffer": "^1.0.2", 511 | "isarray": "^2.0.5", 512 | "object-is": "^1.1.5", 513 | "object-keys": "^1.1.1", 514 | "object.assign": "^4.1.4", 515 | "regexp.prototype.flags": "^1.5.1", 516 | "side-channel": "^1.0.4", 517 | "which-boxed-primitive": "^1.0.2", 518 | "which-collection": "^1.0.1", 519 | "which-typed-array": "^1.1.13" 520 | }, 521 | "engines": { 522 | "node": ">= 0.4" 523 | }, 524 | "funding": { 525 | "url": "https://github.com/sponsors/ljharb" 526 | } 527 | }, 528 | "node_modules/define-data-property": { 529 | "version": "1.1.4", 530 | "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", 531 | "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", 532 | "dev": true, 533 | "dependencies": { 534 | "es-define-property": "^1.0.0", 535 | "es-errors": "^1.3.0", 536 | "gopd": "^1.0.1" 537 | }, 538 | "engines": { 539 | "node": ">= 0.4" 540 | }, 541 | "funding": { 542 | "url": "https://github.com/sponsors/ljharb" 543 | } 544 | }, 545 | "node_modules/define-properties": { 546 | "version": "1.2.1", 547 | "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", 548 | "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", 549 | "dev": true, 550 | "dependencies": { 551 | "define-data-property": "^1.0.1", 552 | "has-property-descriptors": "^1.0.0", 553 | "object-keys": "^1.1.1" 554 | }, 555 | "engines": { 556 | "node": ">= 0.4" 557 | }, 558 | "funding": { 559 | "url": "https://github.com/sponsors/ljharb" 560 | } 561 | }, 562 | "node_modules/defined": { 563 | "version": "1.0.1", 564 | "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", 565 | "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", 566 | "dev": true, 567 | "funding": { 568 | "url": "https://github.com/sponsors/ljharb" 569 | } 570 | }, 571 | "node_modules/dotignore": { 572 | "version": "0.1.2", 573 | "resolved": "https://registry.npmjs.org/dotignore/-/dotignore-0.1.2.tgz", 574 | "integrity": "sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==", 575 | "dev": true, 576 | "dependencies": { 577 | "minimatch": "^3.0.4" 578 | }, 579 | "bin": { 580 | "ignored": "bin/ignored" 581 | } 582 | }, 583 | "node_modules/es-abstract": { 584 | "version": "1.22.5", 585 | "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.5.tgz", 586 | "integrity": "sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w==", 587 | "dev": true, 588 | "dependencies": { 589 | "array-buffer-byte-length": "^1.0.1", 590 | "arraybuffer.prototype.slice": "^1.0.3", 591 | "available-typed-arrays": "^1.0.7", 592 | "call-bind": "^1.0.7", 593 | "es-define-property": "^1.0.0", 594 | "es-errors": "^1.3.0", 595 | "es-set-tostringtag": "^2.0.3", 596 | "es-to-primitive": "^1.2.1", 597 | "function.prototype.name": "^1.1.6", 598 | "get-intrinsic": "^1.2.4", 599 | "get-symbol-description": "^1.0.2", 600 | "globalthis": "^1.0.3", 601 | "gopd": "^1.0.1", 602 | "has-property-descriptors": "^1.0.2", 603 | "has-proto": "^1.0.3", 604 | "has-symbols": "^1.0.3", 605 | "hasown": "^2.0.1", 606 | "internal-slot": "^1.0.7", 607 | "is-array-buffer": "^3.0.4", 608 | "is-callable": "^1.2.7", 609 | "is-negative-zero": "^2.0.3", 610 | "is-regex": "^1.1.4", 611 | "is-shared-array-buffer": "^1.0.3", 612 | "is-string": "^1.0.7", 613 | "is-typed-array": "^1.1.13", 614 | "is-weakref": "^1.0.2", 615 | "object-inspect": "^1.13.1", 616 | "object-keys": "^1.1.1", 617 | "object.assign": "^4.1.5", 618 | "regexp.prototype.flags": "^1.5.2", 619 | "safe-array-concat": "^1.1.0", 620 | "safe-regex-test": "^1.0.3", 621 | "string.prototype.trim": "^1.2.8", 622 | "string.prototype.trimend": "^1.0.7", 623 | "string.prototype.trimstart": "^1.0.7", 624 | "typed-array-buffer": "^1.0.2", 625 | "typed-array-byte-length": "^1.0.1", 626 | "typed-array-byte-offset": "^1.0.2", 627 | "typed-array-length": "^1.0.5", 628 | "unbox-primitive": "^1.0.2", 629 | "which-typed-array": "^1.1.14" 630 | }, 631 | "engines": { 632 | "node": ">= 0.4" 633 | }, 634 | "funding": { 635 | "url": "https://github.com/sponsors/ljharb" 636 | } 637 | }, 638 | "node_modules/es-define-property": { 639 | "version": "1.0.0", 640 | "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", 641 | "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", 642 | "dev": true, 643 | "dependencies": { 644 | "get-intrinsic": "^1.2.4" 645 | }, 646 | "engines": { 647 | "node": ">= 0.4" 648 | } 649 | }, 650 | "node_modules/es-errors": { 651 | "version": "1.3.0", 652 | "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", 653 | "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", 654 | "dev": true, 655 | "engines": { 656 | "node": ">= 0.4" 657 | } 658 | }, 659 | "node_modules/es-get-iterator": { 660 | "version": "1.1.3", 661 | "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", 662 | "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", 663 | "dev": true, 664 | "dependencies": { 665 | "call-bind": "^1.0.2", 666 | "get-intrinsic": "^1.1.3", 667 | "has-symbols": "^1.0.3", 668 | "is-arguments": "^1.1.1", 669 | "is-map": "^2.0.2", 670 | "is-set": "^2.0.2", 671 | "is-string": "^1.0.7", 672 | "isarray": "^2.0.5", 673 | "stop-iteration-iterator": "^1.0.0" 674 | }, 675 | "funding": { 676 | "url": "https://github.com/sponsors/ljharb" 677 | } 678 | }, 679 | "node_modules/es-set-tostringtag": { 680 | "version": "2.0.3", 681 | "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", 682 | "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", 683 | "dev": true, 684 | "dependencies": { 685 | "get-intrinsic": "^1.2.4", 686 | "has-tostringtag": "^1.0.2", 687 | "hasown": "^2.0.1" 688 | }, 689 | "engines": { 690 | "node": ">= 0.4" 691 | } 692 | }, 693 | "node_modules/es-to-primitive": { 694 | "version": "1.2.1", 695 | "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", 696 | "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", 697 | "dev": true, 698 | "dependencies": { 699 | "is-callable": "^1.1.4", 700 | "is-date-object": "^1.0.1", 701 | "is-symbol": "^1.0.2" 702 | }, 703 | "engines": { 704 | "node": ">= 0.4" 705 | }, 706 | "funding": { 707 | "url": "https://github.com/sponsors/ljharb" 708 | } 709 | }, 710 | "node_modules/eventemitter3": { 711 | "version": "4.0.7", 712 | "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", 713 | "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", 714 | "dev": true 715 | }, 716 | "node_modules/follow-redirects": { 717 | "version": "1.15.5", 718 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", 719 | "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", 720 | "dev": true, 721 | "funding": [ 722 | { 723 | "type": "individual", 724 | "url": "https://github.com/sponsors/RubenVerborgh" 725 | } 726 | ], 727 | "engines": { 728 | "node": ">=4.0" 729 | }, 730 | "peerDependenciesMeta": { 731 | "debug": { 732 | "optional": true 733 | } 734 | } 735 | }, 736 | "node_modules/for-each": { 737 | "version": "0.3.3", 738 | "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", 739 | "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", 740 | "dev": true, 741 | "dependencies": { 742 | "is-callable": "^1.1.3" 743 | } 744 | }, 745 | "node_modules/fs.realpath": { 746 | "version": "1.0.0", 747 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 748 | "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", 749 | "dev": true 750 | }, 751 | "node_modules/fsevents": { 752 | "version": "2.3.3", 753 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", 754 | "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", 755 | "dev": true, 756 | "hasInstallScript": true, 757 | "optional": true, 758 | "os": [ 759 | "darwin" 760 | ], 761 | "engines": { 762 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 763 | } 764 | }, 765 | "node_modules/function-bind": { 766 | "version": "1.1.2", 767 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", 768 | "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", 769 | "dev": true, 770 | "funding": { 771 | "url": "https://github.com/sponsors/ljharb" 772 | } 773 | }, 774 | "node_modules/function.prototype.name": { 775 | "version": "1.1.6", 776 | "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", 777 | "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", 778 | "dev": true, 779 | "dependencies": { 780 | "call-bind": "^1.0.2", 781 | "define-properties": "^1.2.0", 782 | "es-abstract": "^1.22.1", 783 | "functions-have-names": "^1.2.3" 784 | }, 785 | "engines": { 786 | "node": ">= 0.4" 787 | }, 788 | "funding": { 789 | "url": "https://github.com/sponsors/ljharb" 790 | } 791 | }, 792 | "node_modules/functions-have-names": { 793 | "version": "1.2.3", 794 | "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", 795 | "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", 796 | "dev": true, 797 | "funding": { 798 | "url": "https://github.com/sponsors/ljharb" 799 | } 800 | }, 801 | "node_modules/get-intrinsic": { 802 | "version": "1.2.4", 803 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", 804 | "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", 805 | "dev": true, 806 | "dependencies": { 807 | "es-errors": "^1.3.0", 808 | "function-bind": "^1.1.2", 809 | "has-proto": "^1.0.1", 810 | "has-symbols": "^1.0.3", 811 | "hasown": "^2.0.0" 812 | }, 813 | "engines": { 814 | "node": ">= 0.4" 815 | }, 816 | "funding": { 817 | "url": "https://github.com/sponsors/ljharb" 818 | } 819 | }, 820 | "node_modules/get-package-type": { 821 | "version": "0.1.0", 822 | "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", 823 | "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", 824 | "dev": true, 825 | "engines": { 826 | "node": ">=8.0.0" 827 | } 828 | }, 829 | "node_modules/get-symbol-description": { 830 | "version": "1.0.2", 831 | "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", 832 | "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", 833 | "dev": true, 834 | "dependencies": { 835 | "call-bind": "^1.0.5", 836 | "es-errors": "^1.3.0", 837 | "get-intrinsic": "^1.2.4" 838 | }, 839 | "engines": { 840 | "node": ">= 0.4" 841 | }, 842 | "funding": { 843 | "url": "https://github.com/sponsors/ljharb" 844 | } 845 | }, 846 | "node_modules/glob": { 847 | "version": "7.2.3", 848 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", 849 | "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", 850 | "dev": true, 851 | "dependencies": { 852 | "fs.realpath": "^1.0.0", 853 | "inflight": "^1.0.4", 854 | "inherits": "2", 855 | "minimatch": "^3.1.1", 856 | "once": "^1.3.0", 857 | "path-is-absolute": "^1.0.0" 858 | }, 859 | "engines": { 860 | "node": "*" 861 | }, 862 | "funding": { 863 | "url": "https://github.com/sponsors/isaacs" 864 | } 865 | }, 866 | "node_modules/globalthis": { 867 | "version": "1.0.3", 868 | "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", 869 | "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", 870 | "dev": true, 871 | "dependencies": { 872 | "define-properties": "^1.1.3" 873 | }, 874 | "engines": { 875 | "node": ">= 0.4" 876 | }, 877 | "funding": { 878 | "url": "https://github.com/sponsors/ljharb" 879 | } 880 | }, 881 | "node_modules/gopd": { 882 | "version": "1.0.1", 883 | "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", 884 | "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", 885 | "dev": true, 886 | "dependencies": { 887 | "get-intrinsic": "^1.1.3" 888 | }, 889 | "funding": { 890 | "url": "https://github.com/sponsors/ljharb" 891 | } 892 | }, 893 | "node_modules/has-bigints": { 894 | "version": "1.0.2", 895 | "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", 896 | "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", 897 | "dev": true, 898 | "funding": { 899 | "url": "https://github.com/sponsors/ljharb" 900 | } 901 | }, 902 | "node_modules/has-dynamic-import": { 903 | "version": "2.1.0", 904 | "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.1.0.tgz", 905 | "integrity": "sha512-su0anMkNEnJKZ/rB99jn3y6lV/J8Ro96hBJ28YAeVzj5rWxH+YL/AdCyiYYA1HDLV9YhmvqpWSJJj2KLo1MX6g==", 906 | "dev": true, 907 | "dependencies": { 908 | "call-bind": "^1.0.5", 909 | "get-intrinsic": "^1.2.2" 910 | }, 911 | "engines": { 912 | "node": ">= 0.4" 913 | }, 914 | "funding": { 915 | "url": "https://github.com/sponsors/ljharb" 916 | } 917 | }, 918 | "node_modules/has-flag": { 919 | "version": "4.0.0", 920 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 921 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 922 | "dev": true, 923 | "engines": { 924 | "node": ">=8" 925 | } 926 | }, 927 | "node_modules/has-property-descriptors": { 928 | "version": "1.0.2", 929 | "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", 930 | "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", 931 | "dev": true, 932 | "dependencies": { 933 | "es-define-property": "^1.0.0" 934 | }, 935 | "funding": { 936 | "url": "https://github.com/sponsors/ljharb" 937 | } 938 | }, 939 | "node_modules/has-proto": { 940 | "version": "1.0.3", 941 | "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", 942 | "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", 943 | "dev": true, 944 | "engines": { 945 | "node": ">= 0.4" 946 | }, 947 | "funding": { 948 | "url": "https://github.com/sponsors/ljharb" 949 | } 950 | }, 951 | "node_modules/has-symbols": { 952 | "version": "1.0.3", 953 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", 954 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", 955 | "dev": true, 956 | "engines": { 957 | "node": ">= 0.4" 958 | }, 959 | "funding": { 960 | "url": "https://github.com/sponsors/ljharb" 961 | } 962 | }, 963 | "node_modules/has-tostringtag": { 964 | "version": "1.0.2", 965 | "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", 966 | "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", 967 | "dev": true, 968 | "dependencies": { 969 | "has-symbols": "^1.0.3" 970 | }, 971 | "engines": { 972 | "node": ">= 0.4" 973 | }, 974 | "funding": { 975 | "url": "https://github.com/sponsors/ljharb" 976 | } 977 | }, 978 | "node_modules/hasown": { 979 | "version": "2.0.1", 980 | "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", 981 | "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", 982 | "dev": true, 983 | "dependencies": { 984 | "function-bind": "^1.1.2" 985 | }, 986 | "engines": { 987 | "node": ">= 0.4" 988 | } 989 | }, 990 | "node_modules/he": { 991 | "version": "1.2.0", 992 | "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", 993 | "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", 994 | "dev": true, 995 | "bin": { 996 | "he": "bin/he" 997 | } 998 | }, 999 | "node_modules/html-encoding-sniffer": { 1000 | "version": "3.0.0", 1001 | "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", 1002 | "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", 1003 | "dev": true, 1004 | "dependencies": { 1005 | "whatwg-encoding": "^2.0.0" 1006 | }, 1007 | "engines": { 1008 | "node": ">=12" 1009 | } 1010 | }, 1011 | "node_modules/http-proxy": { 1012 | "version": "1.18.1", 1013 | "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", 1014 | "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", 1015 | "dev": true, 1016 | "dependencies": { 1017 | "eventemitter3": "^4.0.0", 1018 | "follow-redirects": "^1.0.0", 1019 | "requires-port": "^1.0.0" 1020 | }, 1021 | "engines": { 1022 | "node": ">=8.0.0" 1023 | } 1024 | }, 1025 | "node_modules/http-server": { 1026 | "version": "14.1.1", 1027 | "resolved": "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz", 1028 | "integrity": "sha512-+cbxadF40UXd9T01zUHgA+rlo2Bg1Srer4+B4NwIHdaGxAGGv59nYRnGGDJ9LBk7alpS0US+J+bLLdQOOkJq4A==", 1029 | "dev": true, 1030 | "dependencies": { 1031 | "basic-auth": "^2.0.1", 1032 | "chalk": "^4.1.2", 1033 | "corser": "^2.0.1", 1034 | "he": "^1.2.0", 1035 | "html-encoding-sniffer": "^3.0.0", 1036 | "http-proxy": "^1.18.1", 1037 | "mime": "^1.6.0", 1038 | "minimist": "^1.2.6", 1039 | "opener": "^1.5.1", 1040 | "portfinder": "^1.0.28", 1041 | "secure-compare": "3.0.1", 1042 | "union": "~0.5.0", 1043 | "url-join": "^4.0.1" 1044 | }, 1045 | "bin": { 1046 | "http-server": "bin/http-server" 1047 | }, 1048 | "engines": { 1049 | "node": ">=12" 1050 | } 1051 | }, 1052 | "node_modules/iconv-lite": { 1053 | "version": "0.6.3", 1054 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", 1055 | "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", 1056 | "dev": true, 1057 | "dependencies": { 1058 | "safer-buffer": ">= 2.1.2 < 3.0.0" 1059 | }, 1060 | "engines": { 1061 | "node": ">=0.10.0" 1062 | } 1063 | }, 1064 | "node_modules/inflight": { 1065 | "version": "1.0.6", 1066 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 1067 | "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", 1068 | "dev": true, 1069 | "dependencies": { 1070 | "once": "^1.3.0", 1071 | "wrappy": "1" 1072 | } 1073 | }, 1074 | "node_modules/inherits": { 1075 | "version": "2.0.4", 1076 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 1077 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 1078 | "dev": true 1079 | }, 1080 | "node_modules/internal-slot": { 1081 | "version": "1.0.7", 1082 | "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", 1083 | "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", 1084 | "dev": true, 1085 | "dependencies": { 1086 | "es-errors": "^1.3.0", 1087 | "hasown": "^2.0.0", 1088 | "side-channel": "^1.0.4" 1089 | }, 1090 | "engines": { 1091 | "node": ">= 0.4" 1092 | } 1093 | }, 1094 | "node_modules/internmap": { 1095 | "version": "2.0.3", 1096 | "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", 1097 | "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", 1098 | "engines": { 1099 | "node": ">=12" 1100 | } 1101 | }, 1102 | "node_modules/is-arguments": { 1103 | "version": "1.1.1", 1104 | "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", 1105 | "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", 1106 | "dev": true, 1107 | "dependencies": { 1108 | "call-bind": "^1.0.2", 1109 | "has-tostringtag": "^1.0.0" 1110 | }, 1111 | "engines": { 1112 | "node": ">= 0.4" 1113 | }, 1114 | "funding": { 1115 | "url": "https://github.com/sponsors/ljharb" 1116 | } 1117 | }, 1118 | "node_modules/is-array-buffer": { 1119 | "version": "3.0.4", 1120 | "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", 1121 | "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", 1122 | "dev": true, 1123 | "dependencies": { 1124 | "call-bind": "^1.0.2", 1125 | "get-intrinsic": "^1.2.1" 1126 | }, 1127 | "engines": { 1128 | "node": ">= 0.4" 1129 | }, 1130 | "funding": { 1131 | "url": "https://github.com/sponsors/ljharb" 1132 | } 1133 | }, 1134 | "node_modules/is-bigint": { 1135 | "version": "1.0.4", 1136 | "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", 1137 | "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", 1138 | "dev": true, 1139 | "dependencies": { 1140 | "has-bigints": "^1.0.1" 1141 | }, 1142 | "funding": { 1143 | "url": "https://github.com/sponsors/ljharb" 1144 | } 1145 | }, 1146 | "node_modules/is-boolean-object": { 1147 | "version": "1.1.2", 1148 | "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", 1149 | "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", 1150 | "dev": true, 1151 | "dependencies": { 1152 | "call-bind": "^1.0.2", 1153 | "has-tostringtag": "^1.0.0" 1154 | }, 1155 | "engines": { 1156 | "node": ">= 0.4" 1157 | }, 1158 | "funding": { 1159 | "url": "https://github.com/sponsors/ljharb" 1160 | } 1161 | }, 1162 | "node_modules/is-callable": { 1163 | "version": "1.2.7", 1164 | "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", 1165 | "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", 1166 | "dev": true, 1167 | "engines": { 1168 | "node": ">= 0.4" 1169 | }, 1170 | "funding": { 1171 | "url": "https://github.com/sponsors/ljharb" 1172 | } 1173 | }, 1174 | "node_modules/is-core-module": { 1175 | "version": "2.13.1", 1176 | "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", 1177 | "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", 1178 | "dev": true, 1179 | "dependencies": { 1180 | "hasown": "^2.0.0" 1181 | }, 1182 | "funding": { 1183 | "url": "https://github.com/sponsors/ljharb" 1184 | } 1185 | }, 1186 | "node_modules/is-date-object": { 1187 | "version": "1.0.5", 1188 | "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", 1189 | "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", 1190 | "dev": true, 1191 | "dependencies": { 1192 | "has-tostringtag": "^1.0.0" 1193 | }, 1194 | "engines": { 1195 | "node": ">= 0.4" 1196 | }, 1197 | "funding": { 1198 | "url": "https://github.com/sponsors/ljharb" 1199 | } 1200 | }, 1201 | "node_modules/is-map": { 1202 | "version": "2.0.2", 1203 | "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", 1204 | "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", 1205 | "dev": true, 1206 | "funding": { 1207 | "url": "https://github.com/sponsors/ljharb" 1208 | } 1209 | }, 1210 | "node_modules/is-negative-zero": { 1211 | "version": "2.0.3", 1212 | "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", 1213 | "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", 1214 | "dev": true, 1215 | "engines": { 1216 | "node": ">= 0.4" 1217 | }, 1218 | "funding": { 1219 | "url": "https://github.com/sponsors/ljharb" 1220 | } 1221 | }, 1222 | "node_modules/is-number-object": { 1223 | "version": "1.0.7", 1224 | "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", 1225 | "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", 1226 | "dev": true, 1227 | "dependencies": { 1228 | "has-tostringtag": "^1.0.0" 1229 | }, 1230 | "engines": { 1231 | "node": ">= 0.4" 1232 | }, 1233 | "funding": { 1234 | "url": "https://github.com/sponsors/ljharb" 1235 | } 1236 | }, 1237 | "node_modules/is-regex": { 1238 | "version": "1.1.4", 1239 | "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", 1240 | "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", 1241 | "dev": true, 1242 | "dependencies": { 1243 | "call-bind": "^1.0.2", 1244 | "has-tostringtag": "^1.0.0" 1245 | }, 1246 | "engines": { 1247 | "node": ">= 0.4" 1248 | }, 1249 | "funding": { 1250 | "url": "https://github.com/sponsors/ljharb" 1251 | } 1252 | }, 1253 | "node_modules/is-set": { 1254 | "version": "2.0.2", 1255 | "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", 1256 | "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", 1257 | "dev": true, 1258 | "funding": { 1259 | "url": "https://github.com/sponsors/ljharb" 1260 | } 1261 | }, 1262 | "node_modules/is-shared-array-buffer": { 1263 | "version": "1.0.3", 1264 | "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", 1265 | "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", 1266 | "dev": true, 1267 | "dependencies": { 1268 | "call-bind": "^1.0.7" 1269 | }, 1270 | "engines": { 1271 | "node": ">= 0.4" 1272 | }, 1273 | "funding": { 1274 | "url": "https://github.com/sponsors/ljharb" 1275 | } 1276 | }, 1277 | "node_modules/is-string": { 1278 | "version": "1.0.7", 1279 | "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", 1280 | "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", 1281 | "dev": true, 1282 | "dependencies": { 1283 | "has-tostringtag": "^1.0.0" 1284 | }, 1285 | "engines": { 1286 | "node": ">= 0.4" 1287 | }, 1288 | "funding": { 1289 | "url": "https://github.com/sponsors/ljharb" 1290 | } 1291 | }, 1292 | "node_modules/is-symbol": { 1293 | "version": "1.0.4", 1294 | "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", 1295 | "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", 1296 | "dev": true, 1297 | "dependencies": { 1298 | "has-symbols": "^1.0.2" 1299 | }, 1300 | "engines": { 1301 | "node": ">= 0.4" 1302 | }, 1303 | "funding": { 1304 | "url": "https://github.com/sponsors/ljharb" 1305 | } 1306 | }, 1307 | "node_modules/is-typed-array": { 1308 | "version": "1.1.13", 1309 | "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", 1310 | "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", 1311 | "dev": true, 1312 | "dependencies": { 1313 | "which-typed-array": "^1.1.14" 1314 | }, 1315 | "engines": { 1316 | "node": ">= 0.4" 1317 | }, 1318 | "funding": { 1319 | "url": "https://github.com/sponsors/ljharb" 1320 | } 1321 | }, 1322 | "node_modules/is-weakmap": { 1323 | "version": "2.0.1", 1324 | "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", 1325 | "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", 1326 | "dev": true, 1327 | "funding": { 1328 | "url": "https://github.com/sponsors/ljharb" 1329 | } 1330 | }, 1331 | "node_modules/is-weakref": { 1332 | "version": "1.0.2", 1333 | "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", 1334 | "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", 1335 | "dev": true, 1336 | "dependencies": { 1337 | "call-bind": "^1.0.2" 1338 | }, 1339 | "funding": { 1340 | "url": "https://github.com/sponsors/ljharb" 1341 | } 1342 | }, 1343 | "node_modules/is-weakset": { 1344 | "version": "2.0.2", 1345 | "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", 1346 | "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", 1347 | "dev": true, 1348 | "dependencies": { 1349 | "call-bind": "^1.0.2", 1350 | "get-intrinsic": "^1.1.1" 1351 | }, 1352 | "funding": { 1353 | "url": "https://github.com/sponsors/ljharb" 1354 | } 1355 | }, 1356 | "node_modules/isarray": { 1357 | "version": "2.0.5", 1358 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", 1359 | "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", 1360 | "dev": true 1361 | }, 1362 | "node_modules/lodash": { 1363 | "version": "4.17.21", 1364 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 1365 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", 1366 | "dev": true 1367 | }, 1368 | "node_modules/mime": { 1369 | "version": "1.6.0", 1370 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 1371 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 1372 | "dev": true, 1373 | "bin": { 1374 | "mime": "cli.js" 1375 | }, 1376 | "engines": { 1377 | "node": ">=4" 1378 | } 1379 | }, 1380 | "node_modules/minimatch": { 1381 | "version": "3.1.2", 1382 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 1383 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 1384 | "dev": true, 1385 | "dependencies": { 1386 | "brace-expansion": "^1.1.7" 1387 | }, 1388 | "engines": { 1389 | "node": "*" 1390 | } 1391 | }, 1392 | "node_modules/minimist": { 1393 | "version": "1.2.8", 1394 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", 1395 | "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", 1396 | "dev": true, 1397 | "funding": { 1398 | "url": "https://github.com/sponsors/ljharb" 1399 | } 1400 | }, 1401 | "node_modules/mkdirp": { 1402 | "version": "0.5.6", 1403 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", 1404 | "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", 1405 | "dev": true, 1406 | "dependencies": { 1407 | "minimist": "^1.2.6" 1408 | }, 1409 | "bin": { 1410 | "mkdirp": "bin/cmd.js" 1411 | } 1412 | }, 1413 | "node_modules/mock-property": { 1414 | "version": "1.0.3", 1415 | "resolved": "https://registry.npmjs.org/mock-property/-/mock-property-1.0.3.tgz", 1416 | "integrity": "sha512-2emPTb1reeLLYwHxyVx993iYyCHEiRRO+y8NFXFPL5kl5q14sgTK76cXyEKkeKCHeRw35SfdkUJ10Q1KfHuiIQ==", 1417 | "dev": true, 1418 | "dependencies": { 1419 | "define-data-property": "^1.1.1", 1420 | "functions-have-names": "^1.2.3", 1421 | "gopd": "^1.0.1", 1422 | "has-property-descriptors": "^1.0.0", 1423 | "hasown": "^2.0.0", 1424 | "isarray": "^2.0.5" 1425 | }, 1426 | "engines": { 1427 | "node": ">= 0.4" 1428 | }, 1429 | "funding": { 1430 | "url": "https://github.com/sponsors/ljharb" 1431 | } 1432 | }, 1433 | "node_modules/ms": { 1434 | "version": "2.1.3", 1435 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 1436 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 1437 | "dev": true 1438 | }, 1439 | "node_modules/object-inspect": { 1440 | "version": "1.13.1", 1441 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", 1442 | "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", 1443 | "dev": true, 1444 | "funding": { 1445 | "url": "https://github.com/sponsors/ljharb" 1446 | } 1447 | }, 1448 | "node_modules/object-is": { 1449 | "version": "1.1.6", 1450 | "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", 1451 | "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", 1452 | "dev": true, 1453 | "dependencies": { 1454 | "call-bind": "^1.0.7", 1455 | "define-properties": "^1.2.1" 1456 | }, 1457 | "engines": { 1458 | "node": ">= 0.4" 1459 | }, 1460 | "funding": { 1461 | "url": "https://github.com/sponsors/ljharb" 1462 | } 1463 | }, 1464 | "node_modules/object-keys": { 1465 | "version": "1.1.1", 1466 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", 1467 | "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", 1468 | "dev": true, 1469 | "engines": { 1470 | "node": ">= 0.4" 1471 | } 1472 | }, 1473 | "node_modules/object.assign": { 1474 | "version": "4.1.5", 1475 | "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", 1476 | "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", 1477 | "dev": true, 1478 | "dependencies": { 1479 | "call-bind": "^1.0.5", 1480 | "define-properties": "^1.2.1", 1481 | "has-symbols": "^1.0.3", 1482 | "object-keys": "^1.1.1" 1483 | }, 1484 | "engines": { 1485 | "node": ">= 0.4" 1486 | }, 1487 | "funding": { 1488 | "url": "https://github.com/sponsors/ljharb" 1489 | } 1490 | }, 1491 | "node_modules/once": { 1492 | "version": "1.4.0", 1493 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1494 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 1495 | "dev": true, 1496 | "dependencies": { 1497 | "wrappy": "1" 1498 | } 1499 | }, 1500 | "node_modules/opener": { 1501 | "version": "1.5.2", 1502 | "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", 1503 | "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", 1504 | "dev": true, 1505 | "bin": { 1506 | "opener": "bin/opener-bin.js" 1507 | } 1508 | }, 1509 | "node_modules/path-is-absolute": { 1510 | "version": "1.0.1", 1511 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1512 | "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", 1513 | "dev": true, 1514 | "engines": { 1515 | "node": ">=0.10.0" 1516 | } 1517 | }, 1518 | "node_modules/path-parse": { 1519 | "version": "1.0.7", 1520 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", 1521 | "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", 1522 | "dev": true 1523 | }, 1524 | "node_modules/portfinder": { 1525 | "version": "1.0.32", 1526 | "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz", 1527 | "integrity": "sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg==", 1528 | "dev": true, 1529 | "dependencies": { 1530 | "async": "^2.6.4", 1531 | "debug": "^3.2.7", 1532 | "mkdirp": "^0.5.6" 1533 | }, 1534 | "engines": { 1535 | "node": ">= 0.12.0" 1536 | } 1537 | }, 1538 | "node_modules/possible-typed-array-names": { 1539 | "version": "1.0.0", 1540 | "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", 1541 | "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", 1542 | "dev": true, 1543 | "engines": { 1544 | "node": ">= 0.4" 1545 | } 1546 | }, 1547 | "node_modules/qs": { 1548 | "version": "6.11.2", 1549 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", 1550 | "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", 1551 | "dev": true, 1552 | "dependencies": { 1553 | "side-channel": "^1.0.4" 1554 | }, 1555 | "engines": { 1556 | "node": ">=0.6" 1557 | }, 1558 | "funding": { 1559 | "url": "https://github.com/sponsors/ljharb" 1560 | } 1561 | }, 1562 | "node_modules/regexp.prototype.flags": { 1563 | "version": "1.5.2", 1564 | "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", 1565 | "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", 1566 | "dev": true, 1567 | "dependencies": { 1568 | "call-bind": "^1.0.6", 1569 | "define-properties": "^1.2.1", 1570 | "es-errors": "^1.3.0", 1571 | "set-function-name": "^2.0.1" 1572 | }, 1573 | "engines": { 1574 | "node": ">= 0.4" 1575 | }, 1576 | "funding": { 1577 | "url": "https://github.com/sponsors/ljharb" 1578 | } 1579 | }, 1580 | "node_modules/requires-port": { 1581 | "version": "1.0.0", 1582 | "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", 1583 | "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", 1584 | "dev": true 1585 | }, 1586 | "node_modules/resolve": { 1587 | "version": "2.0.0-next.5", 1588 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", 1589 | "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", 1590 | "dev": true, 1591 | "dependencies": { 1592 | "is-core-module": "^2.13.0", 1593 | "path-parse": "^1.0.7", 1594 | "supports-preserve-symlinks-flag": "^1.0.0" 1595 | }, 1596 | "bin": { 1597 | "resolve": "bin/resolve" 1598 | }, 1599 | "funding": { 1600 | "url": "https://github.com/sponsors/ljharb" 1601 | } 1602 | }, 1603 | "node_modules/rollup": { 1604 | "version": "4.12.0", 1605 | "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", 1606 | "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", 1607 | "dev": true, 1608 | "dependencies": { 1609 | "@types/estree": "1.0.5" 1610 | }, 1611 | "bin": { 1612 | "rollup": "dist/bin/rollup" 1613 | }, 1614 | "engines": { 1615 | "node": ">=18.0.0", 1616 | "npm": ">=8.0.0" 1617 | }, 1618 | "optionalDependencies": { 1619 | "@rollup/rollup-android-arm-eabi": "4.12.0", 1620 | "@rollup/rollup-android-arm64": "4.12.0", 1621 | "@rollup/rollup-darwin-arm64": "4.12.0", 1622 | "@rollup/rollup-darwin-x64": "4.12.0", 1623 | "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", 1624 | "@rollup/rollup-linux-arm64-gnu": "4.12.0", 1625 | "@rollup/rollup-linux-arm64-musl": "4.12.0", 1626 | "@rollup/rollup-linux-riscv64-gnu": "4.12.0", 1627 | "@rollup/rollup-linux-x64-gnu": "4.12.0", 1628 | "@rollup/rollup-linux-x64-musl": "4.12.0", 1629 | "@rollup/rollup-win32-arm64-msvc": "4.12.0", 1630 | "@rollup/rollup-win32-ia32-msvc": "4.12.0", 1631 | "@rollup/rollup-win32-x64-msvc": "4.12.0", 1632 | "fsevents": "~2.3.2" 1633 | } 1634 | }, 1635 | "node_modules/safe-array-concat": { 1636 | "version": "1.1.0", 1637 | "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.0.tgz", 1638 | "integrity": "sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==", 1639 | "dev": true, 1640 | "dependencies": { 1641 | "call-bind": "^1.0.5", 1642 | "get-intrinsic": "^1.2.2", 1643 | "has-symbols": "^1.0.3", 1644 | "isarray": "^2.0.5" 1645 | }, 1646 | "engines": { 1647 | "node": ">=0.4" 1648 | }, 1649 | "funding": { 1650 | "url": "https://github.com/sponsors/ljharb" 1651 | } 1652 | }, 1653 | "node_modules/safe-buffer": { 1654 | "version": "5.1.2", 1655 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 1656 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 1657 | "dev": true 1658 | }, 1659 | "node_modules/safe-regex-test": { 1660 | "version": "1.0.3", 1661 | "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", 1662 | "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", 1663 | "dev": true, 1664 | "dependencies": { 1665 | "call-bind": "^1.0.6", 1666 | "es-errors": "^1.3.0", 1667 | "is-regex": "^1.1.4" 1668 | }, 1669 | "engines": { 1670 | "node": ">= 0.4" 1671 | }, 1672 | "funding": { 1673 | "url": "https://github.com/sponsors/ljharb" 1674 | } 1675 | }, 1676 | "node_modules/safer-buffer": { 1677 | "version": "2.1.2", 1678 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1679 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", 1680 | "dev": true 1681 | }, 1682 | "node_modules/secure-compare": { 1683 | "version": "3.0.1", 1684 | "resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz", 1685 | "integrity": "sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw==", 1686 | "dev": true 1687 | }, 1688 | "node_modules/set-function-length": { 1689 | "version": "1.2.1", 1690 | "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", 1691 | "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", 1692 | "dev": true, 1693 | "dependencies": { 1694 | "define-data-property": "^1.1.2", 1695 | "es-errors": "^1.3.0", 1696 | "function-bind": "^1.1.2", 1697 | "get-intrinsic": "^1.2.3", 1698 | "gopd": "^1.0.1", 1699 | "has-property-descriptors": "^1.0.1" 1700 | }, 1701 | "engines": { 1702 | "node": ">= 0.4" 1703 | } 1704 | }, 1705 | "node_modules/set-function-name": { 1706 | "version": "2.0.2", 1707 | "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", 1708 | "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", 1709 | "dev": true, 1710 | "dependencies": { 1711 | "define-data-property": "^1.1.4", 1712 | "es-errors": "^1.3.0", 1713 | "functions-have-names": "^1.2.3", 1714 | "has-property-descriptors": "^1.0.2" 1715 | }, 1716 | "engines": { 1717 | "node": ">= 0.4" 1718 | } 1719 | }, 1720 | "node_modules/side-channel": { 1721 | "version": "1.0.6", 1722 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", 1723 | "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", 1724 | "dev": true, 1725 | "dependencies": { 1726 | "call-bind": "^1.0.7", 1727 | "es-errors": "^1.3.0", 1728 | "get-intrinsic": "^1.2.4", 1729 | "object-inspect": "^1.13.1" 1730 | }, 1731 | "engines": { 1732 | "node": ">= 0.4" 1733 | }, 1734 | "funding": { 1735 | "url": "https://github.com/sponsors/ljharb" 1736 | } 1737 | }, 1738 | "node_modules/stop-iteration-iterator": { 1739 | "version": "1.0.0", 1740 | "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", 1741 | "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", 1742 | "dev": true, 1743 | "dependencies": { 1744 | "internal-slot": "^1.0.4" 1745 | }, 1746 | "engines": { 1747 | "node": ">= 0.4" 1748 | } 1749 | }, 1750 | "node_modules/string.prototype.trim": { 1751 | "version": "1.2.8", 1752 | "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", 1753 | "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", 1754 | "dev": true, 1755 | "dependencies": { 1756 | "call-bind": "^1.0.2", 1757 | "define-properties": "^1.2.0", 1758 | "es-abstract": "^1.22.1" 1759 | }, 1760 | "engines": { 1761 | "node": ">= 0.4" 1762 | }, 1763 | "funding": { 1764 | "url": "https://github.com/sponsors/ljharb" 1765 | } 1766 | }, 1767 | "node_modules/string.prototype.trimend": { 1768 | "version": "1.0.7", 1769 | "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", 1770 | "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", 1771 | "dev": true, 1772 | "dependencies": { 1773 | "call-bind": "^1.0.2", 1774 | "define-properties": "^1.2.0", 1775 | "es-abstract": "^1.22.1" 1776 | }, 1777 | "funding": { 1778 | "url": "https://github.com/sponsors/ljharb" 1779 | } 1780 | }, 1781 | "node_modules/string.prototype.trimstart": { 1782 | "version": "1.0.7", 1783 | "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", 1784 | "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", 1785 | "dev": true, 1786 | "dependencies": { 1787 | "call-bind": "^1.0.2", 1788 | "define-properties": "^1.2.0", 1789 | "es-abstract": "^1.22.1" 1790 | }, 1791 | "funding": { 1792 | "url": "https://github.com/sponsors/ljharb" 1793 | } 1794 | }, 1795 | "node_modules/supports-color": { 1796 | "version": "7.2.0", 1797 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 1798 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 1799 | "dev": true, 1800 | "dependencies": { 1801 | "has-flag": "^4.0.0" 1802 | }, 1803 | "engines": { 1804 | "node": ">=8" 1805 | } 1806 | }, 1807 | "node_modules/supports-preserve-symlinks-flag": { 1808 | "version": "1.0.0", 1809 | "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", 1810 | "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", 1811 | "dev": true, 1812 | "engines": { 1813 | "node": ">= 0.4" 1814 | }, 1815 | "funding": { 1816 | "url": "https://github.com/sponsors/ljharb" 1817 | } 1818 | }, 1819 | "node_modules/tape": { 1820 | "version": "5.7.5", 1821 | "resolved": "https://registry.npmjs.org/tape/-/tape-5.7.5.tgz", 1822 | "integrity": "sha512-C5Gm1MR8ujZmNrsmOiHSkKFfY2thrnUrFw/fFtcva9FABbN7LrHuQPi3MTS0Z0i/SLfYSJtRIcJYDUpwPsQ8yA==", 1823 | "dev": true, 1824 | "dependencies": { 1825 | "@ljharb/resumer": "^0.1.2", 1826 | "@ljharb/through": "^2.3.12", 1827 | "array.prototype.every": "^1.1.5", 1828 | "call-bind": "^1.0.7", 1829 | "deep-equal": "^2.2.3", 1830 | "defined": "^1.0.1", 1831 | "dotignore": "^0.1.2", 1832 | "for-each": "^0.3.3", 1833 | "get-package-type": "^0.1.0", 1834 | "glob": "^7.2.3", 1835 | "has-dynamic-import": "^2.1.0", 1836 | "hasown": "^2.0.1", 1837 | "inherits": "^2.0.4", 1838 | "is-regex": "^1.1.4", 1839 | "minimist": "^1.2.8", 1840 | "mock-property": "^1.0.3", 1841 | "object-inspect": "^1.13.1", 1842 | "object-is": "^1.1.5", 1843 | "object-keys": "^1.1.1", 1844 | "object.assign": "^4.1.5", 1845 | "resolve": "^2.0.0-next.5", 1846 | "string.prototype.trim": "^1.2.8" 1847 | }, 1848 | "bin": { 1849 | "tape": "bin/tape" 1850 | }, 1851 | "funding": { 1852 | "url": "https://github.com/sponsors/ljharb" 1853 | } 1854 | }, 1855 | "node_modules/typed-array-buffer": { 1856 | "version": "1.0.2", 1857 | "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", 1858 | "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", 1859 | "dev": true, 1860 | "dependencies": { 1861 | "call-bind": "^1.0.7", 1862 | "es-errors": "^1.3.0", 1863 | "is-typed-array": "^1.1.13" 1864 | }, 1865 | "engines": { 1866 | "node": ">= 0.4" 1867 | } 1868 | }, 1869 | "node_modules/typed-array-byte-length": { 1870 | "version": "1.0.1", 1871 | "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", 1872 | "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", 1873 | "dev": true, 1874 | "dependencies": { 1875 | "call-bind": "^1.0.7", 1876 | "for-each": "^0.3.3", 1877 | "gopd": "^1.0.1", 1878 | "has-proto": "^1.0.3", 1879 | "is-typed-array": "^1.1.13" 1880 | }, 1881 | "engines": { 1882 | "node": ">= 0.4" 1883 | }, 1884 | "funding": { 1885 | "url": "https://github.com/sponsors/ljharb" 1886 | } 1887 | }, 1888 | "node_modules/typed-array-byte-offset": { 1889 | "version": "1.0.2", 1890 | "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", 1891 | "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", 1892 | "dev": true, 1893 | "dependencies": { 1894 | "available-typed-arrays": "^1.0.7", 1895 | "call-bind": "^1.0.7", 1896 | "for-each": "^0.3.3", 1897 | "gopd": "^1.0.1", 1898 | "has-proto": "^1.0.3", 1899 | "is-typed-array": "^1.1.13" 1900 | }, 1901 | "engines": { 1902 | "node": ">= 0.4" 1903 | }, 1904 | "funding": { 1905 | "url": "https://github.com/sponsors/ljharb" 1906 | } 1907 | }, 1908 | "node_modules/typed-array-length": { 1909 | "version": "1.0.5", 1910 | "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.5.tgz", 1911 | "integrity": "sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==", 1912 | "dev": true, 1913 | "dependencies": { 1914 | "call-bind": "^1.0.7", 1915 | "for-each": "^0.3.3", 1916 | "gopd": "^1.0.1", 1917 | "has-proto": "^1.0.3", 1918 | "is-typed-array": "^1.1.13", 1919 | "possible-typed-array-names": "^1.0.0" 1920 | }, 1921 | "engines": { 1922 | "node": ">= 0.4" 1923 | }, 1924 | "funding": { 1925 | "url": "https://github.com/sponsors/ljharb" 1926 | } 1927 | }, 1928 | "node_modules/uglify-js": { 1929 | "version": "3.17.4", 1930 | "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", 1931 | "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", 1932 | "dev": true, 1933 | "bin": { 1934 | "uglifyjs": "bin/uglifyjs" 1935 | }, 1936 | "engines": { 1937 | "node": ">=0.8.0" 1938 | } 1939 | }, 1940 | "node_modules/unbox-primitive": { 1941 | "version": "1.0.2", 1942 | "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", 1943 | "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", 1944 | "dev": true, 1945 | "dependencies": { 1946 | "call-bind": "^1.0.2", 1947 | "has-bigints": "^1.0.2", 1948 | "has-symbols": "^1.0.3", 1949 | "which-boxed-primitive": "^1.0.2" 1950 | }, 1951 | "funding": { 1952 | "url": "https://github.com/sponsors/ljharb" 1953 | } 1954 | }, 1955 | "node_modules/union": { 1956 | "version": "0.5.0", 1957 | "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", 1958 | "integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==", 1959 | "dev": true, 1960 | "dependencies": { 1961 | "qs": "^6.4.0" 1962 | }, 1963 | "engines": { 1964 | "node": ">= 0.8.0" 1965 | } 1966 | }, 1967 | "node_modules/url-join": { 1968 | "version": "4.0.1", 1969 | "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", 1970 | "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", 1971 | "dev": true 1972 | }, 1973 | "node_modules/whatwg-encoding": { 1974 | "version": "2.0.0", 1975 | "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", 1976 | "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", 1977 | "dev": true, 1978 | "dependencies": { 1979 | "iconv-lite": "0.6.3" 1980 | }, 1981 | "engines": { 1982 | "node": ">=12" 1983 | } 1984 | }, 1985 | "node_modules/which-boxed-primitive": { 1986 | "version": "1.0.2", 1987 | "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", 1988 | "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", 1989 | "dev": true, 1990 | "dependencies": { 1991 | "is-bigint": "^1.0.1", 1992 | "is-boolean-object": "^1.1.0", 1993 | "is-number-object": "^1.0.4", 1994 | "is-string": "^1.0.5", 1995 | "is-symbol": "^1.0.3" 1996 | }, 1997 | "funding": { 1998 | "url": "https://github.com/sponsors/ljharb" 1999 | } 2000 | }, 2001 | "node_modules/which-collection": { 2002 | "version": "1.0.1", 2003 | "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", 2004 | "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", 2005 | "dev": true, 2006 | "dependencies": { 2007 | "is-map": "^2.0.1", 2008 | "is-set": "^2.0.1", 2009 | "is-weakmap": "^2.0.1", 2010 | "is-weakset": "^2.0.1" 2011 | }, 2012 | "funding": { 2013 | "url": "https://github.com/sponsors/ljharb" 2014 | } 2015 | }, 2016 | "node_modules/which-typed-array": { 2017 | "version": "1.1.14", 2018 | "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", 2019 | "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", 2020 | "dev": true, 2021 | "dependencies": { 2022 | "available-typed-arrays": "^1.0.6", 2023 | "call-bind": "^1.0.5", 2024 | "for-each": "^0.3.3", 2025 | "gopd": "^1.0.1", 2026 | "has-tostringtag": "^1.0.1" 2027 | }, 2028 | "engines": { 2029 | "node": ">= 0.4" 2030 | }, 2031 | "funding": { 2032 | "url": "https://github.com/sponsors/ljharb" 2033 | } 2034 | }, 2035 | "node_modules/wrappy": { 2036 | "version": "1.0.2", 2037 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 2038 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", 2039 | "dev": true 2040 | } 2041 | } 2042 | } 2043 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "d3-area-label", 3 | "version": "1.6.0", 4 | "description": "A library for placing labels in areas.", 5 | "keywords": [ 6 | "d3", 7 | "d3-module" 8 | ], 9 | "license": "BSD-3-Clause", 10 | "main": "build/d3-area-label.js", 11 | "jsnext:main": "index", 12 | "homepage": "https://github.com/curran/d3-area-label", 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/curran/d3-area-label.git" 16 | }, 17 | "scripts": { 18 | "pretest": "rm -rf build && mkdir build && rollup -f umd -n d3 -g d3-scale:d3,d3-array:d3 -o build/d3-area-label.js -- index.js", 19 | "test": "tape 'test/**/*-test.js'", 20 | "test-interactive": "http-server", 21 | "prepublish": "npm run test && uglifyjs build/d3-area-label.js -c -m -o build/d3-area-label.min.js", 22 | "postpublish": "zip -j build/d3-area-label.zip -- LICENSE README.md build/d3-area-label.js build/d3-area-label.min.js" 23 | }, 24 | "devDependencies": { 25 | "http-server": "^14.1.1", 26 | "rollup": "4.12", 27 | "tape": "5", 28 | "uglify-js": "3" 29 | }, 30 | "dependencies": { 31 | "d3-array": "^3.2.4", 32 | "d3-scale": "^4.0.2" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/area-label.js: -------------------------------------------------------------------------------- 1 | import fits from './fits'; 2 | import { max, extent, bisector, range } from 'd3-array'; 3 | import { scaleLinear } from 'd3-scale'; 4 | 5 | // Returns a transform string that will 6 | // translate and scale the label to the computed position and size. 7 | function toTransformString() { 8 | return [ 9 | 'translate(' + this.xTranslate + ',' + this.yTranslate + ')', 10 | 'scale(' + this.scale + ')' 11 | ].join(' '); 12 | }; 13 | 14 | function areaLabel(area) { 15 | var x, 16 | y0, 17 | y1, 18 | bisectorX, 19 | minHeight = 2, 20 | epsilon = 0.01, 21 | maxIterations = 100, 22 | interpolate = true, 23 | interpolateResolution = 800, 24 | paddingLeft = 0, 25 | paddingRight = 0, 26 | paddingTop = 0, 27 | paddingBottom = 0, 28 | numIterations; 29 | 30 | // Gets the height of the area for a particular datum. 31 | function getHeight(d) { 32 | return y0(d) - y1(d); 33 | } 34 | 35 | // Finds the largest value that passes the test 36 | // within some epsilon tolerance. 37 | // https://en.wikipedia.org/wiki/Bisection_method#Algorithm 38 | function bisection(a, b, test, epsilon, maxIterations) { 39 | var i, c, passesTest, withinEpsilon; 40 | for(i = 0; i < maxIterations; i++){ 41 | c = (a + b) / 2; 42 | passesTest = test(c); 43 | withinEpsilon = (b - a) / 2 < epsilon; 44 | 45 | // In our case, the returned value *must* pass the test, 46 | // so it's not enough only to check if the value is within epsilon. 47 | if ( passesTest && withinEpsilon) { 48 | numIterations = i; 49 | return c; 50 | } 51 | if (passesTest) { 52 | a = c; 53 | } else { 54 | b = c; 55 | } 56 | } 57 | return null; 58 | } 59 | 60 | function interpolateY(data, xValue, y) { 61 | var i = bisectorX(data, xValue, 0, data.length - 1), 62 | a = data[i - 1], 63 | b = data[i], 64 | ax = x(a), 65 | ay = y(a), 66 | bx = x(b), 67 | by = y(b), 68 | t = (xValue - ax) / (bx - ax); 69 | return ay * (1 - t) + by * t; 70 | } 71 | 72 | // Returns true if there is at least one rectangle 73 | // of the given aspect ratio and scale 74 | // that fits somewhere within the area. 75 | 76 | function my(data) { 77 | 78 | // The bounding box of the text label as-is. 79 | var box = this.getBBox(); 80 | 81 | // Account for padding. 82 | var paddingFactorX = 1 + paddingLeft + paddingRight; 83 | var paddingFactorY = 1 + paddingTop + paddingBottom; 84 | var boxWidth = box.width * paddingFactorX; 85 | var boxHeight = box.height * paddingFactorY; 86 | 87 | // The aspect ratio of the text label bounding box. 88 | var aspect = boxWidth / boxHeight; 89 | 90 | // Compute maximum possible label bounding box height in pixels. 91 | var maxHeight = max(data, getHeight); 92 | 93 | // Compute the X extent once, to be reused for every height test. 94 | var xExtent = extent(data, x); 95 | 96 | // The test function for use in the bisection method. 97 | var options = { 98 | justTest: true, 99 | xMax: xExtent[1] 100 | }; 101 | 102 | if (interpolate) { 103 | var interpolateResolutionScale = scaleLinear() 104 | .domain([0, interpolateResolution - 1]) 105 | .range(xExtent); 106 | 107 | var interpolatedData = range(interpolateResolution) 108 | .map(function (i) { 109 | var xValue = interpolateResolutionScale(i); 110 | return { 111 | x: xValue, 112 | y0: interpolateY(data, xValue, y0), 113 | y1: interpolateY(data, xValue, y1) 114 | }; 115 | }); 116 | 117 | options.xIndex = function (x) { 118 | return Math.ceil(interpolateResolutionScale.invert(x)); 119 | }; 120 | options.data = interpolatedData; 121 | options.x = function (d) { return d.x; }; 122 | options.y0 = function (d) { return d.y0; }; 123 | options.y1 = function (d) { return d.y1; }; 124 | } else { 125 | options.xIndex = function (x) { 126 | return bisectorX(data, x); 127 | }, 128 | options.data = data; 129 | options.x = x; 130 | options.y0 = y0; 131 | options.y1 = y1; 132 | } 133 | 134 | var test = function (testHeight){ 135 | options.height = testHeight; 136 | options.width = aspect * testHeight; 137 | return fits(options); 138 | }; 139 | 140 | // Use the bisection method to find the largest height label that fits. 141 | var height = bisection(minHeight, maxHeight, test, epsilon, maxIterations); 142 | 143 | // If there's not any position that works, 144 | // return an object that will scale the label down to nothing, 145 | // and indicate that the algorithm failed. 146 | if (height === null) { 147 | return { 148 | failed: true, 149 | numIterations: maxIterations, 150 | scale: 0, 151 | xTranslate: 0, 152 | yTranslate: 0, 153 | toString: toTransformString 154 | }; 155 | } 156 | 157 | // Get the (x, y, width, height) for the largest height label that fits. 158 | options.justTest = false; 159 | var fit = fits(options); 160 | 161 | // Account for padding. 162 | var xInner = fit.x + fit.width / paddingFactorX * paddingLeft; 163 | var yInner = fit.y + fit.height / paddingFactorY * paddingTop; 164 | 165 | // Compute the scale and translate. 166 | fit.scale = height / boxHeight; 167 | fit.xTranslate = xInner - fit.scale * box.x; 168 | fit.yTranslate = yInner - fit.scale * box.y; 169 | 170 | // Expose the toString method, which generates a transform string. 171 | fit.toString = toTransformString; 172 | 173 | // Expose how many iterations the bisection method took. 174 | fit.numIterations = numIterations; 175 | 176 | return fit; 177 | } 178 | 179 | my.x = function(_) { 180 | if (arguments.length) { 181 | x = _; 182 | bisectorX = bisector(x).right; 183 | return my; 184 | } 185 | return x; 186 | }; 187 | 188 | my.y0 = function(_) { 189 | return arguments.length ? (y0 = _, my) : y0; 190 | }; 191 | 192 | my.y1 = function(_) { 193 | return arguments.length ? (y1 = _, my) : y1; 194 | }; 195 | 196 | my.area = function(area) { 197 | return my.x(area.x()).y0(area.y0()).y1(area.y1()); 198 | }; 199 | 200 | my.minHeight = function(_) { 201 | return arguments.length ? (minHeight = +_, my) : minHeight; 202 | }; 203 | 204 | my.epsilon = function(_) { 205 | return arguments.length ? (epsilon = +_, my) : epsilon; 206 | }; 207 | 208 | my.maxIterations = function(_) { 209 | return arguments.length ? (maxIterations = +_, my) : maxIterations; 210 | }; 211 | 212 | my.interpolate = function(_) { 213 | return arguments.length ? (interpolate = +_, my) : interpolate; 214 | }; 215 | 216 | my.interpolateResolution = function(_) { 217 | return arguments.length ? (interpolateResolution = +_, my) : interpolateResolution; 218 | }; 219 | 220 | my.paddingLeft = function(_) { 221 | return arguments.length ? (paddingLeft = +_, my) : paddingLeft; 222 | }; 223 | 224 | my.paddingRight = function(_) { 225 | return arguments.length ? (paddingRight = +_, my) : paddingRight; 226 | }; 227 | 228 | my.paddingTop = function(_) { 229 | return arguments.length ? (paddingTop = +_, my) : paddingTop; 230 | }; 231 | 232 | my.paddingBottom = function(_) { 233 | return arguments.length ? (paddingBottom = +_, my) : paddingBottom; 234 | }; 235 | 236 | my.paddingX = function(_) { 237 | return my.paddingLeft(_).paddingRight(_); 238 | }; 239 | 240 | my.paddingY = function(_) { 241 | return my.paddingTop(_).paddingBottom(_); 242 | }; 243 | 244 | my.padding = function(_) { 245 | return my.paddingX(_).paddingY(_); 246 | }; 247 | 248 | if (area) { 249 | my.area(area); 250 | } 251 | 252 | return my; 253 | }; 254 | 255 | export default areaLabel; 256 | -------------------------------------------------------------------------------- /src/fits.js: -------------------------------------------------------------------------------- 1 | // Determines whether or not a rectangle 2 | // of the given width and height 3 | // fits in side the given area. 4 | export default function fits(options) { 5 | 6 | // Internall variables. 7 | var x0, x1, i0, i1, j, d, top, bottom, ceiling, floor, 8 | 9 | // The width in pixels of the rectangle to test. 10 | width = options.width, 11 | 12 | // The height in pixels of the rectangle to test. 13 | height = options.height, 14 | 15 | // The data that defines the area to test against. 16 | data = options.data, 17 | 18 | // A boolean that indicates we're only interested 19 | // in a Boolean return value, not full solution details. 20 | justTest = options.justTest, 21 | 22 | // The maximum X value. 23 | xMax = options.xMax, 24 | 25 | // A function that returns the index in the data array 26 | // that comes before the X value passed into it. 27 | xIndex = options.xIndex, 28 | 29 | // The X value accessor. 30 | x = options.x, 31 | 32 | // The Y0 value accessor. 33 | y1 = options.y1, 34 | 35 | // The Y1 value accessor. 36 | y0 = options.y0; 37 | 38 | // Check if we can fit the rectangle at an X position 39 | // corresponding with one of the X values from the data. 40 | for(i0 = 0; i0 < data.length; i0++) { 41 | d = data[i0]; 42 | 43 | // The left edge of the rectangle. 44 | x0 = x(d); 45 | 46 | // The right edge of the rectangle. 47 | x1 = x0 + width; 48 | 49 | // Don't go off the right edge of the area. 50 | if (x1 > xMax) { 51 | break; 52 | } 53 | 54 | // Test until we reach the rightmost X position 55 | // within the X positions of the data points. 56 | i1 = xIndex(x1); 57 | ceiling = -Infinity; 58 | floor = Infinity; 59 | for(j = i0; j <= i1; j++) { 60 | d = data[j]; 61 | 62 | bottom = y0(d); 63 | if(bottom < floor) { 64 | floor = bottom; 65 | } 66 | 67 | top = y1(d); 68 | if(top > ceiling) { 69 | ceiling = top; 70 | } 71 | 72 | // Break as soon as we know the rectangle wil not fit. 73 | if ((floor - ceiling) < height) { 74 | break; 75 | } 76 | } 77 | 78 | // If the rectangle fits at the current x0 position, 79 | // the report that the rectangle indeed fits. 80 | if ((floor - ceiling) >= height) { 81 | 82 | // Avoid creating new objects unnecessarily while just testing. 83 | if (justTest) { 84 | return true; 85 | } 86 | 87 | // Output the full solution for use in label transform. 88 | return { 89 | x: x0, 90 | y: ceiling, 91 | width: width, 92 | height: height 93 | }; 94 | } 95 | } 96 | return false; 97 | }; 98 | -------------------------------------------------------------------------------- /test/area-label-test.cjs: -------------------------------------------------------------------------------- 1 | var tape = require("tape"), 2 | d3 = require("../build/d3-area-label"); 3 | 4 | tape( 5 | "areaLabel() returns the answer to the ultimate question of life, the universe, and everything.", 6 | function (test) { 7 | test.equal(typeof d3.areaLabel, "function"); 8 | test.end(); 9 | } 10 | ); 11 | -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Area Label Test 9 | 19 | 20 | 21 | 22 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /test/smallN.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Area Label Test 9 | 19 | 20 | 21 | 22 | 110 | 111 | 112 | --------------------------------------------------------------------------------