diff --git a/.Rbuildignore b/.Rbuildignore index cc99a5080b..428f44cb98 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -2,5 +2,24 @@ ^.*\.Rproj$ ^\.Rproj\.user$ ^data-raw$ +cran-release.Rmd CONDUCT.md CONTRIBUTING.md +build_site.R +travis_debug.R +revdep_email.R +todo.R +.github/ +inst/examples/rmd/*.html +inst/examples/flexdashboard +Untitled* +node_modules/ +rsconnect/ +revdep/ +^LICENSE\.md$ +README.Rmd +abbvie.R +^\.httr-oauth$ +^\.github$ +^\.venv$ +CLAUDE\.md diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000000..2d19fc766d --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..33f0e07d41 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,13 @@ +Please briefly describe your problem and what output you expect. If you have a question, please don't use this form, but instead ask on the community forum or stackoverflow . + +Please include a minimal reprex. The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it. If you've never heard of a reprex before, start by reading , and follow the advice further down the page. Do NOT include session info unless it's explicitly asked for, or you've used `reprex::reprex(..., si = TRUE)` to hide it away. + +Delete these instructions once you have read them. + +--- + +Brief description of the problem + +```r +# insert reprex here +``` diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000000..18a9ebf3e8 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,110 @@ +# NOTE: This workflow is overkill for most R packages +# check-standard.yaml is likely a better choice +# usethis::use_github_action("check-standard") will install it. +# +# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. +# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + # vdiffr & shinytest only runs on mac r-release since the results aren't cross-platform + - {os: macOS-latest, r: 'release', visual_tests: true, node: "14.x", shinytest: true} + - {os: windows-latest, r: 'release'} + # - {os: windows-latest, r: 'oldrel-1'} # pak is having issues + - {os: ubuntu-latest, r: 'devel'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + - {os: ubuntu-latest, r: 'oldrel-2'} + # - {os: ubuntu-latest, r: 'oldrel-3'} # dependency issues with oldrel-3 + # - {os: ubuntu-latest, r: 'oldrel-4'} # dependency issues with oldrel-4 + + env: + VISUAL_TESTS: ${{ matrix.config.visual_tests }} + SHINYTEST: ${{ matrix.config.shinytest }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }} + plotly_username: ${{ secrets.PLOTLY_USERNAME }} + plotly_api_key: ${{ secrets.PLOTLY_API_KEY }} + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - uses: r-lib/actions/setup-r@v2 + id: install-r + with: + r-version: ${{ matrix.config.r }} + use-public-rspm: true + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + cache-version: 3 + needs: check + + - name: Set up Python (for reticulate) + if: matrix.config.visual_tests == true + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install kaleido + if: matrix.config.visual_tests == true + run: | + # We pin kaleido to v0.2.1 here since >=v1.0 doesn't appear to be correctly rendering some plots + Rscript -e 'library(reticulate); use_python(Sys.which("python")); py_install(c("kaleido==0.2.1", "plotly"))' + + # Run test() before R CMD check since, for some reason, rcmdcheck::rcmdcheck() skips vdiffr tests + - name: Run Tests + run: | + options(crayon.enabled = TRUE, testthat.progress.max_fails=1000) + res <- devtools::test() + df <- as.data.frame(res) + if (sum(df$failed) > 0 || any(df$error)) stop("GHA CI tests failed") + shell: Rscript {0} + + # Upload the whole pkg since tests where run with devtools::test() + - name: Upload check results + if: always() + uses: actions/upload-artifact@master + with: + name: ${{ runner.os }}-r${{ matrix.config.r }}-results + path: | + ./ + !./.git/ + + - name: Check package + uses: r-lib/actions/check-r-package@v2 + with: + check-dir: '"check"' + # Run check with --no-tests since we ran them abve + # 2023-01-03: `{purrr}` v1.0.0 had trouble on Windows without the `--no-multiarch` + # https://github.com/plotly/plotly.R/pull/2221 + args: 'c("--no-tests", "--no-manual", "--as-cran", "--no-multiarch")' + error-on: '"warning"' + + #- name: Show testthat output + # if: always() + # run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true + # shell: bash diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..5b35c0c015 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,74 @@ +# Add this file to plotly/plotly.R at .github/workflows/docs.yml +# +# This workflow builds and deploys the R documentation site from +# the graphing-library-docs repository to this repo's GitHub Pages. + +name: Deploy R Documentation + +on: + # Manual trigger + workflow_dispatch: + + # Run weekly to pick up any docs changes + schedule: + - cron: '0 0 * * 0' # Every Sunday at midnight UTC + + # Optional: trigger from docs repo via repository_dispatch + repository_dispatch: + types: [docs-updated] + +# Sets permissions for GitHub Pages deployment +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: false + +env: + # Change this if the docs repo moves to a different location + DOCS_REPO: cpsievert/graphing-library-docs + DOCS_BRANCH: master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout docs repository + uses: actions/checkout@v4 + with: + repository: ${{ env.DOCS_REPO }} + ref: ${{ env.DOCS_BRANCH }} + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2' + bundler-cache: true + + - name: Fetch R/ggplot2 docs from plotly.r-docs + run: make fetch + + - name: Build site + run: bundle exec jekyll build --config _config.yml,_config_production.yml + env: + JEKYLL_ENV: production + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: _site + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index aaa488a0b2..902c8e5c72 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,20 @@ Rapp.history *.Rhistory *.RData *.Rproj.user +*.DS_Store +.venv +node_modules/ +build_site.R +revdep_email.R +abbvie.R +todo.R +inst/examples/rmd/*.html +inst/examples/*/rsconnect/* .Rproj.user +Untitled* +rsconnect/ +revdep/ +travis_debug.R +.httr-oauth +tests/testthat/Rplots.pdf +.venv/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 98329875e3..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,45 +0,0 @@ -language: c -sudo: false - -addons: - apt: - sources: - - r-packages-precise - packages: - - r-base-dev - - r-recommended - -env: - global: - - R_LIBS_USER=~/R/library NOT_CRAN=true R_PKG="$(basename $TRAVIS_REPO_SLUG)" - # plotly_api_key (for posting to plot.ly) - - secure: "jlIAFoBGaDWUQDh6oGNb2BgU31/80iioM4y4xwx35yWkGKkNIID1eMEuiIn+/ipLvOVHkPTDS6DYnOtD8EIBpROgAKHFY33gM1h7P6NRxVszzC6WLP2ASnq95DWq36DAC2Oevy05V7nwSRFilPwSt6JLppYUInG+WdaZ+QOSRi4=" - # GITHUB_PAT (for pushing to plotly-test-table) - - secure: "LHJONgWOo+98vNeFLI7LSJU3RtbMVszlI79GB8CcXmc2mlgM/UtZ5b6RnkNlhmg3Gj1/uObfm/rIybVTwuS1yNpeKv73+gsZOYhobVXiUGVxdRFG/mg5mbqwyWkkuofjPGFlMZCEMgHim37eZzgjSibwVH1LClRDsCoFMCgvgV0=" - -cache: - directories: - $R_LIBS_USER - -before_script: - - mkdir -p "$R_LIBS_USER" - - git config --global user.email "cpsievert1@gmail.com" - - git config --global user.name "cpsievert" - - echo "Sys.setenv('plotly_username' = 'cpsievert')" > ~/.Rprofile - - git clone https://github.com/cpsievert/plotly-test-table.git ../plotly-test-table - - "wget -q -O - https://github.com/yihui/crandalf/raw/master/inst/scripts/install-pandoc | bash" - - Rscript -e 'if (length(find.package("devtools", quiet = TRUE)) == 0L) { install.packages("devtools", repos = "http://cran.rstudio.com") }' - - Rscript -e 'devtools::update_packages("devtools", repos = "http://cran.rstudio.com")' - - Rscript -e 'devtools::install_deps(repos = "http://cran.rstudio.com", dependencies = TRUE)' - - cd ..; rm -f *.tar.gz; R CMD build $R_PKG - - R CMD INSTALL ${R_PKG}_*.tar.gz - -script: - # run R CMD check on the non-pull request build - - sh -c "if [ '$TRAVIS_PULL_REQUEST' = 'false' ]; then R CMD check ${R_PKG}_*.tar.gz --no-manual; fi" - # we do some fancy stuff on the pull request build that confuses R CMD check - - sh -c "if [ '$TRAVIS_PULL_REQUEST' != 'false' ]; then Rscript -e 'source(\"plotly/tests/testthat.R\", chdir = T)'; fi" - -after_success: - - cd plotly-test-table - - Rscript ../plotly/inst/build-push-comment.R diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000000..bad151e8b0 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,98 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +plotly is an R package for creating interactive web graphics via the plotly.js JavaScript library. It provides two main interfaces: +- `ggplotly()`: Converts ggplot2 objects to interactive plotly visualizations +- `plot_ly()`: Direct interface to plotly.js for specialized chart types + +## Common Commands + +### Running Tests +```r +# Run all tests +devtools::test() + +# Run visual tests (requires kaleido via reticulate) +Sys.setenv("VISUAL_TESTS" = "true") +devtools::test() + +# Run a single test file +devtools::test(filter = "ggplot-bar") +``` + +### Package Check +```r +rcmdcheck::rcmdcheck() +``` + +### Building Documentation +```r +devtools::document() +``` + +### Visual Testing via Docker +For consistent visual test results: +```shell +docker run -v $(pwd):/home/plotly --privileged -p 3838:3838 cpsievert/plotly-orca +``` +Access the validation Shiny app at http://0.0.0.0:3838 + +CI-only visual test run: +```shell +docker run -e VMODE="ci" -v $(pwd):/home/plotly --privileged cpsievert/plotly-orca +``` + +## Architecture + +### ggplot2 to plotly Conversion Pipeline + +The conversion from ggplot2 to plotly follows this flow: + +1. **`ggplotly()`** (`R/ggplotly.R`): Entry point that dispatches on input type +2. **`gg2list()`** (`R/ggplotly.R`): Main conversion function that: + - Builds the ggplot object to extract computed data + - Processes each layer through `layers2traces()` + - Processes layout through `layers2layout()` +3. **`layers2traces()`** (`R/layers2traces.R`): Converts ggplot2 geom layers to plotly trace objects +4. **`layers2layout()`** (`R/layers2layout.R`): Converts ggplot2 theme/coordinate settings to plotly layout + +### Direct plotly Interface + +1. **`plot_ly()`** (`R/plotly.R`): Creates a plotly object with trace attributes +2. **`add_trace()`** and `add_*()` functions (`R/add.R`): Add traces to existing plots +3. **`layout()`** (`R/layout.R`): Modify plot layout +4. **`plotly_build()`** (`R/plotly_build.R`): Evaluates lazy attributes and creates final JSON for plotly.js + +### Key Modules + +- `R/shiny.R`: Shiny integration and event handling +- `R/subplots.R`: Combining multiple plots +- `R/highlight.R`: Linked brushing/crosstalk support +- `R/animate.R`: Animation support +- `R/kaleido.R`, `R/orca.R`: Static image export + +## Testing Patterns + +Tests should check the return value of `plotly_build()`: +```r +test_that("example test", { + p <- plot_ly(x = 1:10, y = 1:10) + built <- plotly_build(p) + expect_equal(built$x$data[[1]]$x, 1:10) +}) +``` + +Visual tests use `expect_doppelganger()` from `tests/testthat/helper-vdiffr.R`: +```r +test_that("visual test", { + p <- plot_ly(x = 1:10, y = 1:10) + expect_doppelganger(p, "scatter-basic") +}) +``` + +## Code Style + +Follow the tidyverse style guide: http://style.tidyverse.org/ diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..bc83715229 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at accounts@plot.ly. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.4, available at [http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4/), and may also be found online at . diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cfd289e156..34e5c6e4e2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,32 +2,28 @@ ## Opening issues -Search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/ropensci/plotly/issues/new) +See the [opening issues template](https://github.com/ropensci/plotly/blob/master/.github/ISSUE_TEMPLATE.md) -Bug reports __must__ have a [reproducible example](http://adv-r.had.co.nz/Reproducibility.html) and include the output of `devtools::session_info()` (instead of `sessionInfo()`). +## Development guidelines -GitHub issues are great for reporting bugs and requesting new features, but implementation questions are better suited for Stack Overflow (tagged -[`plotly`](https://stackoverflow.com/questions/tagged/plotly)) or on -community.plot.ly (tagged [`plotly-js`](http://community.plot.ly/c/plotly-js)). +If you'd like to contribute changes to plotly, we use [the GitHub flow](https://guides.github.com/introduction/flow/index.html) for proposing, submitting, reviewing, and accepting changes. If you aren't familiar with git and/or GitHub, we recommend studying these excellent free resources by [Hadley Wickham](http://r-pkgs.had.co.nz/git.html) and [Jenny Bryan](http://happygitwithr.com). We also prefer R coding style that adheres to . -## Development guidelines +If your pull request fixes a bug and/or implements a new feature, please [write a test via testthat](http://r-pkgs.had.co.nz/tests.html) to demonstrate it's working. Tests should generally check the return value of `plotly_build()`, but can also use **vdiffr**'s `expect_doppelganger()` to add a visual test! By default, `devtools::tests()` won't run the visual tests, but you *can* run visual tests on your machine via `Sys.setenv("VDIFFR" = "true"); devtools::test()`. That being said, false positives are likely to occur simply due to superfluous differences in your system environment, so we recommend running visual tests via docker. -If you'd like to contribute changes to plotly, we use [the GitHub flow](https://guides.github.com/introduction/flow/index.html) for proposing, submitting, reviewing, and accepting changes. If you haven't done this before, Hadley Wickham provides a nice overview of git (), as well as best practices for submitting pull requests (). We also recommend using his style guide when writing code (). +### Running visual tests via docker -If your pull request fixes a bug, or implements a new feature, it's a good idea to write a test () to demonstrate it's working. If you'd like to closely simulate the tests that run when you submit your pull request, open R under your local plotly git repo, then do the following: +To ensure a consistent and reproducible environment, visual tests should be run against the [cpsievert/plotly-orca](https://hub.docker.com/r/cpsievert/plotly-orca/) docker image. If you add a new visual test and/or expect any differences, run a container like so: -```r -# the pull request number is arbitrary when running locally -Sys.setenv('TRAVIS_PULL_REQUEST' = '1') -Sys.setenv('TRAVIS_COMMIT' = substr(system('git rev-parse HEAD', intern = T), 1, 7)) -devtools::load_all(); source('tests/testthat.R', chdir = TRUE) +```shell +git clone https://github.com/ropensci/plotly.git +cd plotly +docker run -v $(pwd):/home/plotly --privileged -p 3838:3838 cpsievert/plotly-orca ``` -You can also build a ggplot2/plotly comparison table: +This will launch a shiny app for inspecting and validating any visual differences. To see the shiny app, open your browser to . If there are differences that look 'good', you should validate them via the shiny app. This will automatically copy over the new "baseline" figures over to your host machine (so that you can git add/commit/push the new baselines). If, for some reason, you want to just run the visual tests to see if they'll pass, do: -```r -Sys.setenv('PLOTLY_TEST' = 'TRUE') -devtools::load_all(); source('tests/testthat.R', chdir = TRUE) +```shell +docker run -e VMODE="ci" -v $(pwd):/home/plotly --privileged cpsievert/plotly-orca ``` ## Code of Conduct diff --git a/DESCRIPTION b/DESCRIPTION index 4b8800c2e6..3cbf41b62d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,9 +1,9 @@ Package: plotly -Title: Create Interactive Web Graphics via Plotly's JavaScript Graphing Library -Version: 2.3.3 +Title: Create Interactive Web Graphics via 'plotly.js' +Version: 4.12.0.9000 Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"), - email = "cpsievert1@gmail.com"), - person("Chris", "Parmer", role = c("aut", "cph"), + email = "cpsievert1@gmail.com", comment = c(ORCID = "0000-0002-4958-2844")), + person("Chris", "Parmer", role = "aut", email = "chris@plot.ly"), person("Toby", "Hocking", role = "aut", email = "tdhock5@gmail.com"), @@ -12,39 +12,78 @@ Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"), person("Karthik", "Ram", role = "aut", email = "karthik.ram@gmail.com"), person("Marianne", "Corvellec", role = "aut", - email = "marianne@plot.ly"), + email = "marianne.corvellec@igdore.org", comment = c(ORCID = "0000-0002-1994-3581")), person("Pedro", "Despouy", role = "aut", - email = "pedro@plot.ly")) + email = "pedro@plot.ly"), + person("Salim", "Brüggemann", role = "ctb", + email = "salim-b@pm.me", comment = c(ORCID = "0000-0002-5329-5987")), + person("Plotly Technologies Inc.", role = "cph")) License: MIT + file LICENSE -Description: Easily translate ggplot2 graphs to an interactive web-based version and/or create custom web-based visualizations directly from R. Once uploaded to a plotly account, plotly graphs (and the data behind them) can be viewed and modified in a web browser. -URL: https://plot.ly/r, https://github.com/ropensci/plotly -BugReports: https://github.com/ropensci/plotly/issues +Description: Create interactive web graphics from 'ggplot2' graphs and/or a custom interface to the (MIT-licensed) JavaScript library 'plotly.js' inspired by the grammar of graphics. +URL: https://plotly-r.com, https://github.com/plotly/plotly.R, https://plotly.com/r/ +BugReports: https://github.com/plotly/plotly.R/issues Depends: - ggplot2 (>= 2.0.0) + R (>= 3.2.0), + ggplot2 (>= 3.0.0) Imports: + tools, scales, - httr, - jsonlite, + httr (>= 1.3.0), + jsonlite (>= 1.6), magrittr, digest, - viridis, + viridisLite, base64enc, - htmlwidgets, - plyr -Suggests: + htmltools (>= 0.3.6), + htmlwidgets (>= 1.5.2.9001), + tidyr (>= 1.0.0), + RColorBrewer, dplyr, + vctrs, + tibble, + rlang (>= 1.0.0), + crosstalk, + purrr, + data.table, + promises +Suggests: + MASS, maps, + hexbin, + ggthemes, + GGally, + ggalluvial, testthat, knitr, - devtools, - shiny, - htmltools, + shiny (>= 1.1.0), + shinytest2, curl, rmarkdown, - RColorBrewer, - Rserve, - RSclient, - broom + Cairo, + broom, + webshot, + listviewer, + dendextend, + sf, + png, + IRdisplay, + processx, + plotlyGeoAssets, + forcats, + withr, + palmerpenguins, + rversions, + reticulate, + rsvg, + ggridges LazyData: true -VignetteBuilder: knitr -RoxygenNote: 5.0.1 +RoxygenNote: 7.3.3 +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +Config/Needs/check: + tidyverse/ggplot2, + ggobi/GGally, + rcmdcheck, + devtools, + reshape2, + s2 diff --git a/LICENSE b/LICENSE index 6ea7fce0d9..34e65ef802 100644 --- a/LICENSE +++ b/LICENSE @@ -1,2 +1,2 @@ -YEAR: 2014 -COPYRIGHT HOLDER: Chris Parmer \ No newline at end of file +YEAR: 2017 +COPYRIGHT HOLDER: Plotly, Inc. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000000..fa66b17d20 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2024 Plotly Technologies Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/NAMESPACE b/NAMESPACE index 86bf7444ab..a799edaa2d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,53 +1,286 @@ # Generated by roxygen2: do not edit by hand -S3method(print,figure) -S3method(print,plotly) +S3method(api_create,data.frame) +S3method(api_create,ggplot) +S3method(api_create,plotly) +S3method(embed_notebook,plotly) +S3method(fortify,SharedData) +S3method(geom2trace,GeomBar) +S3method(geom2trace,GeomBlank) +S3method(geom2trace,GeomBoxplot) +S3method(geom2trace,GeomErrorbar) +S3method(geom2trace,GeomErrorbarh) +S3method(geom2trace,GeomPath) +S3method(geom2trace,GeomPoint) +S3method(geom2trace,GeomPolygon) +S3method(geom2trace,GeomRidgelineGradient) +S3method(geom2trace,GeomText) +S3method(geom2trace,GeomTile) +S3method(geom2trace,default) +S3method(ggplot,plotly) +S3method(ggplotly,"NULL") +S3method(ggplotly,ggmatrix) +S3method(ggplotly,ggplot) +S3method(ggplotly,plotly) +S3method(highlight_key,default) +S3method(highlight_key,plotly) +S3method(layout,matrix) +S3method(layout,plotly) +S3method(layout,shiny.tag.list) +S3method(linewidth_or_size,Geom) +S3method(linewidth_or_size,default) +S3method(linewidth_or_size,element) +S3method(plotly_build,"NULL") +S3method(plotly_build,gg) +S3method(plotly_build,ggmatrix) +S3method(plotly_build,list) +S3method(plotly_build,plotly) +S3method(print,api) +S3method(print,api_grid) +S3method(print,api_grid_local) +S3method(print,api_plot) +S3method(print,kaleidoScope) +S3method(print,plotly_data) +S3method(process,api_image) +S3method(process,api_plot) +S3method(process,default) +S3method(to_basic,GeomAbline) +S3method(to_basic,GeomAlluvium) +S3method(to_basic,GeomAnnotationMap) +S3method(to_basic,GeomArea) +S3method(to_basic,GeomBoxplot) +S3method(to_basic,GeomCol) +S3method(to_basic,GeomContour) +S3method(to_basic,GeomCrossbar) +S3method(to_basic,GeomDensity) +S3method(to_basic,GeomDensity2d) +S3method(to_basic,GeomDensityLine) +S3method(to_basic,GeomDensityRidges) +S3method(to_basic,GeomDensityRidges2) +S3method(to_basic,GeomDensityRidgesGradient) +S3method(to_basic,GeomDotplot) +S3method(to_basic,GeomErrorbar) +S3method(to_basic,GeomErrorbarh) +S3method(to_basic,GeomFunction) +S3method(to_basic,GeomHex) +S3method(to_basic,GeomHline) +S3method(to_basic,GeomJitter) +S3method(to_basic,GeomLine) +S3method(to_basic,GeomLinerange) +S3method(to_basic,GeomMap) +S3method(to_basic,GeomPointrange) +S3method(to_basic,GeomQuantile) +S3method(to_basic,GeomRaster) +S3method(to_basic,GeomRasterAnn) +S3method(to_basic,GeomRect) +S3method(to_basic,GeomRibbon) +S3method(to_basic,GeomRidgeline) +S3method(to_basic,GeomRidgelineGradient) +S3method(to_basic,GeomRug) +S3method(to_basic,GeomSegment) +S3method(to_basic,GeomSf) +S3method(to_basic,GeomSmooth) +S3method(to_basic,GeomSpoke) +S3method(to_basic,GeomStep) +S3method(to_basic,GeomStratum) +S3method(to_basic,GeomTile) +S3method(to_basic,GeomViolin) +S3method(to_basic,GeomVline) +S3method(to_basic,default) export("%>%") +export(TeX) +export(add_annotations) +export(add_area) +export(add_bars) +export(add_boxplot) +export(add_choropleth) +export(add_contour) +export(add_data) +export(add_fun) +export(add_heatmap) +export(add_histogram) +export(add_histogram2d) +export(add_histogram2dcontour) +export(add_image) +export(add_lines) +export(add_markers) +export(add_mesh) +export(add_paths) +export(add_pie) +export(add_polygons) +export(add_ribbons) +export(add_scattergeo) +export(add_segments) +export(add_sf) +export(add_surface) +export(add_table) +export(add_text) export(add_trace) +export(animation_button) +export(animation_opts) +export(animation_slider) +export(api) +export(api_create) +export(api_download_grid) +export(api_download_plot) +export(arrange) +export(arrange_) export(as.widget) +export(as_widget) +export(attrs_selected) +export(colorbar) export(config) +export(distinct) +export(distinct_) +export(do) +export(do_) export(embed_notebook) +export(event_data) +export(event_register) +export(event_unregister) +export(export) +export(filter) +export(filter_) +export(geom2trace) export(get_figure) export(gg2list) -export(ggplot_build2) export(ggplotly) export(group2NA) -export(knit_print.figure) -export(knit_print.plotly) +export(group_by) +export(group_by_) +export(groups) +export(hide_colorbar) +export(hide_guides) +export(hide_legend) +export(highlight) +export(highlight_key) +export(kaleido) +export(knit_print.api_grid) +export(knit_print.api_grid_local) +export(knit_print.api_plot) export(last_plot) -export(layer2traces) export(layout) +export(mutate) +export(mutate_) export(offline) -export(paramORdefault) +export(orca) +export(orca_serve) +export(partial_bundle) +export(plot_dendro) +export(plot_geo) export(plot_ly) +export(plot_mapbox) export(plotly) export(plotlyOutput) +export(plotlyProxy) +export(plotlyProxyInvoke) export(plotly_IMAGE) export(plotly_POST) export(plotly_build) +export(plotly_data) export(plotly_empty) +export(plotly_example) +export(plotly_json) +export(rangeslider) +export(raster2uri) +export(remove_typedarray_polyfill) +export(rename) +export(rename_) export(renderPlotly) +export(save_image) +export(schema) +export(select) +export(select_) +export(showRGB) export(signup) +export(slice) +export(slice_) export(style) export(subplot) +export(summarise) +export(summarise_) export(toRGB) +export(toWebGL) +export(to_basic) +export(transmute) +export(transmute_) +export(ungroup) import(ggplot2) -import(httr) -import(jsonlite) -importFrom(base64enc,base64encode) +importFrom(data.table,as.data.table) +importFrom(data.table,setorderv) +importFrom(dplyr,arrange) +importFrom(dplyr,arrange_) +importFrom(dplyr,distinct) +importFrom(dplyr,distinct_) +importFrom(dplyr,do) +importFrom(dplyr,do_) +importFrom(dplyr,filter) +importFrom(dplyr,filter_) +importFrom(dplyr,group_by) +importFrom(dplyr,group_by_) +importFrom(dplyr,groups) +importFrom(dplyr,mutate) +importFrom(dplyr,mutate_) +importFrom(dplyr,rename) +importFrom(dplyr,rename_) +importFrom(dplyr,select) +importFrom(dplyr,select_) +importFrom(dplyr,slice) +importFrom(dplyr,slice_) +importFrom(dplyr,summarise) +importFrom(dplyr,summarise_) +importFrom(dplyr,transmute) +importFrom(dplyr,transmute_) +importFrom(dplyr,ungroup) +importFrom(grDevices,as.raster) importFrom(grDevices,col2rgb) +importFrom(grDevices,dev.list) +importFrom(grDevices,dev.off) +importFrom(grDevices,extendrange) +importFrom(grDevices,rgb) +importFrom(graphics,layout) +importFrom(htmltools,browsable) +importFrom(htmltools,div) +importFrom(htmltools,tagList) +importFrom(htmltools,tags) importFrom(htmlwidgets,createWidget) +importFrom(htmlwidgets,onRender) +importFrom(htmlwidgets,prependContent) +importFrom(htmlwidgets,saveWidget) importFrom(htmlwidgets,shinyRenderWidget) importFrom(htmlwidgets,shinyWidgetOutput) importFrom(htmlwidgets,sizingPolicy) +importFrom(httr,RETRY) +importFrom(httr,add_headers) +importFrom(httr,authenticate) +importFrom(httr,config) +importFrom(httr,content) +importFrom(httr,stop_for_status) +importFrom(httr,warn_for_status) +importFrom(httr,write_disk) +importFrom(jsonlite,parse_json) +importFrom(jsonlite,read_json) +importFrom(jsonlite,toJSON) importFrom(magrittr,"%>%") -importFrom(plyr,ddply) -importFrom(plyr,join) -importFrom(plyr,summarise) +importFrom(purrr,transpose) +importFrom(rlang,"!!!") +importFrom(rlang,"!!") +importFrom(rlang,eval_tidy) +importFrom(rlang,is_na) +importFrom(stats,complete.cases) +importFrom(stats,is.leaf) +importFrom(stats,quantile) importFrom(stats,setNames) +importFrom(tibble,as_tibble) +importFrom(tidyr,unnest) +importFrom(tools,file_ext) +importFrom(tools,file_path_sans_ext) importFrom(utils,browseURL) +importFrom(utils,capture.output) importFrom(utils,data) +importFrom(utils,file.edit) importFrom(utils,getFromNamespace) importFrom(utils,modifyList) importFrom(utils,packageVersion) -importFrom(viridis,viridis) +importFrom(utils,str) +importFrom(viridisLite,viridis) diff --git a/NEWS b/NEWS deleted file mode 100644 index 665cc31996..0000000000 --- a/NEWS +++ /dev/null @@ -1,355 +0,0 @@ -2.3.3 -- 27 Jan 2015 - -Bump axis number for each trace matching a panel number. fixes #318 - -2.3.2 -- 25 Jan 2015 - -More accurate list of data_array properties. Fixes #415 - -2.3.1 -- 25 Jan 2015 - -More accurate conversion of path width. Fixes #373. - -2.3.0 -- 19 Jan 2015 - -Add sharing argument and deprecate world_readable. Fixes #332 - -2.2.4 -- 18 Jan 2015 - -Fix for error in embed_notebook(). See #409. - -2.2.3 -- 18 Jan 2015 - -Fix for geom_vline(). See #402. - -2.2.2 -- 18 Jan 2015 - -Fix bar orientation when we detect geom_bar() + coord_flip() in ggplotly(). Fixes #390. - -2.2.1 -- 18 Jan 2015 - -Search for axis title in scene object. fixes #393. - -2.2.0 -- 13 Jan 2015 - -The default for layout.hovermode is now 'closest' for non-line scatter traces - -2.1.3 -- 12 Jan 2015 - -Fix size and alpha translation for geom_point. Fixes #386 - -2.1.2 -- 11 Jan 2015 - -Upgraded to plotlyjs 1.4.1. For a list of changes, see https://github.com/plotly/plotly.js/releases/tag/v1.4.1 - -2.1.1 -- 11 Jan 2015 - -Upgraded to plotlyjs 1.4. For a list of changes, see https://github.com/plotly/plotly.js/releases/tag/v1.4.0 - -2.1.0 -- 29 Dec 2015 - -plot_ly() now defaults to inherit=FALSE and plotly_build() is now idempotent. Fixes #280 and #277. See #368 for details. - -2.0.19 -- 23 Dec 2015 - -Added as.widget() function for conveniency in converting plotly object to htmlwidget objects. See #294. - -2.0.18 -- 22 Dec 2015 - -Fix #365 - -2.0.17 -- 22 Dec 2015 - -Fix #358 - -2.0.16 -- 18 Dec 2015 - -Require ggplot2 2.0.0 or higher. For details, see #269. - -2.0.15 -- 13 Dec 2015 - -Fix #346 - -2.0.14 -- 13 Dec 2015 - -Fix #212 - -2.0.13 -- 12 Dec 2015 - -Fix #286 - -2.0.12 -- 11 Dec 2015 - -Fix #221 - -2.0.11 -- 11 Dec 2015 - -Fix #250 - -2.0.10 -- 10 Dec 2015 - -Fix #225 - -2.0.9 -- 10 Dec 2015 - -Fix #333 - -2.0.8 -- 10 Dec 2015 - -Fix a bug with geom_segment (see #321 & #228) - -2.0.7 -- 10 Dec 2015 - -Fix #233 - -2.0.6 -- 2 Dec 2015 - -Upgrade to plotlyjs 1.1.1. Fixes #319. - -2.0.5 -- 1 Dec 2015 - -Fix for legend names. See #236. - -2.0.4 -- 28 Nov 2015 - -Fix #313. - -2.0.3 -- 18 Nov 2015 - -Fixed bug causing knitr options to be ignored. Also added VignetteBuilder to DESCRIPTION to vignette is available. - -2.0.2 -- 17 Nov 2015 - -Using plotly_build() on a ggplot object should always return a plotly object - -2.0.1 -- 17 Nov 2015 - -Better printing of server figures. Documentation and other fixes for initial CRAN release! - -2.0.0 -- 2 Nov 2015 - -Added a dependency on htmlwidgets and 'offline' plots are now the default. If you want to create a figure on a plotly server, you need to use `plotly_POST()`. Also added a `config()` function to control the default appearance of the interactive plot - -1.0.10 -- 3 Nov 2015 - -Fixed #292. - -1.0.9 -- 28 Sep 2015 - -Fixed filename, fileopt arguments in plot_ly. Specifying the same filename will now overwrite the plot if it exists. - -1.0.8 -- 14 Sep 2015 - -Added the plotly_IMAGES() function which interfaces to the images endpoint https://api.plot.ly/v2/#images - -Details -> https://github.com/ropensci/plotly/pull/279 - -1.0.7 -- 26 Aug 2015 - -See https://github.com/ropensci/plotly/pull/275 - -1.0.6 -- 25 Aug 2015 - -Fix a bug with subplot domain calculations (see https://github.com/ropensci/plotly/pull/274) - -1.0.5 -- 20 Aug 2015 - -Fix issue converting plotly offline markdown documents to HTML when using `markdown::markdownToHTML` - -1.0.4 -- 14 Aug 2015 - -Bug fix for subplot. See #265 - -1.0.3 -- 7 Aug 2015 - -Improved legend positioning. See #241 - -1.0.2 -- 2 Aug 2015 - -* last_plot() will now look for the last plotly object; if not found, it will try to find the last ggplot object. -* Officially added the filename, fileopt, and world_readable arguments to plot_ly() and ggplotly(). -* If plotly offline is not available, the shiny.launch.browser option is changed to open a web brower. See #245. -* Various namespace/documentation improvements for R CMD check. - -1.0.1 -- 2 Aug 2015 - -Removed the stream() function as it wasn't ready to be included. - -1.0.0 -- 31 July 2015 - -A major reworking of package internals which includes a few backwards incompatible changes. - -Major changes include: - -(1) New high-level grammar for expressing Plotly graphs from R (see the `plot_ly()`, `add_trace()`, `layout()`, and `style()` functions). -(2) New print methods which make it easier to create, modify, and embed Plotly graphs. -(3) Added a `subplot()` function for putting several graphs on a single page. -(4) Added the `renderPlotly()` and `plotlyOutput()` functions for embedding plotly graphs in shiny applications. -(5) Added `offline()` function for creating standalone HTML pages via Plotly Offline (see http://purchasing.plot.ly/) - -For more details, see the new vignettes with `browseVignettes(package = "plotly")` and/or the pull request -> https://github.com/ropensci/plotly/pull/226 - -0.6.3 -- 2 June 2015 - -Add new tests inspired by the R Cookbook distributions #214 - -0.6.2 -- 19 May 2015 - -In geom_bar(stat = "identity"), sum y values if multiple for a given x. - -0.6.1 -- 5 May 2015 - -Add test-cookbook-lines.R and fix bugs that showed up in those tests. - -0.6 -- 4 May 2015 - -Let gg2list() return a figure object (backwards incompatible change). - -0.5.29 -- 16 April 2015 - -geom_density() as filled area chart #202 - -0.5.28 -- 15 April 2015 - -Let ggplot handle histogram binning. Fix #198 - -0.5.27 -- 19 Mar 2015 - -Reimplement geom_ribbon as a basic polygon. Fix #191. Fix #192. - -0.5.26 -- 18 Mar 2015 - -Implemented geom_rect #178 - -0.5.25 -- 10 March 2015 - -Implemented geom_smooth() #183 - -0.5.24 -- 10 March 2015 - -Implemented facet_wrap(scales="free") #167 - -0.5.23 -- 10 March 2015. - -geom_ribbon() now respects alpha transparency - -0.5.22 -- 2 March 2015. - -Fixes for ylim() #171. - -0.5.21 -- 23 February 2015. - -Fixes for error bars and tick marks. - -0.5.20 -- 9 February 2015. - -Add alpha transparency to fill conversion. -Let geom_area support colour and fill aesthetics. - -0.5.19 -- 23 January 2015. - -Support class conversion such as as.Date() within ggplot code. - -0.5.18 -- 22 January 2015. - -Return proper filepath when filename contains directories. - -0.5.17 -- 30 December 2014. - -Support date-time binning in histograms. - -0.5.16 -- 29 December 2014. - -Support colour aesthetic in geom_text(). - -0.5.15 -- 19 December 2014. - -Use proper RCurlOptions in get_figure() method. - -0.5.14 -- 1 December 2014. - -Make layers geom_line + geom_point only one trace in Plotly. - -0.5.13 -- 27 November 2014. - -Rename translation file and server endpoint parameter to be hip. - -0.5.12 -- 12 November 2014. - -Improve legend title position. - -0.5.11 -- 11 November 2014. - -Show legend title. - -0.5.10 -- 7 November 2014. - -Improve showlegend and fix legend’s `x` position. - -0.5.9 -- 3 November 2014. - -Default colours for geom_polygon(). - -0.5.8 -- 30 October 2014. - -Support hline over a factor x range. -Default colours for geom_boxplot(). - -0.5.7 -- 29 October 2014. - -Default colours for geom_area() and geom_ribbon(). - -0.5.6 -- 28 October 2014. - -Convert line size faithfully. - -0.5.5 -- 24 October 2014. - -Support category histograms (with factors). - -0.5.4 -- 22 October 2014. - -Support conversion of geom_vline(). - -0.5.3 -- 21 October 2014. - -Support conversion of geom_bar() with position_dodge(). - -0.5.2 -- 18 October 2014. - -Support aesthetic shape in geom_path() and, hence, geom_line() (conversion). - -0.5.1 -- 15 October 2014. - -Do not show zero lines by default (as in ggplot2 plots). - -0.5.0 -- 15 October 2014. - -From now on, version numbers are meaningful again... -Many changes meanwhile, especially support for more geoms. - -0.4 -- 7 April 2014. - -Re-write geom to trace conversion code. - -0.3.8 -- 21 March 2014. - -ggplotly takes the last_plot() by default. - -Support for ggplotly layout elements title, tickcolor, gridcolor, -showlegend, plot_bgcolor, paper_bgcolor, tickangle, axis titles, plot -border colors. - -0.3.7 -- 14 March 2014. - -For ggplotly: - -- if on the command line, open a web browser (as before). - -- if in knitr/Rmd in a chunk with plotly=TRUE, embed the plot. - -0.3.6 -- 10 March 2014. - -Merge ggplotly code. - -0.3.5 diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000000..174a6a732f --- /dev/null +++ b/NEWS.md @@ -0,0 +1,1409 @@ +# plotly (development version) + +* Completed the `plot_ly()` documentation for what happens when `type` is not + specified (#2362). + +* Removed the dependency on the `{lazyeval}` package. + +## Bug fixes + +* Closed #2483: `save_image()` no longer embeds Windows file paths directly into Python source passed to `reticulate`, fixing static image export with Kaleido on Windows. + + +# plotly 4.12.0 + +## Changes to plotly.js + +Upgrades plotly.js from v2.11.1 to v2.25.2 (35 releases). Key new features now available: + +* **Multiple legends**: Support for `legend2`, `legend3`, etc. with separate positioning and visibility control +* **Shape labels**: New `label` attribute for shapes and `label.texttemplate` for parametric shapes +* **Marker direction**: New `marker.angle`, `marker.angleref`, and `marker.standoff` properties for directional markers +* **Y-axis positioning**: `shift` and `autoshift` properties to avoid y-axis overlapping in multi-axis plots +* **Mapbox clustering**: Clustering options and bounds support for `scattermapbox` traces +* **Equal Earth projection**: New map projection option for geo subplots +* **Pattern fills**: Pattern support extended to pie, funnelarea, sunburst, icicle, and treemap charts +* **Editable selections**: Persistent and editable selections over cartesian subplots with `editSelection` config option +* **Axis label aliases**: `labelalias` for simplified axis label customization +* **Grid styling**: `griddash` property and minor tick/grid line styling options + +Also includes a security fix for prototype pollution and ~90KB bundle size reduction. + +See the [plotly.js releases page](https://github.com/plotly/plotly.js/releases) for the full changelog. + +## Improvements + +* `save_image()` now works with kaleido v1.0 and higher. (#2447) + +## Bug fixes + +* `plotly_build()` now works with `ggmatrix` objects (e.g., from `GGally::ggpairs()`). (#2447) +* Closed #2415: `ggplotly()` now shows variables named 'group' in tooltips when mapped to aesthetics like `colour`. +* Closed #2455, #2460: `ggplotly()` no longer creates empty shapes when `panel.border` is `element_blank()` (ggplot2 4.0.0 compatibility). +* Closed #2466: `ggplotly()` no longer errors when `scale_*_manual()` has unused aesthetics (e.g., `aesthetics = c("colour", "fill")` when only colour is used). +* Closed #2305: `ggplotly()` now respects `geom_boxplot(outlier.shape = NA)` to hide outlier points. +* Closed #2467: `ggplotly()` now correctly shows legends and splits traces when scales have multiple aesthetics. +* Closed #2407, #2187: `ggplotly()` now translates `legend.position` theme element to plotly layout (supports "bottom", "top", "left", and numeric positions). +* Closed #2281: `ggplotly()` no longer drops legends when `geom_blank()` is present in the plot. + +# plotly 4.11.0 + +## New features + +* `ggplotly()` now supports the `{ggridges}` package. (#2314) + +## Improvements + +* Various updates to `ggplotly()` to better support recent versions of ggplot2. (#2315, #2368, #2442, thanks @teunbrand). + +## Bug fixes + +* Closed #2337: Creating a new `event_data()` handler no longer causes a spurious reactive update of existing `event_data()`s. (#2339) +* Closed #2376: Removes errant boxmode warning for grouped boxplot. (#2396) +* Closed #2392: Trivial warning about RColorBrewer minimal n value is no longer thrown (#1999) + +# 4.10.4 + +## Improvements + +* `ggplotly()` now works better with the development version of ggplot2 (> v3.4.4). (#2315) + +# 4.10.3 + +## Improvements + +* `ggplotly()` now works better with the development version of ggplot2 (> v3.4.3). (#2301) + +## Bug fixes + +* Closed #1947: `ggplotly()` now correctly handles `geom_vline`/`geom_hline` with empty data. Previously, if `geom_vline`/`geom_hline` was passed an empty data frame, it would result in an error. The plot is drawn even if no lines are found; this is the same behavior as `ggplot2`. + +* Closed #1214: Do not warn in RStudio on Windows when scattergl is used. Recent RStudio versions can render scattergl correctly. + +* Closed #2298: Fix fill assignment in geom_point when a single shape value was used with multiple fill and colour values mapped (@zeehio) + +# 4.10.2 + +## New features + +* Closed #2216: Additional selectize.js options can now be passed along to `highlight()`'s `selectize` argument. (#2217) + +## Improvements + +* Closed #2259: `ggplotly()` now provides better support for ggplot2 >v3.4.2. (#2262) + +## Bug fixes + +* Closed #2212: `ggplotly()` no longer silently drops legends that are customized through `ggplot2::guide_legend()`. +* Closed #2179: `save_image()` no longer needs `reticulate::py_run_string("import sys")` in order to run without error. (#2179) +* Closed #2218: `highlight(selectize = TRUE)` no longer yields an incorrect selectize.js result when there is a combination of crosstalk and non-crosstalk traces. (#2217) +* Closed #2208: `ggplotly()` no longer errors given a `geom_area()` with 1 or less data points (error introduced by new behavior in ggplot2 v3.4.0). (#2209) +* Closed #2220: `ggplotly()` no longer errors on `stat_summary(geom = "crossbar")`. (#2222) +* Closed #2212: `ggplotly()` no longer removes legends when setting guide properties via `guides(aes = guide_xxx(...))`. + +# 4.10.1 + +## Changes to plotly.js + +* This version of the R package upgrades the version of the underlying plotly.js library from v2.5.1 to v2.11.1. This includes many bug fixes and improvements. The [plotly.js release page](https://github.com/plotly/plotly.js/releases) has the full list of changes. + +## New features + +* `plotlyOutput()` gains a new `fill` parameter. When `TRUE` (the default), the widget's container element is allowed to grow/shrink to fit it's parent container so long as that parent is opinionated about its height and has been marked with `htmltools::bindFillRole(x, container = TRUE)`. (#2198) + * The primary motivation for this is to allow plots to grow/shrink by default [inside `bslib::card_body_fill()`](https://rstudio.github.io/bslib/articles/cards.html#responsive-sizing) +* `ggplotly()` now supports the `{ggalluvial}` package. (#2061, thanks @moutikabdessabour) +* `highlight()` now supports `on="plotly_selecting"`, enabling client-side linked brushing via mouse click+drag (no mouse-up event required, as with `on="plotly_selected"`). (#1280) +* `raster2uri()` supports nativeRaster objects. This enables nativeRaster support for + the `annotation_raster()` geom (#2174, @zeehio). + +## Bug fixes + +* `ggplotly()` now converts `stat_ecdf()` properly. (#2065) +* `ggplotly()` now correctly handles `geom_tile()` with no `fill` aesthetic. (#2063) +* `ggplotly()` now respects `guide(aes = "none")` (e.g., `guide(fill = "none")`) when constructing legend entries. (#2067) +* Fixed an issue with translating `GGally::ggcorr()` via `ggplotly()`. (#2012) +* Fixed an issue where clearing a crosstalk filter would raise an error in the JS console (#2087) +* Fixed an issue where `map_color()` would throw an error on R 4.2 (#2131) + +## Improvements + +* `ggplotly()` does not issue warnings with `options(warnPartialMatchArgs = TRUE)` any longer. (#2046, thanks @bersbersbers) +* `ggplotly()` does not issue warnings related to use of deprecated `tidyr::gather_()` in internals. (#2125, thanks @simonpcouch) + +# 4.10.0 + +## Breaking changes in JavaScript API + +* This version of the R package upgrades the version of the underlying plotly.js library from v1.57.1 to v2.5.1. This includes many breaking changes, bug fixes, and improvements to the underlying JavaScript library. Most of the breaking changes are summarized in [this announcement of the 2.0 release](https://community.plotly.com/t/announcing-plotly-js-2-0/53675), but [see here](https://github.com/plotly/plotly.js/blob/HEAD/CHANGELOG.md) for the full changelog. + +## Breaking changes in R API + +* `ggplotly()` now uses the `layout.legend.title` (instead of `layout.annotations`) plotly.js API to convert guides for discrete scales. (#1961) +* `renderPlotly()` now uses `Plotly.react()` (instead of `Plotly.newPlot()`) to redraw when `layout(transition = )` is specified. This makes it possible/easier to implement a smooth transitions when `renderPlotly()` gets re-executed. (#2001) + +## New Features + +* Added new functions for static image exporting via the [kaleido python package](https://github.com/plotly/Kaleido), namely `save_image()` and `kaleido()`. See `help(save_image, package = "plotly")` for installation info and example usage. (#1971) + +## Improvements + +* `ggplotly()` now better positions axis titles for `facet_wrap()`/`facet_grid()`. (#1975) + +# 4.9.4.1 + +## BUG FIXES + +* Fixes a bug in `ggplotly()` with `{crosstalk}` and `{ggplot2}` v3.3.4 (#1952). + +# 4.9.4 + +## BUG FIXES + +* Duplicate `highlight(selectize=T)` dropdowns are no longer rendered in Shiny (#1936). +* `group_by.plotly()` now properly retains crosstalk information across `{dplyr}` versions (#1920). +* Adds fixes in `ggplotly()` for the upcoming `{ggplot2}` v3.3.4 release (#1952). +* Fixes some issues with `name` and `frames` when both attributes are specified. (#1903 and #1618). + +# 4.9.3 + +## Changes to plotly.js + +* This version of the R package upgrades the version of the underlying plotly.js library from v1.52.2 to v1.57.1. This includes many bug fixes and improvements. The [plotly.js release page](https://github.com/plotly/plotly.js/releases) has the full list of changes. + +## NEW FEATURES + +* `renderPlotly()` now works well with `shiny::bindCache()`, meaning that plotly graphs can now be persistently cached in Shiny apps with `renderPlotly(expr) %>% shiny::bindCache()` (#1879). + +* `ggplotly()` now works well with the [**thematic** package](https://rstudio.github.io/thematic/). That is, it can now correctly translate **ggplot2** styling that derives from **thematic**. Note that, in order to use **thematic**'s auto theming in Shiny with `ggplotly()`, you need **shiny** v1.5.0 (or higher) and **htmlwidgets** v1.5.2.9000 (or higher). Relatedly, if these versions are available, one may now also call `getCurrentOutputInfo()` inside `renderPlotly()` to get CSS styles of the output container (#1801 and #1802). + +## IMPROVEMENTS + +* All HTTP requests are now retried upon failure (#1656, @jameslamb). + +* R linebreaks (`\n`) in _factor labels_ are now translated to HTML linebreaks (`
`), too. Before, this conversion was only done for colums of type character. ([#1700](https://github.com/plotly/plotly.R/pull/1700), @salim-b). + +## BUG FIXES + +* When R's `POSIXt` class is serialized to JSON, the time of day is now correctly preserved (in plotly.js expected `'yyyy-mm-dd HH:MM:SS.ssssss'` format). This should fix a whole host of issues where date-times were being rounded. (#1871, @FlukeAndFeather). + +* `ggplotly()` now handles discrete axes of a `facet_wrap` and `facet_grid` correctly when there is only one category in panels > 1 (#1577 and #1720). + +* `ggplotly()` now correctly accounts for linebreaks in tick label text when computing plot margins (#1791, @trekonom). + +* `ggplotly()` now handles `element_blank()` and `factor()` labels in positional scales correctly (#1731 and #1772). + +* `ggplotly()` now handles missing `y` aesthetic in `geom_errorbar()` (#1779, @trekonom). + +# 4.9.2.1 + +This is minor patch release with a few minor bug fixes and updates test expectations in anticipation of new R 4.0 defaults. + +## BUG FIXES + +* Fixes rendering issues non-HTML **rmarkdown** output formats, which was introduced in the 4.9.2 release (#1702). +* Fixes a `ggplotly()` bug in axis tick translation (#1725, #1721). +* `plot_mapbox()` now correctly defaults to a scattermapbox trace (unless z is present, then it defaults to choroplethmapbox) (#1707). +* `ggplotly()` now correctly resolves overlapping axis tick text in `coord_sf()` (#1673). +* A false-positive warning is no longer thrown when attempting to cast `toWebGL()` (#1569). + +# 4.9.2 + +## Changes to plotly.js + +* This version of the R package upgrades the version of the underlying plotly.js library from v1.49.4 to v1.52.2. This includes many bug fixes, improvements, as well as 2 new trace types: `treemap` and `image`. The [plotly.js release page](https://github.com/plotly/plotly.js/releases) has the full list of changes. + +## IMPROVEMENTS + +* The `add_image()` function was added to make it easier to create image traces via `raster` objects. + +## BUG FIXES + +* `add_sf()`/`geom_sf()` now correctly handle geometry columns that are named something other than `"geometry"` (#1659). +* Specifying an english locale no longer results in error (#1686). + +# 4.9.1 + +## Changes to plotly.js + +* This version of the R package upgrades the version of the underlying plotly.js library from v1.46.1 to v1.49.4. The [plotly.js release page](https://github.com/plotly/plotly.js/releases) has the full list of changes. + +## IMPROVEMENTS + +* `event_data()` gains support for the `plotly_sunburstclick` event (#1648) + +## BUG FIXES + +* Fixed an issue with correctly capturing the return value of user-expressions to `renderPlotly()` (#1528). +* Fixed a resizing issue where graphs could be incorrectly resized to their initial size in some cases (#1553). +* `ggplotly()` now positions the x-axis in the last column of a `facet_wrap()` properly (#1501). +* `ggplotly()` now handles `geom_hline()`/`geom_vline()` correctly in conjunction with `coord_flip()` (#1519). +* `event_data()` now correctly relays the `key` attribute for statistical traces (#1610). + +# 4.9.0 + +## Changes to plotly.js + +* This version of the R package upgrades the version of the underlying plotly.js library from v1.42.3 to v1.46.1. The [plotly.js release page](https://github.com/plotly/plotly.js/releases) has the full list of changes, but here is summary most pertainent ones for the R package: + * New trace types: `sunburst`, `waterfall`, `isosurface`. + * New `hovertemplate` attribute allows for finer-tuned control over tooltip text. See [here](https://plotly-r.com/controlling-tooltips.html#fig:tooltip-format-heatmap) for an example. + * Providing a string to `title` is now deprecated (but still works). Instead, use `title = list(text = "title")`. This change was made to support a new title placement API (e.g., `title = list(text = "title", xanchor = "left")`). Note that these changes are relevant for `layout.title` as well as `layout.xaxis.title`/`layout.yaxis.title`/etc. + +## NEW FEATURES & IMPROVEMENTS + +* Several new features and improvements related to accessing plotly.js events in shiny (learn more about them in this RStudio [webinar](https://posit.co/resources/videos/accessing-and-responding-to-plotly-events-in-shiny/)): + * The `event` argument of the `event_data()` function now supports the following events: `plotly_selecting`, `plotly_brushed`, `plotly_brushing`, `plotly_restyle`, `plotly_legendclick`, `plotly_legenddoubleclick`, `plotly_clickannotation`, `plotly_afterplot`, `plotly_doubleclick`, `plotly_deselect`, `plotly_unhover`. For examples, see `plotly_example("shiny", "event_data")`, `plotly_example("shiny", "event_data_legends")`, and `plotly_example("shiny", "event_data_annotation")`, + * New `event_register()` and `event_unregister()` functions for declaring which events to transmit over the wire (i.e., from the browser to the shiny server). Events that are likely to have large overhead are not registered by default, so you'll need to register these: `plotly_selecting`, `plotly_unhover`, `plotly_restyle`, `plotly_legendclick`, and `plotly_legenddoubleclick`. + * A new `priority` argument. By setting `priority='event'`, the `event` is treated like a true event: any reactive expression using the `event` becomes invalidated (regardless of whether the input values has changed). For an example, see `plotly_example("shiny", "event_priority")`. + * The `event_data()` function now relays the (official plotly.js) `customdata` attribute in similar fashion to (unofficial) `key` attribute (#1423). Run `plotly_example("shiny", "event_data")` for an example. + * `event_data("plotly_selected")` is no longer too eager to clear. That is, it is no longer set to `NULL` when clicking on a plot *after* triggering the "plotly_selected" event (#1121) (#1122). + +* Several new features and improvements for exporting static graphs with the orca command-line utility: + * The `orca()` function now supports conversion of much larger figures (#1322) and works without a mapbox api token (#1314). + * The `orca_serve()` function was added for efficient exporting of many plotly graphs. For examples, see `help(orca_serve)`. + * The `orca()` function gains new arguments `more_args` and `...` for finer control over the underlying system commands. + +* `ggplotly()` now respects horizontal alignment of **ggplot2** titles (e.g., `ggplotly(qplot(1:10) + ggtitle("A title") + theme(plot.title = element_text(hjust = 1)))`). +* **plotly** objects can now be serialized and unserialized in different environments (i.e., you can now use `saveRDS()` to save an object as an rds file and restore it on another machine with `readRDS()`). Note this object is *dynamically* linked to JavaScript libraries, so one should take care to use consistent versions of **plotly** when serializing and unserializing (#1376). +* The `style()` function now supports "partial updates" (i.e. modification of a particular property of an object, rather than the entire object). For example, notice how the first plot retains the original marker shape (a square): `p <- plot_ly(x = 1:10, y = 1:10, symbol = I(15)); subplot(style(p, marker.color = "red"), style(p, marker = list(color = "red")))` (#1342). +* The `method` argument of `plotlyProxyInvoke()` gains support for a `"reconfig"` method. This makes it possible to modify just the configuration of a plot in a **shiny** app. For an example use, see `plotly_example("shiny", "event_data_annotation")`. +* The `plotly_example()` function will now attempt to open the source file(s) used to run the example. Set `edit = FALSE` to prevent the source file(s) from opening. +* An informative warning is now thrown if invalid argument names are supplied to `config()`. + +## CHANGES + +* If `stroke` is specified, `span` now defaults to `I(1)`. This results in a slightly narrower default span for some trace types (e.g., `box`, `contour`), but it also ensures the `stroke` is always visible when it's relevant (e.g. `plot_ly(x = 1:10, y = 1:10, stroke = I("black"))`), making for a more consistent overall default (#1507). +* The 'collaborate' button no longer appears in the modebar, and is longer supported, so the `config()` function no longer has a `collaborate` argument. +* The `cloud` argument is now deprecated and will be removed in a future version. Use `showSendToCloud` instead. +* `ggplotly()` now translates title information to `layout.title.text` (instead of `layout.title`) and `layout.title.font` (instead of `layout.titlefont`) + +## BUG FIXES + +* `subplot()` now works much better with annotations, images, and shapes: + - When `xref`/`yref` references an x/y axis these references are bumped accordingly (#1181). + - When `xref`/`yref` references paper coordinates, these coordinates are updated accordingly (#1332). +* `subplot()` now repositions shapes with fixed height/width (i.e., `xsizemode`/`ysizemode` of `"pixel"`) correctly (#1494). +* The `colorscale` attribute now correctly handles a wider range of input values (#1432, #1485) +* The colorscale generated via the `color` argument in `plot_ly()` now uses an evenly spaced grid of values instead of quantiles (#1308). +* When using **shinytest** to test a **shiny** that contains **plotly** graph, false positive differences are no longer reported (rstudio/shinytest#174). +* When the `size` argument maps to `marker.size`, it now converts to an array of appropriate length (#1479). +* The `color` and `stroke` arguments now work as expected for trace types with `fillcolor` but no `fill` attribute (e.g. `box` traces) (#1292). +* Information emitted by in `event_data()` for heatmaps with atomic vectors for `x`/`y`/`z` is now correct (#1141). +* Fixed issue where **dplyr** groups caused a problem in the ordering of data arrays passed to `marker` objects (#1351). +* In some cases, a `ggplotly()` colorbar would cause issues with hover behavior, which is now fixed (#1381). +* An articial marker no longer appears when clearing a crosstalk selection of a plot with a colorbar (#1406). +* Clearing a highlight event via crosstalk no longer deletes all the traces added since initial draw (#1436). +* Recursive attribute validation is now only performed on recursive objects (#1315). +* The `text` attribute is no longer collapsed to a string when `hoveron='fills+points'` (#1448). +* `layout.[x-y]axis.domain` is no longer supplied a default when `layout.grid` is specified (#1427). +* When uploading charts to a plot.ly account via `api_create()`, layout attributes are no longer incorrectly src-ified, which was causing inconsistencies in local/remote rendering of `ggplotly()` charts (#1197). + +# 4.8.0 + +## NEW FEATURES & IMPROVEMENTS + +### plotly.js and `plot_ly()` specific improvements + +* Upgraded to plotly.js v1.39.2. A _huge_ amount of features and improvements have been made since v1.29.2 (i.e., the version included in the last CRAN release of the R package - v4.7.1). Highlights include a complete re-write of `scattergl` to make it nearly feature complete with `scatter`, localization of text rendering (i.e., international translations), and six new trace types (`cone`, `scatterpolar`, `scatterpolargl`, `splom`, `table`, & `violin`)! See [here](https://github.com/plotly/plotly.js/releases) for a complete list of plotly.js-specific improvements. +* Support for **sf** (simple feature) data structures was added to `plot_ly()`, `plot_mapbox()`, and `plot_geo()` (via the new `add_sf()` function). See [this blog post](https://blog.cpsievert.me/2018/03/30/visualizing-geo-spatial-data-with-sf-and-plotly) for an overview. +* Better control over the stroke (i.e., outline) appearance of various filled graphical marks via the new "special arguments" (`stroke`, `strokes`, `alpha_stroke`, `span`, and `spans`). For an overview, see the **sf** blog post linked to in the bullet point above and the new package demos (list all demos with `demo(package = "plotly")`). + +### `ggplotly()` specific improvements + +* `ggplotly()` now supports conversion of **ggplot2**'s `geom_sf()`. +* One may now inform `ggplotly()` about the relevant **shiny** output size via `session$clientData`. This ensures `ggplotly()` sizing is closer to **ggplot2** sizing, even on window resize. For an example, run `plotly_example("shiny", "ggplotly_sizing")`. + +### Other improvements relevant for all **plotly** objects + +* LaTeX rendering via MathJax is now supported and the new `TeX()` function may be used to flag a character vector as LaTeX (#375). Use the new `mathjax` argument in `config()` to specify either external (`mathjax="cdn"`) or local (`mathjax="local"`) MathJaX. If `"cdn"`, mathjax is loaded externally (meaning an internet connection is needed for TeX rendering). If `"local"`, the PLOTLY_MATHJAX_PATH environment variable must be set to the location (a local file path) of MathJax. IMPORTANT: **plotly** uses SVG-based mathjax rendering which doesn't play nicely with HTML-based rendering (e.g., **rmarkdown** documents and **shiny** apps). To leverage both types of rendering, you must `', + url, width %||% "100%", height %||% "400" + ) +} diff --git a/R/export.R b/R/export.R new file mode 100644 index 0000000000..866a1b60ba --- /dev/null +++ b/R/export.R @@ -0,0 +1,80 @@ +#' Export a plotly graph to a static file +#' +#' This function is deprecated, use [save_image] instead. +#' +#' @details For SVG plots, a screenshot is taken via `webshot::webshot()`. +#' Since `phantomjs` (and hence `webshot`) does not support WebGL, +#' the RSelenium package is used for exporting WebGL plots. +#' +#' @param p a plotly or ggplot object. +#' @param file a filename. The file type is inferred from the file extension. +#' Valid extensions include 'jpeg' | 'png' | 'webp' | 'svg' | 'pdf' +#' @param selenium used only when `p` is a WebGL plot or the output +#' format is 'webp' or 'svg'. Should be an object of class "rsClientServer" +#' returned by `RSelenium::rsDriver`. +#' @param ... if `p` is non-WebGL and the output file format is +#' jpeg/png/pdf arguments are passed along to `webshot::webshot()`. +#' Otherwise, they are ignored. +#' @export +#' @author Carson Sievert +#' +export <- function(p = last_plot(), file = "plotly.png", selenium = NULL, ...) { + .Deprecated("save_image") + + # infer the file type + fileType <- tolower(tools::file_ext(file)) + if (!fileType %in% c('jpeg', 'png', 'webp', 'svg', 'pdf')) { + stop("File type ", fileType, " not supported", call. = FALSE) + } + if (is.webgl(p) && fileType %in% "pdf") { + stop( + "A personal (or professional) plan is required to export WebGL to pdf:\n", + "https://plot.ly/products/cloud/", + call. = FALSE + ) + } + + # webshot only support non-webgl jpeg/png/pdf + use_webshot <- !is.webgl(p) && fileType %in% c('jpeg', 'png', 'pdf') + + if (!use_webshot) { + # download the image when widget is done rendering + cmd <- sprintf( + "function(el, x) { + var gd = document.getElementById(el.id); + Plotly.downloadImage(gd, {format: '%s', width: %s, height: %s, filename: '%s'}); + }", + fileType, + p$width %||% p$layout$width %||% 800, + p$height %||% p$layout$height %||% 600, + tools::file_path_sans_ext(file) + ) + p <- htmlwidgets::onRender(p, cmd) + } + + # save widget to an HTML file + f <- basename(tempfile('plotly', '.', '.html')) + on.exit(unlink(f), add = TRUE) + html <- htmlwidgets::saveWidget(p, f) + + # phantomjs doesn't support webgl or svg/webp output + if (use_webshot) { + try_library("webshot", "export") + return(webshot::webshot(f, file, ...)) + } + + if (inherits(selenium, "rsClientServer")) { + # TODO: does this work cross-platform? + selenium$client$navigate(paste0("file://", normalizePath(f))) + } else { + stop( + "Must provide an object of class 'rsClientServer' to the `selenium` ", + "argument to export this plot (see examples section on `help(export)`)", + call. = FALSE + ) + } + message( + sprintf("Success! Check your downloads folder for a file named: '%s'", file) + ) + invisible(file) +} diff --git a/R/figure.R b/R/figure.R deleted file mode 100644 index 37a62cfb4c..0000000000 --- a/R/figure.R +++ /dev/null @@ -1,24 +0,0 @@ -#' Request a figure object -#' -#' Figure objects work in the same way as plotly objects, but when printed, -#' they overwrite the already existing plotly object -#' (instead of creating a new plotly). -#' -#' @param username corresponding username for the figure. -#' @param id of the Plotly figure. -#' @export -#' @references https://plot.ly/rest/ -#' @examples -#' \dontrun{ -#' # Anyone can obtain the information for a particular plot -#' fig <- get_figure("cpsievert", "559") -#' # If you have proper credentials, you can easily modify -#' layout(fig, title = paste("Modified on ", Sys.time())) -#' } -get_figure <- function(username, id) { - if (missing(username)) username <- verify("username") - if (missing(id)) stop("Please provide a figure id number") - base_url <- file.path(get_domain(), "apigetfile", username, id) - resp <- httr::GET(base_url, plotly_headers(), httr::config(ssl_verifypeer=FALSE)) - process(struct(resp, "figure")) -} diff --git a/R/ggplotly.R b/R/ggplotly.R index 683cd2a2ba..1c4461fc15 100644 --- a/R/ggplotly.R +++ b/R/ggplotly.R @@ -1,965 +1,1614 @@ -#' Create plotly graphs using ggplot2 syntax +#' Convert ggplot2 to plotly #' -#' See up-to-date documentation and examples at -#' \url{https://plot.ly/ggplot2} +#' This function converts a [ggplot2::ggplot()] object to a +#' plotly object. +#' +#' @details Conversion of relative sizes depends on the size of the current +#' graphics device (if no device is open, width/height of a new (off-screen) +#' device defaults to 640/480). In other words, `height` and +#' `width` must be specified at runtime to ensure sizing is correct. +#' For examples on how to specify the output container's `height`/`width` in a +#' shiny app, see `plotly_example("shiny", "ggplotly_sizing")`. +#' #' #' @param p a ggplot object. -#' @param filename character string describing the name of the plot in your plotly account. -#' Use / to specify directories. If a directory path does not exist it will be created. -#' If this argument is not specified and the title of the plot exists, -#' that will be used for the filename. -#' @param fileopt character string describing whether to create a "new" plotly, "overwrite" an existing plotly, -#' "append" data to existing plotly, or "extend" it. -#' @param world_readable logical. If \code{TRUE}, the graph is viewable -#' by anyone who has the link and in the owner's plotly account. -#' If \code{FALSE}, graph is only viewable in the owner's plotly account. -#' @seealso \link{signup}, \link{plot_ly} -#' @import httr jsonlite +#' @param width Width of the plot in pixels (optional, defaults to automatic sizing). +#' @param height Height of the plot in pixels (optional, defaults to automatic sizing). +#' @param tooltip a character vector specifying which aesthetic mappings to show +#' in the tooltip. The default, "all", means show all the aesthetic mappings +#' (including the unofficial "text" aesthetic). The order of variables here will +#' also control the order they appear. For example, use +#' `tooltip = c("y", "x", "colour")` if you want y first, x second, and +#' colour last. +#' @param dynamicTicks should plotly.js dynamically generate axis tick labels? +#' Dynamic ticks are useful for updating ticks in response to zoom/pan +#' interactions; however, they can not always reproduce labels as they +#' would appear in the static ggplot2 image. +#' @param layerData data from which layer should be returned? +#' @param originalData should the "original" or "scaled" data be returned? +#' @param source a character string of length 1. Match the value of this string +#' with the source argument in [event_data()] to retrieve the +#' event data corresponding to a specific plot (shiny apps can have multiple plots). +#' @param ... arguments passed onto methods. #' @export #' @author Carson Sievert +#' @references \url{https://plotly.com/ggplot2/} +#' @seealso [plot_ly()] #' @examples \dontrun{ #' # simple example -#' ggiris <- qplot(Petal.Width, Sepal.Length, data = iris, color = Species) -#' ggplotly(ggiris) -#' -#' # maps!! +#' ggpenguins <- qplot(bill_length_mm , body_mass_g, +#' data = palmerpenguins::penguins, color = species) +#' ggplotly(ggpenguins) +#' #' data(canada.cities, package = "maps") #' viz <- ggplot(canada.cities, aes(long, lat)) + -#' borders(regions = "canada", name = "borders") + +#' borders(regions = "canada") + #' coord_equal() + -#' geom_point(aes(text = name, size = pop), colour = "red", -#' alpha = 1/2, name = "cities") -#' ggplotly(viz) -#' } +#' geom_point(aes(text = name, size = pop), colour = "red", alpha = 1/2) +#' ggplotly(viz, tooltip = c("text", "size")) #' -ggplotly <- function(p = ggplot2::last_plot(), filename, fileopt, - world_readable = TRUE) { - l <- gg2list(p) - # tack on special keyword arguments - if (!missing(filename)) l$filename <- filename - if (!missing(fileopt)) l$fileopt <- fileopt - l$world_readable <- world_readable - hash_plot(p$data, l) -} - -# ---------------------------------------------------------------------------- -# Objects accessed inside gg2list() -# ---------------------------------------------------------------------------- - -# calc. the epoch -now <- Sys.time() -the.epoch <- now - as.numeric(now) - -aesConverters <- list( - linetype=function(lty) { - lty2dash[as.character(lty)] - }, - colour=function(col) { - toRGB(col) - }, - # ggplot2 size is in millimeters. plotly is in pixels. To do this correctly, - # we need to know PPI/DPI of the display. I'm not sure of a decent way to do that - # from R, but it seems 96 is a reasonable assumption. - size=function(mm) { - (mm * 96) / 25.4 - }, - sizeref=identity, - sizemode=identity, - alpha=identity, - shape=function(pch) { - pch2symbol[as.character(pch)] - }, - direction=identity -) - -markLegends <- - # NOTE: Do we also want to split on size? - # Legends based on sizes not implemented yet in Plotly - # list(point=c("colour", "fill", "shape", "size"), - list(point=c("colour", "fill", "shape"), - path=c("linetype", "size", "colour", "shape"), - ## NOTE: typically "group" should not be present here, since - ## that would mean creating a separate plotly legend for each - ## group, even when they have the exact same visual - ## characteristics and could be drawn using just 1 trace! - polygon=c("colour", "fill", "linetype", "size"), - bar=c("colour", "fill"), - density=c("colour", "fill", "linetype"), - boxplot=c("colour", "fill", "size"), - errorbar=c("colour", "linetype"), - errorbarh=c("colour", "linetype"), - area=c("colour", "fill"), - step=c("linetype", "size", "colour"), - text=c("colour")) - -markUnique <- as.character(unique(unlist(markLegends))) - -markSplit <- markLegends -markSplit$boxplot <- "x" - -# obtain the "type" of geom/position/etc. -type <- function(x, y) { - sub(y, "", tolower(class(x[[y]])[[1]])) -} - -guide_names <- function(p, aes = c("shape", "fill", "alpha", "area", - "color", "colour", "size", "linetype")) { - sc <- as.list(p$scales)$scales - nms <- lapply(sc, "[[", "name") - if (length(nms) > 0) { - names(nms) <- lapply(sc, "[[", "aesthetics") - if (is.null(unlist(nms))) {nms <- list()} - } - unlist(modifyList(p$labels[names(p$labels) %in% aes], nms)) +#' # linked scatterplot brushing +#' d <- highlight_key(mtcars) +#' qplot(data = d, x = mpg, y = wt) %>% +#' subplot(qplot(data = d, x = mpg, y = vs)) %>% +#' layout(title = "Click and drag to select points") %>% +#' highlight("plotly_selected") +#' +#' +#' # more brushing (i.e. highlighting) examples +#' demo("crosstalk-highlight-ggplotly", package = "plotly") +#' +#' # client-side linked brushing in a scatterplot matrix +#' highlight_key(palmerpenguins::penguins) %>% +#' GGally::ggpairs(aes(colour = Species), columns = 1:4) %>% +#' ggplotly(tooltip = c("x", "y", "colour")) %>% +#' highlight("plotly_selected") +#' } +#' +ggplotly <- function(p = ggplot2::last_plot(), width = NULL, height = NULL, + tooltip = "all", dynamicTicks = FALSE, + layerData = 1, originalData = TRUE, source = "A", ...) { + UseMethod("ggplotly", p) +} + +#' @export +ggplotly.NULL <- function(...) { + htmltools::browsable(htmltools::div(...)) +} + +#' @export +ggplotly.plotly <- function(p = ggplot2::last_plot(), width = NULL, height = NULL, + tooltip = "all", dynamicTicks = FALSE, + layerData = 1, originalData = TRUE, source = "A", ...) { + p +} + +#' @export +ggplotly.ggmatrix <- function(p = ggplot2::last_plot(), width = NULL, + height = NULL, tooltip = "all", dynamicTicks = FALSE, + layerData = 1, originalData = TRUE, source = "A", ...) { + dots <- list(...) + + # provide a sensible crosstalk if none is already provided (makes ggnostic() work at least) + if (!crosstalk_key() %in% names(p$data)) { + p$data[[crosstalk_key()]] <- p$data[[".rownames"]] %||% seq_len(nrow(p$data)) + attr(p$data, "set") <- dots[["set"]] %||% new_id() + } + subplotList <- list() + for (i in seq_len(p$ncol)) { + columnList <- list() + for (j in seq_len(p$nrow)) { + thisPlot <- p[j, i] + if (i == 1) { + # should the first column contain axis labels? + if (p$showYAxisPlotLabels %||% TRUE) thisPlot <- thisPlot + ylab(p$yAxisLabels[j]) + } else { + # y-axes are never drawn on the interior, and diagonal plots are densities, + # so it doesn't make sense to synch zoom actions on y + thisPlot <- thisPlot + ylab(NULL) + + theme( + axis.ticks.y = element_blank(), + axis.text.y = element_blank() + ) + } + columnList <- c( + columnList, list(ggplotly( + thisPlot, tooltip = tooltip, dynamicTicks = dynamicTicks, + layerData = layerData, originalData = originalData, source = source, + width = width, height = height + )) + ) + } + # conditioned on a column in a ggmatrix, the x-axis should be on the + # same scale. + s <- subplot(columnList, nrows = p$nrow, margin = 0.01, shareX = TRUE, + titleY = TRUE, titleX = TRUE) + subplotList <- c(subplotList, list(s)) + } + s <- subplot(subplotList, nrows = 1, margin = 0.01, + titleY = TRUE, titleX = TRUE) %>% + hide_legend() %>% + layout(dragmode = "select") + if (robust_nchar(p$title) > 0) { + s <- layout(s, title = p$title) + } + for (i in seq_along(p$xAxisLabels)) { + s$x$layout[[sub("^xaxis1$", "xaxis", paste0("xaxis", i))]]$title <- p$xAxisLabels[[i]] + } + if (length(p$yAxisLabels)) { + s$x$layout$margin$l <- s$x$layout$margin$l + 50 + } + + config(s) +} + +#' @export +ggplotly.ggplot <- function(p = ggplot2::last_plot(), width = NULL, + height = NULL, tooltip = "all", dynamicTicks = FALSE, + layerData = 1, originalData = TRUE, source = "A", ...) { + l <- gg2list(p, width = width, height = height, tooltip = tooltip, + dynamicTicks = dynamicTicks, layerData = layerData, + originalData = originalData, source = source, ...) + config(as_widget(l)) } #' Convert a ggplot to a list. -#' @import ggplot2 #' @param p ggplot2 plot. -#' @return figure object (list with names "data" and "layout"). +#' @param width Width of the plot in pixels (optional, defaults to automatic sizing). +#' @param height Height of the plot in pixels (optional, defaults to automatic sizing). +#' @param tooltip a character vector specifying which aesthetic tooltips to show in the +#' tooltip. The default, "all", means show all the aesthetic tooltips +#' (including the unofficial "text" aesthetic). +#' @param dynamicTicks accepts the following values: `FALSE`, `TRUE`, `"x"`, or `"y"`. +#' Dynamic ticks are useful for updating ticks in response to zoom/pan/filter +#' interactions; however, there is no guarantee they reproduce axis tick text +#' as they would appear in the static ggplot2 image. +#' @param layerData data from which layer should be returned? +#' @param originalData should the "original" or "scaled" data be returned? +#' @param source a character string of length 1. Match the value of this string +#' with the source argument in [event_data()] to retrieve the +#' event data corresponding to a specific plot (shiny apps can have multiple plots). +#' @param ... currently not used +#' @return a 'built' plotly object (list with names "data" and "layout"). #' @export -gg2list <- function(p) { - # ggplot now applies geom_blank() (instead of erroring) when no layers exist - if (length(p$layers) == 0) p <- p + geom_blank() - layout <- list() - trace.list <- list() - - # Before building the ggplot, we would like to add aes(name) to - # figure out what the object group is later. This also copies any - # needed global aes/data values to each layer, so we do not have to - # worry about combining global and layer-specific aes/data later. - for(layer.i in seq_along(p$layers)) { - layer.aes <- p$layers[[layer.i]]$mapping - if(p$layers[[layer.i]]$inherit.aes){ - to.copy <- names(p$mapping)[!names(p$mapping) %in% names(layer.aes)] - layer.aes[to.copy] <- p$mapping[to.copy] - } - mark.names <- names(layer.aes) # make aes.name for all aes. - name.names <- sprintf("%s.name", mark.names) - layer.aes[name.names] <- layer.aes[mark.names] - p$layers[[layer.i]]$mapping <- layer.aes - if(!is.data.frame(p$layers[[layer.i]]$data)){ - p$layers[[layer.i]]$data <- p$data - } +gg2list <- function(p, width = NULL, height = NULL, + tooltip = "all", dynamicTicks = FALSE, + layerData = 1, originalData = TRUE, source = "A", ...) { + + # To convert relative sizes correctly, we use grid::convertHeight(), + # which requires a known output (device) size. + dev_fun <- if (capabilities("aqua") || capabilities("png")) { + grDevices::png + } else if (capabilities("jpeg")) { + grDevices::jpeg + } else if (is_installed("Cairo")) { + function(filename, ...) Cairo::Cairo(file = filename, ...) + } else { + stop( + "No Cairo or bitmap device is available. Such a graphics device is required to convert sizes correctly in ggplotly().\n\n", + " You have two options:\n", + " (1) install.packages('Cairo')\n", + " (2) compile R to use a bitmap device (png or jpeg)", + call. = FALSE + ) + } + # if a device (or RStudio) is already open, use the device size as default size + if (!is.null(grDevices::dev.list()) || is_rstudio()) { + width <- width %||% default(grDevices::dev.size("px")[1]) + height <- height %||% default(grDevices::dev.size("px")[2]) } + # open the device and make sure it closes on exit + dev_fun(filename = tempfile(), width = width %||% 640, height = height %||% 480) + on.exit(grDevices::dev.off(), add = TRUE) - # Test fill and color to see if they encode a quantitative - # variable. This may be useful for several reasons: (1) it is - # sometimes possible to plot several different colors in the same - # trace (e.g. points), and that is faster for large numbers of - # data points and colors; (2) factors on x or y axes should be - # sent to plotly as characters, not as numeric data (which is - # what ggplot_build gives us). - misc <- list() - for(a in c("fill", "colour", "x", "y", "size")){ - for(data.type in c("continuous", "date", "datetime", "discrete")){ - fun.name <- sprintf("scale_%s_%s", a, data.type) - misc.name <- paste0("is.", data.type) - misc[[misc.name]][[a]] <- tryCatch({ - fun <- get(fun.name) - suppressMessages({ - with.scale <- p + fun() - }) - ggplot_build(with.scale) - TRUE - }, error=function(e){ - FALSE - }) - } + # check the value of dynamicTicks + dynamicValues <- c(FALSE, TRUE, "x", "y") + if (length(setdiff(dynamicTicks, dynamicValues))) { + stop( + sprintf( + "`dynamicValues` accepts the following values: '%s'", + paste(dynamicValues, collapse = "', '") + ), call. = FALSE + ) } - ## scales are needed for legend ordering. - misc$breaks <- list() - for(sc in p$scales$scales){ - a.vec <- sc$aesthetics - default.breaks <- inherits(sc$breaks, "waiver") - if (length(a.vec) == 1 && (!default.breaks) ) { - ## TODO: generalize for x/y scales too. - br <- sc$breaks - ranks <- seq_along(br) - names(ranks) <- br - misc$breaks[[a.vec]] <- ranks - } - ## store if this is a reverse scale so we can undo that later. - if(is.character(sc$trans$name)){ - misc$trans[sc$aesthetics] <- sc$trans$name + # ------------------------------------------------------------------------ + # Our internal version of ggplot2::ggplot_build(). Modified from + # https://github.com/hadley/ggplot2/blob/0cd0ba/R/plot-build.r#L18-L92 + # ------------------------------------------------------------------------ + ggplotly_build <- function(p) { + plot <- ggfun("plot_clone")(p) + + if (length(plot$layers) == 0) { + plot <- plot + geom_blank() } - } - reverse.aes <- names(misc$trans)[misc$trans=="reverse"] - - # Extract data from built ggplots - built <- ggplot_build2(p) - # Get global ranges now because we need some of its info in layer2traces - ranges.list <- list() - for(xy in c("x", "y")){ - use.ranges <- - misc$is.continuous[[xy]] || - misc$is.date[[xy]] || - misc$is.datetime[[xy]] - range.values <- if(use.ranges){ - range.name <- paste0(xy, ".range") - sapply(built$panel$ranges, "[[", range.name) - }else{ - ## for categorical variables on the axes, panel$ranges info is - ## meaningless. - name.name <- paste0(xy, ".name") - sapply(built$data, function(df){ - if(name.name %in% names(df)){ - ## usually for discrete data there is a .name column. - paste(df[[name.name]]) - }else{ - ## for heatmaps there may not be. - df[[xy]] - } - }) + layers <- plot$layers + layer_data <- lapply(layers, function(y) y$layer_data(plot$data)) + + # save crosstalk sets before this attribute gets squashed + sets <- lapply(layer_data, function(y) attr(y, "set")) + + scales <- plot$scales + + # Apply function to layer and matching data + by_layer <- function(f) { + out <- vector("list", length(data)) + for (i in seq_along(data)) { + out[[i]] <- f(l = layers[[i]], d = data[[i]]) + } + out } - ranges.list[[xy]] <- range(range.values) - } - - # Get global size range because we need some of its info in layer2traces - if ("size.name" %in% name.names) { - sizerange <- sapply(built$prestats.data, `[[`, "size") - ggsizemin <- min(unlist(sizerange)) - ggsizemax <- max(unlist(sizerange)) - } - - layer.legends <- list() - for(i in seq_along(built$plot$layers)){ - # This is the layer from the original ggplot object. - L <- p$layers[[i]] - - # for each layer, there is a correpsonding data.frame which - # evaluates the aesthetic mapping. - df <- built$data[[i]] - - # get gglayout now because we need some of its info in layer2traces - gglayout <- built$panel$layout - # invert rows so that plotly and ggplot2 show panels in the same order - gglayout$plotly.row <- max(gglayout$ROW) - gglayout$ROW + 1 - # ugh, ggplot counts panel right-to-left & top-to-bottom - # plotly count them right-to-left & *bottom-to-top* - gglayout$plotly.panel <- with(gglayout, order(plotly.row, COL)) - - # Add ROW and COL to df: needed to link axes to traces; keep df's - # original ordering while merging. - df$order <- seq_len(nrow(df)) - df <- merge(df, gglayout[, c("PANEL", "plotly.row", "COL")]) - df <- df[order(df$order),] - df$order <- NULL - - prestats <- built$prestats.data[[i]] - # scale_reverse multiples x/y data by -1, so here we undo that so - # that the actual data can be uploaded to plotly. - replace.aes <- intersect(names(prestats), reverse.aes) - for (a in replace.aes) { - prestats[[a]] <- -1 * prestats[[a]] + + # ggplot2 3.1.0.9000 introduced a Layer method named setup_layer() + # currently, LayerSf is the only core-ggplot2 Layer that makes use + # of it https://github.com/tidyverse/ggplot2/pull/2875#issuecomment-438708426 + data <- layer_data + if (get_package_version("ggplot2") > "3.1.0") { + data <- by_layer(function(l, d) if (is.function(l$setup_layer)) l$setup_layer(d, plot) else d) } - L$prestats.data <- - merge(prestats, - gglayout[, c("PANEL", "plotly.row", "COL")]) - - # Add global range info. - for(xy in names(ranges.list)){ - range.vec <- ranges.list[[xy]] - names(range.vec) <- c("min", "max") - for(range.name in names(range.vec)){ - glob.name <- paste0("glob", xy, range.name) - L$prestats.data[[glob.name]] <- range.vec[[range.name]] + + # Initialise panels, add extra data for margins & missing facetting + # variables, and add on a PANEL variable to data + layout <- ggfun("create_layout")(plot$facet, plot$coordinates) + data <- layout$setup(data, plot$data, plot$plot_env) + + # save the domain of the group for display in tooltips + groupDomains <- Map(function(x, y) { + aes_g <- y$mapping[["group"]] %||% plot$mapping[["group"]] + tryNULL(rlang::eval_tidy(aes_g, x)) + }, data, layers) + + # for simple (StatIdentity) geoms, add crosstalk key to aes mapping + # (effectively adding it as a group) + # later on, for more complicated geoms (w/ non-trivial summary statistics), + # we construct a nested key mapping (within group) + layers <- Map(function(x, y) { + if (crosstalk_key() %in% names(y) && !"key" %in% names(x[["mapping"]]) && + inherits(x[["stat"]], "StatIdentity")) { + # ggplot2 v3.3.4 started using the computed_mapping (instead of mapping) + # field to inform the compute_aesthetics() method, so in order to add + # the crosstalk key, we need to add to that field (when present) + # https://github.com/tidyverse/ggplot2/pull/4475 + nm <- if ("computed_mapping" %in% names(x)) "computed_mapping" else "mapping" + x[[nm]] <- c(x[[nm]], key = as.name(crosstalk_key())) } - } + x + }, layers, layer_data) - # Add global size info if relevant - if ("size.name" %in% name.names) { - L$prestats.data$globsizemin <- ggsizemin - L$prestats.data$globsizemax <- ggsizemax + # Compute aesthetics to produce data with generalised variable names + data <- by_layer(function(l, d) l$compute_aesthetics(d, plot)) + if (exists("setup_plot_labels", envir = asNamespace("ggplot2"))) { + # Mirror ggplot2/#5879 + plot$labels <- ggfun("setup_plot_labels")(plot, layers, data) } - # This extracts essential info for this geom/layer. - traces <- layer2traces(L, df, misc) - - possible.legends <- markLegends[[type(L, "geom")]] - actual.legends <- possible.legends[possible.legends %in% names(L$mapping)] - layer.legends[[paste(i)]] <- actual.legends - - # Do we really need to coord_transform? - # g$data <- ggplot2:::coord_transform(built$plot$coord, g$data, - # built$panel$ranges[[1]]) - trace.list <- c(trace.list, traces) - } - - # for barcharts, verify that all traces have the same barmode; we don't - # support different barmodes on the same plot yet. - barmodes <- do.call(c, lapply(trace.list, function (x) x$barmode)) - barmodes <- barmodes[!is.null(barmodes)] - if (length(barmodes) > 0) { - layout$barmode <- barmodes[1] - if (!all(barmodes == barmodes[1])) - warning(paste0("You have multiple barcharts or histograms with different positions; ", - "Plotly's layout barmode will be '", layout$barmode, "'.")) - # for stacked bar charts, plotly cumulates bar heights, but ggplot doesn't - if (layout$barmode == "stack") { - # could speed up this function with environments or C/C++ - unStack <- function(vec) { - n <- length(vec) - if (n == 1) return(vec) - seq.n <- seq_len(n) - names(vec) <- seq.n - vec <- sort(vec) - for (k in seq(2, n)) { - vec[k] <- vec[k] - sum(vec[seq(1, k-1)]) - } - as.numeric(vec[as.character(seq.n)]) + + # add frame to group if it exists + data <- lapply(data, function(d) { + if (!"frame" %in% names(d)) return(d) + d$group <- with(d, paste(group, frame, sep = "-")) + d + }) + + # The computed aesthetic codes the groups as integers + # Here we build a map each of the integer values to the group label + group_maps <- Map(function(x, y) { + tryCatch({ + x_group <- x[["group"]] + names(x_group) <- y + x_group <- x_group[!duplicated(x_group)] + x_group + }, error = function(e) NULL + ) + }, data, groupDomains) + + # Before mapping x/y position, save the domain (for discrete scales) + # to display in tooltip. + data <- lapply(data, function(d) { + d[["x_plotlyDomain"]] <- d[["x"]] + d[["y_plotlyDomain"]] <- d[["y"]] + d + }) + # And since we're essentially adding an "unknown" (to ggplot2) + # aesthetic, add it to the dropped_aes field to avoid fals positive + # warnings (https://github.com/tidyverse/ggplot2/pull/4866) + layers <- lapply(layers, function(l) { + l$stat$dropped_aes <- c(l$stat$dropped_aes, "x_plotlyDomain") + l$stat$dropped_aes <- c(l$stat$dropped_aes, "y_plotlyDomain") + l + }) + + # Transform all scales + data <- lapply(data, scales_transform_df, scales = scales) + + # Map and train positions so that statistics have access to ranges + # and all positions are numeric + scale_x <- function() scales$get_scales("x") + scale_y <- function() scales$get_scales("y") + + layout$train_position(data, scale_x(), scale_y()) + + data <- layout$map_position(data) + + # build a mapping between group and key + # if there are multiple keys within a group, the key is a list-column + reComputeGroup <- function(x, layer = NULL) { + # 1-to-1 link between data & visual marks -- group == key + if (inherits(layer$geom, "GeomDotplot")) { + x <- split(x, x[["PANEL"]]) + x <- lapply(x, function(d) { + d[["group"]] <- do.call("order", d[c("x", "group")]) + d + }) + x <- dplyr::bind_rows(x) } - ys <- lapply(trace.list, "[[", "y") - xs <- lapply(trace.list, "[[", "x") - x.vals <- unique(unlist(xs)) - # if there are two or more y-values (for a particular x value), - # then modify those y-values so they *add up* to the correct value(s) - for (val in x.vals) { - zs <- lapply(xs, function(x) which(x == val)) - ys.given.x <- Map(function(x, y) y[x], zs, ys) - if (length(unlist(ys.given.x)) < 2) next - st <- unStack(unlist(ys.given.x)) - lens <- sapply(ys.given.x, length) - trace.seq <- seq_along(trace.list) - ws <- split(st, rep(trace.seq, lens)) - for (tr in seq_along(ws)) { - idx <- zs[[tr]] - replacement <- ws[[tr]] - if (length(idx) > 0 && length(replacement) > 0) - trace.list[[tr]]$y[idx] <- replacement - } + if (inherits(layer$geom, "GeomSf")) { + x <- split(x, x[["PANEL"]]) + x <- lapply(x, function(d) { + d[["group"]] <- seq_len(nrow(d)) + d + }) + # I think this is safe? + x <- suppressWarnings(dplyr::bind_rows(x)) } + x } - } - - # Bar Gap for histograms should be 0 - bargaps <- do.call(c, lapply(trace.list, function (x) x$bargap)) - if (length(bargaps) > 0) { - if (any(bargaps == 0)) { - layout$bargap <- 0 - if (!all(bargaps == 0)) { - warning("You have multiple bar charts and histograms;\n - Plotly's layout bargap will be 0 for all of them.") + + nestedKeys <- Map(function(x, y, z) { + key <- y[[crosstalk_key()]] + if (is.null(key) || inherits(z[["stat"]], "StatIdentity")) return(NULL) + x <- reComputeGroup(x, z) + tib <- tibble::as_tibble(x[c("PANEL", "group")]) + tib[["key"]] <- key + nested <- tidyr::nest(tib, key = key) + # reduce the dimensions of list column elements from 2 to 1 + nested$key <- lapply(nested$key, function(x) x[[1]]) + nested + }, data, layer_data, layers) + + # for some geoms (e.g. boxplots) plotly.js needs the "pre-statistics" data + # we also now provide the option to return one of these two + prestats_data <- data + data <- by_layer(function(l, d) l$compute_statistic(d, layout)) + data <- by_layer(function(l, d) l$map_statistic(d, plot)) + + # Make sure missing (but required) aesthetics are added + scales_add_missing(plot, c("x", "y")) + + # Reparameterise geoms from (e.g.) y and width to ymin and ymax + data <- by_layer(function(l, d) l$compute_geom_1(d)) + + # compute_geom_1 can reorder the rows from `data`, making groupDomains + # invalid. We rebuild groupDomains based on the current `data` and the + # group map we built before. + groupDomains <- Map(function(x, y) { + tryCatch({ + names(y)[match(x$group, y)] + }, error = function(e) NULL + ) + }, data, group_maps) + + # there are some geoms (e.g. geom_dotplot()) where attaching the key + # before applying the statistic can cause problems, but there is still a + # 1-to-1 corresponding between graphical marks and + + # Apply position adjustments + data <- by_layer(function(l, d) l$compute_position(d, layout)) + + # Reset position scales, then re-train and map. This ensures that facets + # have control over the range of a plot: is it generated from what's + # displayed, or does it include the range of underlying data + layout$reset_scales() + layout$train_position(data, scale_x(), scale_y()) + layout$setup_panel_params() + data <- layout$map_position(data) + + # Train and map non-position scales + npscales <- scales$non_position_scales() + if (npscales$n() > 0) { + lapply(data, scales_train_df, scales = npscales) + # this for loop is unique to plotly -- it saves the "domain" + # of each non-positional scale for display in tooltips + for (sc in npscales$scales) { + data <- lapply(data, function(d) { + present_aes <- intersect(sc$aesthetics, names(d)) + if (length(present_aes) > 0) { + d[paste0(present_aes, "_plotlyDomain")] <- d[present_aes] + } + d + }) } - } else { - bargaps <- NULL # Do not specify anything - } - } - - # Export axis specification as a combination of breaks and labels, on - # the relevant axis scale (i.e. so that it can be passed into d3 on the - # x axis scale instead of on the grid 0-1 scale). This allows - # transformations to be used out of the box, with no additional d3 - # coding. - theme.pars <- getFromNamespace("plot_theme", "ggplot2")(p) - - # Flip labels if coords are flipped - transform does not take care - # of this. Do this BEFORE checking if it is blank or not, so that - # individual axes can be hidden appropriately, e.g. #1. - # ranges <- built$panel$ranges[[1]] - # if("flip"%in%attr(built$plot$coordinates, "class")){ - # temp <- built$plot$labels$x - # built$plot$labels$x <- built$plot$labels$y - # built$plot$labels$y <- temp - # } - e <- function(el.name){ - ggplot2::calc_element(el.name, p$theme) - } - is.blank <- function(el.name, null.is.blank=FALSE) { - # NULL shows ticks and hides borders - cls <- attr(e(el.name),"class") - "element_blank" %in% cls || null.is.blank && is.null(cls) - } - trace.order.list <- list() - trace.name.map <- c() - for(xy in c("x","y")){ - ax.list <- list() - coord.lim <- p$coordinates$limits[[xy]] %||% p$scales$get_scales(xy)$limits - if(is.numeric(coord.lim)){ - ## TODO: maybe test for more exotic coord specification types - ## involving NA, Inf, etc? - ax.list$range <- coord.lim - } - s <- function(tmp)sprintf(tmp, xy) - ax.list$tickcolor <- toRGB(theme.pars$axis.ticks$colour) - - # When gridlines are dotted or dashed: - grid <- theme.pars$panel.grid - grid.major <- theme.pars$panel.grid.major - if ((!is.null(grid$linetype) || !is.null(grid.major$linetype)) && - c(grid$linetype, grid.major$linetype) %in% c(2, 3, "dashed", "dotted")) { - ax.list$gridcolor <- ifelse(is.null(grid.major$colour), - toRGB(grid$colour, 0.1), - toRGB(grid.major$colour, 0.1)) - } else { - ax.list$gridcolor <- toRGB(grid.major$colour) + data <- lapply(data, scales_map_df, scales = npscales) } - ax.list$showgrid <- !is.blank(s("panel.grid.major.%s")) - # These numeric length variables are not easily convertible. - #ax.list$gridwidth <- as.numeric(theme.pars$panel.grid.major$size) - #ax.list$ticklen <- as.numeric(theme.pars$axis.ticks.length) + # Fill in defaults etc. + data <- by_layer(function(l, d) l$compute_geom_2(d)) + + # Let layer stat have a final say before rendering + data <- by_layer(function(l, d) l$finish_statistics(d)) - theme2font <- function(text){ - if(!is.null(text)){ - list(family=text$family, - size=text$size, - color=toRGB(text$colour)) + # Let Layout modify data before rendering + data <- layout$finish_data(data) + + # if necessary, attach key + data <- Map(function(x, y, z) { + if (!length(y)) return(x) + x <- reComputeGroup(x, z) + # dplyr issue??? https://github.com/tidyverse/dplyr/issues/2701 + attr(y$group, "n") <- NULL + # https://github.com/plotly/plotly.R/issues/2013 + if (!identical(class(x$group), class(y$group))) { + x$group <- as.character(x$group) + y$group <- as.character(y$group) } + suppressMessages(dplyr::left_join(x, y)) + }, data, nestedKeys, layers) + + structure( + list( + data = data, layout = layout, plot = plot, + env = environment() + ), + class = "ggplot_built" + ) + } + + # Allow thematic to add new defaults to the plot object based on it's theme + built <- if (isNamespaceLoaded("thematic")) { + tns <- asNamespace("thematic") + tns$ggthematic_build(p, ggplotly_build, tns$thematic_get_theme(resolve = TRUE)) + } else { + ggplotly_build(p) + } + + # Assign all the objects available to ggplotly_build() to this functions environment + built_env <- built$env + envir <- environment() + for (var in ls(built_env)) { + assign(var, built_env[[var]], envir = envir) + } + + theme <- calculated_theme_elements(plot) + + # Translate plot wide theme elements to plotly.js layout + pm <- unitConvert(theme$plot.margin, "pixels") + gglayout <- list( + margin = list(t = pm[[1]], r = pm[[2]], b = pm[[3]], l = pm[[4]]), + plot_bgcolor = toRGB(theme$panel.background$fill), + paper_bgcolor = toRGB(theme$plot.background$fill), + font = text2font(theme$text) + ) + # main plot title + if (robust_nchar(plot$labels$title) > 0) { + gglayout$title <- list( + text = faced(plot$labels$title, theme$plot.title$face), + font = text2font(theme$plot.title), + # don't translate vjust to y since they since have very different meaning... + # y is allowed to span the paper coordinate whereas vjust it local to it's grob + x = theme$plot.title$hjust, + xref = "paper" + ) + gglayout$margin$t <- gglayout$margin$t + gglayout$title$font$size + } + # ensure there's enough space for the modebar (this is based on a height of 1em) + # https://github.com/plotly/plotly.js/blob/dd1547/src/components/modebar/index.js#L171 + gglayout$margin$t <- gglayout$margin$t + 16 + + # important stuff like layout$panel_params is already flipped, but + # plot$scales/plot$labels/data aren't. We flip x/y trace data at the very end + # and scales in the axis loop below. + if (inherits(plot$coordinates, "CoordFlip")) { + plot$labels[c("x", "y")] <- plot$labels[c("y", "x")] + } + + # important panel summary stats + nPanels <- nrow(layout$layout) + nRows <- max(layout$layout$ROW) + nCols <- max(layout$layout$COL) + + # panel -> plotly.js axis/anchor info + # (assume a grid layout by default) + layout$layout <- dplyr::mutate( + layout$layout, + xaxis = COL, + yaxis = ROW, + xanchor = nRows, + yanchor = 1L + ) + if (inherits(plot$facet, "FacetWrap")) { + if (plot$facet$params$free$x && plot$facet$params$free$y) { + layout$layout <- dplyr::mutate( + layout$layout, + xaxis = PANEL, + yaxis = PANEL, + xanchor = PANEL, + yanchor = PANEL + ) + } else if (plot$facet$params$free$x) { + layout$layout <- dplyr::mutate( + layout$layout, + xaxis = PANEL, + xanchor = ROW + ) + } else if (plot$facet$params$free$y) { + layout$layout <- dplyr::mutate( + layout$layout, + yaxis = PANEL, + yanchor = COL + ) } - # Ticks. - if (is.blank("axis.ticks")) { - ax.list$ticks <- "" - } else if (is.blank(s("axis.ticks.%s"))) { - ax.list$ticks <- "" - } else { - ax.list$ticks <- "outside" # by default ggplot2 plots have ticks - } - ax.list$tickwidth <- theme.pars$axis.ticks$size - tick.text.name <- s("axis.text.%s") - ax.list$showticklabels <- !is.blank(tick.text.name) - tick.text <- e(tick.text.name) - if (is.numeric(tick.text$angle)) { - ax.list$tickangle <- -tick.text$angle + # anchor X axis to the lowest plot in its column + layout$layout <- dplyr::group_by(layout$layout, !!rlang::sym("xaxis")) + layout$layout <- dplyr::mutate(layout$layout, xanchor = max(as.integer(yaxis))) + } + layout$layout <- as.data.frame(layout$layout) + + # format the axis/anchor to a format plotly.js respects + layout$layout$xaxis <- paste0("xaxis", sub("^1$", "", layout$layout$xaxis)) + layout$layout$yaxis <- paste0("yaxis", sub("^1$", "", layout$layout$yaxis)) + layout$layout$xanchor <- paste0("y", sub("^1$", "", layout$layout$xanchor)) + layout$layout$yanchor <- paste0("x", sub("^1$", "", layout$layout$yanchor)) + # for some layers2traces computations, we need the range of each panel + layout$layout$x_min <- sapply(layout$panel_params, function(z) { min(z[["x"]]$dimension %()% z$x.range %||% z$x_range) }) + layout$layout$x_max <- sapply(layout$panel_params, function(z) { max(z[["x"]]$dimension %()% z$x.range %||% z$x_range) }) + layout$layout$y_min <- sapply(layout$panel_params, function(z) { min(z[["y"]]$dimension %()% z$y.range %||% z$y_range) }) + layout$layout$y_max <- sapply(layout$panel_params, function(z) { max(z[["y"]]$dimension %()% z$y.range %||% z$y_range) }) + + # layers -> plotly.js traces + plot$tooltip <- tooltip + data <- Map(function(x, y) { + tryCatch({ x$group_plotlyDomain <- y; x }, error = function(e) x) + }, data, groupDomains) + + # reattach crosstalk key-set attribute + data <- Map(function(x, y) structure(x, set = y), data, sets) + traces <- layers2traces(data, prestats_data, layout, plot) + + gglayout <- layers2layout(gglayout, layers, layout$layout) + + # default to just the text in hover info, mainly because of this + # https://github.com/plotly/plotly.js/issues/320 + traces <- lapply(traces, function(tr) { + tr$hoverinfo <- tr$hoverinfo %||%"text" + tr + }) + # show only one legend entry per legendgroup (skip invisible traces for dedup) + grps <- sapply(traces, "[[", "legendgroup") + is_visible <- sapply(traces, function(tr) !isFALSE(tr$visible)) + grps_for_dedup <- ifelse(is_visible, grps, paste0(grps, "_invisible_", seq_along(grps))) + traces <- Map(function(x, y) { + if (!is.null(x[["frame"]])) return(x) + x$showlegend <- isTRUE(x$showlegend) && y + x + }, traces, !duplicated(grps_for_dedup)) + + # ------------------------------------------------------------------------ + # axis/facet/margin conversion + # ------------------------------------------------------------------------ + + # panel margins must be computed before panel/axis loops + # (in order to use get_domains()) + panelMarginX <- unitConvert( + theme[["panel.spacing.x"]] %||% theme[["panel.spacing"]], + "npc", "width" + ) + panelMarginY <- unitConvert( + theme[["panel.spacing.y"]] %||% theme[["panel.spacing"]], + "npc", "height" + ) + # space for _interior_ facet strips + if (inherits(plot$facet, "FacetWrap")) { + stripSize <- unitConvert( + theme[["strip.text.x"]] %||% theme[["strip.text"]], + "npc", "height" + ) + panelMarginY <- panelMarginY + stripSize + # space for ticks/text in free scales + if (plot$facet$params$free$x) { + axisTicksX <- unitConvert( + theme[["axis.ticks.x"]] %||% theme[["axis.ticks"]], + "npc", "height" + ) + # allocate enough space for the _longest_ text label + axisTextX <- theme[["axis.text.x"]] %||% theme[["axis.text"]] + labz <- unlist(lapply(layout$panel_params, function(pp) { pp[["x"]]$get_labels %()% pp$x.labels })) + lab <- longest_element(labz) + panelMarginY <- panelMarginY + axisTicksX + + bbox(lab, axisTextX$angle, unitConvert(axisTextX, "npc", "height"))[["height"]] } - ax.list$tickfont <- theme2font(tick.text) - - ## determine axis type first, since this information is used later - ## (trace.order.list is only used for type=category). - title.text <- e(s("axis.title.%s")) - ax.list$titlefont <- theme2font(title.text) - ax.list$type <- if (misc$is.continuous[[xy]]){ - "linear" - } else if (misc$is.discrete[[xy]]){ - "category" - } else if (misc$is.date[[xy]] || misc$is.datetime[[xy]]){ - "date" - } else { - stop("unrecognized data type for ", xy, " axis") + if (plot$facet$params$free$y) { + axisTicksY <- unitConvert( + theme[["axis.ticks.y"]] %||% theme[["axis.ticks"]], + "npc", "width" + ) + # allocate enough space for the _longest_ text label + axisTextY <- theme[["axis.text.y"]] %||% theme[["axis.text"]] + labz <- unlist(lapply(layout$panel_params, function(pp) { pp[["y"]]$get_labels %()% pp$y.labels })) + lab <- longest_element(labz) + panelMarginX <- panelMarginX + axisTicksY + + bbox(lab, axisTextY$angle, unitConvert(axisTextY, "npc", "width"))[["width"]] } - - # Translate axes labels. - scale.i <- which(p$scales$find(xy)) - ax.list$title <- if(length(scale.i)){ - sc <- p$scales$scales[[scale.i]] - if(ax.list$type == "category"){ - trace.order.list[[xy]] <- sc$limits - if(is.character(sc$breaks)){ - if(is.character(sc$labels)){ - trace.name.map[sc$breaks] <- sc$labels - } - ##TODO: if(is.function(sc$labels)){ - } - } - if (is.null(sc$breaks)) { - ax.list$showticklabels <- FALSE - ax.list$showgrid <- FALSE - ax.list$ticks <- "" + } + margins <- c( + rep(panelMarginX, 2), + rep(panelMarginY, 2) + ) + doms <- get_domains(nPanels, nRows, margins) + + for (i in seq_len(nPanels)) { + lay <- layout$layout[i, ] + for (xy in c("x", "y")) { + # find axis specific theme elements that inherit from their parent + theme_el <- function(el) { + theme[[paste0(el, ".", xy)]] %||% theme[[el]] } - if (is.numeric(sc$breaks)) { - dticks <- diff(sc$breaks) - dt <- dticks[1] - if(all(dticks == dt)){ - ax.list$dtick <- dt - ax.list$autotick <- FALSE + axisTicks <- theme_el("axis.ticks") + axisText <- theme_el("axis.text") + axisTitle <- theme_el("axis.title") + axisLine <- theme_el("axis.line") + panelGrid <- theme_el("panel.grid.major") %||% theme_el("panel.grid") + stripText <- theme_el("strip.text") + + axisName <- lay[, paste0(xy, "axis")] + anchor <- lay[, paste0(xy, "anchor")] + rng <- layout$panel_params[[i]] + + # panel_params is quite different for "CoordSf" + if ("CoordSf" %in% class(p$coordinates)) { + # see CoordSf$render_axis_v + direction <- if (xy == "x") "E" else "N" + idx <- rng$graticule$type == direction & + !is.na(rng$graticule$degree_label) & + # Respect the logical 'plot12' column which sf constructs for + # determining which tick labels should be drawn + # https://github.com/r-spatial/sf/blob/b49d37/R/graticule.R#L199 + # https://github.com/r-spatial/sf/blob/52a8351/R/plot.R#L580 + (rng$graticule$plot12 %||% TRUE) + tickData <- rng$graticule[idx, ] + # TODO: how to convert a language object to unicode character string? + rng[[paste0(xy, ".labels")]] <- sub( + "\\*\\s+degree[ ]?[\\*]?", "°", + gsub("\"", "", tickData[["degree_label"]]) + ) + # Downstream logic expects these 'break positions' to be on 0-1 scale + # (which is then rescaled back to the data scale) + rng[[paste0(xy, ".major")]] <- scales::rescale(tickData[[paste0(xy, "_start")]]) + + # If it doesn't already exist (for this panel), + # generate graticule (as done in, CoordSf$render_bg) + isGrill <- vapply(traces, function(tr) { + identical(tr$xaxis, lay$xaxis) && + identical(tr$yaxis, lay$yaxis) && + isTRUE(tr$`_isGraticule`) + }, logical(1)) + + if (sum(isGrill) == 0) { + # TODO: reduce the number of points (via coord_munch?) + d <- fortify_sf(rng$graticule) + d$x <- scales::rescale(d$x, rng$x_range, from = c(0, 1)) + d$y <- scales::rescale(d$y, rng$y_range, from = c(0, 1)) + params <- list( + colour = panelGrid$colour, + linetype = panelGrid$linetype + ) + nm <- linewidth_or_size(panelGrid) + params[[nm]] <- panelGrid[[nm]] + grill <- geom2trace.GeomPath(d, params) + grill$hoverinfo <- "none" + grill$showlegend <- FALSE + grill$`_isGraticule` <- TRUE + grill$xaxis <- sub("axis", "", lay$xaxis) + grill$yaxis <- sub("axis", "", lay$yaxis) + + traces <- c(list(grill), traces) } - } - ax.list$range <- if(!is.null(sc$limits)){ - sc$limits - }else{ - if(misc$is.continuous[[xy]]){ - built$panel$ranges[[1]][[s("%s.range")]] #TODO: facets! - }else{ # for a discrete scale, range should be NULL. - NULL + + # if labels are empty, don't show axis ticks + tickExists <- with(rng$graticule, sapply(degree_label, is.language)) + if (sum(tickExists) == 0) { + theme$axis.ticks.length <- 0 } } - if(is.character(sc$trans$name) && sc$trans$name == "reverse"){ - ax.list$range <- sort(-ax.list$range, decreasing = TRUE) + + # stuff like layout$panel_params is already flipped, but scales aren't + sc <- if (inherits(plot$coordinates, "CoordFlip")) { + scales$get_scales(setdiff(c("x", "y"), xy)) + } else { + scales$get_scales(xy) } - if(!is.null(sc$name)){ - sc$name - }else{ - p$labels[[xy]] + # type of unit conversion + type <- if (xy == "x") "height" else "width" + # get axis title + axisTitleText <- sc$name %||% plot$labels[[xy]] %||% "" + if (is_blank(axisTitle)) axisTitleText <- "" + + # is this axis dynamic? + isDynamic <- isTRUE(dynamicTicks) || identical(dynamicTicks, xy) + if (isDynamic && !p$coordinates$is_linear()) { + warning( + "`dynamicTicks` is only supported for linear (i.e., cartesian) coordinates", + call. = FALSE + ) } - }else{ - p$labels[[xy]] - } - - ax.list$zeroline <- FALSE # ggplot2 plots do not show zero lines - # Lines drawn around the plot border. - ax.list$showline <- !is.blank("panel.border", TRUE) - ax.list$linecolor <- toRGB(theme.pars$panel.border$colour) - ax.list$linewidth <- theme.pars$panel.border$size - # Some other params that we used in animint but we don't yet - # translate to plotly: - !is.blank(s("axis.line.%s")) - layout[[s("%saxis")]] <- ax.list - # remove traces that are outside the range of (discrete) scales - nms <- unlist(lapply(traces, "[[", "name")) - if (is.discrete(ax.list$range) && !is.null(nms)) - trace.list <- trace.list[nms %in% ax.list$range] - } - # copy [x/y]axis to [x/y]axisN and set domain, range, etc. for each - xaxis.title <- layout$xaxis$title - yaxis.title <- layout$yaxis$title - inner.margin <- 0.01 # between facets - outer.margin <- 0.05 # to put titles outside of the plots - orig.xaxis <- layout$xaxis - orig.yaxis <- layout$yaxis - if (nrow(gglayout) > 1) { - row.size <- 1. / max(gglayout$ROW) - col.size <- 1. / max(gglayout$COL) - npanels <- nrow(gglayout) - for (i in seq_len(npanels)) { - row <- gglayout[i, "plotly.row"] - col <- gglayout[i, "COL"] - panel <- gglayout[i, "plotly.panel"] - x <- col * col.size - xmin <- x - col.size - xmax <- x - inner.margin - y <- row * row.size - ymin <- y - row.size - ymax <- y - inner.margin - # assume grid layout by default where axes are restrict to the exterior - xaxis.name <- if (col == 1) "xaxis" else paste0("xaxis", col) - yaxis.name <- if (row == 1) "yaxis" else paste0("yaxis", row) - # anchor needs to be incremented if the corresponding axis is "free" - xanchor <- "y" - yanchor <- "x" - if ("wrap" %in% class(p$facet)) { - # in wrap layout, axes can be drawn on interior (if scales are free) - # make room for facet strip label - ymax <- ymax - 0.04 - # make room for yaxis labels (this should be a function of label size) - if (col == 1) { - xmax <- xmax - 0.02 - } else { - xmin <- xmin + 0.02 + + # determine axis types + isDate <- inherits(sc, c("ScaleContinuousDatetime", "ScaleContinuousDate")) + isDateType <- isDynamic && isDate + isDiscrete <- inherits(sc, "ScaleDiscretePosition") + isDiscreteType <- isDynamic && isDiscrete + + # In 3.2.x .major disappeared in favor of break_positions() + # (tidyverse/ggplot2#3436), but with 3.4.x break_positions() no longer + # yields the actual final positions on a 0-1 scale, but .major does + # (tidyverse/ggplot2#5029) + ticktext <- rng[[paste0(xy, ".labels")]] %||% rng[[xy]]$get_labels() + tickvals <- rng[[paste0(xy, ".major")]] %||% rng[[xy]]$break_positions() + + # https://github.com/tidyverse/ggplot2/pull/3566#issuecomment-565085809 + hasTickText <- !(is.na(ticktext) | is.na(tickvals)) + ticktext <- as.character(unlist(ticktext[hasTickText])) + tickvals <- as.numeric(unlist(tickvals[hasTickText])) + + axisObj <- list( + # TODO: log type? + type = if (isDateType) "date" else if (isDiscreteType) "category" else "linear", + autorange = isDynamic, + range = rng[[xy]]$dimension %()% rng[[paste0(xy, ".range")]] %||% rng[[paste0(xy, "_range")]], + tickmode = if (isDynamic) "auto" else "array", + ticktext = ticktext, + tickvals = tickvals, + categoryorder = "array", + categoryarray = ticktext, + nticks = nrow(rng), + ticks = if (is_blank(axisTicks)) "" else "outside", + tickcolor = toRGB(axisTicks$colour), + ticklen = unitConvert(theme$axis.ticks.length, "pixels", type), + tickwidth = unitConvert(axisTicks, "pixels", type), + showticklabels = !is_blank(axisText), + tickfont = text2font(axisText, type), + tickangle = - (axisText$angle %||% 0), + showline = !is_blank(axisLine), + linecolor = toRGB(axisLine$colour), + linewidth = unitConvert(axisLine, "pixels", type), + # TODO: always `showgrid=FALSE` and implement our own using traces + showgrid = !is_blank(panelGrid) && !"CoordSf" %in% class(p$coordinates), + domain = sort(as.numeric(doms[i, paste0(xy, c("start", "end"))])), + gridcolor = toRGB(panelGrid$colour), + gridwidth = unitConvert(panelGrid, "pixels", type), + zeroline = FALSE, + anchor = anchor, + # layout.axisid.title don't yet support alignment :( + title = list( + text = faced(axisTitleText, axisTitle$face), + font = text2font(axisTitle) + ) + ) + + # set scaleanchor/scaleratio if these are fixed coordinates + # the logic here is similar to what p$coordinates$aspect() does, + # but the ratio is scaled to the data range by plotly.js + is_fixed <- inherits( + p$coordinates, + c("CoordSf", "CoordFixed", "CoordMap", "CoordQuickmap") + ) + if (is_fixed || isFALSE(p$coordinates$is_free())) { + axisObj$scaleanchor <- anchor + ratio <- p$coordinates$ratio %||% 1 + axisObj$scaleratio <- if (xy == "y") ratio else 1 / ratio + + if (inherits(p$coordinates, "CoordSf")) { + if (isTRUE(sf::st_is_longlat(rng$crs))) { + ratio <- cos(mean(rng$y_range) * pi/180) + } + # note how ratio is flipped in CoordSf$aspect() vs CoordFixed$aspect() + axisObj$scaleratio <- if (xy == "y") 1 / ratio else ratio } - # make room for xaxis labels - if (row == 1) { - ymax <- ymax - 0.02 + } + + # TODO: seems like we _could_ support this with scaleanchors, + # but inverse transform by the panel ranges? + # also, note how aspect.ratio overwrites fixed coordinates: + # ggplot(mtcars, aes(wt, mpg)) + geom_point() + coord_fixed(0.5) + # ggplot(mtcars, aes(wt, mpg)) + geom_point() + coord_fixed(0.5) + theme(aspect.ratio = 1) + if (!is.null(theme$aspect.ratio)) { + warning( + "Aspect ratios aren't yet implemented, but you can manually set", + " a suitable height/width", call. = FALSE + ) + } + + # tickvals are currently on 0-1 scale, but we want them on data scale + axisObj$tickvals <- scales::rescale( + axisObj$tickvals, to = axisObj$range, from = c(0, 1) + ) + + # inverse transform date data based on tickvals/ticktext + invert_date <- function(x, scale) { + if (inherits(scale, "ScaleContinuousDatetime")) { + as.POSIXct(x, origin = "1970-01-01", tz = scale$timezone) } else { - ymin <- ymin + 0.02 + as.Date(x, origin = "1970-01-01", tz = scale$timezone) } - if (p$facet$free$y && panel > 1) { - # draw a y-axis on each panel - yaxis.name <- paste0("yaxis", panel) - for (j in seq_along(trace.list)) { - tr <- trace.list[[j]] - if (tr$PANEL == panel) { - trace.list[[j]]$yaxis <- paste0("y", panel) - } - } - yanchor <- if (p$facet$free$x) paste0("x", panel) else paste0("x",col) - } - if (p$facet$free$x && panel > 1) { - # draw an x-axis on each panel - xaxis.name <- paste0("xaxis", panel) - for (j in seq_along(trace.list)) { - tr <- trace.list[[j]] - if (tr$PANEL == panel) { - trace.list[[j]]$xaxis <- paste0("x", panel) - } + } + + if (isDateType) { + axisObj$range <- invert_date(axisObj$range, sc) + traces <- lapply(traces, function(tr) { + tr[[xy]] <- invert_date(tr[[xy]], sc) + # TODO: are there other similar cases we need to handle? + if (identical("bar", tr$type)) { + tr[["width"]] <- invert_date(tr[["width"]], sc) } - xanchor <- if (p$facet$free$y) paste0("y", panel) else paste0("y",row) - } - } - layout[[xaxis.name]] <- orig.xaxis - layout[[xaxis.name]]$domain <- c(xmin, xmax) - layout[[xaxis.name]]$anchor <- xanchor - layout[[xaxis.name]]$title <- NULL - layout[[yaxis.name]] <- orig.yaxis - layout[[yaxis.name]]$domain <- c(ymin, ymax) - layout[[yaxis.name]]$anchor <- yanchor - layout[[yaxis.name]]$title <- NULL - if (is.null(layout[[xaxis.name]]$anchor)) - layout[[xaxis.name]]$anchor <- "y" - if (is.null(layout[[yaxis.name]]$anchor)) - layout[[yaxis.name]]$anchor <- "x" - # range only makes sense for numeric data - if (orig.xaxis$type == "linear") { - layout[[xaxis.name]]$range <- built$panel$ranges[[i]]$x.range - layout[[xaxis.name]]$autorange <- FALSE + tr + }) } - if (orig.yaxis$type == "linear") { - layout[[yaxis.name]]$range <- built$panel$ranges[[i]]$y.range - layout[[yaxis.name]]$autorange <- FALSE + + # inverse transform categorical data based on tickvals/ticktext + if (isDiscreteType) { + traces <- lapply(traces, function(tr) { + # map x/y trace data back to the 'closest' ticktext label + # http://r.789695.n4.nabble.com/check-for-nearest-value-in-a-vector-td4369339.html + tr[[xy]]<- vapply(tr[[xy]], function(val) { + with(axisObj, ticktext[[which.min(abs(tickvals - val))]]) + }, character(1)) + tr + }) + if ("dodge" %in% sapply(layers, ggtype, "position")) gglayout$barmode <- "dodge" } - } - # add panel titles as annotations - annotations <- list() - nann <- 1 - make.label <- function(text, x, y, xanchor="auto", yanchor="auto", textangle=0) - list(text=text, showarrow=FALSE, x=x, y=y, ax=0, ay=0, - xref="paper", yref="paper", xanchor=xanchor, yanchor=yanchor, - textangle=textangle) - if ("grid" %in% class(p$facet)) { - frows <- names(p$facet$rows) - nann <- 1 - for (i in seq_len(max(gglayout$ROW))) { - text <- paste(lapply(gglayout[gglayout$ROW == i, frows, drop=FALSE][1,], - as.character), - collapse=", ") - if (text != "") { # to not create extra annotations - increase_margin_r <- TRUE - annotations[[nann]] <- make.label(text, - 1 + outer.margin - 0.04, - row.size * (max(gglayout$ROW)-i+0.5), - xanchor="center", - textangle=90) - nann <- nann + 1 + # attach axis object to the layout + gglayout[[axisName]] <- axisObj + + # do some stuff that should be done once for the entire plot + is_x <- xy == "x" + if (i == 1) { + # Split ticktext elements by "\n" to account for linebreaks + axisTickText <- strsplit(as.character(axisObj$ticktext), split = "\n", fixed = TRUE) + axisTickText <- longest_element(unlist(axisTickText)) + side <- if (is_x) "b" else "l" + # account for axis ticks, ticks text, and titles in plot margins + # (apparently ggplot2 doesn't support axis.title/axis.text margins) + gglayout$margin[[side]] <- gglayout$margin[[side]] + axisObj$ticklen + + bbox(axisTickText, axisObj$tickangle, axisObj$tickfont$size)[[type]] + + bbox(axisTitleText, axisTitle$angle, unitConvert(axisTitle, "pixels", type))[[type]] + + if (robust_nchar(axisTitleText) > 0) { + axisTextSize <- unitConvert(axisText, "npc", type) + axisTitleSize <- unitConvert(axisTitle, "npc", type) } - } - fcols <- names(p$facet$cols) - for (i in seq_len(max(gglayout$COL))) { - text <- paste(lapply(gglayout[gglayout$COL == i, fcols, drop=FALSE][1,], - as.character), - collapse=", ") - if (text!="") { - annotations[[nann]] <- make.label(text, - col.size * (i-0.5) - inner.margin/2, - 1 + outer.margin, - xanchor="center") - nann <- nann + 1 + + # add space for exterior facet strips in `layout.margin` + + if (has_facet(plot)) { + stripSize <- unitConvert(stripText, "pixels", type) + if (is_x) { + gglayout$margin$t <- gglayout$margin$t + stripSize + } + if (is_x && inherits(plot$facet, "FacetGrid")) { + gglayout$margin$r <- gglayout$margin$r + stripSize + } + # facets have multiple axis objects, but only one title for the plot, + # so we empty the titles and try to draw the title as an annotation + if (robust_nchar(axisTitleText) > 0) { + axisAnn <- make_label( + faced(axisTitleText, axisTitle$face), + el = axisTitle, + x = if (is_x) 0.5 else 0, + y = if (is_x) 0 else 0.5, + xanchor = if (is_x) "center" else "right", + yanchor = if (is_x) "top" else "center", + annotationType = "axis" + ) + + textMargin <- sum(axisText$margin[if (is_x) c(1, 3) else c(2, 4)]) + class(textMargin) <- setdiff(class(textMargin), "margin") + titleMargin <- axisTitle$margin[if (is_x) 1 else 2] + class(titleMargin) <- setdiff(class(titleMargin), "margin") + offset <- bbox(axisTickText, axisText$angle, axisTextSize)[[type]] + + unitConvert(theme$axis.ticks.length, "npc", type) + + unitConvert(textMargin, "npc", type) + + unitConvert(titleMargin, "npc", type) + + offset <- unitConvert(grid::unit(offset, "npc"), "pixels", type) + + shift <- if (is_x) "yshift" else "xshift" + axisAnn[[1]][[shift]] <- -1 * offset + gglayout$annotations <- c(gglayout$annotations, axisAnn) + } } } - - # add empty traces everywhere so that the background shows even if there - # is no data for a facet - for (r in seq_len(max(gglayout$ROW))) - for (c in seq_len(max(gglayout$COL))) - trace.list <- c(trace.list, list(list(xaxis=paste0("x", c), yaxis=paste0("y", r), showlegend=FALSE))) - } else if ("wrap" %in% class(p$facet)) { - facets <- names(p$facet$facets) - for (i in seq_len(max(as.numeric(gglayout$PANEL)))) { - ix <- gglayout$PANEL == i - row <- gglayout$ROW[ix] - col <- gglayout$COL[ix] - text <- paste(lapply(gglayout[ix, facets, drop=FALSE][1,], - as.character), - collapse=", ") - annotations[[nann]] <- make.label(text, - col.size * (col-0.5) - inner.margin/2, - row.size * (max(gglayout$ROW) - row + 0.985), - xanchor="center", - yanchor="top") - nann <- nann + 1 + if (has_facet(plot)) gglayout[[axisName]]$title <- "" + } # end of axis loop + + # theme(panel.border = ) -> plotly rect shape + xdom <- gglayout[[lay[, "xaxis"]]]$domain + ydom <- gglayout[[lay[, "yaxis"]]]$domain + border <- make_panel_border(xdom, ydom, theme) + gglayout$shapes <- c(gglayout$shapes, border) + + # facet strips -> plotly annotations + if (has_facet(plot)) { + col_vars <- ifelse(inherits(plot$facet, "FacetWrap"), "facets", "cols") + col_txt <- paste( + plot$facet$params$labeller( + lay[names(plot$facet$params[[col_vars]])] + ), collapse = br() + ) + if (is_blank(theme[["strip.text.x"]])) col_txt <- "" + if (inherits(plot$facet, "FacetGrid") && lay$ROW != 1) col_txt <- "" + if (robust_nchar(col_txt) > 0) { + col_lab <- make_label( + col_txt, x = mean(xdom), y = max(ydom), + el = theme[["strip.text.x"]] %||% theme[["strip.text"]], + xanchor = "center", yanchor = "bottom" + ) + gglayout$annotations <- c(gglayout$annotations, col_lab) + strip <- make_strip_rect(xdom, ydom, theme, "top") + gglayout$shapes <- c(gglayout$shapes, strip) + } + row_txt <- paste( + plot$facet$params$labeller( + lay[names(plot$facet$params$rows)] + ), collapse = br() + ) + if (is_blank(theme[["strip.text.y"]])) row_txt <- "" + if (inherits(plot$facet, "FacetGrid") && lay$COL != nCols) row_txt <- "" + if (robust_nchar(row_txt) > 0) { + row_lab <- make_label( + row_txt, x = max(xdom), y = mean(ydom), + el = theme[["strip.text.y"]] %||% theme[["strip.text"]], + xanchor = "left", yanchor = "middle" + ) + gglayout$annotations <- c(gglayout$annotations, row_lab) + strip <- make_strip_rect(xdom, ydom, theme, "right") + gglayout$shapes <- c(gglayout$shapes, strip) } } - # axes titles - annotations[[nann]] <- make.label(xaxis.title, - 0.5, - -outer.margin, - yanchor="top") - nann <- nann + 1 - annotations[[nann]] <- make.label(yaxis.title, - -outer.margin, - 0.5, - textangle=-90) - layout$annotations <- annotations - } - - # Main plot title. - layout$title <- built$plot$labels$title - - # Background color. - layout$plot_bgcolor <- toRGB(theme.pars$panel.background$fill) - layout$paper_bgcolor <- toRGB(theme.pars$plot.background$fill) - - # Legend. - layout$margin$r <- 10 - if (exists("increase_margin_r")) { - layout$margin$r <- 60 - } - layout$legend <- list(bordercolor = "transparent", - x = 1.01, - y = 0.075 * 0.5* length(trace.list) + 0.45, - xref="paper", yref="paper", - xanchor = "left", yanchor = "top") - - ## Legend hiding when guides(fill="none"). - legends.present <- unique(unlist(layer.legends)) - is.false <- function(x){ - is.logical(x) && length(x) == 1 && x == FALSE - } - is.none <- function(x){ - is.character(x) && length(x) == 1 && x == "none" - } - is.hidden <- function(x){ - is.false(x) || is.none(x) - } - layout$showlegend <- if(length(legends.present) == 0) FALSE else TRUE - for(a in legends.present){ - if(is.hidden(p$guides[[a]])){ - layout$showlegend <- FALSE + } # end of panel loop + + + # ------------------------------------------------------------------------ + # guide conversion + # Strategy: Obtain and translate the output of ggplot2:::guides_train(). + # To do so, we borrow some of the body of ggplot2:::guides_build(). + # ------------------------------------------------------------------------ + # will there be a legend? + gglayout$showlegend <- sum(unlist(lapply(traces, "[[", "showlegend"))) >= 1 + + # legend styling + gglayout$legend <- list( + bgcolor = toRGB(theme$legend.background$fill), + bordercolor = toRGB(theme$legend.background$colour), + borderwidth = unitConvert( + theme$legend.background[[linewidth_or_size(theme$legend.background)]], + "pixels", "width" + ), + font = text2font(theme$legend.text) + ) + + # Translate legend.position to plotly layout + legend_pos <- theme$legend.position %||% theme[["legend.position"]] + if (!is.null(legend_pos) && !identical(legend_pos, "none")) { + if (is.character(legend_pos)) { + gglayout$legend <- switch(legend_pos, + "bottom" = modifyList(gglayout$legend, list( + orientation = "h", x = 0.5, y = -0.15, xanchor = "center", yanchor = "top" + )), + "top" = modifyList(gglayout$legend, list( + orientation = "h", x = 0.5, y = 1.02, xanchor = "center", yanchor = "bottom" + )), + "left" = modifyList(gglayout$legend, list( + x = -0.15, y = 0.5, xanchor = "right", yanchor = "middle" + )), + "inside" = { + inside_pos <- theme$legend.position.inside %||% theme[["legend.position.inside"]] + if (is.numeric(inside_pos) && length(inside_pos) == 2) { + modifyList(gglayout$legend, list( + x = inside_pos[1], y = inside_pos[2], xanchor = "left", yanchor = "bottom" + )) + } else { + gglayout$legend + } + }, + gglayout$legend + ) + } else if (is.numeric(legend_pos) && length(legend_pos) == 2) { + gglayout$legend <- modifyList(gglayout$legend, list( + x = legend_pos[1], y = legend_pos[2], xanchor = "left", yanchor = "bottom" + )) } } - # Legend hiding from theme. - if(theme.pars$legend.position=="none"){ - layout$showlegend <- FALSE - } - - # Only show a legend title if there is at least 1 trace with - # showlegend=TRUE. - ggplot_labels <- ggplot2::labs(p)$labels - trace.showlegend <- sapply(trace.list, "[[", "showlegend") - if (any(trace.showlegend) && layout$showlegend && length(p$data)) { - # Retrieve legend title - temp.title <- guide_names(p) - legend.title <- if (length(unique(temp.title)) > 1){ - paste(temp.title, collapse = " / ") - } else { - unique(temp.title) - } - legend.title <- paste0("", legend.title, "") + + # if theme(legend.position = "none") is used, don't show a legend _or_ guide + if (npscales$n() == 0 || identical(theme$legend.position, "none")) { + gglayout$showlegend <- FALSE + } else { + # by default, guide boxes are vertically aligned + theme$legend.box <- theme$legend.box %||% "vertical" - # Create legend title element as an annotation - if (exists("annotations")) { - nann <- nann + 1 + # size of key (also used for bar in colorbar guide) + theme$legend.key.width <- theme$legend.key.width %||% theme$legend.key.size + theme$legend.key.height <- theme$legend.key.height %||% theme$legend.key.size + + # legend direction must be vertical + theme$legend.direction <- theme$legend.direction %||% "vertical" + if (!identical(theme$legend.direction, "vertical")) { + warning( + "plotly.js does not (yet) support horizontal legend items \n", + "You can track progress here: \n", + "https://github.com/plotly/plotly.js/issues/53 \n", + call. = FALSE + ) + theme$legend.direction <- "vertical" + } + + # justification of legend boxes + theme$legend.box.just <- theme$legend.box.just %||% c("center", "center") + # scales -> data for guides + gdefs <- if (inherits(plot$guides, "ggproto")) { + get_gdefs_ggproto(npscales$scales, theme, plot, layers, layer_data) } else { - annotations <- list() - nann <- 1 + get_gdefs(scales, theme, plot, layers) } - annotations[[nann]] <- list(text=legend.title, - x = layout$legend$x * 1.0154, - y = 0.075 * 0.5* length(trace.list) + 0.55, - showarrow=FALSE, - xref="paper", yref="paper", - xanchor="left", yanchor = "top", - textangle=0) - layout$annotations <- annotations - } - # Family font for text - if (!is.null(theme.pars$text$family)) { - layout$titlefont$family <- theme.pars$text$family - layout$legend$font$family <- theme.pars$text$family - } - - # Family font for title - if (!is.null(theme.pars$plot.title$family)) { - layout$titlefont$family <- theme.pars$plot.title$family - } - - # Family font for legend - if (!is.null(theme.pars$legend.text$family)) { - layout$legend$font$family <- theme.pars$legend.text$family - } - - # Bold, italic and bold.italic face for text - text_face <- theme.pars$text$face - if (!is.null(text_face)) { - if (text_face=="bold") { - layout$title <- paste0("", layout$title, "") - layout$yaxis$title <- paste0("", layout$yaxis$title, "") - layout$xaxis$title <- paste0("", layout$xaxis$title, "") - } else if (text_face=="italic") { - layout$title <- paste0("", layout$title, "") - layout$yaxis$title <- paste0("", layout$yaxis$title, "") - layout$xaxis$title <- paste0("", layout$xaxis$title, "") - } else if (text_face=="bold.italic") { - layout$title <- paste0("", layout$title, "") - layout$yaxis$title <- paste0("", layout$yaxis$title, "") - layout$xaxis$title <- paste0("", layout$xaxis$title, "") + + # colourbar -> plotly.js colorbar + colorbar <- compact(lapply(gdefs, gdef2trace, theme, gglayout)) + nguides <- length(colorbar) + gglayout$showlegend + # If we have 2 or more guides, set x/y positions accordingly + if (nguides >= 2) { + # place legend at the bottom + gglayout$legend$y <- 1 / nguides + gglayout$legend$yanchor <- "top" + # adjust colorbar position(s) + for (i in seq_along(colorbar)) { + colorbar[[i]]$marker$colorbar$yanchor <- "top" + colorbar[[i]]$marker$colorbar$len <- 1 / nguides + colorbar[[i]]$marker$colorbar$y <- 1 - (i - 1) * (1 / nguides) + } } + traces <- c(traces, colorbar) + + legendTitles <- compact(lapply(gdefs, function(g) if (inherits(g, "legend")) g$title else NULL)) + legendTitle <- paste(legendTitles, collapse = br()) + gglayout$legend$title <- list( + text = legendTitle, + font = text2font(theme$legend.title) + ) } - # Bold, italic and bold.italic face for title - title_face <- theme.pars$plot.title$face - if (!is.null(title_face)) { - if (title_face=="bold") { - layout$title <- paste0("", layout$title, "") - } else if (title_face=="italic") { - layout$title <- paste0("", layout$title, "") - } else if (title_face=="bold.italic") { - layout$title <- paste0("", layout$title, "") + # flip x/y in traces for flipped coordinates + # (we've already done appropriate flipping for axis objects) + if (inherits(plot$coordinates, "CoordFlip")) { + for (i in seq_along(traces)) { + tr <- traces[[i]] + # flipping logic for bar positioning is in geom2trace.GeomBar + if (!identical(tr$type, "bar")) traces[[i]][c("x", "y")] <- tr[c("y", "x")] + if (identical(tr$type, "box")) { + traces[[i]]$orientation <- "h" + traces[[i]]$hoverinfo <- "x" + } + names(traces[[i]])[grepl("^error_y$", names(tr))] <- "error_x" + names(traces[[i]])[grepl("^error_x$", names(tr))] <- "error_y" } } - # Bold, italic, and bold.italic face for axis title - title_face <- list(theme.pars$axis.title.y$face, - theme.pars$axis.title.x$face) - sub_elem <- c("yaxis", "xaxis") - - for (i in seq_along(title_face)) { - if (!is.null(title_face[[i]])) { - if (title_face[[i]]=="bold") { - layout[[sub_elem[i]]]["title"] <- paste0("", - layout[[sub_elem[i]]]["title"], - "") - } else if (title_face[[i]]=="italic") { - layout[[sub_elem[i]]]["title"] <- paste0("", - layout[[sub_elem[i]]]["title"], - "") - } else if (title_face[[i]]=="bold.italic") { - layout[[sub_elem[i]]]["title"] <- paste0("", - layout[[sub_elem[i]]]["title"], - "") + # Error bar widths in ggplot2 are on the range of the x/y scale, + # but plotly wants them in pixels: + for (xy in c("x", "y")) { + type <- if (xy == "x") "width" else "height" + err <- if (xy == "x") "error_y" else "error_x" + for (i in seq_along(traces)) { + e <- traces[[i]][[err]] + if (!is.null(e)) { + # TODO: again, "npc" is on device scale...we really want plot scale + w <- grid::unit(e$width %||% 0, "npc") + traces[[i]][[err]]$width <- unitConvert(w, "pixels", type) } } } - # If background elements are NULL, and background rect (rectangle) is defined: - rect_fill <- theme.pars$rect$fill - if (!is.null(rect_fill)) { - if (is.null(layout$plot_bgcolor)) - layout$plot_bgcolor <- toRGB(s(rect_fill)) - if (is.null(layout$paper_bgcolor)) - layout$paper_bgcolor <- toRGB(s(rect_fill)) - if (is.null(layout$legend$bgcolor)) - layout$legend$bgcolor <- toRGB(s(rect_fill)) - } - - if (length(trace.list) == 0) { - stop("No exportable traces") - } - - mode.mat <- matrix(NA, 3, 3) - rownames(mode.mat) <- colnames(mode.mat) <- c("markers", "lines", "none") - mode.mat["markers", "lines"] <- - mode.mat["lines", "markers"] <- "lines+markers" - mode.mat["markers", "none"] <- mode.mat["none", "markers"] <- "markers" - mode.mat["lines", "none"] <- mode.mat["none", "lines"] <- "lines" - merged.traces <- list() - not.merged <- trace.list - while(length(not.merged)){ - tr <- not.merged[[1]] - not.merged <- not.merged[-1] - # Are there any traces that have not yet been merged, and can be - # merged with tr? - can.merge <- logical(length(not.merged)) - for(other.i in seq_along(not.merged)){ - other <- not.merged[[other.i]] - criteria <- c() - for(must.be.equal in c("x", "y", "xaxis", "yaxis")){ - other.attr <- other[[must.be.equal]] - tr.attr <- tr[[must.be.equal]] - criteria[[must.be.equal]] <- - isTRUE(all.equal(other.attr, tr.attr)) && - unique(other$type, tr$type) == "scatter" - } - if(all(criteria)){ - can.merge[[other.i]] <- TRUE - } - } - to.merge <- not.merged[can.merge] - not.merged <- not.merged[!can.merge] - for(other in to.merge){ - new.mode <- tryCatch({ - mode.mat[tr$mode, other$mode] - }, error=function(e){ - NA - }) - if(is.character(new.mode) && !is.na(new.mode %||% NA)){ - tr$mode <- new.mode - } - attrs <- c("error_x", "error_y", "marker", "line") - for(attr in attrs){ - if(!is.null(other[[attr]]) && is.null(tr[[attr]])){ - tr[[attr]] <- other[[attr]] - } + # try to merge marker/line traces that have the same values for these props + props <- c("x", "y", "text", "type", "xaxis", "yaxis", "name") + hashes <- vapply(traces, function(x) digest::digest(x[names(x) %in% props]), character(1)) + modes <- vapply(traces, function(x) x$mode %||% "", character(1)) + nhashes <- length(unique(hashes)) + if (nhashes < length(traces)) { + mergedTraces <- vector("list", nhashes) + for (i in unique(hashes)) { + idx <- which(hashes %in% i) + mergedTraces[[i]] <- Reduce(modify_list, traces[idx]) + mergedTraces[[i]]$mode <- paste( + unique(unlist(lapply(traces[idx], "[[", "mode"))), + collapse = "+" + ) + # show one, show all + show <- vapply(traces[idx], function(tr) tr$showlegend %||% TRUE, logical(1)) + if (any(show)) { + mergedTraces[[i]]$showlegend <- TRUE } } - merged.traces[[length(merged.traces)+1]] <- tr - } - - # ------------------------------- - # avoid redundant legends entries - # ------------------------------- - # remove alpha from a color entry - rm_alpha <- function(x) { - if (length(x) == 0) return(x) - pat <- "^rgba\\(" - if (!grepl(pat, x)) return(x) - sub(",\\s*[0]?[.]?[0-9]+\\)$", ")", sub(pat, "rgb(", x)) - } - # convenient for extracting name/value of legend entries (ignoring alpha) - entries <- function(x, y) { - z <- try(x[[y]], silent = TRUE) - if (inherits(e, "try-error")) { - paste0(x$name, "-") + traces <- mergedTraces + } + + # better layout defaults (TODO: provide a mechanism for templating defaults) + gglayout$hovermode <- "closest" + ax <- grep("^[x-y]axis", names(gglayout)) + for (i in ax) { + gglayout[[i]]$hoverformat <- ".2f" + } + # If a trace isn't named, it shouldn't have additional hoverinfo + traces <- lapply(compact(traces), function(x) { x$name <- x$name %||% ""; x }) + + gglayout$width <- width %|D|% NULL + gglayout$height <- height %|D|% NULL + gglayout$barmode <- gglayout$barmode %||% "relative" + + l <- list( + data = setNames(traces, NULL), + layout = compact(gglayout), + # prevent autosize on doubleClick which clears ggplot2 margins + config = list(doubleClick = "reset"), + source = source + ) + # strip any existing 'AsIs' list elements of their 'AsIs' status. + # this is necessary since ggplot_build(qplot(1:10, fill = I("red"))) + # returns list element with their 'AsIs' class, + # which conflicts with our JSON unboxing strategy. + l <- rm_asis(l) + + # start build a plotly object with meta information about the ggplot + # first, translate layer mappings -> plotly attrs + mappingFormulas <- lapply(layers, function(x) { + mappings <- getAesMap(plot, x) + if (originalData) { + lapply(mappings, function(x) rlang::new_formula(lhs = NULL, rhs = x)) } else { - paste0(x$name, "-", rm_alpha(z)) + nms <- names(mappings) + setNames(lapply(nms, function(x) rlang::new_formula(lhs = NULL, rhs = as.name(x))), nms) } + }) + + return_dat <- if (originalData) layer_data else data + + # translate group aesthetics to data attributes + return_dat <- Map(function(x, y) { + if (is.null(y[["group"]])) return(x) + dplyr::group_by(x, !!rlang::as_quosure(y[["group"]])) + }, return_dat, mappingFormulas) + + # don't need to add group as an attribute anymore + mappingFormulas <- lapply(mappingFormulas, function(x) x[!grepl("^group$", names(x))]) + + ids <- lapply(seq_along(data), function(x) new_id()) + l$attrs <- setNames(mappingFormulas, ids) + l$attrs <- lapply(l$attrs, function(x) structure(x, class = "plotly_eval")) + # the build step removes the first attrs if no type exists + l$attrs[[1]][["type"]] <- l$data[[1]][["type"]] %||% "scatter" + + l$cur_data <- ids[[layerData]] + l$visdat <- setNames(lapply(return_dat, function(x) function(y) x), ids) + + l +} + + +# Due to the non-standard use of assign() in g2list() (above) +utils::globalVariables(c("groupDomains", "layers", "prestats_data", "scales", "sets")) + +# Get the "complete" set of theme elements and their calculated values +calculated_theme_elements <- function(plot) { + complete_theme <- ggfun("complete_theme") + if (is.function(complete_theme)) { + theme <- complete_theme(plot$theme) + elements <- names(theme) + } else { + theme <- ggfun("plot_theme")(plot) + elements <- names(which(sapply(theme, inherits, "element"))) } - fill_set <- unlist(lapply(merged.traces, entries, "fillcolor")) - line_set <- unlist(lapply(merged.traces, entries, c("line", "color"))) - mark_set <- unlist(lapply(merged.traces, entries, c("marker", "color"))) - mode_set <- lapply(merged.traces, "[[", "mode") - legend_intersect <- function(x, y) { - i <- intersect(x, y) - # restrict intersection to valid legend entries - i[grepl("-rgb[a]?\\(", i)] - } - # if there is a mark & line legend, get rid of line - t1 <- line_set %in% legend_intersect(mark_set, line_set) - # that is, unless the mode is 'lines+markers'... - t1 <- t1 & !(mode_set %in% "lines+markers") - # if there is a mark & fill legend, get rid of fill - t2 <- fill_set %in% legend_intersect(mark_set, fill_set) - # if there is a line & fill legend, get rid of fill - t3 <- fill_set %in% legend_intersect(line_set, fill_set) - t <- t1 | t2 | t3 - for (m in seq_along(merged.traces)) - if (isTRUE(merged.traces[[m]]$showlegend && t[m])) - merged.traces[[m]]$showlegend <- FALSE - - # Put the traces in correct order, according to any manually - # specified scales. This seems to be repetitive with the trace$rank - # attribute in layer2traces (which is useful for sorting traces that - # get different legend entries but come from the same geom, as in - # test-ggplot-legend.R), but in fact this is better since it could - # be used for sorting traces that come from different geoms - # (currently we don't have a test for this). TODO: write such a - # test, delete the trace$rank code, and have it work here instead. - trace.order <- unlist(trace.order.list) - ordered.traces <- if(length(trace.order)){ - trace.order.score <- seq_along(trace.order) - names(trace.order.score) <- trace.order - trace.name <- sapply(merged.traces, "[[", "name") - trace.score <- trace.order.score[trace.name] - merged.traces[order(trace.score)] - }else{ - merged.traces - } - - # Translate scale(labels) to trace name. - named.traces <- ordered.traces - for(trace.i in seq_along(named.traces)){ - tr.name <- named.traces[[trace.i]][["name"]] - new.name <- trace.name.map[[tr.name]] - if(!is.null(new.name)){ - named.traces[[trace.i]][["name"]] <- new.name - } + + for (i in elements) { + theme[[i]] <- ggplot2::calc_element(i, theme) } - # If coord_flip is defined, then flip x/y in each trace, and in - # each axis. - flipped.traces <- named.traces - flipped.layout <- layout - coord_cl <- sub("coord", "", tolower(class(built$plot$coordinates))) - if("flip" %in% coord_cl){ - if(!inherits(p$facet, "null")){ - stop("coord_flip + facet conversion not supported") + theme +} + + +#----------------------------------------------------------------------------- +# ggplotly 'utility' functions +#----------------------------------------------------------------------------- + +# convert ggplot2 sizes and grid unit(s) to pixels or normalized point coordinates +unitConvert <- function(u, to = c("npc", "pixels"), type = c("x", "y", "height", "width")) { + u <- verifyUnit(u) + + convert <- switch( + type[1], + x = grid::convertX, + y = grid::convertY, + width = grid::convertWidth, + height = grid::convertHeight + ) + # convert everything to npc first + if (inherits(u, "margin")) { + # margins consist of 4 parts: top, right, bottom, and left + uh <- grid::convertHeight(u, "npc") + uw <- grid::convertWidth(u, "npc") + u <- grid::unit(c(uh[1], uw[2], uh[3], uw[4]), "npc") + } else { + u <- convert(u, "npc") + } + if (to[1] == "pixels") { + if (inherits(u, "margin")) { + uh <- mm2pixels(grid::convertHeight(uh, "mm")) + uw <- mm2pixels(grid::convertWidth(uw, "mm")) + u <- c(uh[1], uw[2], uh[3], uw[4]) + } else { + u <- mm2pixels(convert(u, "mm")) } - for(trace.i in seq_along(flipped.traces)){ - tr <- flipped.traces[[trace.i]] - x <- tr[["x"]] - y <- tr[["y"]] - tr[["y"]] <- x - tr[["x"]] <- y - if (isTRUE(tr[["type"]] == "bar")) tr$orientation <- "h" - flipped.traces[[trace.i]] <- tr + } + as.numeric(u) +} + +# ggplot2 size is in millimeters. plotly is in pixels. To do this correctly, +# we need to know PPI/DPI of the display. I'm not sure of a decent way to do that +# from R, but it seems 96 is a reasonable assumption. +mm2pixels <- function(u) { + u <- verifyUnit(u) + if (any(getUnitType(u) != "mm")) { + stop("All units must be in millimeters") + } + (as.numeric(u) * 96) / 25.4 +} + +verifyUnit <- function(u) { + if (grid::is.unit(u)) return(u) + + ## the default unit in ggplot2 is millimeters (unless it's element_text()) + if (inherits(u, "element")) { + grid::unit(u[[linewidth_or_size(u)]] %||% 0, "points") + } else { + grid::unit(u %||% 0, "mm") + } +} + +# Use public API for getting the unit's type, if available +# https://github.com/ropensci/plotly/pull/1646#issue-331268260 +getUnitType <- function(u) { + tryNULL(get("unitType", envir = asNamespace("grid"))(u)) %||% + attr(u, "unit") +} + +# detect a blank theme element +is_blank <- function(x) { + inherits(x, "element_blank") && inherits(x, "element") +} + +# given text, and x/y coordinates on 0-1 scale, +# convert ggplot2::element_text() to plotly annotation +make_label <- function(txt = "", x, y, el = ggplot2::element_text(), ...) { + if (is_blank(el) || is.null(txt) || robust_nchar(txt) == 0 || length(txt) == 0) { + return(NULL) + } + angle <- el$angle %||% 0 + list(list( + text = txt, + x = x, + y = y, + showarrow = FALSE, + # TODO: hjust/vjust? + ax = 0, + ay = 0, + font = text2font(el), + xref = "paper", + yref = "paper", + textangle = -angle, + ... + )) +} + +has_facet <- function(x) { + inherits(x$facet, c("FacetGrid", "FacetWrap")) +} + +#' Estimate bounding box of a rotated string +#' +#' @param txt a character string of length 1 +#' @param angle sets the angle of the tick labels with respect to the +#' horizontal (e.g., `tickangle` of -90 draws the tick labels vertically) +#' @param size vertical size of a character +#' @references +#' https://www.dropbox.com/s/nc6968prgw8ne4w/bbox.pdf?dl=0 + +bbox <- function(txt = "foo", angle = 0, size = 12) { + # assuming the horizontal size of a character is roughly half of the vertical + n <- robust_nchar(txt) + if (sum(n) == 0) return(list(height = 0, width = 0)) + w <- size * (robust_nchar(txt) / 2) + angle <- abs(angle %||% 0) + # do the sensible thing in the majority of cases + if (angle == 0) return(list(height = size, width = w)) + if (angle == 90) return(list(height = w, width = size)) + # first, compute the hypotenus + hyp <- sqrt(size ^ 2 + w ^ 2) + list( + height = max(hyp * cos(90 - angle), size), + width = max(hyp * sin(90 - angle), w) + ) +} + +# create a plotly font object from ggplot2::element_text() +text2font <- function(x = ggplot2::element_text(), type = "height") { + list( + color = toRGB(x$colour), + family = font_family(x$family), + # TODO: what about the size of vertical text? + size = unitConvert(grid::unit(x$size %||% 0, "points"), "pixels", type) + ) +} + +# Replace a default font family, "", with thematic's font option (if set) +font_family <- function(family = "") { + if (!identical(family, "")) { + return(family) + } + if (!isNamespaceLoaded("thematic")) { + return("") + } + font <- asNamespace("thematic")$thematic_get_option("font", resolve = TRUE) + if (!length(font)) { + return("") + } + # font$families is a vector of families, but font.family wants to be a + # string (like CSS font-family), so make sure the names are unquoted, + # then quote them + families <- sub("'$", "", sub("^'", "", font$families)) + sprintf("'%s'", paste(families, collapse = "', '")) +} + +# wrap text in bold/italics according to the text "face" +faced <- function(txt, face = "plain") { + if (is.null(face)) face <- "plain" + x <- switch(face, + plain = txt, + bold = bold(txt), + italic = italic(txt), + bold.italic = bold(italic(txt)) + ) + # if, for some reason, a face we don't support is used, return the text + if (is.null(x)) txt else x +} +bold <- function(x) paste("", x, "") +italic <- function(x) paste("", x, "") + +# if a vector that has one unique value (ignoring missings), return that value +uniq <- function(x) { + u <- unique(x) + if (identical(u, NA) || length(u) == 0) return(u) + u <- u[!is.na(u)] + if (length(u) == 1) u else x +} + +# theme(strip.background) -> plotly.js rect shape +make_strip_rect <- function(xdom, ydom, theme, side = "top") { + rekt <- rect2shape(theme[["strip.background"]]) + stripTextX <- theme[["strip.text.x"]] %||% theme[["strip.text"]] + topSize <- + mm2pixels(grid::convertHeight(stripTextX$margin[1], "mm")) + + mm2pixels(grid::convertHeight(stripTextX$margin[3], "mm")) + + mm2pixels(grid::convertHeight(grid::unit(stripTextX$size, units = "points"), "mm")) + stripTextY <- theme[["strip.text.y"]] %||% theme[["strip.text"]] + rightSize <- + mm2pixels(grid::convertWidth(stripTextX$margin[2], "mm")) + + mm2pixels(grid::convertWidth(stripTextX$margin[4], "mm")) + + mm2pixels(grid::convertWidth(grid::unit(stripTextY$size, units = "points"), "mm")) + if ("right" %in% side) { + # x-padding should be accounted for in `layout.margin.r` + rekt$y0 <- ydom[1] + rekt$y1 <- ydom[2] + rekt$x0 <- 0 + rekt$x1 <- rightSize + rekt$xanchor <- xdom[2] + rekt$xsizemode <- "pixel" + } + if ("top" %in% side) { + rekt$x0 <- xdom[1] + rekt$x1 <- xdom[2] + rekt$y0 <- 0 + rekt$y1 <- topSize + rekt$yanchor <- ydom[2] + rekt$ysizemode <- "pixel" + } + list(rekt) +} + +# theme(panel.border) -> plotly.js rect shape +make_panel_border <- function(xdom, ydom, theme) { + # Use calc_element to get fully resolved element with inherited values + border <- ggplot2::calc_element("panel.border", theme) + if (is.null(border) || is_blank(border)) { + return(list()) + } + rekt <- rect2shape(border) + rekt$x0 <- xdom[1] + rekt$x1 <- xdom[2] + rekt$y0 <- ydom[1] + rekt$y1 <- ydom[2] + list(rekt) +} + +# element_rect -> plotly.js rect shape +rect2shape <- function(rekt = ggplot2::element_rect()) { + list( + type = "rect", + fillcolor = toRGB(rekt$fill), + line = list( + color = toRGB(rekt$colour), + width = unitConvert(rekt, "pixels", "width"), + linetype = lty2dash(rekt$linetype) + ), + yref = "paper", + xref = "paper", + layer = "below" + ) +} + +# We need access to internal ggplot2 functions in several places +# this helps us import functions in a way that R CMD check won't cry about +ggfun <- function(x) { + tryCatch(getFromNamespace(x, "ggplot2"), error = function(e) NULL) +} + +ggtype <- function(x, y = "geom") { + sub(y, "", tolower(class(x[[y]])[1])) +} + +# colourbar -> plotly.js colorbar +gdef2trace <- function(gdef, theme, gglayout) { + if (inherits(gdef, "colorbar")) { + # sometimes the key has missing values, which we can ignore + gdef$key <- gdef$key[!is.na(gdef$key$.value), ] + + # Put values on a 0-1 scale + # N.B. ggplot2 >v3.4.2 (specifically #4879) renamed bar to decor and also + # started returning normalized values for the key field + decor <- gdef$decor %||% gdef$bar + decor$value <- decor$value %||% decor$max + rng <- range(decor$value) + decor$value <- scales::rescale(decor$value, from = rng) + if (!"decor" %in% names(gdef)) { + gdef$key$.value <- scales::rescale(gdef$key$.value, from = rng) } - x <- layout[["xaxis"]] - y <- layout[["yaxis"]] - flipped.layout[["xaxis"]] <- y - flipped.layout[["yaxis"]] <- x + + vals <- lapply(gglayout[c("xaxis", "yaxis")], function(ax) { + res <- if (identical(ax$tickmode, "auto")) ax$ticktext else ax$tickvals + # if zero-length, return NULL to avoid subscript oob errors + res %||% NULL + }) + + list( + x = vals[[1]][[1]], + y = vals[[2]][[1]], + # essentially to prevent this getting merged at a later point + name = gdef$hash, + type = "scatter", + mode = "markers", + opacity = 0, + hoverinfo = "skip", + showlegend = FALSE, + # do everything on a 0-1 scale + marker = list( + color = c(0, 1), + colorscale = setNames(decor[c("value", "colour")], NULL), + colorbar = list( + bgcolor = toRGB(theme$legend.background$fill), + bordercolor = toRGB(theme$legend.background$colour), + borderwidth = unitConvert( + theme$legend.background[[linewidth_or_size(theme$legend.background)]], + "pixels", "width" + ), + thickness = unitConvert( + theme$legend.key.width, "pixels", "width" + ), + title = gdef$title, + titlefont = text2font(gdef$title.theme %||% theme$legend.title), + tickmode = "array", + ticktext = gdef$key$.label, + tickvals = gdef$key$.value, + tickfont = text2font(gdef$label.theme %||% theme$legend.text), + ticklen = 2, + len = 1/2 + ) + ) + ) + } else { + # if plotly.js gets better support for multiple legends, + # that conversion should go here + NULL } +} + + +getAesMap <- function(plot, layer) { + if (isTRUE(layer$inherit.aes)) { + modify_list(plot$mapping, layer$mapping) + } else { + layer$mapping + } +} + +# ------------------------------------------------------------------ +# Handle compatibility for changes in ggplot2 >v3.4.2 (specifically #5144), +# which moved away from scales_transform_df(), scales_train_df(), etc +# towards ggproto methods attached to `scales` +# ------------------------------------------------------------------ +scales_transform_df <- function(scales, df) { + if (is.function(scales$transform_df)) { + scales$transform_df(df) + } else { + ggfun("scales_transform_df")(df, scales = scales) + } +} + +scales_train_df <- function(scales, df) { + if (is.function(scales$train_df)) { + scales$train_df(df) + } else { + ggfun("scales_train_df")(df, scales = scales) + } +} + +scales_map_df <- function(scales, df) { + if (is.function(scales$map_df)) { + scales$map_df(df) + } else { + ggfun("scales_map_df")(df, scales = scales) + } +} + +scales_add_missing <- function(plot, aesthetics) { + if (is.function(plot$scales$add_missing)) { + plot$scales$add_missing(c("x", "y"), plot$plot_env) + } else { + ggfun("scales_add_missing")(plot, aesthetics, plot$plot_env) + } +} + +# ------------------------------------------------------------------------- +# Handle compatibility for changes in ggplot2 >v3.4.2 (specifically #4879), +# which away from guides_train(), guides_merge(), guides_geom() +# towards ggproto methods attached to `plot$guides` +# ------------------------------------------------------------------------- +get_gdefs_ggproto <- function(scales, theme, plot, layers, layer_data) { - l <- list(data = flipped.traces, layout = flipped.layout) + # Unfortunate duplication of logic in tidyverse/ggplot2#5428 + # which ensures a 1:1 mapping between aesthetics and scales + aesthetics <- lapply(scales, `[[`, "aesthetics") + scales <- rep.int(scales, lengths(aesthetics)) + aesthetics <- unlist(aesthetics, recursive = FALSE, use.names = FALSE) + + guides <- plot$guides$setup(scales, aesthetics = aesthetics) + guides$train(scales, plot$labels) + if (length(guides$guides) > 0) { + guides$merge() + guides$process_layers(layers, layer_data) + } + # Add old legend/colorbar classes to guide params so that ggplotly() code + # can continue to work the same way it always has + for (i in which(vapply(guides$guides, inherits, logical(1), "GuideColourbar"))) { + guides$params[[i]] <- prefix_class(guides$params[[i]], "colorbar") + } + for (i in which(vapply(guides$guides, inherits, logical(1), "GuideLegend"))) { + guides$params[[i]] <- prefix_class(guides$params[[i]], "legend") + } + guides$params +} - structure(add_boxed(rm_asis(l)), class = "plotly") +get_gdefs <- function(scales, theme, plot, layers) { + gdefs <- ggfun("guides_train")(scales, theme, plot$guides, plot$labels) + if (length(gdefs) > 0) { + gdefs <- ggfun("guides_merge")(gdefs) + gdefs <- ggfun("guides_geom")(gdefs, layers, plot$mapping) + } + gdefs } diff --git a/R/ggridges.R b/R/ggridges.R new file mode 100644 index 0000000000..afe34b6978 --- /dev/null +++ b/R/ggridges.R @@ -0,0 +1,272 @@ +# Get data for ridge plots +# +# @param data dataframe, the data returned by `ggplot2::ggplot_build()`. +# @param na.rm boolean, from params +# +# @return dataframe containing plotting data +# +get_ridge_data <- function(data, na.rm) { + if (isTRUE(na.rm)) { + data <- data[stats::complete.cases(data[c("x", "ymin", "ymax")]), ] + } + + #if dataframe is empty there's nothing to draw + if (nrow(data) == 0) return(list()) + + # remove all points that fall below the minimum height + data$ymax[data$height < data$min_height] <- NA + + # order data + data <- data[order(data$ymin, data$x), ] + + # remove missing points + missing_pos <- !stats::complete.cases(data[c("x", "ymin", "ymax")]) + ids <- cumsum(missing_pos) + 1 + data$group <- paste0(data$group, "-", ids) + data[!missing_pos, ] +} + + +# Prepare plotting data for ggridges +# @param closed boolean, should the polygon be closed at bottom (TRUE for +# geom_density_ridges2, FALSE for geom_density_ridges) +prepare_ridge_chart <- function(data, prestats_data, layout, params, p, closed = FALSE, ...) { + d <- get_ridge_data(data, params$na.rm) + + # split data into separate groups + groups <- split(d, factor(d$group)) + + # sort list so lowest ymin values are in the front (opposite of ggridges) + o <- order( + unlist( + lapply( + groups, + function(data) data$ymin[1] + ) + ), + decreasing = FALSE + ) + groups <- groups[o] + + # for each group create a density + vline + point as applicable + res <- lapply( + rev(groups), + function(x) { + draw_stuff <- split(x, x$datatype) + + # first draw the basic density ridge part + stopifnot(!is.null(draw_stuff$ridgeline)) + + d2 <- d1 <- draw_stuff$ridgeline + if (!closed) d2$colour <- NA # no colour for density bottom line + + d1$y <- d1$ymax + d1$alpha <- 1 # don't use fill alpha for line alpha + + ridges <- list( + to_basic(prefix_class(d2, "GeomDensity")), + to_basic(prefix_class(d1, "GeomLine")) + ) + # attach the crosstalk group/set + ridges[[1]] <- structure(ridges[[1]], set = attr(d2, 'set')) # Density + ridges[[2]] <- structure(ridges[[2]], set = attr(d1, 'set')) # Line + + if ('vline' %in% names(draw_stuff)) { + draw_stuff$vline$xend <- draw_stuff$vline$x + draw_stuff$vline$yend <- draw_stuff$vline$ymax + draw_stuff$vline$y <- draw_stuff$vline$ymin + draw_stuff$vline$colour <- draw_stuff$vline$vline_colour + draw_stuff$vline$size <- draw_stuff$vline$vline_size + + vlines <- to_basic( + prefix_class(draw_stuff$vline, 'GeomSegment'), + prestats_data, layout, params, p, ... + ) + # attach the crosstalk group/set + vlines <- structure(vlines, set = attr(draw_stuff$vline, 'set')) + ridges <- c(ridges, list(vlines)) + } + + # points + if ('point' %in% names(draw_stuff)) { + draw_stuff$point$y <- draw_stuff$point$ymin + + # use point aesthetics + draw_stuff$point$shape <- draw_stuff$point$point_shape + draw_stuff$point$fill <- draw_stuff$point$point_fill + draw_stuff$point$stroke <- draw_stuff$point$point_stroke + draw_stuff$point$alpha <- draw_stuff$point$point_alpha + draw_stuff$point$colour <- draw_stuff$point$point_colour + draw_stuff$point$size <- draw_stuff$point$point_size + + points <- to_basic( + prefix_class(as.data.frame(draw_stuff$point), # remove ridge classes + 'GeomPoint'), + prestats_data, layout, params, p, ... + ) + # attach the crosstalk group/set + points <- structure(points, set = attr(draw_stuff$point, 'set')) + ridges <- c(ridges, list(points)) + } + + ridges + } + ) + res +} + + +#' @export +to_basic.GeomDensityRidgesGradient <- function(data, prestats_data, layout, params, p, ...) { + res <- prepare_ridge_chart(data, prestats_data, layout, params, p, FALSE, ...) + # set list depth to 1 + unlist(res, recursive = FALSE) +} + + +#' @export +to_basic.GeomDensityRidges <- function(data, prestats_data, layout, params, p, ...) { + to_basic( + prefix_class(data, 'GeomDensityRidgesGradient'), + prestats_data, layout, params, p, + closed = FALSE, + ... + ) +} + + +#' @export +to_basic.GeomDensityRidges2 <- function(data, prestats_data, layout, params, p, ...) { + to_basic( + prefix_class(data, 'GeomDensityRidgesGradient'), + prestats_data, layout, params, p, + closed = TRUE, + ... + ) +} + + + +#' @export +to_basic.GeomDensityLine <- function(data, prestats_data, layout, params, p, ...) { + to_basic(prefix_class(data, 'GeomDensity')) +} + + + +#' @export +to_basic.GeomRidgeline <- function(data, prestats_data, layout, params, p, ...) { + to_basic( + prefix_class(data, 'GeomDensityRidgesGradient'), + prestats_data, layout, params, p, ... + ) +} + + +#' @export +to_basic.GeomRidgelineGradient <- function(data, prestats_data, layout, params, p, ...) { + d <- get_ridge_data(data, params$na.rm) + + # split data into separate groups + groups <- split(d, factor(d$group)) + + # sort list so lowest ymin values are in the front (opposite of ggridges) + o <- order( + unlist( + lapply( + groups, + function(data) data$ymin[1] + ) + ), + decreasing = FALSE + ) + groups <- groups[o] + + # for each group create a density + vline + point as applicable + res <- lapply( + rev(groups), + function(x) { + + draw_stuff <- split(x, x$datatype) + + # first draw the basic density ridge part + + stopifnot(!is.null(draw_stuff$ridgeline)) + d2 <- d1 <- draw_stuff$ridgeline + d2$colour <- NA # no colour for density area + d2$fill_plotlyDomain <- NA + + d1$y <- d1$ymax + d1$alpha <- 1 # don't use fill alpha for line alpha + + # calculate all the positions where the fill type changes + fillchange <- c(FALSE, d2$fill[2:nrow(d2)] != d2$fill[1:nrow(d2)-1]) + + # and where the id changes + idchange <- c(TRUE, d2$group[2:nrow(d2)] != d2$group[1:nrow(d2)-1]) + + # make new ids from all changes in fill style or original id + d2$ids <- cumsum(fillchange | idchange) + + # get fill color for all ids + fill <- d2$fill[fillchange | idchange] + + # rows to be duplicated + dupl_rows <- which(fillchange & !idchange) + d2$y <- d2$ymax + if (length(dupl_rows) > 0) { + rows <- d2[dupl_rows, ] + rows$ids <- d2$ids[dupl_rows-1] + rows <- rows[rev(seq_len(nrow(rows))), , drop = FALSE] + # combine original and duplicated d2 + d2 <- rbind(d2, rows) + } + + # split by group to make polygons + d2 <- tibble::deframe(tidyr::nest(d2, .by = 'ids')) + + ridges <- c( + d2, + list( + to_basic(prefix_class(d1, "GeomLine")) + ) + ) + + ridges + } + ) + # set list depth to 1 + unlist(res, recursive = FALSE) +} + + + +#' @export +geom2trace.GeomRidgelineGradient <- function(data, params, p) { + # munching for polygon + positions <- data.frame( + x = c(data$x , rev(data$x)), + y = c(data$ymax, rev(data$ymin)) + ) + + L <- list( + x = positions[["x"]], + y = positions[["y"]], + text = uniq(data[["hovertext"]]), + key = data[["key"]], + customdata = data[["customdata"]], + frame = data[["frame"]], + ids = positions[["ids"]], + type = "scatter", + mode = "lines", + line = list( + width = aes2plotly(data, params, linewidth_or_size(GeomPolygon)), + color = toRGB('black'), + dash = aes2plotly(data, params, "linetype") + ), + fill = "toself", + fillcolor = toRGB(unique(data$fill[1])), + hoveron = hover_on(data) + ) + compact(L) +} diff --git a/R/group2NA.R b/R/group2NA.R new file mode 100644 index 0000000000..78af437ed6 --- /dev/null +++ b/R/group2NA.R @@ -0,0 +1,102 @@ +#' Separate groups with missing values +#' +#' This function is used internally by plotly, but may also be useful to some +#' power users. The details section explains when and why this function is useful. +#' +#' @details If a group of scatter traces share the same non-positional characteristics +#' (i.e., color, fill, etc), it is more efficient to draw them as a single trace +#' with missing values that separate the groups (instead of multiple traces), +#' In this case, one should also take care to make sure +#' \href{https://plotly.com/r/reference/#scatter-connectgaps}{connectgaps} +#' is set to `FALSE`. +#' +#' @param data a data frame. +#' @param groupNames character vector of grouping variable(s) +#' @param nested other variables that group should be nested +#' (i.e., ordered) within. +#' @param ordered a variable to arrange by (within nested & groupNames). This +#' is useful primarily for ordering by x +#' @param retrace.first should the first row of each group be appended to the +#' last row? This is useful for enclosing polygons with lines. +#' @export +#' @return a data.frame with rows ordered by: `nested`, +#' then `groupNames`, then `ordered`. As long as `groupNames` +#' contains valid variable names, new rows will also be inserted to separate +#' the groups. +#' @examplesIf interactive() +#' +#' # note the insertion of new rows with missing values +#' group2NA(mtcars, "vs", "cyl") +#' +#' # need to group lines by city somehow! +#' plot_ly(txhousing, x = ~date, y = ~median) %>% add_lines() +#' +#' # instead of using group_by(), you could use group2NA() +#' tx <- group2NA(txhousing, "city") +#' plot_ly(tx, x = ~date, y = ~median) %>% add_lines() +#' +#' # add_lines() will ensure paths are sorted by x, but this is equivalent +#' tx <- group2NA(txhousing, "city", ordered = "date") +#' plot_ly(tx, x = ~date, y = ~median) %>% add_paths() +#' + +group2NA <- function(data, groupNames = "group", nested = NULL, ordered = NULL, + retrace.first = inherits(data, "GeomPolygon")) { + + if (NROW(data) == 0) return(data) + + # for restoring class information on exit + datClass <- oldClass(data) + + # data.table doesn't play nice with list-columns + if (inherits(data, "sf")) data <- fortify_sf(data) + + # evaluate this lazy argument now (in case we change class of data) + retrace <- force(retrace.first) + + # sanitize variable names (TODO: throw warnings if non-existing vars are referenced?) + groupNames <- groupNames[groupNames %in% names(data)] + nested <- nested[nested %in% names(data)] + ordered <- ordered[ordered %in% names(data)] + + dt <- data.table::as.data.table(data) + + # if group doesn't exist, just order the rows and exit + if (!length(groupNames)) { + keyVars <- c(nested, ordered) + if (length(keyVars)) data.table::setorderv(dt, cols = keyVars) + return(structure(dt, class = datClass)) + } + + # order the rows + data.table::setorderv(dt, cols = c(nested, groupNames, ordered)) + + # when connectgaps=FALSE, inserting NAs ensures each "group" + # will be visually distinct https://plotly.com/r/reference/#scatter-connectgaps + # also, retracing is useful for creating polygon(s) via scatter trace(s) + keyVars <- c(nested, groupNames) + keyNum <- length(keyVars) + 1 + idx <- if (retrace) { + dt[, c(.I, .I[1], NA), by = keyVars][[keyNum]] + } else { + dt[, c(.I, NA), by = keyVars][[keyNum]] + } + dt <- dt[idx] + + # remove NAs that unnecessarily seperate nested groups + # (at least internally, nested really tracks trace index, meaning we don't need + # to seperate them) + NAidx <- which(is.na(idx)) + for (i in seq_along(keyVars)) { + dt[[keyVars[[i]]]][NAidx] <- dt[[keyVars[[i]]]][NAidx - 1] + } + if (length(nested)) { + dt <- dt[ dt[, .I[-.N], by = nested][[length(nested) + 1]] ] + } else { + dt <- dt[-.N] + } + + structure(dt, class = datClass) +} + +utils::globalVariables(c(".I", ".N")) diff --git a/R/helpers.R b/R/helpers.R new file mode 100644 index 0000000000..8018ce0db9 --- /dev/null +++ b/R/helpers.R @@ -0,0 +1,237 @@ +#' Modify the colorbar +#' +#' @param p a plotly object +#' @param ... arguments are documented here +#' \url{https://plotly.com/r/reference/#scatter-marker-colorbar}. +#' @param limits numeric vector of length 2. Set the extent of the colorbar scale. +#' @param which colorbar to modify? Should only be relevant for subplots with +#' multiple colorbars. +#' @author Carson Sievert +#' @export +#' @examplesIf interactive() || !identical(.Platform$OS.type, "windows") +#' +#' p <- plot_ly(mtcars, x = ~wt, y = ~mpg, color = ~cyl) +#' +#' # pass any colorbar attribute -- +#' # https://plotly.com/r/reference/#scatter-marker-colorbar +#' colorbar(p, len = 0.5) +#' +#' # Expand the limits of the colorbar +#' colorbar(p, limits = c(0, 20)) +#' # values outside the colorbar limits are considered "missing" +#' colorbar(p, limits = c(5, 6)) +#' +#' # also works on colorbars generated via a z value +#' corr <- cor(diamonds[vapply(diamonds, is.numeric, logical(1))]) +#' plot_ly(x = rownames(corr), y = colnames(corr), z = corr) %>% +#' add_heatmap() %>% +#' colorbar(limits = c(-1, 1)) + +colorbar <- function(p, ..., limits = NULL, which = 1) { + colorbar_built(plotly_build(p), ..., limits = limits, which = which) +} + +colorbar_built <- function(p, ..., limits = NULL, which = 1) { + + isBar <- vapply(p$x$data, is.colorbar, logical(1)) + if (sum(isBar) == 0) { + warning("Didn't find a colorbar to modify.", call. = FALSE) + return(p) + } + + indicies <- which(isBar)[which] + + for (i in indicies) { + + tr <- p$x$data[[i]] + hasZcolor <- inherits(tr, "zcolor") + + # retrain limits of the colorscale + if (!is.null(limits)) { + limits <- sort(limits) + if (hasZcolor) { + z <- p$x$data[[i]][["z"]] + if (!is.null(dz <- dim(z))) { + z <- c(z) + } + z[z < limits[1] | limits[2] < z] <- NA + if (!is.null(dz)) dim(z) <- dz + p$x$data[[i]]$z <- z + p$x$data[[i]]$zmin <- limits[1] + p$x$data[[i]]$zmax <- limits[2] + } else { + # since the colorscale is in a different trace, retrain all traces + # TODO: without knowing which traces are tied to the colorscale, + # there are always going to be corner-cases where limits are applied + # to more traces than it should + p$x$data <- lapply(p$x$data, function(x) { + type <- x[["type"]] %||% "scatter" + col <- x$marker[["color"]] + if (has_color_array(type, "marker") && is.numeric(col)) { + x$marker[["color"]][col < limits[1] | limits[2] < col] <- default(NA) + x$marker[["cmin"]] <- default(limits[1]) + x$marker[["cmax"]] <- default(limits[2]) + } + col <- x$line[["color"]] + if (has_color_array(type, "line") && is.numeric(col)) { + x$line[["color"]][col < limits[1] | limits[2] < col] <- default(NA) + x$line[["cmin"]] <- default(limits[1]) + x$line[["cmax"]] <- default(limits[2]) + } + x + }) + } + } + + # pass along ... to the colorbar + if (hasZcolor) { + p$x$data[[i]]$colorbar <- modify_list(tr$colorbar, list(...)) + } else { + p$x$data[[i]]$marker$colorbar <- modify_list(tr$marker$colorbar, list(...)) + } + } + + p +} + + +#' Hide guides (legends and colorbars) +#' +#' @param p a plotly object. +#' @export +#' @seealso [hide_legend()], [hide_colorbar()] +#' + +hide_guides <- function(p) { + hide_legend(hide_colorbar(p)) +} + + +#' Hide color bar(s) +#' +#' @param p a plotly object. +#' @export +#' @seealso [hide_legend()] +#' @examplesIf interactive() || !identical(.Platform$OS.type, "windows") +#' +#' p <- plot_ly(mtcars, x = ~wt, y = ~cyl, color = ~cyl) +#' hide_colorbar(p) +#' +hide_colorbar <- function(p) { + p <- plotly_build(p) + for (i in seq_along(p$x$data)) { + trace <- p$x$data[[i]] + if (has_attr(trace$type, "showscale")) { + p$x$data[[i]]$showscale <- default(FALSE) + } + if (has_attr(trace$type, "marker")) { + p$x$data[[i]]$marker$showscale <- default(FALSE) + } + } + p +} + +#' Hide legend +#' +#' @param p a plotly object. +#' @export +#' @seealso [hide_colorbar()] +#' @examplesIf interactive() || !identical(.Platform$OS.type, "windows") +#' +#' p <- plot_ly(mtcars, x = ~wt, y = ~cyl, color = ~factor(cyl)) +#' hide_legend(p) + +hide_legend <- function(p) { + if (ggplot2::is.ggplot(p)) { + p <- plotly_build(p) + } + p$x$.hideLegend <- TRUE + p +} + +#' Convert trace types to WebGL +#' +#' @param p a plotly or ggplot object. +#' @export +#' @examplesIf interactive() || !identical(.Platform$OS.type, "windows") +#' +#' # currently no bargl trace type +#' toWebGL(ggplot() + geom_bar(aes(1:10))) +#' toWebGL(qplot(1:10, 1:10)) +#' +toWebGL <- function(p) { + if (ggplot2::is.ggplot(p)) { + p <- plotly_build(p) + } + p$x$.plotlyWebGl <- TRUE + p +} + + +#' Create a complete empty plotly graph. +#' +#' Useful when used with [subplot()] +#' +#' @param ... arguments passed onto [plot_ly()] +#' +#' @export +plotly_empty <- function(...) { + eaxis <- list( + showticklabels = FALSE, + showgrid = FALSE, + zeroline = FALSE + ) + layout(plot_ly(...), xaxis = eaxis, yaxis = eaxis) +} + + +#' Encode a raster object as a data URI +#' +#' Encode a raster object as a data URI, which is suitable for +#' use with `layout()` \href{https://plotly.com/r/reference/#layout-images}{images}. +#' This is especially convenient for embedding raster images on a plot in +#' a self-contained fashion (i.e., so they don't depend on external URL links). +#' +#' @param r an object coercable to a raster object via [as.raster()] +#' @param ... arguments passed onto [as.raster()]. +#' @author Carson Sievert +#' @export +#' @references +#' @examplesIf interactive() || !identical(.Platform$OS.type, "windows") +#' +#' # a red gradient (from ?as.raster) +#' r <- as.raster(matrix(hcl(0, 80, seq(50, 80, 10)), nrow = 4, ncol = 5)) +#' plot(r) +#' +#' # embed the raster as an image +#' plot_ly(x = 1, y = 1) %>% +#' layout( +#' images = list(list( +#' source = raster2uri(r), +#' xref = "paper", +#' yref = "paper", +#' x = 0, y = 0, +#' sizex = 0.5, sizey = 0.5, +#' xanchor = "left", yanchor = "bottom" +#' )) +#' ) + +raster2uri <- function(r, ...) { + try_library("png", "raster2uri") + # should be 4 x n matrix + if (inherits(r, "nativeRaster")) { + # png::writePNG directly supports nativeRaster objects + png <- r + } else { + r <- grDevices::as.raster(r, ...) + rgbs <- col2rgb(c(r), alpha = T) / 255 + nr <- dim(r)[1] + nc <- dim(r)[2] + reds <- matrix(rgbs[1, ], nrow = nr, ncol = nc, byrow = TRUE) + greens <- matrix(rgbs[2, ], nrow = nr, ncol = nc, byrow = TRUE) + blues <- matrix(rgbs[3, ], nrow = nr, ncol = nc, byrow = TRUE) + alphas <- matrix(rgbs[4, ], nrow = nr, ncol = nc, byrow = TRUE) + png <- array(c(reds, greens, blues, alphas), dim = c(dim(r), 4)) + } + base64enc::dataURI(png::writePNG(png), mime = "image/png") +} diff --git a/R/highlight.R b/R/highlight.R new file mode 100644 index 0000000000..17434f92e5 --- /dev/null +++ b/R/highlight.R @@ -0,0 +1,233 @@ +#' Query graphical elements in multiple linked views +#' +#' This function sets a variety of options for brushing (i.e., highlighting) +#' multiple plots. These options are primarily designed for linking +#' multiple plotly graphs, and may not behave as expected when linking +#' plotly to another htmlwidget package via crosstalk. In some cases, +#' other htmlwidgets will respect these options, such as persistent selection +#' in leaflet (see `demo("highlight-leaflet", package = "plotly")`). +#' +#' @param p a plotly visualization. +#' @param on turn on a selection on which event(s)? To disable on events +#' altogether, use `NULL`. Currently the following are supported: +#' \itemize{ +#' \item `'plotly_click'` +#' \item `'plotly_hover'` +#' \item `'plotly_selected'`: triggered through rectangular +#' (layout.dragmode = 'select') or lasso (layout.dragmode = 'lasso') brush. +#' } +#' @param off turn off a selection on which event(s)? To disable off +#' events altogether, use `NULL`. Currently the following are supported: +#' \itemize{ +#' \item `'plotly_doubleclick'`: triggered on a double mouse click while +#' (layout.dragmode = 'zoom') or (layout.dragmode = 'pan') +#' \item `'plotly_deselect'`: triggered on a double mouse click while +#' (layout.dragmode = 'select') or (layout.dragmode = 'lasso') +#' \item `'plotly_relayout'`: triggered whenever axes are rescaled +#' (i.e., clicking the home button in the modebar) or whenever the height/width +#' of the plot changes. +#' } +#' @param persistent should selections persist (i.e., accumulate)? We often +#' refer to the default (`FALSE`) as a 'transient' selection mode; +#' which is recommended, because one may switch from 'transient' to +#' 'persistent' selection by holding the shift key. +#' @param dynamic should a widget for changing selection colors be included? +#' @param color character string of color(s) to use for +#' highlighting selections. See [toRGB()] for valid color +#' specifications. If `NULL` (the default), the color of selected marks +#' are not altered. +#' @param selectize whether or not to render a selectize.js widget for selecting +#' [highlight_key()] values. A list of additional selectize.js options may +#' also be provided. The label used for this widget should be set via the +#' `groupName` argument of [highlight_key()]. +#' @param defaultValues a vector of values for setting a "default selection". +#' These values should match the key attribute. +#' @param opacityDim a number between 0 and 1 used to reduce the +#' opacity of non-selected traces (by multiplying with the existing opacity). +#' @param selected attributes of the selection, see [attrs_selected()]. +#' @param debounce amount of time to wait before firing an event (in milliseconds). +#' The default of 0 means do not debounce at all. +#' Debouncing is mainly useful when `on = "plotly_hover"` to avoid firing too many events +#' when users clickly move the mouse over relevant graphical marks. +#' @param ... currently not supported. +#' @export +#' @author Carson Sievert +#' @references \url{https://plotly-r.com/client-side-linking.html} +#' @seealso [attrs_selected()] +#' @examplesIf interactive() +#' +#' # These examples are designed to show you how to highlight/brush a *single* +#' # view. For examples of multiple linked views, see `demo(package = "plotly")` +#' +#' d <- highlight_key(txhousing, ~city) +#' p <- ggplot(d, aes(date, median, group = city)) + geom_line() +#' gg <- ggplotly(p, tooltip = "city") +#' highlight(gg, dynamic = TRUE) +#' +#' # supply custom colors to the brush +#' cols <- toRGB(RColorBrewer::brewer.pal(3, "Dark2"), 0.5) +#' highlight(gg, on = "plotly_hover", color = cols, dynamic = TRUE) +#' +#' # Use attrs_selected() for complete control over the selection appearance +#' # note any relevant colors you specify here should override the color argument +#' s <- attrs_selected( +#' showlegend = TRUE, +#' mode = "lines+markers", +#' marker = list(symbol = "x") +#' ) +#' +#' highlight(layout(gg, showlegend = TRUE), selected = s) +#' + +highlight <- function(p, on = "plotly_click", off, + persistent = getOption("persistent", FALSE), + dynamic = FALSE, color = NULL, + selectize = FALSE, defaultValues = NULL, + opacityDim = getOption("opacityDim", 0.2), + selected = attrs_selected(), debounce = 0, + ...) { + + # currently ... is not-supported and will catch + # some arguments we supported at one point + dots <- list(...) + if (length(dots)) { + warning( + "The following arguments are not supported:\n", + toString(names(dots)), "\n", + "Arguments such as: hoverinfo and showInLegend \n", + "have been replaced by selected and other", + call. = FALSE + ) + } + + if (opacityDim < 0 || 1 < opacityDim) { + stop("opacityDim must be between 0 and 1", call. = FALSE) + } + if (dynamic && length(color) < 2) { + message("Adding more colors to the selection color palette.") + color <- c(color, RColorBrewer::brewer.pal(4, "Set1")) + } + if (!dynamic && length(color) > 1) { + warning( + "Can only use a single color for selections when `dynamic = FALSE`.", + call. = FALSE + ) + color <- color[1] + } + + # attach HTML dependencies (these libraries are used in the HTMLwidgets.renderValue() method) + # TODO: only attach these when keys are present! + if (!identical(selectize, FALSE)) { + p$dependencies <- c(p$dependencies, list(selectizeLib())) + } + if (dynamic) { + p$dependencies <- c(p$dependencies, list(colourPickerLib())) + } + + + # TODO: expose unhover? + off_options <- paste0( + "plotly_", c("doubleclick", "deselect", "relayout") + ) + if (missing(off)) { + off_default <- switch( + on %||% "", + plotly_selecting = , + plotly_selected = "plotly_deselect", + plotly_click = "plotly_doubleclick", + plotly_hover = "plotly_doubleclick" + ) + off <- default(off_default %||% "plotly_relayout") + } + + if (isTRUE(persistent)) { + message( + "We recommend setting `persistent` to `FALSE` (the default) because ", + "persistent selection mode can now be used by holding the shift key ", + "(while triggering the `on` event)." + ) + } + + # main (non-plotly.js) spec passed along to HTMLwidgets.renderValue() + p$x$highlight <- list( + # NULL may be used to disable on/off events + on = if (!is.null(on)) match.arg(on, paste0("plotly_", c("click", "hover", "selected", "selecting"))), + off = if (is.default(off)) off else if (!is.null(off)) match.arg(off, off_options), + persistent = persistent, + dynamic = dynamic, + # TODO: convert to hex...see colourpicker:::formatHEX() + color = toRGB(color), + selectize = selectize, + defaultValues = defaultValues, + opacityDim = opacityDim, + selected = selected, + debounce = debounce + ) + + p +} + +#' Specify attributes of selection traces +#' +#' By default the name of the selection trace derives from the selected values. +#' +#' +#' @param opacity a number between 0 and 1 specifying the overall opacity of +#' the selected trace +#' @param ... other trace attributes attached to the selection trace. +#' @export +#' @author Carson Sievert + +attrs_selected <- function(opacity = 1, ...) { + if (opacity < 0 || 1 < opacity) { + stop("opacity must be between 0 and 1", call. = FALSE) + } + + args <- list( + opacity = opacity + ) + + # TODO: verify attr names... maybe that should happen in the build step? + dots <- list(...) + + + c(dots, args) +} + + +# ---------------------------------------------------------------------------- +# Utility functions +# ---------------------------------------------------------------------------- + + +highlight_defaults <- function() { + args <- formals(highlight)[-1] + # have to evaluate args now that some of them are functions... + compact(lapply(args, function(x) tryNULL(eval(x)))) +} + +selectizeLib <- function(bootstrap = TRUE) { + htmltools::htmlDependency( + name = "selectize", + version = "0.12.0", + package = "plotly", + src = dependency_dir("selectize"), + stylesheet = if (bootstrap) "selectize.bootstrap3.css", + script = "selectize.min.js" + ) +} + +colourPickerLib <- function() { + htmltools::htmlDependency( + name = "colourpicker", + version = "1.1", + package = "plotly", + src = dependency_dir("colourpicker"), + stylesheet = "colourpicker.min.css", + script = "colourpicker.min.js" + ) +} + +dependency_dir <- function(...) { + file.path('htmlwidgets', 'lib', ...) +} diff --git a/R/imports.R b/R/imports.R new file mode 100644 index 0000000000..fa7aaa2cd3 --- /dev/null +++ b/R/imports.R @@ -0,0 +1,176 @@ +#' @import ggplot2 +#' @importFrom grDevices col2rgb extendrange dev.list dev.off rgb as.raster +#' @importFrom graphics layout +#' @importFrom utils getFromNamespace modifyList data packageVersion browseURL str file.edit +#' @importFrom stats setNames complete.cases quantile is.leaf +#' @importFrom tidyr unnest +#' @importFrom viridisLite viridis +#' @importFrom jsonlite toJSON parse_json read_json +#' @importFrom httr RETRY content config add_headers authenticate stop_for_status warn_for_status write_disk +#' @importFrom htmlwidgets createWidget sizingPolicy saveWidget onRender prependContent +#' @importFrom tibble as_tibble +#' @importFrom htmltools browsable tagList tags div +#' @importFrom purrr transpose +#' @importFrom tools file_ext file_path_sans_ext +#' @importFrom data.table as.data.table setorderv +#' @importFrom rlang eval_tidy !! !!! +NULL + + +#' @importFrom dplyr mutate +#' @name mutate +#' @rdname reexports +#' @export +dplyr::mutate + +#' @importFrom dplyr mutate_ +#' @name mutate_ +#' @rdname reexports +#' @export +dplyr::mutate_ + +#' @importFrom dplyr transmute +#' @name transmute +#' @rdname reexports +#' @export +dplyr::transmute + +#' @importFrom dplyr transmute_ +#' @name transmute_ +#' @rdname reexports +#' @export +dplyr::transmute_ + +#' @importFrom dplyr select +#' @name select +#' @rdname reexports +#' @export +dplyr::select + +#' @importFrom dplyr select_ +#' @name select_ +#' @rdname reexports +#' @export +dplyr::select_ + +#' @importFrom dplyr rename +#' @name rename +#' @rdname reexports +#' @export +dplyr::rename + +#' @importFrom dplyr rename_ +#' @name rename_ +#' @rdname reexports +#' @export +dplyr::rename_ + +#' @importFrom dplyr group_by +#' @name group_by +#' @rdname reexports +#' @export +dplyr::group_by + +#' @importFrom dplyr group_by_ +#' @name group_by_ +#' @rdname reexports +#' @export +dplyr::group_by_ + +#' @importFrom dplyr groups +#' @name groups +#' @rdname reexports +#' @export +dplyr::groups + +#' @importFrom dplyr ungroup +#' @name ungroup +#' @rdname reexports +#' @export +dplyr::ungroup + +#' @importFrom dplyr summarise +#' @name summarise +#' @rdname reexports +#' @export +dplyr::summarise + +#' @importFrom dplyr summarise_ +#' @name summarise_ +#' @rdname reexports +#' @export +dplyr::summarise_ + +#' @importFrom dplyr do +#' @name do +#' @rdname reexports +#' @export +dplyr::do + +#' @importFrom dplyr do_ +#' @name do_ +#' @rdname reexports +#' @export +dplyr::do_ + +#' @importFrom dplyr arrange +#' @name arrange +#' @rdname reexports +#' @export +dplyr::arrange + +#' @importFrom dplyr arrange_ +#' @name arrange_ +#' @rdname reexports +#' @export +dplyr::arrange_ + +#' @importFrom dplyr distinct +#' @name distinct +#' @rdname reexports +#' @export +dplyr::distinct + +#' @importFrom dplyr distinct_ +#' @name distinct_ +#' @rdname reexports +#' @export +dplyr::distinct_ + +#' @importFrom dplyr slice +#' @name slice +#' @rdname reexports +#' @export +dplyr::slice + +#' @importFrom dplyr slice_ +#' @name slice_ +#' @rdname reexports +#' @export +dplyr::slice_ + +#' @importFrom dplyr filter +#' @name filter +#' @rdname reexports +#' @export +dplyr::filter + +#' @importFrom dplyr filter_ +#' @name filter_ +#' @rdname reexports +#' @export +dplyr::filter_ + +# waiting on https://github.com/tidyverse/tidyr/pull/229 +# +# #' @importFrom tidyr gather +# #' @name gather +# #' @rdname reexports +# #' @export +# tidyr::gather +# +# #' @importFrom tidyr gather_ +# #' @name gather_ +# #' @rdname reexports +# #' @export +# tidyr::gather_ diff --git a/R/kaleido.R b/R/kaleido.R new file mode 100644 index 0000000000..03c0703a61 --- /dev/null +++ b/R/kaleido.R @@ -0,0 +1,274 @@ +#' Save plot as a static image +#' +#' Static image exporting via [the kaleido python +#' package](https://github.com/plotly/Kaleido/). `kaleido()` imports +#' kaleido into a \pkg{reticulate}d Python session and returns a `$transform()` +#' method for converting R plots into static images. `save_image()` provides a convenience wrapper around `kaleido()$transform()`. +#' +#' @section Installation: +#' +#' `kaleido()` requires [the kaleido python +#' package](https://github.com/plotly/Kaleido/) to be usable via the +#' \pkg{reticulate} package. If you're starting from scratch, you install +#' eveything you need with the following R code: +#' +#' ``` +#' install.packages("reticulate") +#' library(reticulate) +#' use_python(install_python()) +#' py_install(c("kaleido", "plotly")) +#' ``` +#' +#' @param ... not currently used. +#' @param p a plot object. +#' @param file a file path with a suitable file extension (png, jpg, jpeg, +#' webp, svg, or pdf). +#' @param width,height The width/height of the exported image in layout +#' pixels. If `scale` is 1, this will also be the width/height of the exported +#' image in physical pixels. +#' @param scale The scale factor to use when exporting +#' the figure. A scale factor larger than 1.0 will increase the image +#' resolution with respect to the figure's layout pixel dimensions. Whereas as +#' scale factor of less than 1.0 will decrease the image resolution. +#' @export +#' @return For `save_image()`, the generated `file`. For `kaleido()`, an environment that contains: +#' * `transform()`: a function to convert plots objects into static images. This function has the same signature (i.e., arguments) as `save_image()` +#' * `shutdown()`: a function for shutting down any currently running subprocesses +#' that were launched via `transform()` +#' * `scope`: a reference to the underlying `kaleido.scopes.plotly.PlotlyScope` +#' python object. Modify this object to customize the underlying Chromium +#' subprocess and/or configure other details such as URL to plotly.js, MathJax, etc. +#' @examplesIf interactive() || !identical(.Platform$OS.type, "windows") +#' +#' \dontrun{ +#' # Save a single image +#' p <- plot_ly(x = 1:10) +#' tmp <- tempfile(fileext = ".png") +#' save_image(p, tmp) +#' file.show(tmp) +#' +#' # Efficiently save multiple images +#' scope <- kaleido() +#' for (i in 1:5) { +#' scope$transform(p, tmp) +#' } +#' # Remove and garbage collect to remove +#' # R/Python objects and shutdown subprocesses +#' rm(scope); gc() +#' } +#' +save_image <- function(p, file, ..., width = NULL, height = NULL, scale = NULL) { + kaleido()$transform( + p, file, ..., width = width, height = height, scale = scale + ) +} + +#' @rdname save_image +#' @export +kaleido <- function(...) { + rlang::check_installed("reticulate") + + call_env <- rlang::caller_env() + + if (!reticulate::py_available(TRUE)) { + rlang::abort(c("`{reticulate}` wasn't able to find a Python environment.", + i = "If you have an existing Python installation, use `reticulate::use_python()` to inform `{reticulate}` of it.", + i = "To have `{reticulate}` install Python for you, `reticulate::install_python()`." + ), call = call_env) + } + + tryCatch( + reticulate::import("plotly"), + error = function(e) { + rlang::abort(c( + "The `plotly` Python package is required for static image exporting.", + i = "Please install it via `reticulate::py_install('plotly')`." + ), call = call_env) + } + ) + + kaleido <- tryCatch( + reticulate::import("kaleido"), + error = function(e) { + rlang::abort(c( + "The `kaleido` Python package is required for static image exporting.", + i = "Please install it via `reticulate::py_install('kaleido')`." + ), call = call_env) + } + ) + + # Check for kaleido v1 by looking for v1-specific function + res <- if (reticulate::py_has_attr(kaleido, "write_fig_sync")) { + newKaleidoScope(kaleido) + } else { + legacyKaleidoScope(kaleido) + } + + class(res) <- "kaleidoScope" + res +} + +newKaleidoScope <- function(kaleido) { + force(kaleido) + list( + scopes = NULL, + transform = function(p, file, ..., width = NULL, height = NULL, scale = NULL) { + # Perform JSON conversion exactly how the R package would do it + fig_data <- plotly_build(p)$x[c("data", "layout", "config")] + + # Inject mapbox token into layout.mapbox.accesstoken if available + # We use layout instead of config because Kaleido's parser preserves + # layout but drops config. This handles the case where users set + # MAPBOX_TOKEN env var but don't use plot_mapbox() + mapbox <- Sys.getenv("MAPBOX_TOKEN", NA) + if (!is.na(mapbox) && is.null(fig_data$layout$mapbox$accesstoken)) { + fig_data$layout$mapbox$accesstoken <- mapbox + } + + fig <- to_JSON(fig_data) + + # Write to JSON file + tmp_json <- tempfile(fileext = ".json") + on.exit(unlink(tmp_json)) + writeLines(fig, tmp_json) + + # Import it as a fig (dict) + .py_run_string_with_context( + "import json; fig = json.load(open(tmp_json_path))", + context = list(tmp_json_path = tmp_json) + ) + + # Gather figure-level options + opts <- list( + format = tools::file_ext(file), + width = reticulate::r_to_py(width), + height = reticulate::r_to_py(height), + scale = reticulate::r_to_py(scale) + ) + + # Pass the R plotly.js bundle path to Kaleido + kopts <- list(plotlyjs = plotlyMainBundlePath()) + + # Write the figure to a file using kaleido + kaleido$write_fig_sync(reticulate::py$fig, file, opts = opts, kopts = kopts) + }, + shutdown = function() {} + ) +} + + +legacyKaleidoScope <- function(kaleido) { + py <- reticulate::py + scope_name <- paste0("scope_", new_id()) + py[[scope_name]] <- kaleido$scopes$plotly$PlotlyScope( + plotlyjs = plotlyMainBundlePath() + ) + + scope <- py[[scope_name]] + + mapbox <- Sys.getenv("MAPBOX_TOKEN", NA) + if (!is.na(mapbox)) { + scope$mapbox_access_token <- mapbox + } + + res <- list2env(list( + scope = scope, + # https://github.com/plotly/Kaleido/blob/6a46ecae/repos/kaleido/py/kaleido/scopes/plotly.py#L78-L106 + transform = function(p, file = "figure.png", ..., width = NULL, height = NULL, scale = NULL) { + # Perform JSON conversion exactly how the R package would do it + # (this is essentially plotly_json(), without the additional unneeded info) + # and attach as an attribute on the python scope object + scope[["_last_plot"]] <- to_JSON( + plotly_build(p)$x[c("data", "layout", "config")] + ) + # On the python side, _last_plot is a string, so use json.loads() to + # convert to dict(). This should be fine since json is a dependency of the + # BaseScope() https://github.com/plotly/Kaleido/blob/586be5/repos/kaleido/py/kaleido/scopes/base.py#L2 + transform_cmd <- sprintf( + "%s.transform(sys.modules['json'].loads(%s._last_plot), format='%s', width=%s, height=%s, scale=%s)", + scope_name, scope_name, tools::file_ext(file), + reticulate::r_to_py(width), reticulate::r_to_py(height), + reticulate::r_to_py(scale) + ) + # Write the base64 encoded string that transform() returns to disk + # https://github.com/plotly/Kaleido/blame/master/README.md#L52 + .py_run_string_with_context( + sprintf("import sys; open(output_file, 'wb').write(%s)", transform_cmd), + context = list(output_file = file) + ) + + invisible(file) + }, + # Shutdown the kaleido subprocesses + # https://github.com/plotly/Kaleido/blob/586be5c/repos/kaleido/py/kaleido/scopes/base.py#L71-L72 + shutdown = function() { + reticulate::py_run_string(paste0(scope_name, ".__del__()")) + } + )) + + # Shutdown subprocesses and delete python scope when + # this object is garbage collected by R + reg.finalizer(res, onexit = TRUE, function(x) { + x$shutdown() + reticulate::py_run_string(paste("del", scope_name)) + }) + + res +} + +.py_run_string_with_context <- function(code, context = list(), convert = TRUE) { + context_names <- names(context) + old_values <- vector("list", length(context)) + had_value <- logical(length(context)) + was_set <- logical(length(context)) + + if (length(context) > 0) { + if (is.null(context_names) || any(context_names == "")) { + rlang::abort("`context` must be a named list.") + } + if (any(!grepl("^[A-Za-z_][A-Za-z0-9_]*$", context_names))) { + rlang::abort("`context` names must be valid Python identifiers.") + } + + py <- reticulate::py + on.exit({ + for (i in rev(which(was_set))) { + name <- context_names[[i]] + if (had_value[[i]]) { + reticulate::py_set_attr(py, name, old_values[[i]]) + } else { + reticulate::py_del_attr(py, name) + } + } + }, add = TRUE) + + for (i in seq_along(context)) { + name <- context_names[[i]] + had_value[[i]] <- reticulate::py_has_attr(py, name) + if (had_value[[i]]) { + old_values[[i]] <- reticulate::py_get_attr(py, name) + } + reticulate::py_set_attr(py, name, context[[i]]) + was_set[[i]] <- TRUE + } + } + + reticulate::py_run_string(code, convert = convert) +} + + +#' Print method for kaleido +#' +#' S3 method for [kaleido()]. +#' +#' @param x a [kaleido()] object. +#' @param ... currently unused. +#' @export +#' @importFrom utils capture.output +#' @keywords internal +print.kaleidoScope <- function(x, ...) { + args <- formals(x$transform) + cat("$transform: function(", paste(names(args), collapse = ", "), ")\n", sep = "") + cat("$shutdown: function()\n") + cat("$scope: ", utils::capture.output(x$scope)) +} diff --git a/R/last_plot.R b/R/last_plot.R new file mode 100644 index 0000000000..26bdbcf16c --- /dev/null +++ b/R/last_plot.R @@ -0,0 +1,21 @@ +# Same as here, thanks Hadley -- +# https://github.com/hadley/ggplot2/blob/8aa578/R/plot-last.r + +.plot_store <- function() { + .last_plot <- NULL + + list( + get = function() .last_plot, + set = function(value) .last_plot <<- value + ) +} +.store <- .plot_store() + +# Set last plot created or modified +set_last_plot <- function(value) .store$set(value) + +#' Retrieve the last plot to be modified or created. +#' +#' @seealso [ggplot2::last_plot()] +#' @export +last_plot <- function() .store$get() diff --git a/R/layers2layout.R b/R/layers2layout.R new file mode 100644 index 0000000000..bf628afd95 --- /dev/null +++ b/R/layers2layout.R @@ -0,0 +1,29 @@ +# convert layout-specific geoms/layers +layers2layout <- function(gglayout, layers, layout) { + geoms <- sapply(layers, function(x) class(x[["geom"]])[1]) + RasterGeom <- which(geoms %in% "GeomRasterAnn") + for (i in RasterGeom) { + params <- layers[[i]]$computed_geom_params %||% layers[[i]]$geom_params + for (j in seq_len(nrow(layout))) { + lay <- layout[j, ] + + img <- list( + source = raster2uri(params$raster), + # TODO: ask plotly.js to implement explicit placement between traces? + layer = if (RasterGeom / length(geoms) > 0.5) "above" else "below", + xref = sub("axis", "", lay[["xaxis"]]), + yref = sub("axis", "", lay[["yaxis"]]), + x = params$xmin, + xanchor = "left", + sizex = with(params, abs(xmax - xmin)), + y = params$ymin, + yanchor = "bottom", + sizey = with(params, abs(ymax - ymin)), + sizing = "stretch" + ) + gglayout$images <- c(gglayout$images, list(img)) + } + } + # TODO: maybe we could support a subset of grobs in GeomCustomAnn? + gglayout +} diff --git a/R/layers2traces.R b/R/layers2traces.R new file mode 100644 index 0000000000..181ef72909 --- /dev/null +++ b/R/layers2traces.R @@ -0,0 +1,1263 @@ +# layer -> trace conversion +layers2traces <- function(data, prestats_data, layout, p) { + # Attach a "geom class" to each layer of data for method dispatch + data <- Map(function(x, y) prefix_class(x, class(y$geom)[1]), data, p$layers) + + # Extract parameters (and "hovertext aesthetics") in each layer + params <- Map(function(x, y) { + param <- c( + y[["computed_geom_params"]] %||% y[["geom_params"]], + y[["computed_stat_params"]] %||% y[["stat_params"]], + y[["aes_params"]], + position = ggtype(y, "position") + ) + + map <- getAesMap(p, y) + + # consider "calculated" aesthetics (e.g., density, count, etc) + calc_aes <- y$stat$default_aes[ggfun("is_calculated_aes")(y$stat$default_aes)] + calc_aes <- calc_aes[!names(calc_aes) %in% names(map)] + + map <- c(calc_aes, map) + + # turn symbol (e.g., ..count..) & call (e.g. calc(count)) mappings into text labels + map <- ggfun("make_labels")(map) + + + # filter tooltip aesthetics down to those specified in `tooltip` arg + if (!identical(p$tooltip, "all")) { + # rectify tooltips, ggplot automatically convert `color` => `colour` + p$tooltip[p$tooltip == "color"] <- "colour" + map <- map[names(map) %in% p$tooltip | map %in% p$tooltip] + } + + # throw out positional coordinates if we're hovering on fill + if (identical("fills", hover_on(x))) { + map <- map[!names(map) %in% c("x", "xmin", "xmax", "y", "ymin", "ymax")] + } + + # disregard geometry mapping in hovertext for GeomSf + if ("GeomSf" %in% class(y$geom)) { + map <- map[!names(map) %in% "geometry"] + } + + param[["hoverTextAes"]] <- map + param + }, data, p$layers) + + hoverTextAes <- lapply(params, "[[", "hoverTextAes") + # attach a new column (hovertext) to each layer of data + # (mapped to the text trace property) + data <- Map(function(x, y) { + if (nrow(x) == 0) return(x) + # make sure the relevant aes exists in the data + for (i in seq_along(y)) { + aesName <- names(y)[[i]] + if (!aesName %in% names(x)) next + # TODO: should we be getting the name from scale_*(name) first? + varName <- y[[i]] + # Skip auto-generated group aesthetic, but keep explicit group mappings + if (identical(aesName, "group") && identical(varName, "group")) next + # add a line break if hovertext already exists + if ("hovertext" %in% names(x)) x$hovertext <- paste0(x$hovertext, br()) + # text aestheic should be taken verbatim (for custom tooltips) + prefix <- if (identical(aesName, "text")) "" else paste0(varName, ": ") + # look for the domain, if that's not found, provide the range (useful for identity scales) + txt <- x[[paste0(aesName, "_plotlyDomain")]] %||% x[[aesName]] + suffix <- tryNULL(format(txt, justify = "none")) %||% "" + # put the height of the bar in the tooltip + if (inherits(x, "GeomBar") && identical(aesName, "y")) { + suffix <- format(x[["ymax"]] - x[["ymin"]], justify = "none") + } + x$hovertext <- paste0(x$hovertext, prefix, suffix) + } + x$hovertext <- x$hovertext %||% "" + x + }, data, hoverTextAes) + + # draw legends only for discrete scales (skip scales with guide = "none") + discreteScales <- list() + for (sc in p$scales$non_position_scales()$scales) { + if (sc$is_discrete() && !identical(sc$guide, "none")) { + for (aes_name in sc$aesthetics) { + discreteScales[[aes_name]] <- sc + } + } + } + # Convert "high-level" geoms to their "low-level" counterpart + # This may involve preprocessing the data, for example: + # 1. geom_line() is really geom_path() with data sorted by x + # 2. geom_smooth() is really geom_path() + geom_ribbon() + datz <- list() + paramz <- list() + for (i in seq_along(data)) { + # This has to be done in a loop, since some layers are really two layers, + # (and we need to replicate the data/params in those cases) + set <- attr(data[[i]], "set") + d <- to_basic(data[[i]], prestats_data[[i]], layout, params[[i]], p) + d <- structure(d, set = set) + if (is.data.frame(d)) d <- list(d) + for (j in seq_along(d)) { + datz <- c(datz, d[j]) + paramz <- c(paramz, params[i]) + } + } + # now to the actual layer -> trace conversion + trace.list <- list() + + # ggplot2 >v3.4.2 (specifically #4879) moved the guides system to ggproto, + # which moved the location of the name->value fields + guides <- if (inherits(p$guides, "ggproto")) p$guides$guides else p$guides + aes_no_guide <- names(guides)[vapply(guides, identical, logical(1), "none")] + + for (i in seq_along(datz)) { + d <- datz[[i]] + # variables that produce multiple traces and deserve their own legend entries + split_legend <- paste0( + setdiff(names(discreteScales), aes_no_guide), + "_plotlyDomain" + ) + # add variable that produce multiple traces, but do _not_ deserve entries + split_by <- c(split_legend, aes_no_guide, "PANEL", "frame", split_on(d)) + # ensure the factor level orders (which determines traces order) + # matches the order of the domain values + split_vars <- intersect(split_by, names(d)) + lvls <- unique(d[split_vars]) + lvls <- lvls[do.call(order, lvls), , drop = FALSE] + separator <- new_id() + fac <- factor( + apply(d[split_vars], 1, paste, collapse = separator), + levels = unique(apply(lvls, 1, paste, collapse = separator)) + ) + if (all(is.na(fac))) fac <- 1 + dl <- split(d, fac, drop = TRUE) + # list of traces for this layer + trs <- Map(geom2trace, dl, paramz[i], list(p)) + # attach the crosstalk group/set + trs <- Map(function(x, y) { x$set <- attr(y, "set"); x}, trs, dl) + # if we need a legend, set name/legendgroup/showlegend + # note: this allows us to control multiple traces from one legend entry + if (any(split_legend %in% names(d))) { + nms <- strsplit(names(trs), separator, fixed = TRUE) + nms <- vapply(nms, function(x) { + y <- unique(x[seq_along(split_legend)]) + if (length(y) > 1) paste0("(", paste(y, collapse = ","), ")") else y + }, character(1)) + trs <- Map(function(x, y) { + x$name <- y + x$legendgroup <- y + # depending on the geom (e.g. smooth) this may be FALSE already + x$showlegend <- x$showlegend %||% TRUE + x + }, trs, nms) + } else { + trs <- lapply(trs, function(x) { x$showlegend <- FALSE; x }) + } + + # each trace is with respect to which axis? + for (j in seq_along(trs)) { + panel <- unique(dl[[j]]$PANEL) + trs[[j]]$xaxis <- sub("axis", "", layout$layout[panel, "xaxis"]) + trs[[j]]$yaxis <- sub("axis", "", layout$layout[panel, "yaxis"]) + } + trace.list <- c(trace.list, trs) + } + trace.list +} + + +#' Convert a geom to a "basic" geom. +#' +#' This function makes it possible to convert ggplot2 geoms that +#' are not included with ggplot2 itself. Users shouldn't need to use +#' this function. It exists purely to allow other package authors to write +#' their own conversion method(s). +#' +#' @param data the data returned by `ggplot2::ggplot_build()`. +#' @param prestats_data the data before statistics are computed. +#' @param layout the panel layout. +#' @param params parameters for the geom, statistic, and 'constant' aesthetics +#' @param p a ggplot2 object (the conversion may depend on scales, for instance). +#' @param ... currently ignored +#' @export +to_basic <- function(data, prestats_data, layout, params, p, ...) { + UseMethod("to_basic") +} + +#' @export +to_basic.GeomFunction <- function (data, prestats_data, layout, params, p, ...) { + data$y <- params$fun(data$x) + prefix_class(data, "GeomPath") +} + +#' @export +to_basic.GeomCol <- function(data, prestats_data, layout, params, p, ...) { + prefix_class(data, "GeomBar") +} + +#' @export +to_basic.GeomViolin <- function(data, prestats_data, layout, params, p, ...) { + n <- nrow(data) + data <- data[order(data[["y"]], decreasing = FALSE), ] + revData <- data[order(data[["y"]], decreasing = TRUE), ] + idx <- !names(data) %in% c("x", "xmin", "xmax") + data <- rbind( + cbind(x = data[["x"]] - data$violinwidth / 2, data[, idx]), + cbind(x = revData[["x"]] + revData$violinwidth / 2, revData[, idx]) + ) + if (!is.null(data$hovertext)) data$hovertext <- paste0(data$hovertext, br()) + data$hovertext <- paste0( + data$hovertext, "density: ", format(data$density, justify = "none") + ) + prefix_class(data, c("GeomPolygon", "GeomViolin")) +} + +#' @export +to_basic.GeomBoxplot <- function(data, prestats_data, layout, params, p, ...) { + aez <- names(GeomBoxplot$default_aes) + for (i in aez) { + prestats_data[[i]] <- NULL + } + vars <- c("PANEL", "group", "key", aez, grep("_plotlyDomain$", names(data), value = T)) + prefix_class( + merge(prestats_data, data[names(data) %in% vars], by = c("PANEL", "group"), sort = FALSE), + "GeomBoxplot" + ) +} + +#' @export +to_basic.GeomSmooth <- function(data, prestats_data, layout, params, p, ...) { + if (nrow(data) == 0) { + return(prefix_class(data, "GeomBlank")) + } + dat <- prefix_class(data, "GeomPath") + # alpha for the path is always 1 (see GeomSmooth$draw_key) + dat$alpha <- 1 + if (!identical(params$se, FALSE)) { + dat2 <- prefix_class(ribbon_dat(data), c("GeomPolygon", "GeomSmooth")) + dat2$colour <- NULL + dat <- list(dat, dat2) + } + dat +} + +#' @export +to_basic.GeomRibbon <- function(data, prestats_data, layout, params, p, ...) { + prefix_class(ribbon_dat(data), "GeomPolygon") +} + +#' @export +to_basic.GeomArea <- function(data, prestats_data, layout, params, p, ...) { + prefix_class(ribbon_dat(data), "GeomPolygon") +} + +#' @export +to_basic.GeomDensity <- function(data, prestats_data, layout, params, p, ...) { + prefix_class(ribbon_dat(data), "GeomPolygon") +} + +#' @export +to_basic.GeomLine <- function(data, prestats_data, layout, params, p, ...) { + data <- data[order(data[["x"]]), ] + prefix_class(data, "GeomPath") +} + +#' @export +to_basic.GeomStep <- function(data, prestats_data, layout, params, p, ...) { + data <- data[order(data[["x"]]), ] + prefix_class(data, "GeomPath") +} + +#' @export +to_basic.GeomSegment <- function(data, prestats_data, layout, params, p, ...) { + # Every row is one segment, we convert to a line with several + # groups which can be efficiently drawn by adding NA rows. + data$group <- seq_len(nrow(data)) + others <- data[!names(data) %in% c("x", "y", "xend", "yend")] + data <- with(data, { + rbind(cbind(x, y, others), + cbind(x = xend, y = yend, others)) + }) + prefix_class(data, "GeomPath") +} + +#' @export +to_basic.GeomRect <- function(data, prestats_data, layout, params, p, ...) { + data$group <- seq_len(nrow(data)) + others <- data[!names(data) %in% c("xmin", "ymin", "xmax", "ymax", "y", "x")] + dat <- with(data, { + rbind(cbind(x = xmin, y = ymin, others), + cbind(x = xmin, y = ymax, others), + cbind(x = xmax, y = ymax, others), + cbind(x = xmax, y = ymin, others)) + }) + prefix_class(dat, c("GeomPolygon", "GeomRect")) +} + +#' @export +to_basic.GeomSf <- function(data, prestats_data, layout, params, p, ...) { + + data <- sf::st_as_sf(data) + geom_type <- sf::st_geometry_type(data) + # st_cast should "expand" a collection into multiple rows (one per feature) + if ("GEOMETRYCOLLECTION" %in% geom_type) { + data <- sf::st_cast(data) + geom_type <- sf::st_geometry_type(data) + } + + basic_type <- dplyr::recode( + as.character(geom_type), + TRIANGLE = "GeomPolygon", + TIN = "GeomPolygon", + POLYHEDRALSURFACE = "GeomPolygon", + SURFACE = "GeomPolygon", + CURVE = "GeomPath", + MULTISURFACE = "GeomPolygon", + MULTICURVE = "GeomPath", + CURVEPOLYGON = "GeomPolygon", + COMPOUNDCURVE = "GeomPath", + CIRCULARSTRING = "GeomPath", + MULTIPOLYGON = "GeomPolygon", + MULTILINESTRING = "GeomPath", + MULTIPOINT = "GeomPoint", + POLYGON = "GeomPolygon", + LINESTRING = "GeomPath", + POINT = "GeomPoint" + ) + + # return a list of data frames...one for every geometry (a la, GeomSmooth) + d <- split(data, basic_type) + for (i in seq_along(d)) { + d[[i]] <- prefix_class( + fortify_sf(d[[i]]), c(names(d)[[i]], "GeomSf") + ) + d[[i]] <- remove_class(d[[i]], "sf") + } + if (length(d) == 1) d[[1]] else d +} + +#' @export +to_basic.GeomMap <- function(data, prestats_data, layout, params, p, ...) { + common <- intersect(data$map_id, params$map$id) + data <- data[data$map_id %in% common, , drop = FALSE] + map <- params$map[params$map$id %in% common, , drop = FALSE] + # TODO: do we need coord_munch() as in GeomMap$draw_panel() + data$id <- data$map_id + data$map_id <- NULL + data$group <- NULL + data <- merge(data, map, by = "id", sort = FALSE) + data$group <- interaction(data[names(data) %in% c("PANEL", "group", "id")]) + prefix_class(data, c("GeomPolygon", "GeomMap")) +} + +#' @export +to_basic.GeomAnnotationMap <- function(data, prestats_data, layout, params, p, ...) { + # TODO: we could/should? reduce this data down to the panel limits, but + # probably more effort than it's worth + d <- params$map + + # add hovertext + hasRegion <- isTRUE(p$tooltip %in% c("all", "region")) + hasSubRegion <- isTRUE(p$tooltip %in% c("all", "subregion")) + d$hovertext <- d$hovertext %||% paste0( + if (hasRegion) d$region, if (hasSubRegion) paste0(br(), d$subregion) + ) + prefix_class(d, c("GeomPolygon", "GeomAnnotationMap")) +} + +#' @export +to_basic.GeomRaster <- function(data, prestats_data, layout, params, p, ...) { + data <- prefix_class(data, "GeomTile") + to_basic(data, prestats_data, layout, params) +} + +#' @export +to_basic.GeomRasterAnn <- function(data, prestats_data, layout, params, p, ...) { + # rasters are handled in ggplotly.R since they are layout specific + prefix_class(data, "GeomBlank") +} + +#' @export +to_basic.GeomTile <- function(data, prestats_data, layout, params, p, ...) { + # geom2trace.GeomTile is a heatmap, which requires continuous fill + if (is.discrete(data$fill_plotlyDomain %||% NA_character_)) { + data <- prefix_class(data, "GeomRect") + to_basic(data, prestats_data, layout, params, p) + } else { + data + } +} + +#' @export +to_basic.GeomHex <- function(data, prestats_data, layout, params, p, ...) { + # see ggplot2:::hexGrob + dx <- resolution(data[["x"]], FALSE) + dy <- resolution(data[["y"]], FALSE)/sqrt(3)/2 * 1.15 + hexC <- hexbin::hexcoords(dx, dy, n = 1) + n <- nrow(data) + nm <- linewidth_or_size(GeomHex) + size <- data[[nm]] + data[[nm]] <- ifelse(size < 1, size ^ (1 / 6), size ^ 6) + x <- rep.int(hexC[["x"]], n) * rep(data[[nm]], each = 6) + rep(data[["x"]], each = 6) + y <- rep.int(hexC[["y"]], n) * rep(data[[nm]], each = 6) + rep(data[["y"]], each = 6) + data <- data[rep(seq_len(n), each = 6), ] + data[["x"]] <- x + data[["y"]] <- y + data$group <- rep(seq_len(n), each = 6) + prefix_class(data, c("GeomPolygon", "GeomHex")) +} + +#' @export +to_basic.GeomContour <- function(data, prestats_data, layout, params, p, ...) { + if (!"fill" %in% names(data)) data$fill <- NA + prefix_class(data, "GeomPath") +} + +#' @export +to_basic.GeomDensity2d <- function(data, prestats_data, layout, params, p, ...) { + if ("hovertext" %in% names(data)) { + data$hovertext <- paste0(data$hovertext, br()) + } + data$hovertext <- paste0( + data$hovertext, "Level: ", format(data$level, justify = "none") + ) + if (!"fill" %in% names(data)) data$fill <- NA + prefix_class(data, "GeomPath") +} + +#' @export +to_basic.GeomAbline <- function(data, prestats_data, layout, params, p, ...) { + # ugh, we can't trust the group here + data$group <- interaction( + data[!grepl("group", names(data)) & !vapply(data, anyNA, logical(1))] + ) + lay <- tidyr::pivot_longer( + data = layout$layout, cols = c("x_min", "x_max"), values_to = "x", names_to = "variable" + ) + lay <- as.data.frame(lay) + data <- merge(lay[c("PANEL", "x")], data, by = "PANEL") + data[["y"]] <- with(data, intercept + slope * x) + prefix_class(data, c("GeomHline", "GeomPath")) +} + +#' @export +to_basic.GeomHline <- function(data, prestats_data, layout, params, p, ...) { + # ugh, we can't trust the group here + data$group <- do.call(paste, + data[!grepl("group", names(data)) & !vapply(data, anyNA, logical(1))] + ) + x <- if (inherits(p$coordinates, "CoordFlip")) "y" else "x" + lay <- tidyr::pivot_longer( + data = layout$layout, cols = paste0(x, c("_min", "_max")), values_to = x, names_to = "variable" + ) + lay <- as.data.frame(lay) + if (nrow(data) > 0) { + data <- merge(lay[c("PANEL", x)], data, by = "PANEL") + } + data[["x"]] <- data[[x]] + data[["y"]] <- data$yintercept + prefix_class(data, c("GeomHline", "GeomPath")) +} + +#' @export +to_basic.GeomVline <- function(data, prestats_data, layout, params, p, ...) { + # ugh, we can't trust the group here + data$group <- do.call(paste, + data[!grepl("group", names(data)) & !vapply(data, anyNA, logical(1))] + ) + y <- if (inherits(p$coordinates, "CoordFlip")) "x" else "y" + lay <- tidyr::pivot_longer( + data = layout$layout, cols = paste0(y, c("_min", "_max")), values_to = y, names_to = "variable" + ) + lay <- as.data.frame(lay) + if (nrow(data) > 0) { + data <- merge(lay[c("PANEL", y)], data, by = "PANEL") + } + data[["y"]] <- data[[y]] + data[["x"]] <- data$xintercept + prefix_class(data, c("GeomVline", "GeomPath")) +} + +#' @export +to_basic.GeomJitter <- function(data, prestats_data, layout, params, p, ...) { + prefix_class(data, "GeomPoint") +} + + +#' @export +to_basic.GeomErrorbar <- function(data, prestats_data, layout, params, p, ...) { + # width for ggplot2 means size of the entire bar, on the data scale + # (plotly.js wants half, in pixels) + data <- merge(data, layout$layout, by = "PANEL", sort = FALSE) + data$width <- if (params[["flipped_aes"]]) { + (data[["ymax"]] - data[["y"]]) /(data[["y_max"]] - data[["y_min"]]) + } else { + (data[["xmax"]] - data[["x"]]) /(data[["x_max"]] - data[["x_min"]]) + } + data$fill <- NULL + prefix_class(data, "GeomErrorbar") +} + +#' @export +to_basic.GeomErrorbarh <- function(data, prestats_data, layout, params, p, ...) { + # height for ggplot2 means size of the entire bar, on the data scale + # (plotly.js wants half, in pixels) + data <- merge(data, layout$layout, by = "PANEL", sort = FALSE) + data$width <- (data[["ymax"]] - data[["y"]]) / (data[["y_max"]] - data[["y_min"]]) + data$fill <- NULL + prefix_class(data, "GeomErrorbarh") +} + +#' @export +to_basic.GeomLinerange <- function(data, prestats_data, layout, params, p, ...) { + + if (!is.null(data[["y"]])) { + data$width <- 0 + return(prefix_class(data, "GeomErrorbar")) + } + + # reshape data so that x/y reflect path data + data$group <- seq_len(nrow(data)) + data <- tidyr::pivot_longer( + data = data, cols = c("ymin", "ymax"), values_to = "y", names_to = "recodeVariable" + ) + data <- as.data.frame(data) + data <- data[order(data$group), ] + # fix the hovertext (by removing the "irrelevant" aesthetic) + recodeMap <- p$mapping[dplyr::recode(data[["recodeVariable"]], "ymax" = "ymin", "ymin" = "ymax")] + data$hovertext <- Map(function(x, y) { + paste(x[!grepl(y, x)], collapse = br()) + }, strsplit(data$hovertext, br()), paste0("^", recodeMap, ":")) + + prefix_class(data, "GeomPath") +} + +#' @export +to_basic.GeomPointrange <- function(data, prestats_data, layout, params, p, ...) { + data$width <- 0 + list( + prefix_class(data, "GeomErrorbar"), + prefix_class(data, "GeomPoint") + ) +} + +#' @export +to_basic.GeomDotplot <- function(data, prestats_data, layout, params, p, ...) { + if (identical(params$binaxis, "y")) { + dotdia <- params$dotsize * data$binwidth[1]/(layout$layout$y_max - layout$layout$y_min) + data$size <- as.numeric(grid::convertHeight(grid::unit(dotdia, "npc"), "mm")) / 2 + data$x <- (data$countidx - 0.5) * (as.numeric(dotdia) * 6) + } else { + dotdia <- params$dotsize * data$binwidth[1]/(layout$layout$x_max - layout$layout$x_min) + data$size <- as.numeric(grid::convertWidth(grid::unit(dotdia, "npc"), "mm")) / 2 + # TODO: why times 6?!?! + data$y <- (data$countidx - 0.5) * (as.numeric(dotdia) * 6) + } + prefix_class(data, "GeomPoint") +} + +#' @export +to_basic.GeomSpoke <- function(data, prestats_data, layout, params, p, ...) { + # if radius/angle are a constant, still add them to the hovertext + # NOTE: it'd be more accurate, but more complicated, to use the aes mapping + for (var in c("radius", "angle")) { + if (length(unique(data[[var]])) != 1) next + data[["hovertext"]] <- paste0( + data[["hovertext"]], br(), var, ": ", format(data[[var]], justify = "none") + ) + } + prefix_class(to_basic.GeomSegment(data), "GeomSpoke") +} + +#' @export +to_basic.GeomCrossbar <- function(data, prestats_data, layout, params, p, ...) { + # from GeomCrossbar$draw_panel() + middle <- base::transform(data, x = xmin, xend = xmax, yend = y, alpha = NA) + nm <- linewidth_or_size(GeomCrossbar) + data[[nm]] <- data[[nm]] * (params$fatten %||% formals(geom_crossbar)$fatten) + list( + prefix_class(to_basic.GeomRect(data), "GeomCrossbar"), + prefix_class(to_basic.GeomSegment(middle), "GeomCrossbar") + ) +} +utils::globalVariables(c("xmin", "xmax", "y", "size", "linewidth", "COL", "PANEL", "ROW", "yaxis")) + +#' @export +to_basic.GeomRug <- function(data, prestats_data, layout, params, p, ...) { + # allow the tick length to vary across panels + layout <- layout$layout + layout$tickval_y <- 0.03 * abs(layout$y_max - layout$y_min) + layout$tickval_x <- 0.03 * abs(layout$x_max - layout$x_min) + data <- merge(data, layout[c("PANEL", "x_min", "x_max", "y_min", "y_max", "tickval_y", "tickval_x")]) + + # see GeomRug$draw_panel() + rugs <- list() + sides <- params$sides + others <- data[!names(data) %in% c("x", "y")] + if (!is.null(data[["x"]])) { + if (grepl("b", sides)) { + rugs$b <- with( + data, data.frame( + x = x, + xend = x, + y = y_min, + yend = y_min + tickval_y, + others + ) + ) + } + if (grepl("t", sides)) { + rugs$t <- with( + data, data.frame( + x = x, + xend = x, + y = y_max - tickval_y, + yend = y_max, + others + ) + ) + } + } + if (!is.null(data[["y"]])) { + if (grepl("l", sides)) { + rugs$l <- with( + data, data.frame( + x = x_min, + xend = x_min + tickval_x, + y = y, + yend = y, + others + ) + ) + } + if (grepl("r", sides)) { + rugs$r <- with( + data, data.frame( + x = x_max - tickval_x, + xend = x_max, + y = y, + yend = y, + others + ) + ) + } + } + + lapply(rugs, function(d) { + prefix_class(to_basic.GeomSegment(d), "GeomRug") + }) +} + +#' @export +to_basic.GeomQuantile <- function(data, prestats_data, layout, params, p, ...){ + dat <- split(data, data$quantile) + dat <- lapply(dat, prefix_class, y = "GeomPath") + dat +} + +# ggalluvial::GeomStratum +#' @export +to_basic.GeomStratum <- function(data, ...) { + to_basic.GeomRect(data, ...) +} + +# ggalluvial::GeomAlluvium +#' @export +to_basic.GeomAlluvium <- function(data, ...) { + # geom_alluvium by default generates a data.frame with a colour column and sets it to 0, which leads to an error when trying to get the colour from the number and grid::col2rgb complains that colors must be positive integers. + cols <- unique(data$colour) + if (length(cols) == 1 && cols[1] == 0) { + data$colour <- NULL + } + + data <- data[order(data$x), ] + row_number <- nrow(data) + data_rev <- data[rev(seq_len(row_number)), ] + unused_aes <- setdiff(names(data), c("x", "y", "ymin", "ymax")) + + d <- structure(rbind( + cbind(x = data$x, y = data$ymin, data[unused_aes]), + cbind(x = data$x[row_number], y = data$ymin[row_number], data[row_number, unused_aes]), + cbind(x = data_rev$x, y = data_rev$ymax, data_rev[unused_aes]) + ), class = class(data)) + + prefix_class(d, "GeomPolygon") +} + +#' @export +to_basic.default <- function(data, prestats_data, layout, params, p, ...) { + data +} + +#' Convert a "basic" geoms to a plotly.js trace. +#' +#' This function makes it possible to convert ggplot2 geoms that +#' are not included with ggplot2 itself. Users shouldn't need to use +#' this function. It exists purely to allow other package authors to write +#' their own conversion method(s). +#' +#' @param data the data returned by `plotly::to_basic`. +#' @param params parameters for the geom, statistic, and 'constant' aesthetics +#' @param p a ggplot2 object (the conversion may depend on scales, for instance). +#' @export +geom2trace <- function(data, params, p) { + if (nrow(data) == 0) return(geom2trace.GeomBlank(data, params, p)) + UseMethod("geom2trace") +} + +#' @export +geom2trace.GeomBlank <- function(data, params, p) { + list(visible = FALSE, showlegend = FALSE) +} + +#' @export +geom2trace.GeomPath <- function(data, params, p) { + data <- group2NA(data) + L <- list( + x = data[["x"]], + y = data[["y"]], + text = uniq(data[["hovertext"]]), + key = data[["key"]], + customdata = data[["customdata"]], + frame = data[["frame"]], + ids = data[["ids"]], + type = "scatter", + mode = "lines", + name = if (inherits(data, "GeomSmooth")) "fitted values", + line = list( + # TODO: line width array? -- https://github.com/plotly/plotly.js/issues/147 + width = aes2plotly(data, params, linewidth_or_size(GeomPath))[1], + color = toRGB( + aes2plotly(data, params, "colour"), + aes2plotly(data, params, "alpha") + ), + dash = aes2plotly(data, params, "linetype") + ), + hoveron = hover_on(data) + ) + if (inherits(data, "GeomStep")) L$line$shape <- params$direction %||% "hv" + compact(L) +} + +#' @export +geom2trace.GeomPoint <- function(data, params, p) { + shape <- aes2plotly(data, params, "shape") + color <- aes2plotly(data, params, "colour") + isDotPlot <- inherits(data, "GeomDotplot") + L <- list( + x = data[["x"]], + y = data[["y"]], + text = if (isDotPlot) data[["key"]] else uniq(data[["hovertext"]]), + key = data[["key"]], + customdata = data[["customdata"]], + frame = data[["frame"]], + ids = data[["ids"]], + type = "scatter", + mode = "markers", + marker = list( + autocolorscale = FALSE, + color = color, + opacity = aes2plotly(data, params, "alpha"), + size = aes2plotly(data, params, "size"), + symbol = shape, + line = list( + width = aes2plotly(data, params, "stroke"), + color = color + ) + ), + hoveron = hover_on(data) + ) + # fill is only relevant for pch %in% 21:25 + pch <- uniq(data$shape) %||% params$shape %||% GeomPoint$use_defaults(NULL)$shape + if (any(idx <- pch %in% 21:25) || any(idx <- !is.null(data[["fill_plotlyDomain"]]))) { + fill_value <- aes2plotly(data, params, "fill") + if (length(idx) == 1) { + L$marker$color <- fill_value + } else { + L$marker$color[idx] <- fill_value[idx] + } + } + compact(L) +} + +#' @export +geom2trace.GeomBar <- function(data, params, p) { + # TODO: does position play a role here? + #pos <- params$position %||% "stack" + flip <- inherits(p$coordinates, "CoordFlip") + + if (!flip) { + width <- with(data, xmax - xmin) + # TODO: does this cause rounding issues when inverse transforming for dynamicTicks? + x <- with(data, (xmax + xmin) / 2) + base <- data[["ymin"]] + y <- with(data, ymax - ymin) + } else { + width <- with(data, xmax - xmin) + # TODO: does this cause rounding issues when inverse transforming for dynamicTicks? + y <- with(data, (xmax + xmin) / 2) + base <- data[["ymin"]] + x <- with(data, ymax - ymin) + } + + compact(list( + orientation = if (flip) "h" else "v", + width = width, + base = base, + x = x, + y = y, + text = uniq(data[["hovertext"]]), + key = data[["key"]], + customdata = data[["customdata"]], + frame = data[["frame"]], + ids = data[["ids"]], + type = "bar", + # plotly.js v2.0 changed default to textposition='auto', meaning + # text will display by default, which makes sense for plot_ly() maybe, + # but not ggplotly() + # https://github.com/plotly/orca/issues/374 + textposition = "none", + marker = list( + autocolorscale = FALSE, + color = toRGB( + aes2plotly(data, params, "fill"), + aes2plotly(data, params, "alpha") + ), + line = list( + width = aes2plotly(data, params, linewidth_or_size(GeomBar)), + color = aes2plotly(data, params, "colour") + ) + ) + )) +} + +#' @export +geom2trace.GeomPolygon <- function(data, params, p) { + + data <- group2NA(data) + + L <- list( + x = data[["x"]], + y = data[["y"]], + text = uniq(data[["hovertext"]]), + key = data[["key"]], + customdata = data[["customdata"]], + frame = data[["frame"]], + ids = data[["ids"]], + type = "scatter", + mode = "lines", + line = list( + width = aes2plotly(data, params, linewidth_or_size(GeomPolygon)), + color = toRGB( + aes2plotly(data, params, "colour"), + aes2plotly(data, params, "alpha") + ), + dash = aes2plotly(data, params, "linetype") + ), + fill = "toself", + fillcolor = toRGB( + aes2plotly(data, params, "fill"), + aes2plotly(data, params, "alpha") + ), + hoveron = hover_on(data) + ) + if (inherits(data, "GeomSmooth")) L$hoverinfo <- "x+y" + if (inherits(data, "GeomCrossbar")) L$hoverinfo <- "none" + compact(L) +} + +#' @export +geom2trace.GeomBoxplot <- function(data, params, p) { + # marker styling must inherit from GeomPoint$default_aes + # https://github.com/hadley/ggplot2/blob/ab42c2ca81458b0cf78e3ba47ed5db21f4d0fc30/NEWS#L73-L7 + point_defaults <- GeomPoint$use_defaults(NULL) + hide_outliers <- isFALSE(params$outliers) || isTRUE(is.na(params$outlier_gp$shape)) + + compact(list( + x = data[["x"]], + y = data[["y"]], + hoverinfo = "y", + key = data[["key"]], + customdata = data[["customdata"]], + frame = data[["frame"]], + ids = data[["ids"]], + type = "box", + fillcolor = toRGB( + aes2plotly(data, params, "fill"), + aes2plotly(data, params, "alpha") + ), + boxpoints = if (hide_outliers) FALSE, + # markers/points + marker = list( + opacity = point_defaults$alpha, + outliercolor = toRGB(point_defaults$colour), + line = list( + width = mm2pixels(point_defaults$stroke), + color = toRGB(point_defaults$colour) + ), + size = mm2pixels(point_defaults$size) + ), + line = list( + color = aes2plotly(data, params, "colour"), + width = aes2plotly(data, params, linewidth_or_size(GeomBoxplot)) + ) + )) +} + + +#' @export +geom2trace.GeomText <- function(data, params, p) { + compact(list( + x = data[["x"]], + y = data[["y"]], + text = data[["label"]], + hovertext = data[["hovertext"]], + key = data[["key"]], + customdata = data[["customdata"]], + frame = data[["frame"]], + ids = data[["ids"]], + textfont = list( + # TODO: how to translate fontface/family? + size = aes2plotly(data, params, "size"), + color = toRGB( + aes2plotly(data, params, "colour"), + aes2plotly(data, params, "alpha") + ) + ), + type = "scatter", + mode = "text", + hoveron = hover_on(data) + )) +} + +#' @export +geom2trace.GeomTile <- function(data, params, p) { + x <- sort(unique(data[["x"]])) + y <- sort(unique(data[["y"]])) + # make sure we're dealing with a complete grid + g <- expand.grid(x = x, y = y) + g$order <- seq_len(nrow(g)) + g <- merge(g, data, by = c("x", "y"), all.x = TRUE) + g <- g[order(g$order), ] + # put fill domain on 0-1 scale for colorscale purposes + g$fill_plotlyDomain <- scales::rescale(g$fill_plotlyDomain) + # create the colorscale + colScale <- unique(g[, c("fill_plotlyDomain", "fill")]) + # colorscale goes crazy if there are NAs + colScale <- colScale[stats::complete.cases(colScale), ] + colScale <- colScale[order(colScale$fill_plotlyDomain), ] + compact(list( + x = x, + y = y, + z = matrix(g$fill_plotlyDomain, nrow = length(y), ncol = length(x), byrow = TRUE), + text = matrix(g$hovertext, nrow = length(y), ncol = length(x), byrow = TRUE), + key = data[["key"]], + customdata = data[["customdata"]], + frame = data[["frame"]], + ids = data[["ids"]], + colorscale = setNames(colScale, NULL), + type = "heatmap", + showscale = FALSE, + autocolorscale = FALSE + )) +} + +#' @export +geom2trace.GeomErrorbar <- function(data, params, p) { + # Support of bi-directional GeomErrorbar introduced with ggplot2 3.3.0 + # g <- ggplot() + geom_errorbar(aes(y = "A", xmin = 1, xmax = 2)) + # ggplotly(g) +# Support of bi-directional GeomErrorbar introduced with ggplot2 3.3.0: +# g <- ggplot() + geom_errorbar(aes(y = "A", xmin = 1, xmax = 2)) +# ggplotly(g) +if (params[["flipped_aes"]]) { + make_error(data, params, "x") + } else { + make_error(data, params, "y") + } +} + +#' @export +geom2trace.GeomErrorbarh <- function(data, params, p) { + make_error(data, params, "x") +} + +#' @export +geom2trace.default <- function(data, params, p) { + warning( + "geom_", class(data)[1], "() has yet to be implemented in plotly.\n", + " If you'd like to see this geom implemented,\n", + " Please open an issue with your example code at\n", + " https://github.com/ropensci/plotly/issues" + ) + list() +} + +# --------------------------------------------------------------------------- +# Utility functions +# -------------------------------------------------------------------------- + +# given a geom, should we split on any continuous variables? +# this is necessary for some geoms, for example, polygons +# since plotly.js can't draw two polygons with different fill in a single trace +split_on <- function(dat) { + lookup <- list( + GeomHline = c("linetype", "colour", "size", "linewidth"), + GeomVline = c("linetype", "colour", "size", "linewidth"), + GeomAbline = c("linetype", "colour", "size", "linewidth"), + GeomPath = c("fill", "colour", "size", "linewidth"), + GeomPolygon = c("fill", "colour", "size", "linewidth"), + GeomBar = "fill", + GeomBoxplot = c("colour", "fill", "size"), + GeomErrorbar = "colour", + GeomErrorbarh = "colour", + GeomText = "colour" + ) + # try to split on the domain (for sensible trace ordering) + for (i in names(lookup)) { + domainName <- paste0(lookup[[i]], "_plotlyDomain") + idx <- domainName %in% names(dat) + lookup[[i]][idx] <- domainName[idx] + } + # search all the classes for relevant splits (moving from specific->generic) + splits <- NULL + for (i in class(dat)) { + splits <- splits %||% lookup[[i]] + } + # if hovering on fill, we need to split on hovertext + if (identical(hover_on(dat), "fills")) { + splits <- c(splits, "hovertext") + } + # make sure the variable is in the data, and is non-constant + splits <- splits[splits %in% names(dat)] + # is there more than one unique value for this aes split in the data? + for (i in splits) { + if (length(unique(dat[, i])) < 2) { + splits <- setdiff(splits, i) + } + } + splits +} + +# given a geom, are we hovering over points or fill? +hover_on <- function(data) { + if (inherits(data, c("GeomHex", "GeomRect", "GeomMap", "GeomMosaic", "GeomAnnotationMap")) || + # is this a "basic" polygon? + identical("GeomPolygon", grep("^Geom", class(data), value = T))) { + "fills" + } else { + "points" + } +} + +# make trace with errorbars +make_error <- function(data, params, xy = "x") { + # if xy is NULL: set xy to mean of xy_min and xy_max + data[[xy]] <- data[[xy]] %||% ((data[[paste0(xy, "min")]] + data[[paste0(xy, "max")]]) / 2) + color <- aes2plotly(data, params, "colour") + e <- list( + x = data[["x"]], + y = data[["y"]], + text = uniq(data[["hovertext"]]), + key = data[["key"]], + customdata = data[["customdata"]], + frame = data[["frame"]], + ids = data[["ids"]], + type = "scatter", + mode = "lines", + opacity = aes2plotly(data, params, "alpha"), + line = list(color = "transparent") + ) + e[[paste0("error_", xy)]] <- list( + array = data[[paste0(xy, "max")]] - data[[xy]], + arrayminus = data[[xy]] - data[[paste0(xy, "min")]], + type = "data", + width = data$width[1] / 2, + symmetric = FALSE, + color = color + ) + compact(e) +} + +# function to transform geom_ribbon data into format plotly likes +# (note this function is also used for geom_smooth) +ribbon_dat <- function(dat) { + n <- nrow(dat) + if (n == 0) return(dat) + o <- order(dat[["x"]]) + o2 <- order(dat[["x"]], decreasing = TRUE) + used <- c("x", "ymin", "ymax", "y") + not_used <- setdiff(names(dat), used) + # top-half of ribbon + tmp <- dat[o, ] + others <- tmp[not_used] + dat1 <- cbind(x = tmp[["x"]], y = tmp[["ymin"]], others) + dat1[n+1, ] <- data.frame(x = tmp[["x"]][n], y = tmp[["ymin"]][n], others[n, ]) + # bottom-half of ribbon + tmp2 <- dat[o2, ] + others2 <- tmp2[not_used] + dat2 <- cbind(x = tmp2[["x"]], y = tmp2[["ymax"]], others2) + structure(rbind(dat1, dat2), class = oldClass(dat)) +} + +aes2plotly <- function(data, params, aes = "size") { + geom <- class(data)[1] + + vals <- uniq(data[[aes]]) %||% params[[aes]] + + if (is.null(vals)) { + # Hack to support this geom_sf hack + # https://github.com/tidyverse/ggplot2/blob/505e4bfb/R/sf.R#L179-L187 + defaults <- if (inherits(data, "GeomSf") && exists("default_aesthetics", envir = asNamespace("ggplot2"))) { + type <- if (any(grepl("[P-p]oint", class(data)))) "point" else if (any(grepl("[L-l]ine", class(data)))) "line" else "" + ggfun("default_aesthetics")(type) + } else { + geom_obj <- ggfun(geom) + # If the first class of `data` is a data.frame, + # ggfun() returns a function because ggplot2 now + # defines data.frame in it's namespace + # https://github.com/ropensci/plotly/pull/1481 + if ("default_aes" %in% names(geom_obj)) geom_obj$use_defaults(NULL) else NULL + } + vals <- defaults[[aes]] + } + vals <- vals %||% NA + + converter <- switch( + aes, + size = mm2pixels, + linewidth = mm2pixels, + stroke = mm2pixels, + colour = toRGB, + fill = toRGB, + linetype = lty2dash, + shape = pch2symbol, + alpha = function(x) { x[is.na(x)] <- 1; x }, + width = function(x) { x / 2}, + height = function(x) { x / 2} + ) + if (is.null(converter)) { + warning("A converter for ", aes, " wasn't found. \n", + "Please report this issue to: \n", + "https://github.com/ropensci/plotly/issues/new", call. = FALSE) + converter <- identity + } + converter(vals) +} + + +# ggplot2 3.4.0 deprecated size in favor of linewidth in line-based geoms (e.g., +# GeomLine, GeomRect, etc) and elements (e.g., element_line(), element_rect(), +# etc). Note that, some geoms (e.g., GeomBoxplot, GeomSf) can have both +# linewidth and size +linewidth_or_size <- function(x) { + UseMethod("linewidth_or_size") +} + +#' @export +linewidth_or_size.Geom <- function(x) { + if ("linewidth" %in% x$aesthetics()) "linewidth" else "size" +} + +#' @export +linewidth_or_size.element <- function(x) { + # S7 objects (ggplot2 >= 4.0) don't have traditional names(), check for slot + if (!is.null(x$linewidth) || "linewidth" %in% names(x)) "linewidth" else "size" +} + +#' @export +linewidth_or_size.default <- function(x) { + if (get_package_version("ggplot2") >= "3.4") "linewidth" else "size" +} + + +# Convert R pch point codes to plotly "symbol" codes. +pch2symbol <- function(x) { + lookup <- list( + "0" = "square-open", + "1" = "circle-open", + "2" = "triangle-up-open", + "3" = "cross-thin-open", + "4" = "x-thin-open", + "5" = "diamond-open", + "6" = "triangle-down-open", + "7" = "square-x-open", + "8" = "asterisk-open", + "9" = "diamond-x-open", + "10" = "circle-cross-open", + "11" = "hexagram-open", + "12" = "square-cross-open", + "13" = "circle-x-open", + "14" = "square-open-dot", + "15" = "square", + "16" = "circle", + "17" = "triangle-up", + "18" = "diamond", + "19" = "circle", + "20" = "circle", + "21" = "circle", + "22" = "square", + "23" = "diamond", + "24" = "triangle-up", + "25" = "triangle-down", + "32" = "circle", + "35" = "hash-open", + "42" = "asterisk-open", + "43" = "cross-thin-open", + "45" = "line-ew-open", + "47" = "line-ne-open", + "48" = "circle-open", + "79" = "circle-open", + "88" = "x-thin-open", + "92" = "line-nw-open", + "95" = "line-ew-open", + "111" = "circle-open", + "o" = "circle-open", + "O" = "circle-open", + "+" = "cross-thin-open" + ) + x <- as.character(x) + idx <- x %in% names(lookup) + if (any(idx)) { + x[idx] <- lookup[x[idx]] + } + as.character(x) +} + +# Convert R lty line type codes to plotly "dash" codes. +lty2dash <- function(x) { + lookup <- list( + "0" = "none", + "1" = "solid", + "2" = "dash", + "3" = "dot", + "4" = "dashdot", + "5" = "longdash", + "6" = "longdashdot", + "blank" = "none", + "solid" = "solid", + "dashed" = "dash", + "dotted" = "dot", + "dotdash" = "dashdot", + "longdash" = "longdash", + "twodash" = "longdashdot", + "22" = "dash", + "42" = "dot", + "44" = "dashdot", + "13" = "longdash", + "1343" = "longdashdot", + "73" = "dash", + "2262" = "dashdot" , + "12223242" = "dashdot" , + "F282" = "dash", + "F4448444" = "dash", + "224282F2" = "dash", + "F1" = "dash" + ) + x <- as.character(x) + idx <- x %in% names(lookup) + if (any(idx)) { + x[idx] <- lookup[x[idx]] + } + as.character(x) +} diff --git a/R/layout.R b/R/layout.R new file mode 100644 index 0000000000..e72bb5ceb0 --- /dev/null +++ b/R/layout.R @@ -0,0 +1,175 @@ +#' Modify the layout of a plotly visualization +#' +#' @param p A plotly object. +#' @param ... Arguments to the layout object. For documentation, +#' see \url{https://plotly.com/r/reference/layout/} +#' @param data A data frame to associate with this layout (optional). If not +#' provided, arguments are evaluated using the data frame in [plot_ly()]. +#' @author Carson Sievert +#' @export +layout <- function(p, ..., data = NULL) { + UseMethod("layout") +} + +#' @export +layout.matrix <- function(p, ..., data = NULL) { + # workaround for the popular graphics::layout() function + # https://github.com/ropensci/plotly/issues/464 + graphics::layout(p, ...) +} + +#' @export +layout.shiny.tag.list <- function(p, ..., data = NULL) { + idx <- which(vapply(p, is.plotly, logical(1))) + for (i in idx) { + p[[i]] <- layout.plotly(p[[i]], ..., data = NULL) + } + p +} + +#' @export +layout.plotly <- function(p, ..., data = NULL) { + p <- add_data(p, data) + attrs <- list(...) + if (!is.null(attrs[["height"]]) || !is.null(attrs[["width"]])) { + warning("Specifying width/height in layout() is now deprecated.\n", + "Please specify in ggplotly() or plot_ly()", call. = FALSE) + } + # similar to add_trace() + p$x$layoutAttrs <- c( + p$x$layoutAttrs %||% list(), + setNames(list(attrs), p$x$cur_data) + ) + p +} + +#' Add a range slider to the x-axis +#' +#' @param p plotly object. +#' @param start a start date/value. +#' @param end an end date/value. +#' @param ... these arguments are documented here +#' \url{https://plotly.com/r/reference/#layout-xaxis-rangeslider} +#' @export +#' @author Carson Sievert +#' @examplesIf interactive() || !identical(.Platform$OS.type, "windows") +#' +#' plot_ly(x = time(USAccDeaths), y = USAccDeaths) %>% +#' add_lines() %>% +#' rangeslider() +#' +#' d <- tibble::tibble( +#' time = seq(as.Date("2016-01-01"), as.Date("2016-08-31"), by = "days"), +#' y = rnorm(seq_along(time)) +#' ) +#' +#' plot_ly(d, x = ~time, y = ~y) %>% +#' add_lines() %>% +#' rangeslider(d$time[5], d$time[50]) +#' +#' +rangeslider <- function(p, start = NULL, end = NULL, ...) { + if (sum(grepl("^xaxis", names(p$x$layout))) > 1) { + stop("Can only add a rangeslider to a plot with one x-axis", call. = FALSE) + } + + p$x$layout$xaxis$range <- c( + to_milliseconds(start), + to_milliseconds(end) + ) + + p$x$layout$xaxis$rangeslider <- list(visible = TRUE, ...) + p +} + + +#' Set the default configuration for plotly +#' +#' @param p a plotly object +#' @param ... these arguments are documented at +#' \url{https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js} +#' @param cloud deprecated. Use `showSendToCloud` instead. +#' @param showSendToCloud include the send data to cloud button? +#' @param locale locale to use. See [here](https://github.com/plotly/plotly.js/tree/master/dist#to-include-localization) for more info. +#' @param mathjax add [MathJax rendering support](https://github.com/plotly/plotly.js/tree/master/dist#to-support-mathjax). +#' If `"cdn"`, mathjax is loaded externally (meaning an internet connection is needed for +#' TeX rendering). If `"local"`, the PLOTLY_MATHJAX_PATH environment variable must be +#' set to the location (a local file path) of MathJax. IMPORTANT: **plotly** uses SVG-based +#' mathjax rendering which doesn't play nicely with HTML-based rendering +#' (e.g., **rmarkdown** documents and **shiny** apps). To leverage both types of rendering, +#' you must `', - url, width %||% "100%", height %||% "400" - ) + +#' Embed a plotly grid as an iframe in a knitr doc +#' +#' @param x a plotly figure object +#' @param options knitr options. +#' @param ... placeholder. +#' @export +#' @references https://github.com/yihui/knitr/blob/master/vignettes/knit_print.Rmd +knit_print.api_grid_local <- function(x, options, ...) { + print(tibble::as_tibble(x$preview)) +} + + +api_plot_url <- function(x, embed = FALSE) { + url <- if (embed) x$embed_url else x$web_url + secret <- x$share_key_enabled %||% FALSE + if (secret) paste0(url, "?share_key=", x$share_key) else url +} + +api_grid_url <- function(x, embed = FALSE) { + secret <- x$share_key_enabled %||% FALSE + if (embed) { + paste0(x$embed_url, if (secret) paste0("?share_key=", x$share_key)) + } else { + # encourage people to use the create platform + paste0("https://plot.ly/create/?fid=", x$fid, if (secret) paste0("&share_key=", x$share_key)) + } } diff --git a/R/process.R b/R/process.R index 412f0a863e..bb422e6839 100644 --- a/R/process.R +++ b/R/process.R @@ -6,38 +6,53 @@ process <- function(resp) { UseMethod("process") } -process.clientresp <- function(resp) { - httr::stop_for_status(resp) - con <- from_JSON(httr::content(resp, as = "text")) - if (nchar(con$error) > 0) stop(con$error, call. = FALSE) - if (nchar(con$warning) > 0) warning(con$warning, call. = FALSE) - if (nchar(con$message) > 0) message(con$message, call. = FALSE) - con +#' @export +process.default <- function(resp) { + json_content(relay_error(resp)) } -process.image <- function(resp) { - httr::stop_for_status(resp) +#' @export +process.api_plot <- function(resp) { + json_content(relay_error(resp)) +} + +#' @export +process.api_image <- function(resp) { + relay_error(resp) + type <- resp[["headers"]][["content-type"]] # httr (should) know to call png::readPNG() which returns raster array - tryCatch(httr::content(resp, as = "parsed"), - error = function(e) httr::content(resp, as = "raw")) + tryCatch( + httr::content(resp, as = "parsed", type = type), + error = function(e) httr::content(resp, as = "raw", type = type) + ) } -process.figure <- function(resp) { - httr::stop_for_status(resp) - con <- from_JSON(content(resp, as = "text")) - fig <- con$payload$figure - fig$url <- sub("apigetfile/", "~", resp$url) - fig <- add_boxed(fig) - fig$data[[1]]$inherit <- FALSE - # any reasonable way to return a data frame? - hash_plot(data.frame(), fig) +# the default for httr::content() doesn't simplify vectors apparently... +json_content <- function(resp) { + if (length(resp$content) == 0) return(list()) + from_JSON( + httr::content( + resp, + as = "text", + type = resp[["headers"]][["content-type"]], + encoding = "UTF-8" + ) + ) } -process.signup <- function(resp) { - httr::stop_for_status(resp) - con <- from_JSON(content(resp, as = "text")) - if (nchar(con[["error"]]) > 0) stop(con$error, call. = FALSE) - # Relaying a message with a private key probably isn't a great idea -- - # https://github.com/ropensci/plotly/pull/217#issuecomment-100381166 - con +relay_error <- function(resp) { + if (!httr::http_error(resp)) { + return(resp) + } + con <- httr::content(resp) + # if we can't relay the plotly server error messages, return the response + if (!"errors" %in% names(con)) { + return(resp) + } + msgs <- lapply(con$errors, "[[", "message") + stop( + httr::http_status(resp)[["message"]], "\n\t", + paste(msgs, collapse = "\n\t"), + call. = FALSE + ) } diff --git a/R/proxy.R b/R/proxy.R new file mode 100644 index 0000000000..f1b9e142b4 --- /dev/null +++ b/R/proxy.R @@ -0,0 +1,112 @@ +#' Modify a plotly object inside a shiny app +#' +#' @param outputId single-element character vector indicating the output ID +#' map to modify (if invoked from a Shiny module, the namespace will be added +#' automatically) +#' @param session the Shiny session object to which the map belongs; usually the +#' default value will suffice. +#' @param deferUntilFlush indicates whether actions performed against this +#' instance should be carried out right away, or whether they should be held +#' until after the next time all of the outputs are updated. +#' @rdname plotlyProxy +#' @export +#' @examplesIf interactive() || !identical(.Platform$OS.type, "windows") +#' +#' +#' if (require("shiny") && interactive()) { +#' plotly_example("shiny", "proxy_relayout") +#' plotly_example("shiny", "proxy_mapbox") +#' } +#' +plotlyProxy <- function(outputId, session = shiny::getDefaultReactiveDomain(), + deferUntilFlush = TRUE) { + + # implementation very similar to leaflet::leafletProxy & DT:dataTableProxy + if (is.null(session)) { + stop("plotlyProxy must be called from the server function of a Shiny app") + } + + if (!is.null(session$ns) && nzchar(session$ns(NULL)) && + # TODO: require a recent version of R and use startsWith()? + substring(outputId, 1, nchar(session$ns(""))) != session$ns("")) { + outputId <- session$ns(outputId) + } + structure( + list( + session = session, + id = outputId, + deferUntilFlush = deferUntilFlush + # TODO: is there actually a use-case for this? + #x = structure(list(), leafletData = data), + #dependencies = NULL + ), + class = "plotly_proxy" + ) +} + + +# ---------------------------------------------------------------------- +# TODO: implement some higher-level functions, say `plotlyProxyLayout()`, +# `plotlyProxyAddTraces()`, `plotlyProxyStyle()`, that pick the right +# method, except formula/data mappings, and possibly some argument checking +# ---------------------------------------------------------------------- + + +#' @param p a plotly proxy object (created with `plotlyProxy`) +#' @param method a plotlyjs method to invoke. For a list of options, +#' visit +#' @param ... unnamed arguments passed onto the plotly.js method +#' @rdname plotlyProxy +#' @export +plotlyProxyInvoke <- function(p, method, ...) { + + if (!is.proxy(p)) + stop("p must be a proxy object. See `help(plotlyProxy)`", call. = FALSE) + + if (missing(method)) + stop( + "Must provide a plotly.js method (as a character string of length 1).\n", + sprintf("Valid options include: '%s'", + paste(plotlyjs_methods(), collapse = "', '")), + call. = FALSE + ) + + method <- match.arg(method, plotlyjs_methods()) + + msg <- list( + id = p$id, + method = method, + # TODO: can we leverage the plotly_build() infrastructure in a smart way? + # args = evalFormula(list(...), data) + args = list(...) + ) + + if (isTRUE(p$deferUntilFlushed)) { + + p$session$onFlushed(function() { + p$session$sendCustomMessage("plotly-calls", msg) + }, once = TRUE) + + } else { + + p$session$sendCustomMessage("plotly-calls", msg) + + } + + p +} + + +plotlyjs_methods <- function() { + c( + "restyle", "relayout", "update", "addTraces", "deleteTraces", "moveTraces", + "extendTraces", "prependTraces", "purge", "toImage", "downloadImage", "animate", + "newPlot", "react", "validate", "makeTemplate", "validateTemplate", "addFrames", + "reconfig" + ) +} + + +is.proxy <- function(x) { + inherits(x, "plotly_proxy") +} diff --git a/R/sf.R b/R/sf.R new file mode 100644 index 0000000000..a92c919bca --- /dev/null +++ b/R/sf.R @@ -0,0 +1,102 @@ +# IMPORTANT: fortify_sf() should only be used on collections of identical +# geometries -- https://github.com/r-spatial/sf/issues/584 + +# Note how, in to_basic.GeomSf(), we split data into a list of data.frames +# (each data frame has at most one geometry type). + +# TODO: speed this up by avoiding conversion redundant features (e.g. animation) +fortify_sf <- function(model, ...) { + # matrix with coordinates (X, Y, possibly Z and/or M) in rows, possibly + # followed by integer indicators L1,...,L3 that point out to which structure + # the coordinate belongs; for POINT this is absent (each coordinate is a feature), + # for LINESTRING L1 refers to the feature, for MULTIPOLYGON L1 refers to the main + # ring or holes, L2 to the ring id in the MULTIPOLYGON, and L3 to the simple feature. + coords <- sf::st_coordinates(sf::st_geometry(model)) + colnames(coords) <- tolower(colnames(coords)) + lcols <- grep("^l", colnames(coords)) + + # no longer need to carry around sf class or geometry list-column + model <- remove_class(model, "sf") + model$geometry <- NULL + + # no join necessary for points + if (!length(lcols)) return(cbind(model, coords)) + + # warn about potential column name conflicts + nms <- intersect(names(model), colnames(coords)) + if (length(nms)) { + warning( + sprintf("Found columns named: '%s' ", paste(nms, collapse = "', '")), + "in your data. These names conflict with auto-generated sf coordinates ", + "it might be a good idea to change these names.", + call. = FALSE + ) + } + + # attach a simple feature row id (for joining data with coords) + model[[sf_key()]] <- seq_len(nrow(model)) + + # last column of coords pertains to the simple feature row id + coords <- as.data.frame(coords) + coords[[sf_key()]] <- coords[[ncol(coords)]] + + # join back together + d <- dplyr::left_join(coords, model, by = sf_key()) + + # drop simple feature row id + d[[sf_key()]] <- NULL + + # the combination of l1/l2/l3 should be treated like a new grouping var + # TODO: group is included here for ggplotly() purposes...it should probably be taken out... + group_var <- d[names(d) %in% c("group", "l1", "l2", "l3")] + paste_ <- function(...) paste(..., sep = "-") + d$group <- Reduce(paste_, group_var) + + # TODO: drop l1/l2/l3? + d +} + +sf_key <- function() ".sf-group-id" + +# Credit to Hadley Wickham +# https://github.com/rstudio/leaflet/blame/d489e2cd/R/normalize-sf.R#L94-L113 +st_cast_crs <- function(x) { + crs <- sf::st_crs(x) + + if (is.na(crs)) { + warning( + "Missing coordinate reference system (crs). Defaulting to EPSG:4326" + ) + return(sf::st_set_crs(x, 4326)) + } + + isLongLat <- isTRUE(sf::st_is_longlat(x)) + isWGS84 <- grepl("+datum=WGS84", crs$proj4string, fixed = TRUE) + + if (!(isLongLat && isWGS84)) { + warning( + "The trace types 'scattermapbox' and 'scattergeo' require a projected ", + "coordinate system that is based on the WGS84 datum (EPSG:4326), ", + "but the crs provided is: '", crs$proj4string, "'. ", + "Attempting transformation to the target coordinate system.", + call. = FALSE + ) + return(sf::st_transform(x, 4326)) + } + + x +} + +# the minimal set of attribute defaults +sf_default_attrs <- function(d) { + if (inherits(d, "GeomPolygon")) return(list(mode = "lines", fill = "toself")) + if (inherits(d, "GeomPath")) return(list(mode = "lines")) + if (inherits(d, "GeomPoint")) return(list(mode = "markers")) + stop("Unexpected case. Please report an issue here https://github.com/ropensci/plotly/issues/new", call. = FALSE) +} + + +is_sf <- function(dat) { + if (crosstalk::is.SharedData(dat)) dat <- dat$origData() + inherits(dat, "sf") +} diff --git a/R/shiny.R b/R/shiny.R index 57710dce83..a25b653aac 100644 --- a/R/shiny.R +++ b/R/shiny.R @@ -5,27 +5,270 @@ #' #' @param outputId output variable to read from #' @param width,height Must be a valid CSS unit (like \code{"100\%"}, -#' \code{"400px"}, \code{"auto"}) or a number, which will be coerced to a -#' string and have \code{"px"} appended. +#' `"400px"`, `"auto"`) or a number, which will be coerced to a +#' string and have `"px"` appended. Note that, for height, using "auto" +#' or "100%" generally will not work as expected, because of how +#' height is computed with HTML/CSS. +#' @param inline use an inline (`span()`) or block container +#' (`div()`) for the output +#' @param reportTheme whether or not to report CSS styles (if a sufficient +#' version of shiny and htmlwidgets is available). #' @param expr An expression that generates a plotly -#' @param env The environment in which to evaluate \code{expr}. -#' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This +#' @param env The environment in which to evaluate `expr`. +#' @param quoted Is `expr` a quoted expression (with `quote()`)? This #' is useful if you want to save an expression in a variable. -#' +#' @param fill see [htmlwidgets::shinyWidgetOutput()] for explanation (requires +#' a recent version of htmlwidgets). #' @importFrom htmlwidgets shinyWidgetOutput #' @importFrom htmlwidgets shinyRenderWidget #' @name plotly-shiny #' #' @export -plotlyOutput <- function(outputId, width = "100%", height = "400px") { - htmlwidgets::shinyWidgetOutput(outputId, "plotly", width, height, package = "plotly") +plotlyOutput <- function(outputId, width = "100%", height = "400px", + inline = FALSE, reportTheme = TRUE, fill = !inline) { + args <- list( + outputId = outputId, + name = "plotly", + width = width, + height = height, + inline = inline, + package = "plotly", + reportSize = TRUE + ) + if (is_installed("shiny", "1.4.0.9003") && is_installed("htmlwidgets", "1.5.2.9000")) { + args$reportTheme <- reportTheme + } + if (is_installed("htmlwidgets", "1.5.4.9001")) { + args$fill <- fill + } + do.call(htmlwidgets::shinyWidgetOutput, args) } #' @rdname plotly-shiny #' @export renderPlotly <- function(expr, env = parent.frame(), quoted = FALSE) { - if (!quoted) { expr <- substitute(expr) } # force quoted - # https://github.com/ramnathv/htmlwidgets/issues/166#issuecomment-153000306 - expr <- call("as.widget", expr) - shinyRenderWidget(expr, plotlyOutput, env, quoted = TRUE) + if (!quoted) { + quoted <- TRUE + expr <- substitute(expr) + } + # Install the (user-supplied) expression as a function + # This way, if the user-supplied expression contains a return() + # statement, we can capture that return value and pass it along + # to prepareWidget() + # prepareWidget() makes it possible to pass different non-plotly + # objects to renderPlotly() (e.g., ggplot2, promises). It also is used + # to inform event_data about what events have been registered + shiny::installExprFunction(expr, "func", env, quoted) + expr2 <- quote(getFromNamespace("prepareWidget", "plotly")(func())) + renderFunc <- shinyRenderWidget(expr2, plotlyOutput, environment(), quoted, + cacheHint = list(label = "renderPlotly", userExpr = expr) + ) + # remove 'internal' plotly attributes that are known to cause false + # positive test results in shinytest (snapshotPreprocessOutput was added + # in shiny 1.0.3.9002, but we require >= 1.1) + shiny::snapshotPreprocessOutput( + renderFunc, + function(value) { + json <- from_JSON(value) + json$x <- json$x[setdiff(names(json$x), c("visdat", "cur_data", "attrs"))] + to_JSON(json) + } + ) +} + +# Converts a plot, OR a promise of a plot, to plotly +prepareWidget <- function(x) { + if (promises::is.promising(x)) { + promises::then( + promises::then(x, plotly_build), + register_plot_events + ) + } else { + register_plot_events(plotly_build(x)) + } +} + +register_plot_events <- function(p) { + session <- shiny::getDefaultReactiveDomain() + eventIDs <- paste(p$x$shinyEvents, p$x$source, sep = "-") + session$userData$plotlyShinyEventIDs <- unique(c( + session$userData$plotlyShinyEventIDs, + eventIDs + )) + p +} + + +#' Access plotly user input event data in shiny +#' +#' This function must be called within a reactive shiny context. +#' +#' @param event The type of plotly event. All supported events are listed in the +#' function signature above (i.e., the usage section). +#' @param source a character string of length 1. Match the value of this string +#' with the `source` argument in [plot_ly()] (or [ggplotly()]) to respond to +#' events emitted from that specific plot. +#' @param session a shiny session object (the default should almost always be used). +#' @param priority the priority of the corresponding shiny input value. +#' If equal to `"event"`, then [event_data()] always triggers re-execution, +#' instead of re-executing only when the relevant shiny input value changes +#' (the default). +#' @export +#' @seealso [event_register], [event_unregister] +#' @references +#' * +#' * +#' @author Carson Sievert +#' @examples \dontrun{ +#' plotly_example("shiny", "event_data") +#' } + +event_data <- function( + event = c( + "plotly_hover", "plotly_unhover", "plotly_click", "plotly_doubleclick", + "plotly_selected", "plotly_selecting", "plotly_brushed", "plotly_brushing", + "plotly_deselect", "plotly_relayout", "plotly_restyle", "plotly_legendclick", + "plotly_legenddoubleclick", "plotly_clickannotation", "plotly_afterplot", + "plotly_sunburstclick" + ), + source = "A", + session = shiny::getDefaultReactiveDomain(), + priority = c("input", "event") +) { + if (is.null(session)) { + stop("No reactive domain detected. This function can only be called \n", + "from within a reactive shiny context.") + } + + event <- match.arg(event) + eventID <- paste(event, source, sep = "-") + + # It's possible for event_data() to execute before any + # relevant input values have been registered (i.e, before + # relevant plotly graphs have been executed). Therefore, + # we delay checking that a relevant input value has been + # registered until shiny flushes + session$onFlushed( + function() { + eventIDRegistered <- eventID %in% session$userData$plotlyShinyEventIDs + if (!eventIDRegistered) { + warning( + "The '", event, "' event tied a source ID of '", source, "' ", + "is not registered. In order to obtain this event data, ", + "please add `event_register(p, '", event, "')` to the plot (`p`) ", + "that you wish to obtain event data from.", + call. = FALSE + ) + } + } + ) + + # legend clicking returns trace(s), which shouldn't be simplified... + parseJSON <- if (event %in% c("plotly_legendclick", "plotly_legenddoubleclick")) { + from_JSON + } else { + function(x) jsonlite::parse_json(x, simplifyVector = TRUE) + } + + # Handle NULL sensibly + parseJSONVal <- function(x) { + if (is.null(x)) x else parseJSON(x) + } + + parsedInputValue <- function() { + parseJSONVal(session$rootScope()$input[[eventID]]) + } + + # events that don't emit any data should _always_ be treated with event priority + priority <- if (event %in% c("plotly_doubleclick", "plotly_deselect", "plotly_afterplot")) { + "event" + } else { + match.arg(priority) + } + + if (priority == "event") { + # Shiny.setInputValue() is always called with event priority + # so simply return the parse input value + return(parsedInputValue()) + + } else { + + eventHasStorage <- eventID %in% shiny::isolate(names(session$userData$plotlyInputStore)) + + if (!eventHasStorage) { + # store input value as a reactive value to leverage caching + session$userData$plotlyInputStore <- session$userData$plotlyInputStore %||% shiny::reactiveValues() + session$userData$plotlyInputStore[[eventID]] <- shiny::isolate(parsedInputValue()) + shiny::observe({ + session$userData$plotlyInputStore[[eventID]] <- parsedInputValue() + }, priority = 10000, domain = session) + } + + session$userData$plotlyInputStore[[eventID]] + } + +} + + +#' Register a shiny input value +#' +#' @inheritParams event_data +#' @param p a plotly object. +#' @seealso [event_data] +#' @export +#' @author Carson Sievert +event_register <- function(p, event = NULL) { + event <- match.arg(event, event_data_events()) + shiny_event_add(p, event) +} + +#' Un-register a shiny input value +#' +#' @inheritParams event_data +#' @param p a plotly object. +#' @seealso [event_data] +#' @export +#' @author Carson Sievert +event_unregister <- function(p, event = NULL) { + event <- match.arg(event, event_data_events()) + shiny_event_remove(p, event) +} + + +# helpers +shiny_event_add <- function(p, event) { + p <- shiny_defaults_set(p) + p$x$shinyEvents <- unique(c(p$x$shinyEvents, event)) + p +} + +shiny_event_remove <- function(p, event) { + p <- shiny_defaults_set(p) + p$x$shinyEvents <- setdiff(p$x$shinyEvents, event) + p +} + +shiny_defaults_set <- function(p) { + p$x$shinyEvents <- p$x$shinyEvents %||% shiny_event_defaults() + p +} + +shiny_event_defaults <- function() { + c( + "plotly_hover", + "plotly_click", + "plotly_selected", + "plotly_relayout", + "plotly_brushed", + "plotly_brushing", + "plotly_clickannotation", + "plotly_doubleclick", + "plotly_deselect", + "plotly_afterplot", + "plotly_sunburstclick" + ) +} + +event_data_events <- function() { + eval(formals(event_data)$event) } diff --git a/R/signup.R b/R/signup.R index 2d8f5051a3..82ce8b4e8b 100644 --- a/R/signup.R +++ b/R/signup.R @@ -1,3 +1,4 @@ + #' Create a new plotly account. #' #' A sign up interface to plotly through the R Console. @@ -12,7 +13,7 @@ #' \item api_key key to use with the api #' \item tmp_pw temporary password to access your plotly account #' } -#' @references https://plot.ly/rest/ +#' @references https://plotly.com/rest/ #' @export #' @examples \dontrun{ #' # You need a plotly username and API key to communicate with the plotly API. @@ -41,11 +42,18 @@ signup <- function(username, email, save = TRUE) { un = username, email = email, platform = "R", - version = as.character(packageVersion("plotly")) + version = as.character(get_package_version("plotly")) ) base_url <- file.path(get_domain(), "apimkacct") - resp <- httr::POST(base_url, body = bod) - con <- process(struct(resp, "signup")) + resp <- httr::RETRY( + verb = "POST", + base_url, + body = bod, + times = 5, + terminate_on = c(400, 401, 403, 404), + terminate_on_success = TRUE + ) + con <- process(append_class(resp, "signup")) if (save) { # store API key as an environment variable in .Rprofile cat_profile("username", con$un) diff --git a/R/staticimports.R b/R/staticimports.R new file mode 100644 index 0000000000..525b30fcb7 --- /dev/null +++ b/R/staticimports.R @@ -0,0 +1,107 @@ +# Generated by staticimports; do not edit by hand. +# ====================================================================== +# Imported from pkg:staticimports +# ====================================================================== + +# Borrowed from pkgload:::dev_meta, with some modifications. +# Returns TRUE if `pkg` was loaded with `devtools::load_all()`. +devtools_loaded <- function(pkg) { + ns <- .getNamespace(pkg) + if (is.null(ns) || is.null(ns$.__DEVTOOLS__)) { + return(FALSE) + } + TRUE +} + +get_package_version <- function(pkg) { + # `utils::packageVersion()` can be slow, so first try the fast path of + # checking if the package is already loaded. + ns <- .getNamespace(pkg) + if (is.null(ns)) { + utils::packageVersion(pkg) + } else { + as.package_version(ns$.__NAMESPACE__.$spec[["version"]]) + } +} + +is_installed <- function(pkg, version = NULL) { + installed <- isNamespaceLoaded(pkg) || nzchar(system_file_cached(package = pkg)) + if (is.null(version)) { + return(installed) + } + installed && isTRUE(get_package_version(pkg) >= version) +} + +# Borrowed from pkgload::shim_system.file, with some modifications. This behaves +# like `system.file()`, except that (1) for packages loaded with +# `devtools::load_all()`, it will return the path to files in the package's +# inst/ directory, and (2) for other packages, the directory lookup is cached. +# Also, to keep the implementation simple, it doesn't support specification of +# lib.loc or mustWork. +system_file <- function(..., package = "base") { + if (!devtools_loaded(package)) { + return(system_file_cached(..., package = package)) + } + + if (!is.null(names(list(...)))) { + stop("All arguments other than `package` must be unnamed.") + } + + # If package was loaded with devtools (the package loaded with load_all), + # also search for files under inst/, and don't cache the results (it seems + # more likely that the package path will change during the development + # process) + pkg_path <- find.package(package) + + # First look in inst/ + files_inst <- file.path(pkg_path, "inst", ...) + present_inst <- file.exists(files_inst) + + # For any files that weren't present in inst/, look in the base path + files_top <- file.path(pkg_path, ...) + present_top <- file.exists(files_top) + + # Merge them together. Here are the different possible conditions, and the + # desired result. NULL means to drop that element from the result. + # + # files_inst: /inst/A /inst/B /inst/C /inst/D + # present_inst: T T F F + # files_top: /A /B /C /D + # present_top: T F T F + # result: /inst/A /inst/B /C NULL + # + files <- files_top + files[present_inst] <- files_inst[present_inst] + # Drop cases where not present in either location + files <- files[present_inst | present_top] + if (length(files) == 0) { + return("") + } + # Make sure backslashes are replaced with slashes on Windows + normalizePath(files, winslash = "/") +} + +# A wrapper for `system.file()`, which caches the results, because +# `system.file()` can be slow. Note that because of caching, if +# `system_file_cached()` is called on a package that isn't installed, then the +# package is installed, and then `system_file_cached()` is called again, it will +# still return "". +system_file_cached <- local({ + pkg_dir_cache <- character() + + function(..., package = "base") { + if (!is.null(names(list(...)))) { + stop("All arguments other than `package` must be unnamed.") + } + + not_cached <- is.na(match(package, names(pkg_dir_cache))) + if (not_cached) { + pkg_dir <- system.file(package = package) + pkg_dir_cache[[package]] <<- pkg_dir + } else { + pkg_dir <- pkg_dir_cache[[package]] + } + + file.path(pkg_dir, ...) + } +}) diff --git a/R/style.R b/R/style.R new file mode 100644 index 0000000000..1a1f1ed65e --- /dev/null +++ b/R/style.R @@ -0,0 +1,77 @@ + +#' Modify trace(s) +#' +#' Modify trace(s) of an existing plotly visualization. Useful when used in +#' conjunction with [get_figure()]. +#' +#' @param p A plotly visualization. +#' @param ... Visual properties. +#' @param traces numeric vector. Which traces should be modified? By default, +#' attributes place in `...` will be applied to every trace. +#' @seealso [api_download_plot()] +#' @author Carson Sievert +#' @export +#' @examplesIf interactive() || !identical(.Platform$OS.type, "windows") +#' +#' # style() is especially useful in conjunction with ggplotly() +#' # It allows you to leverage the underlying plotly.js library to change +#' # the return result of ggplotly() +#' (p <- ggplotly(qplot(data = mtcars, wt, mpg, geom = c("point", "smooth")))) +#' +#' # removes hoverinfo for the line/ribbon traces (use `plotly_json()` to verify!) +#' style(p, hoverinfo = "none", traces = c(2, 3)) +#' +#' # another example with plot_ly() instead of ggplotly() +#' marker <- list( +#' color = "red", +#' line = list( +#' width = 20, +#' color = "black" +#' ) +#' ) +#' (p <- plot_ly(x = 1:10, y = 1:10, marker = marker)) +#' +#' # note how the entire (marker) object is replaced if a list is provided +#' style(p, marker = list(line = list(color = "blue"))) +#' +#' # similar to plotly.js, you can update a particular attribute like so +#' # https://github.com/plotly/plotly.js/issues/1866#issuecomment-314115744 +#' style(p, marker.line.color = "blue") +#' # this clobbers the previously supplied marker.line.color +#' style(p, marker.line = list(width = 2.5), marker.size = 10) +#' +style <- function(p, ..., traces = NULL) { + p <- plotly_build(p) + n_traces <- length(p$x$data) + trace_idx <- traces %||% seq_len(n_traces) + if (any(trace_idx > n_traces)) { + warning("You've referenced non-existent traces", call. = FALSE) + } + + values <- list(...) + paths <- strsplit(names(values), "\\.") + + p$x$data[trace_idx] <- lapply(p$x$data[trace_idx], function(trace) { + for (i in seq_along(paths)) { + trace <- trace_replace(trace, paths[[i]], values[[i]]) + } + trace + }) + + p +} + +#' @param trace a single plotly trace +#' @param path character vector of path elements pointing to a trace property: c("marker", "line", "size") +#' @param value a value to assign to that trace property +#' @noRd +trace_replace <- function(trace, path, value) { + if (length(path) == 0) return(trace) + if (length(path) == 1) { + trace[[path]] <- value + return(trace) + } + trace[[path[1]]] <- trace[[path[1]]] %||% setNames(list(NULL), path[2]) + trace[[path[1]]] <- trace_replace(trace[[path[1]]], path[-1], value) + trace +} diff --git a/R/subplots.R b/R/subplots.R index 249a6fc3ce..1474e4e4ca 100644 --- a/R/subplots.R +++ b/R/subplots.R @@ -1,157 +1,392 @@ #' View multiple plots in a single view #' -#' @param ... any number of plotly objects +#' @param ... One of the following +#' \itemize{ +#' \item any number of plotly/ggplot2 objects. +#' \item a list of plotly/ggplot2 objects. +#' \item a tibble with one list-column of plotly/ggplot2 objects. +#' } #' @param nrows number of rows for laying out plots in a grid-like structure. #' Only used if no domain is already specified. -#' @param which_layout adopt the layout of which plot? If the default value of -#' "merge" is used, all plot level layout options will be included in the final -#' layout. This argument also accepts a numeric vector which will restric +#' @param widths relative width of each column on a 0-1 scale. By default all +#' columns have an equal relative width. +#' @param heights relative height of each row on a 0-1 scale. By default all +#' rows have an equal relative height. #' @param margin either a single value or four values (all between 0 and 1). #' If four values are provided, the first is used as the left margin, the second #' is used as the right margin, the third is used as the top margin, and the #' fourth is used as the bottom margin. #' If a single value is provided, it will be used as all four margins. +#' @param shareX should the x-axis be shared amongst the subplots? +#' @param shareY should the y-axis be shared amongst the subplots? +#' @param titleX should x-axis titles be retained? +#' @param titleY should y-axis titles be retained? +#' @param which_layout adopt the layout of which plot? If the default value of +#' "merge" is used, layout options found later in the sequence of plots will +#' override options found earlier in the sequence. This argument also accepts a +#' numeric vector specifying which plots to consider when merging. #' @return A plotly object #' @export -#' @importFrom plyr join #' @author Carson Sievert -#' @examples \dontrun{ -#' p1 <- plot_ly(economics, x = date, y = uempmed, showlegend = F) -#' p2 <- plot_ly(economics, x = date, y = unemploy, showlegend = F) -#' subplot(p1, p2, p1, p2, nrows = 2) -#' } - +#' @examplesIf interactive() || !identical(.Platform$OS.type, "windows") +#' +#' # pass any number of plotly objects to subplot() +#' p1 <- plot_ly(economics, x = ~date, y = ~uempmed) +#' p2 <- plot_ly(economics, x = ~date, y = ~unemploy) +#' subplot(p1, p2, p1, p2, nrows = 2, margin = 0.05) +#' +#' #' # anchor multiple traces on the same legend entry +#' p1 <- add_lines(p1, color = I("black"), name = "1st", legendgroup = "1st") +#' p2 <- add_lines(p2, color = I("red"), name = "2nd", legendgroup = "2nd") +#' +#' subplot( +#' p1, style(p1, showlegend = FALSE), +#' p2, style(p2, showlegend = FALSE), +#' nrows = 2, margin = 0.05 +#' ) +#' +#' # or pass a list +#' economics_long %>% +#' split(.$variable) %>% +#' lapply(function(d) plot_ly(d, x = ~date, y = ~value)) %>% +#' subplot(nrows = NROW(.), shareX = TRUE) +#' +#' # or pass a tibble with a list-column of plotly objects +#' economics_long %>% +#' group_by(variable) %>% +#' do(p = plot_ly(., x = ~date, y = ~value)) %>% +#' subplot(nrows = NROW(.), shareX = TRUE) +#' +#' # learn more at https://plotly.com/r/subplots/ +#' -## TODO: throw warning if geo and non-geo coordinates are used!!! -subplot <- function(..., nrows = 1, which_layout = "merge", margin = 0.02) { - # note that dots is a _list of plotlys_ - dots <- lapply(list(...), plotly_build) - # put existing plot anchors and domain information into a tidy format - # (geo, xaxis, or yaxis can be used to anchor traces on different plots) - p_info <- list() - ctr <- 1 - for (i in seq_along(dots)) { - dat <- dots[[i]]$data - layout <- dots[[i]]$layout - for (j in seq_along(dat)) { - tr <- dat[[j]] - idx <- if (j == 1) "" else j - geo <- unique(tr$geo) %||% "" - # if a valid geo property exists, use that and ignore x/y axis properties - info <- if (grepl("^geo[0-9]+$", geo)) { - d <- layout[[paste0("geo", idx)]][["domain"]] %||% list(x = NA, y = NA) - c( - geo = sub("^geo1$", "geo", geo), - xaxis = "", - xstart = d$x[1], - xend = d$x[2], - yaxis = "", - ystart = d$y[1], - yend = d$y[2] - ) +subplot <- function(..., nrows = 1, widths = NULL, heights = NULL, margin = 0.02, + shareX = FALSE, shareY = FALSE, titleX = shareX, + titleY = shareY, which_layout = "merge") { + + + plots <- dots2plots(...) + + # some plotly functions call plotly_build()...subplot() doesn't like that + for (i in seq_along(plots)) { + if (!is.null(plots[[i]][["frames"]])) { + warning( + sprintf("`subplot()` detected plot #%s was 'pre-built' and already has registered\n", i), + "animation frames. This can cause problems and may happen by calling a \n", + "function like `animation_opts()` or `highlight()` (which returns a 'built' plot)\n", + "_before_ `subplot()`. Consider using such functions _after_ `subplot()`.", + call. = FALSE + ) + } + } + + # build all the plots without registering frames + plotz <- lapply(plots, function(d) plotly_build(d, registerFrames = FALSE)[["x"]]) + + # Are any traces referencing "axislike" layout attributes that are missing? + # If so, move those traces to a "new plot", and inherit layout attributes, + # which makes this sort of thing possible: + # https://plotly.com/r/map-subplots-and-small-multiples/ + plots <- list() + for (i in seq_along(plotz)) { + p <- plots[[i]] <- plotz[[i]] + layoutAttrs <- c(names(p$layout), c("mapbox", "geo", "xaxis", "yaxis")) + xTraceAttrs <- sub("^x", "xaxis", sapply(p$data, function(tr) tr[["subplot"]] %||% tr[["geo"]] %||% tr[["xaxis"]] %||% "x")) + yTraceAttrs <- sub("^y", "yaxis", sapply(p$data, function(tr) tr[["subplot"]] %||% tr[["geo"]] %||% tr[["yaxis"]] %||% "y")) + missingAttrs <- setdiff(c(xTraceAttrs, yTraceAttrs), layoutAttrs) + # move to next iteration if trace references are complete + if (!length(missingAttrs)) next + # remove each "missing" trace from this plot + missingTraces <- xTraceAttrs %in% missingAttrs | yTraceAttrs %in% missingAttrs + plots[[i]]$data[missingTraces] <- NULL + # move traces with "similar missingness" to a new plot + for (j in missingAttrs) { + newPlot <- list( + data = p$data[xTraceAttrs %in% j | yTraceAttrs %in% j], + layout = p$layout + ) + # reset the anchors + newPlot$data <- lapply(newPlot$data, function(tr) { + for (k in c("mapbox", "geo", "xaxis", "yaxis")) { + tr[[k]] <- sub("[0-9]+", "", tr[[k]]) %||% NULL + } + tr + }) + plots <- c(plots, list(newPlot)) + } + } + + # grab main plot objects + traces <- lapply(plots, "[[", "data") + layouts <- lapply(plots, "[[", "layout") + shapes <- lapply(layouts, "[[", "shapes") + images <- lapply(layouts, "[[", "images") + annotations <- lapply(layouts, function(x) { + # keep non axis title annotations (for rescaling) + axes <- vapply(x$annotations, function(a) identical(a$annotationType, "axis"), logical(1)) + x$annotations[!axes] + }) + # collect axis objects (note a _single_ geo/mapbox object counts a both an x and y) + xAxes <- lapply(layouts, function(lay) { + keys <- grep("^geo|^mapbox|^xaxis", names(lay), value = TRUE) %||% "xaxis" + for (k in keys) { + dom <- lay[[k]]$domain %||% c(0, 1) + if ("x" %in% names(dom)) dom <- dom[["x"]] + } + lay[keys] + }) + yAxes <- lapply(layouts, function(lay) { + keys <- grep("^geo|^mapbox|^yaxis", names(lay), value = TRUE) %||% "yaxis" + for (k in keys) { + dom <- lay[[k]]$domain %||% c(0, 1) + if ("y" %in% names(dom)) dom <- dom[["y"]] + } + lay[keys] + }) + if (!titleX) { + xAxes <- lapply(xAxes, function(ax) lapply(ax, function(y) { y$title <- NULL; y })) + } + if (!titleY) { + yAxes <- lapply(yAxes, function(ax) lapply(ax, function(y) { y$title <- NULL; y })) + } + # number of x/y axes per plot + xAxisN <- vapply(xAxes, length, numeric(1)) + yAxisN <- vapply(yAxes, length, numeric(1)) + # old -> new axis name dictionary + ncols <- ceiling(length(plots) / nrows) + xAxisID <- seq_len(sum(xAxisN)) + if (shareX) { + if (length(unique(xAxisN)) > 1) { + warning("Must have a consistent number of axes per 'subplot' to share them.") + } else { + xAxisID <- rep(rep(seq_len(ncols * unique(xAxisN)), length.out = length(plots)), unique(xAxisN)) + } + } + yAxisID <- seq_len(sum(yAxisN)) + if (shareY) { + if (length(unique(yAxisN)) > 1) { + warning("Must have a consistent number of axes per 'subplot' to share them.") + } else { + yAxisID <- rep(rep(seq_len(nrows * unique(xAxisN)), each = ncols, length.out = length(plots)), unique(yAxisN)) + } + } + # current "axis" names + xCurrentNames <- unlist(lapply(xAxes, names)) + yCurrentNames <- unlist(lapply(yAxes, names)) + xNewNames <- paste0( + sub("[0-9]+$", "", xCurrentNames), + sub("^1$", "", xAxisID) + ) + yNewNames <- paste0( + sub("[0-9]+$", "", yCurrentNames), + sub("^1$", "", yAxisID) + ) + xAxisMap <- setNames(xCurrentNames, xNewNames) + yAxisMap <- setNames(yCurrentNames, yNewNames) + # split the map by plot ID + xAxisMap <- split(xAxisMap, rep(seq_along(plots), xAxisN)) + yAxisMap <- split(yAxisMap, rep(seq_along(plots), yAxisN)) + # domains of each subplot + domainInfo <- get_domains( + length(plots), nrows, margin, widths = widths, heights = heights + ) + for (i in seq_along(plots)) { + # map axis object names + xMap <- xAxisMap[[i]] + yMap <- yAxisMap[[i]] + xAxes[[i]] <- setNames(xAxes[[i]], names(xMap)) + yAxes[[i]] <- setNames(yAxes[[i]], names(yMap)) + # for cartesian, bump corresponding axis anchor + for (j in seq_along(xAxes[[i]])) { + if (grepl("^geo|^mapbox", names(xAxes[[i]][j]))) next + map <- yMap[yMap %in% sub("y", "yaxis", xAxes[[i]][[j]]$anchor %||% "y")] + xAxes[[i]][[j]]$anchor <- sub("axis", "", names(map)) + } + for (j in seq_along(yAxes[[i]])) { + if (grepl("^geo|^mapbox", names(yAxes[[i]][j]))) next + map <- xMap[xMap %in% sub("x", "xaxis", yAxes[[i]][[j]]$anchor %||% "x")] + yAxes[[i]][[j]]$anchor <- sub("axis", "", names(map)) + } + + for (key in c("geo", "subplot", "xaxis", "yaxis")) { + # bump trace axis references + oldAnchors <- unlist(lapply(traces[[i]], "[[", key)) + if (!length(oldAnchors)) next + axisMap <- if (key == "yaxis") yMap else xMap + axisMap <- setNames(sub("axis", "", axisMap), sub("axis", "", names(axisMap))) + newAnchors <- names(axisMap)[match(oldAnchors, axisMap)] + traces[[i]] <- Map(function(tr, a) { tr[[key]] <- a; tr }, traces[[i]], newAnchors) + + # bump annotation, image, shape xref/yref + # (none of these layout components have geo/subplot support) + ref <- list(xaxis = "xref", yaxis = "yref")[[key]] + if (is.null(ref)) next + bump_axis_ref <- function(obj, ref_default = sub("ref", "", ref)) { + # TODO: throw error/warning if ref_default doesn't match axisMap? + obj[[ref]] <- obj[[ref]] %||% ref_default + if (identical(obj[[ref]], "paper")) return(obj) + refIdx <- match(obj[[ref]], axisMap) + if (!is.na(refIdx)) obj[[ref]] <- names(axisMap)[refIdx][1] + obj + } + annotations[[i]] <- lapply(annotations[[i]], bump_axis_ref) + shapes[[i]] <- lapply(shapes[[i]], bump_axis_ref) + images[[i]] <- lapply(images[[i]], bump_axis_ref, "paper") + } + + + # rescale domains according to the tabular layout + xDom <- as.numeric(domainInfo[i, c("xstart", "xend")]) + yDom <- as.numeric(domainInfo[i, c("yend", "ystart")]) + reScale <- function(old, new) { + sort(scales::rescale( + old %||% c(0, 1), new, from = c(0, 1) + )) + } + xAxes[[i]] <- lapply(xAxes[[i]], function(ax) { + if (all(c("x", "y") %in% names(ax$domain))) { + # geo domains are different from cartesian + ax$domain$x <- reScale(ax$domain$x, xDom) + ax$domain$y <- reScale(ax$domain$y, yDom) } else { - dx <- layout[[paste0("xaxis", idx)]][["domain"]] %||% NA - dy <- layout[[paste0("yaxis", idx)]][["domain"]] %||% NA - c( - geo = "", - xaxis = unique(tr$xaxis) %||% "", - xstart = dx[1], - xend = dx[2], - yaxis = unique(tr$yaxis) %||% "", - ystart = dy[1], - yend = dy[2] - ) + ax$domain <- reScale(ax$domain, xDom) } - p_info[[ctr]] <- c(info, plot = i, trace = j) - ctr <- ctr + 1 - } - } - # put p_info into a data.frame() - p_info <- Reduce(rbind, p_info) - row.names(p_info) <- NULL - p_info <- data.frame(p_info, stringsAsFactors = FALSE) - # obtain the _actual_ plot id - key <- with(p_info, paste0(geo, xaxis, yaxis, plot)) - p_info$key <- match(key, unique(key)) - # bump x/y axis anchors appropriately - p_info$xaxis <- sub("x1", "x", paste0("x", p_info$key)) - p_info$yaxis <- sub("y1", "y", paste0("y", p_info$key)) - # Only do domain computations if they are _completely_ missing - # (I don't think it makes sense to support partial specification of domains) - if (all(is.na(with(p_info, c(xstart, xend, ystart, yend))))) { - doms <- get_domains(max(p_info$key), nrows, margin) - doms$key <- as.character(seq_len(nrow(doms))) - p_info <- p_info[!names(p_info) %in% c("xstart", "xend", "ystart", "yend")] - p_info <- plyr::join(p_info, doms, by = "key") - } - # empty plot container that we'll fill up with new info + ax + }) + yAxes[[i]] <- lapply(yAxes[[i]], function(ax) { + if (all(c("x", "y") %in% names(ax$domain))) { + # geo domains are different from cartesian + ax$domain$x <- reScale(ax$domain$x, xDom) + ax$domain$y <- reScale(ax$domain$y, yDom) + } else { + ax$domain <- reScale(ax$domain, yDom) + } + ax + }) + } + p <- list( - data = vector("list", nrow(p_info)) + data = unlist(traces, recursive = FALSE), + layout = Reduce(modify_list, c(xAxes, rev(yAxes))) ) - # merge layouts of the subplots - ls <- if (which_layout == "merge") { - lapply(dots, "[[", "layout") - } else { + + + # reposition shapes and annotations + annotations <- Map(reposition, annotations, split(domainInfo, seq_along(plots))) + shapes <- Map(reposition, shapes, split(domainInfo, seq_along(plots))) + images <- Map(reposition, images, split(domainInfo, seq_along(plots))) + p$layout$annotations <- unlist(annotations, recursive = FALSE) + p$layout$shapes <- unlist(shapes, recursive = FALSE) + p$layout$images <- unlist(images, recursive = FALSE) + + # merge non-axis layout stuff + layouts <- lapply(layouts, function(x) { + x[!grepl("^[x-y]axis|^geo|^mapbox|annotations|shapes|images", names(x))] %||% list() + }) + if (which_layout != "merge") { if (!is.numeric(which_layout)) warning("which_layout must be numeric") - if (!all(idx <- which_layout %in% seq_along(dots))) { + if (!all(idx <- which_layout %in% seq_along(plots))) { warning("which_layout is referencing non-existant layouts") which_layout <- which_layout[idx] } - lapply(dots[which_layout], "[[", "layout") - } - ls <- ls[!vapply(ls, is.null, logical(1))] - p[["layout"]] <- Reduce(modifyList, ls) - - # tack on trace, domain, and anchor information - p_info$plot <- as.numeric(p_info$plot) - p_info$trace <- as.numeric(p_info$trace) - for (i in seq_along(p$data)) { - info <- p_info[i, ] - xdom <- sort(c(info$xstart, info$xend)) - ydom <- sort(c(info$ystart, info$yend)) - p$data[[i]] <- dots[[info$plot]]$data[[info$trace]] - if (grepl("^geo", info$geo)) { - # carry over first geo object if this one is missing - p$layout[[info$geo]] <- p$layout[[info$geo]] %||% p$layout[["geo"]] - # add domains to the layout - p$layout[[info$geo]] <- modifyList( - p$layout[[info$geo]] %||% list(), - list(domain = list(x = xdom, y = ydom)) - ) - # ensure the geo anchor is a single value - p$data[[i]]$geo <- info$geo - } else { - xaxis <- sub("x", "xaxis", info$xaxis) - yaxis <- sub("y", "yaxis", info$yaxis) - # does this plot contain x/y axis styling? If so, use it - # (but overwrite domain/anchor info) - l <- dots[[info$plot]]$layout - p$layout[[xaxis]] <- modifyList( - if (any(idx <- names(l) %in% "xaxis")) l[idx][[1]] else list(), - list(domain = xdom, anchor = info$yaxis) - ) - p$layout[[yaxis]] <- modifyList( - if (any(idx <- names(l) %in% "yaxis")) l[idx][[1]] else list(), - list(domain = ydom, anchor = info$xaxis) + layouts <- layouts[which_layout] + } + p$attrs <- unlist(lapply(plots, "[[", "attrs"), recursive = FALSE) + p$layout <- Reduce(modify_list, layouts, p$layout) + p$source <- ensure_one(plots, "source") + p$config <- ensure_one(plots, "config") + p$highlight <- ensure_one(plots, "highlight") + + # retrain default coloring + p$data <- colorway_retrain(p$data, p$layout$colorway %||% colorway()) + + p$subplot <- TRUE + as_widget(p) +} + +# ---------------------------------------------------------------- +# Functions used solely within subplot() +# ---------------------------------------------------------------- + +# take a "collection" of plots and +dots2plots <- function(...) { + dotz <- list(...) + + # if ... is a list (or a tibble), list(...) is a (length 1) list + # containing a list of plotly objects + if (length(dotz) == 1 && is.list(dotz[[1]]) && !is.plotly(dotz[[1]])) { + dotz <- dotz[[1]] + } + + if (tibble::is_tibble(dotz)) { + # if dots is a tibble, search for one column with a list of plotly objects + idx <- which(vapply(dotz, function(x) is.plotly(x[[1]]), logical(1))) + if (length(idx) != 1) { + stop( + "If you supply a tibble to subplot(), \n", + "it must have _one_ column with a list of plotly objects", + call. = FALSE ) - p$data[[i]]$xaxis <- info$xaxis - p$data[[i]]$yaxis <- info$yaxis + } + dotz <- dotz[[idx]] + } + + dotz +} + + + +# helper function that warns if more than one plot-level attribute +# has been specified in a list of plots (and returning that attribute) +ensure_one <- function(plots, attr) { + attrs <- Filter(Negate(is.null), lapply(plots, "[[", attr)) + if (length(attrs) == 0) { + warning("No ", attr, " found", call. = FALSE) + return (NULL) + } + for (i in seq_along(attrs)) { + if (!identical(attrs[[1]], attrs[[i]])) { + warning("Can only have one: ", attr, call. = FALSE) + break } } - hash_plot(data.frame(), p) + attrs[[length(attrs)]] } -get_domains <- function(nplots = 1, nrows = 1, margins = 0.01) { +get_domains <- function(nplots = 1, nrows = 1, margins = 0.01, + widths = NULL, heights = NULL) { if (length(margins) == 1) margins <- rep(margins, 4) if (length(margins) != 4) stop("margins must be length 1 or 4", call. = FALSE) ncols <- ceiling(nplots / nrows) + widths <- widths %||% rep(1 / ncols, ncols) + heights <- heights %||% rep(1 / nrows, nrows) + if (length(widths) != ncols) { + stop("The length of the widths argument must be equal ", + "to the number of columns", call. = FALSE) + } + if (length(heights) != nrows) { + stop("The length of the heights argument is ", length(heights), + ", but the number of rows is ", nrows, call. = FALSE) + } + if (any(widths < 0) | any(heights < 0)) { + stop("The widths and heights arguments must contain positive values") + } + if (sum(widths) > (1 + sqrt(.Machine$double.eps)) | sum(heights) > (1 + sqrt(.Machine$double.eps))) { + stop("The sum of the widths and heights arguments must be less than 1") + } + + widths <- cumsum(c(0, widths)) + heights <- cumsum(c(0, heights)) + # 'center' these values if there is still room left + widths <- widths + (1 - max(widths)) / 2 + heights <- heights + (1 - max(heights)) / 2 xs <- vector("list", ncols) for (i in seq_len(ncols)) { xs[[i]] <- c( - xstart = ((i - 1) / ncols) + ifelse(i == 1, 0, margins[1]), - xend = (i / ncols) - ifelse(i == ncols, 0, margins[2]) + xstart = widths[i] + if (i == 1) 0 else margins[1], + xend = widths[i + 1] - if (i == ncols) 0 else margins[2] ) } xz <- rep_len(xs, nplots) @@ -160,17 +395,66 @@ get_domains <- function(nplots = 1, nrows = 1, margins = 0.01) { for (i in seq_len(nplots)) { j <- ceiling(i / ncols) ys[[i]] <- c( - ystart = 1 - ((j - 1) / nrows) - ifelse(j == 1, 0, margins[3]), - yend = 1 - (j / nrows) + ifelse(j == nrows, 0, margins[4]) + ystart = 1 - (heights[j]) - if (j == 1) 0 else margins[3], + yend = 1 - (heights[j + 1]) + if (j == nrows) 0 else margins[4] ) } list2df(Map(c, xz, ys)) } list2df <- function(x, nms) { - stopifnot(length(unique(sapply(x, length))) == 1) - m <- Reduce(rbind, x) + #stopifnot(length(unique(sapply(x, length))) == 1) + m <- if (length(x) == 1) t(x[[1]]) else do.call(rbind, x) row.names(m) <- NULL df <- data.frame(m) if (!missing(nms)) setNames(df, nms) else df } + +# translate x/y positions according to domain objects +# (useful mostly for repositioning annotations/shapes in subplots) +reposition <- function(obj, domains) { + # we need x and y in order to rescale them! + xdom <- as.numeric(domains[c("xstart", "xend")]) + ydom <- as.numeric(domains[c("yend", "ystart")]) + + for (i in seq_along(obj)) { + o <- obj[[i]] + xs <- if (identical(o$xref, "paper")) { + if (is.numeric(o$sizex)) obj[[i]]$sizex <- o$sizex * abs(diff(xdom)) + if (identical(o$xsizemode, "pixel")) "xanchor" else c("x", "x0", "x1") + } + for (j in xs) { + if (is.numeric(o[[j]])) { + obj[[i]][[j]] <- scales::rescale(o[[j]], xdom, from = c(0, 1)) + } + } + ys <- if (identical(o$yref, "paper")) { + if (is.numeric(o$sizey)) obj[[i]]$sizey <- o$sizey * abs(diff(ydom)) + if (identical(o$ysizemode, "pixel")) "yanchor" else c("y", "y0", "y1") + } + for (j in ys) { + if (is.numeric(o[[j]])) { + obj[[i]][[j]] <- scales::rescale(o[[j]], ydom, from = c(0, 1)) + } + } + } + obj +} + + +colorway_retrain <- function(traces, colorway = colorway()) { + colorway <- rep(colorway, length.out = length(traces)) + for (i in seq_along(traces)) { + col <- prefix_class(default(colorway[[i]]), "colorway") + traces[[i]] <- rapply(traces[[i]], function(x) { if (inherits(x, "colorway")) alpha_inherit(col, x) else x }, how = "replace") + } + traces +} + + +# retrieve the alpha of an 'old' color code and apply it to a new color code +alpha_inherit <- function(new, old) { + # should return the alpha in a rgba() code + alphas <- as.numeric(col2rgb(rgb2hex(old), alpha = TRUE)["alpha", ] / 255) + prefix_class(default(toRGB(new, alphas)), "colorway") +} diff --git a/R/sysdata.rda b/R/sysdata.rda new file mode 100644 index 0000000000..529557367a Binary files /dev/null and b/R/sysdata.rda differ diff --git a/R/toRGB.R b/R/toRGB.R new file mode 100644 index 0000000000..750dd7113f --- /dev/null +++ b/R/toRGB.R @@ -0,0 +1,104 @@ +#' Convert R colours to RGBA hexadecimal colour values +#' @param x see the `col` argument in `col2rgb` for valid specifications +#' @param alpha alpha channel on 0-1 scale +#' @return hexadecimal colour value (if is.na(x), return "transparent" for compatibility with Plotly) +#' @export +#' @seealso [showRGB()] +#' @examplesIf interactive() || !identical(.Platform$OS.type, "windows") +#' +#' toRGB("steelblue") +#' # [1] "rgba(70,130,180,1)" +#' +#' m <- list( +#' color = toRGB("red"), +#' line = list( +#' color = toRGB("black"), +#' width = 19 +#' ) +#' ) +#' +#' plot_ly(x = 1, y = 1, marker = m) +#' +toRGB <- function(x, alpha = 1) { + if (length(x) == 0) return(x) + if (any(x %in% "transparent")) return(x) + # allow x/alpha vector(s), but only sensible cases... + if (length(x) != length(alpha)) { + # try to reduce alpha to length 1 (in case x is of length 1) + alpha <- uniq(alpha) + if (length(x) != length(alpha) && length(alpha) != 1) { + stop( + "alpha must be of length 1 or the same length as x", + call. = FALSE + ) + } + } + # add alpha to already converted "rgb(x,y,z)" codes + idx <- grepl("^rgba\\(", x) & alpha <= 1 & 0 <= alpha + if (any(idx)) { + x[idx] <- rgb2hex(x[idx]) + } + # for some reason ggplot2 has "NA" in some place (instead of NA) + if (is.character(x)) { + x[x == "NA"] <- NA + } + # as of ggplot2 version 1.1, an NA alpha is treated as though it's 1 + alpha[is.na(alpha)] <- 1 + rgb_matrix <- grDevices::col2rgb(x, alpha = TRUE) + # multiply the existing alpha with specified alpha (both on 0-1 scale) + rgb_matrix["alpha", ] <- alpha * scales::rescale( + rgb_matrix["alpha", ], from = c(0, 255) + ) + rgb_matrix["alpha", ] <- round(rgb_matrix["alpha", ], 4) + rgba <- sprintf("rgba(%s)", apply(rgb_matrix, 2, paste, collapse = ",")) + + rgba[is.na(x)] <- "transparent" + rgba +} + + +#' View colors already formatted by toRGB() +#' +#' Useful for viewing colors after they've been converted to plotly.js' +#' color format -- "rgba(255, 255, 255, 1)" +#' +#' @param x character string specifying color(s). +#' @param ... arguments passed along to `scales::show_col`. +#' @export +#' @author Carson Sievert +#' @examplesIf interactive() || !identical(.Platform$OS.type, "windows") +#' +#' showRGB(toRGB(colors()), labels = FALSE) +showRGB <- function(x, ...) { + if (!all(grepl("^rgba", x))) stop("All values must begin with rgba") + cols <- lapply(strsplit(x, ","), function(y) { + vals <- as.numeric(gsub("rgba\\(|\\)", "", y)) + vals[1:3] <- vals[1:3] / 255 + setNames(as.list(vals), c("red", "green", "blue", "alpha")) + }) + rgbs <- sapply(cols, function(x) do.call(grDevices::rgb, x)) + scales::show_col(rgbs, ...) +} + +# take a 'plotly color' and produce a hex code +rgb2hex <- function(string = "rgba(255,255,255,1)") { + vals <- sub("rgba\\(", "", sub("\\)", "", string)) + valz <- strsplit(vals, ",") + sapply(valz, function(x) { + x <- setNames(as.numeric(x), c("red", "green", "blue", "alpha")) + x[["alpha"]] <- x[["alpha"]] * 255 + do.call(grDevices::rgb, c(x, list(maxColorValue = 255))) + }) +} + +#convert rgba() to rgb() +strip_alpha <- function(string = "rgba(255,255,255,1)", warn = TRUE) { + if (length(string) == 0) return(string) + if (warn) { + if (any(!grepl(",1\\)$", string))) { + warning("Ignoring an alpha value lower than 1") + } + } + string <- sub(",1\\)$", ")", string) + sub("^rgba", "rgb", string) +} diff --git a/R/trace_generation.R b/R/trace_generation.R deleted file mode 100644 index e6e3e948b2..0000000000 --- a/R/trace_generation.R +++ /dev/null @@ -1,723 +0,0 @@ -#' Convert a layer to a list of traces. Called from gg2list() -#' @param l one layer of the ggplot object -#' @param d one layer of calculated data from ggplot2::ggplot_build(p) -#' @param misc named list of plot info, independent of layer. -#' @return list representing a layer, with corresponding aesthetics, ranges, and groups. -#' @importFrom plyr ddply -#' @importFrom plyr summarise -#' @export -layer2traces <- function(l, d, misc) { - - # TODO: do we really need to remove records with any NAs? - # New version of ggplot2 allows NA for aes (e.g., alpha) - g <- list( - geom = type(l, "geom"), - data = d, - prestats.data = l$prestats.data - ) - # needed for when group, etc. is an expression. - g$aes <- sapply(l$mapping, function(k) as.character(as.expression(k))) - # Partial conversion for geom_violin (Plotly does not offer KDE yet) - if (g$geom == "violin") { - g$geom <- "boxplot" - warning("Converting violin plot into boxplot:\n - probability density estimation is not supported in Plotly yet.") - } - - # geom_smooth() means geom_line() + geom_ribbon() - # Note the line is always drawn, but ribbon is not if se = FALSE. - if (g$geom == "smooth") { - # If smoothLine has been compiled already, consider drawing the ribbon - if (isTRUE(misc$smoothLine)) { - misc$smoothLine <- FALSE - if (isTRUE(l$stat_params$se == FALSE)) { - return(NULL) - } else { - g$geom <- "smoothRibbon" - # disregard colour - g$data <- g$data[!grepl("^colour[.name]?", names(g$data))] - } - } else { - misc$smoothLine <- TRUE - g$geom <- "smoothLine" - } - } - - # For non-numeric data on the axes, we should take the values from - # the original data. - for (axis.name in c("x", "y")) { - if (!misc$is.continuous[[axis.name]]) { - aes.names <- paste0(axis.name, c("", "end", "min", "max")) - aes.used <- aes.names[aes.names %in% names(g$aes)] - for(a in aes.used) { - a.name <- paste0(a, ".name") - col.name <- g$aes[a.name] - dtemp <- l$data[[col.name]] - if (is.null(dtemp)) { - if (!is.null(g$data[[a.name]])) { - # Handle the case where as.Date() is passed in aes argument. - if (class(g$data[[a]]) != class(g$data[[a.name]])) { - g$data[[a]] <- g$data[[a.name]] - data.vec <- g$data[[a]] - } - } - } else { - data.vec <- dtemp - } - - # For some plot types, we overwrite `data` with `prestats.data`. - pdata.vec <- g$prestats.data[[a]] - if (inherits(data.vec, "POSIXt")) { - # Re-create dates from nb seconds - data.vec <- try(strftime(as.POSIXlt(g$data[[a]], origin=the.epoch), - "%Y-%m-%d %H:%M:%S"), silent=TRUE) - pdata.vec <- strftime(as.POSIXlt(g$prestats.data[[a]], - origin=the.epoch), - "%Y-%m-%d %H:%M:%S") - } else if (inherits(data.vec, "Date")) { - # Re-create dates from nb days - data.vec <- try(strftime(as.Date(g$data[[a]], origin=the.epoch), - "%Y-%m-%d %H:%M:%S"), silent=TRUE) - pdata.vec <- strftime(as.Date(g$prestats.data[[a]], origin=the.epoch), - "%Y-%m-%d %H:%M:%S") - } else if (inherits(data.vec, c("character", "factor"))) { - # Re-order data so that Plotly gets it right from ggplot2. - data.vec <- as.factor(data.vec) - g$data <- g$data[order(g$data[[a]]), ] - vec.i <- match(g$data[[a]], as.numeric(data.vec)) - if(anyNA(vec.i)){ - vec.i <- match(g$data[[a.name]], data.vec) - } - data.vec <- data.vec[vec.i] - g$prestats.data <- g$prestats.data[order(g$prestats.data[[a]]), ] - pvec.i <- match(g$prestats.data[[a]], as.numeric(pdata.vec)) - pdata.vec <- pdata.vec[pvec.i] - if (length(pdata.vec) == length(data.vec)) - pdata.vec <- data.vec - if (!is.factor(pdata.vec)) - pdata.vec <- g$prestats.data[[a.name]] - } - - g$data[[a]] <- data.vec - g$prestats.data[[a]] <- pdata.vec - } - } - } - # use un-named parameters so that they will not be exported - # to JSON as a named object, since that causes problems with - # e.g. colour. - g$params <- c(l$geom_params, l$stat_params) - # non-ggplot2 params like name are useful for plot.ly and ggplot2 - # places them into stat_params. - for(p.name in names(g$params)){ - # c("foo") is translated to "foo" in JSON, so instead we use - # list("foo") which becomes ["foo"]. However we need to make sure - # that the list does not have names since list(bar="foo") becomes - # {"bar":"foo"} - names(g$params[[p.name]]) <- NULL - } - - # Convert complex ggplot2 geoms so that they are treated as special - # cases of basic geoms. In ggplot2, this processing is done in the - # draw method of the geoms. - - # for type='scatter', you can define - # mode=none,markers,lines,lines+markers where "lines" is the - # default for 20 or more points, "lines+markers" is the default for - # <20 points. "none" is useful mainly if fill is used to make area - # plots with no lines. - - # First convert to a "basic" geom, e.g. segments become lines. - convert <- toBasic[[g$geom]] - basic <- if (is.function(convert)) convert(g) else g - # Then split on visual characteristics that will get different - # legend entries. - data.list <- if (basic$geom %in% names(markSplit)) { - mark.names <- markSplit[[basic$geom]] - # However, continuously colored points are an exception: they do - # not need a legend entry, and they can be efficiently rendered - # using just 1 trace. - - # Maybe it is nice to show a legend for continuous points? - # if(basic$geom == "point"){ - # to.erase <- names(misc$is.continuous)[misc$is.continuous] - # mark.names <- mark.names[!mark.names %in% to.erase] - # } - name.names <- sprintf("%s.name", mark.names) - # split on 'PANEL' to support facets - is.split <- names(basic$data) %in% c(name.names, "PANEL") - if(any(is.split)){ - data.i <- which(is.split) - matched.names <- names(basic$data)[data.i] - name.i <- name.names %in% matched.names - invariable.names <- cbind(name.names, mark.names)[name.i,] - other.names <- !names(basic$data) %in% invariable.names - vec.list <- basic$data[is.split] - df.list <- split(basic$data, vec.list, drop=TRUE) - lapply(df.list, function(df){ - params <- basic$params - params[invariable.names] <- if (ncol(x <- df[1, invariable.names]) > 0) x else NULL - list(data=df[other.names], - params=params) - }) - } - } - - # case of no legend, if either of the two ifs above failed. - if(is.null(data.list)){ - data.list <- structure(list(list(data=basic$data, params=basic$params)), - names=basic$params$name) - } - getTrace <- geom2trace[[basic$geom]] - if(is.null(getTrace)){ - getTrace <- geom2trace[["blank"]] - warning("geom_", g$geom, " has yet to be implemented in plotly.\n", - " If you'd like to see this geom implemented,\n", - " Please open an issue with your example code at\n", - " https://github.com/ropensci/plotly/issues") - } - traces <- NULL - names.in.legend <- NULL - for (data.i in seq_along(data.list)) { - data.params <- data.list[[data.i]] - data.params$params$stat.type <- type(l, "stat") - # as of ggplot2 version 1.1, param defaults can be obtained from the data - data.params$params <- modifyList( - dat2params(data.params$data), - data.params$params - ) - tr <- do.call(getTrace, data.params) - for (v.name in c("x", "y")) { - vals <- tr[[v.name]] - if (length(vals) > 0 && is.na(vals[length(vals)])) { - tr[[v.name]] <- vals[-length(vals)] - } - } - name.names <- grep("[.]name$", names(data.params$params), value=TRUE) - not.group <- grep("group", name.names, value=TRUE, invert=TRUE) - if (length(not.group)) { - for(a.name in not.group){ - a <- sub("[.]name$", "", a.name) - tr$sort[[a.name]] <- if (a %in% names(misc$breaks)){ - # Custom breaks were specified. - a.value <- as.character(data.params$params[[a.name]]) - ranks <- misc$breaks[[a]] - if (a.value %in% names(ranks)){ - ranks[[a.value]] - } else { - Inf # sorts to the end, when there are less breaks than classes. - } - } else { # custom breaks were not specified. - 1 # sort them all the same. - } - } - name.list <- data.params$params[not.group] - tr$name <- paste(unlist(name.list), collapse=".") - if (length(unique(name.list)) < 2) - tr$name <- as.character(name.list[[1]]) - } - dpd <- data.params$data - if ("PANEL" %in% names(dpd) && nrow(dpd) > 0) { - tr$xaxis <- paste0("x", dpd[1, "COL"]) - tr$yaxis <- paste0("y", dpd[1, "plotly.row"]) - tr$PANEL <- dpd[1, "PANEL"] - } - - if (is.null(tr$name) || tr$name %in% names.in.legend) - tr$showlegend <- FALSE - names.in.legend <- c(names.in.legend, tr$name) - - # special handling for bars - if (g$geom == "bar") { - is_hist <- misc$is.continuous[["x"]] - tr$bargap <- if (is_hist) 0 else "default" - pos <- type(l, "position") - tr$barmode <- - if (pos %in% "identity" && is_hist) { - "overlay" - } else if (pos %in% c("identity", "stack", "fill")) { - "stack" - } else { - "group" - } - } - - traces <- c(traces, list(tr)) - } - - sort.val <- sapply(traces, function(tr){ - rank.val <- unlist(tr$sort) - if(is.null(rank.val)){ - 0 - }else if(length(rank.val)==1){ - rank.val - }else{ - 0 - } - }) - - # reverse the traces in the following cases: - # geom_area - # geom_density with position = stack - if (g$geom %in% c("area", "density") && type(l, "position") == "stack"){ - traces <- rev(traces) - } else{ - traces - } - - ord <- order(sort.val) - no.sort <- traces[ord] - for(tr.i in seq_along(no.sort)){ - s <- no.sort[[tr.i]]$sort - no.sort[[tr.i]]$showlegend <- - if (is.numeric(s)) { - if (s == Inf){ - FALSE - } else { - TRUE - } - } else { # no legend. - FALSE - } - no.sort[[tr.i]]$sort <- NULL - } - # if line portion of geom_smooth was compiled, call layer2traces() - # again for ribbon portion - if (isTRUE(misc$smoothLine)) { - c(layer2traces(l, d, misc), no.sort) - } else { - no.sort - } -}#layer2traces - - -# Preprocess data and params. -toBasic <- list( - segment=function(g){ - # Every row is one segment, we convert to a line with several - # groups which can be efficiently drawn by adding NA rows. - g$data$group <- 1:nrow(g$data) - used <- c("x", "y", "xend", "yend") - others <- g$data[!names(g$data) %in% used] - g$data <- with(g$data, { - rbind(cbind(x, y, others), - cbind(x=xend, y=yend, others)) - }) - group2NA(g, "path") - }, - rect=function(g){ - g$data$group <- 1:nrow(g$data) - used <- c("xmin", "ymin", "xmax", "ymax") - others <- g$data[!names(g$data) %in% used] - g$data <- with(g$data, { - rbind(cbind(x=xmin, y=ymin, others), - cbind(x=xmin, y=ymax, others), - cbind(x=xmax, y=ymax, others), - cbind(x=xmax, y=ymin, others)) - }) - g$geom <- "polygon" - g - }, - ribbon=function(g) { - g$data <- ribbon_dat(g$data) - g$geom <- "polygon" - g - }, - path=function(g) { - group2NA(g, "path") - }, - line=function(g) { - g$data <- g$data[order(g$data$x), ] - group2NA(g, "path") - }, - boxplot=function(g) { - # Preserve default colour values using fill: - if (!is.null(g$data$fill)) { - g$prestats.data$fill <- NULL - dat <- unique(g$data[c("x", "fill")]) - g$prestats.data <- plyr::join(g$prestats.data, dat, by = "x") - } - g$data <- g$prestats.data - g - }, - bar=function(g){ - g <- group2NA(g, "bar") - g$data <- g$data[!is.na(g$data$y), ] - g - }, - contour=function(g) { - g$data <- g$prestats.data - g - }, - density=function(g) { - g$geom <- "area" - if (is.null(g$data$fill) && is.null(g$params$alpha)) g$params$alpha <- 0 - if (is.null(g$data$colour)) g$params$colour <- "black" - g - }, - density2d=function(g) { - g$data <- g$prestats.data - g - }, - abline=function(g) { - N <- nrow(g$data) - m <- g$data$slope - b <- g$data$intercept - xmin <- min(g$prestats.data$globxmin, na.rm = T) - xmax <- max(g$prestats.data$globxmax, na.rm = T) - g$data$plotly_id <- seq_len(N) - l <- list() - for (i in seq_len(N)) { - # the NAs tell plotly to draw different traces for each line - l$x <- c(l$x, xmin, xmax, NA) - l$y <- c(l$y, xmin * m[i] + b[i], xmax * m[i] + b[i], NA) - l$plotly_id <- c(l$plotly_id, rep(i, 3)) - } - g$data <- plyr::join(g$data, data.frame(l), by = "plotly_id") - group2NA(g, "path") - }, - hline=function(g) { - N <- nrow(g$data) - yint <- g$data$yintercept - if (is.factor(g$data$x)) { - s <- sort(g$data$x) - xmin <- as.character(s[1]) - xmax <- as.character(s[length(s)]) - } else { - xmin <- min(g$prestats.data$globxmin, na.rm = T) - xmax <- max(g$prestats.data$globxmax, na.rm = T) - } - g$data$plotly_id <- seq_len(N) - l <- list() - for (i in seq_len(N)) { - l$x <- c(l$x, xmin, xmax, NA) - l$y <- c(l$y, yint[i], yint[i], NA) - l$plotly_id <- c(l$plotly_id, rep(i, 3)) - } - g$data <- plyr::join(g$data, data.frame(l), by = "plotly_id") - group2NA(g, "path") - }, - vline=function(g) { - N <- nrow(g$data) - xint <- g$data$xintercept - if (is.factor(g$data$y)) { - s <- sort(g$data$y) - ymin <- as.character(s[1]) - ymax <- as.character(s[length(s)]) - } else { - ymin <- min(g$prestats.data$globymin, na.rm = T) - ymax <- max(g$prestats.data$globymax, na.rm = T) - } - g$data$plotly_id <- seq_len(N) - l <- list() - for (i in seq_len(N)) { - l$x <- c(l$x, xint[i], xint[i], NA) - l$y <- c(l$y, ymin, ymax, NA) - l$plotly_id <- c(l$plotly_id, rep(i, 3)) - } - g$data <- plyr::join(g$data, data.frame(l), by = "plotly_id") - group2NA(g, "path") - }, - jitter=function(g) { - if ("size" %in% names(g$data)) { - g$params$sizemin <- min(g$prestats.data$globsizemin) - g$params$sizemax <- max(g$prestats.data$globsizemax) - } - g$geom <- "point" - g - }, - point=function(g) { - if (length(unique(g$data$size)) > 1 && is.null(g$data$text)) { - g$data$text <- paste("size:", g$data$size) - } - g - }, - smoothLine=function(g) { - if (length(grep("^colour$", names(g$data))) == 0) - g$params$colour <- "#3366FF" - group2NA(g, "path") - }, - smoothRibbon=function(g) { - if (is.null(g$params$alpha)) g$params$alpha <- 0.2 - g$data <- ribbon_dat(g$data) - g$geom <- "polygon" - g - } -) - -#' Drawing ggplot2 geoms with a group aesthetic is most efficient in -#' plotly when we convert groups of things that look the same to -#' vectors with NA. -#' @param g list of geom info with g$data$group. -#' @param geom change g$geom to this. -#' @export -#' @return list of geom info. -#' @author Toby Dylan Hocking -group2NA <- function(g, geom) { - poly.list <- split(g$data, g$data$group, drop=TRUE) - is.group <- names(g$data) == "group" - poly.na.list <- list() - forward.i <- seq_along(poly.list) - ## When group2NA is called on geom_polygon (or geom_rect, which is - ## treated as a basic polygon), we need to retrace the first points - ## of each group, see https://github.com/ropensci/plotly/pull/178 - retrace.first.points <- g$geom == "polygon" - for (i in forward.i) { - no.group <- poly.list[[i]][, !is.group, drop=FALSE] - na.row <- no.group[1, ] - na.row[, c("x", "y")] <- NA - retrace.first <- if(retrace.first.points){ - no.group[1,] - } - poly.na.list[[paste(i, "forward")]] <- - rbind(no.group, retrace.first, na.row) - } - if(retrace.first.points){ - backward.i <- rev(forward.i[-1])[-1] - for(i in backward.i){ - no.group <- poly.list[[i]][1, !is.group, drop=FALSE] - na.row <- no.group[1, ] - na.row[, c("x", "y")] <- NA - poly.na.list[[paste(i, "backward")]] <- rbind(no.group, na.row) - } - if(length(poly.list) > 1){ - first.group <- poly.list[[1]][1, !is.group, drop=FALSE] - poly.na.list[["last"]] <- rbind(first.group, first.group) - } - } - g$data <- do.call(rbind, poly.na.list) - if(is.na(g$data$x[nrow(g$data)])){ - g$data <- g$data[-nrow(g$data), ] - } - g$geom <- geom - g -} - -# Make a trace for geom_errorbar -> error_y or geom_errorbarh -> -# error_x. -make.errorbar <- function(data, params, xy){ - tr <- list( - x = data$x, - y = data$y, - type = "scatter", - mode = "none" - ) - err.name <- paste0("error_", xy) - min.name <- paste0(xy, "min") - max.name <- paste0(xy, "max") - e <- list( - array = data[[max.name]] - data[[xy]], - type = "data", - width = params$width, - symmetric = TRUE, - color = toRGB(params$colour) - ) - arrayminus <- data[[xy]] - data[[min.name]] - if(!isTRUE(all.equal(e$array, arrayminus))){ - e$arrayminus <- arrayminus - e$symmetric <- FALSE - } - tr[[err.name]] <- e - tr -} - -# function to transform geom_ribbon data into format plotly likes -# (note this function is also used for geom_smooth) -ribbon_dat <- function(dat) { - n <- nrow(dat) - o <- order(dat$x) - o2 <- order(dat$x, decreasing = TRUE) - used <- c("x", "ymin", "ymax") - not_used <- setdiff(names(dat), used) - # top-half of ribbon - tmp <- dat[o, ] - others <- tmp[not_used] - dat1 <- cbind(x = tmp$x, y = tmp$ymax, others) - dat1[n+1, ] <- cbind(x = tmp$x[n], y = tmp$ymin[n], others[n, ]) - # bottom-half of ribbon - tmp2 <- dat[o2, ] - others2 <- tmp2[not_used] - dat2 <- cbind(x = tmp2$x, y = tmp2$ymin, others2) - rbind(dat1, dat2) -} - - -dat2params <- function(d) { - params <- c(names(aesConverters), "fill") - l <- as.list(d[names(d) %in% params]) - lapply(l, unique) -} - -# Convert basic geoms to traces. -geom2trace <- list( - blank=function(data, params) { - list( - x=data$x, - y=data$y, - name=params$name, - text=data$text, - type="scatter", - mode="markers", - marker=list(opacity = 0) - ) - }, - path=function(data, params) { - # when converting ggplot2 size to plotly size, we assume size is an _area_, - # but "size" for lines really means linewidth, so size is a _length_ in this case - # (see aesConverters$size) - params$size <- ifelse(params$size < 1, params$size ^ 2, sqrt(params$size)) - list(x=data$x, - y=data$y, - name=params$name, - text=data$text, - type="scatter", - mode="lines", - line=paramORdefault(params, aes2line, ggplot2::GeomPath$default_aes)) - }, - polygon=function(data, params){ - g <- list(data = data, geom = "polygon") - g <- group2NA(g, "polygon") - list( - x = g$data$x, - y = g$data$y, - name = params$name, - text = g$data$text, - type = "scatter", - mode = "lines", - line = paramORdefault(params, aes2line, ggplot2::GeomPolygon$default_aes), - fill = "tozerox", - fillcolor = toRGB(params$fill, params$alpha) - ) - }, - point=function(data, params){ - # params contains unique values, but we need _all_ values from the data - for (i in names(params)) { - if (length(params[[i]]) > 1) params[[i]] <- data[[i]] - } - L <- list( - x = data$x, - y = data$y, - name = params$name, - text = as.character(data$text), - type = "scatter", - mode = "markers", - marker = paramORdefault(params, aes2marker, ggplot2::GeomPoint$default_aes) - ) - if (!is.null(params$shape) && params$shape %in% c(21:25)) { - L$marker$color <- toRGB(params$fill %||% "black") - } - if (!is.null(params$shape) && params$shape %in% c(32)) { - L$visible <- FALSE - } - L - }, - text=function(data, params){ - L <- list(x=data$x, - y=data$y, - text=data$label, - type="scatter", - mode="text") - if (!is.null(params$size)) { - L$textfont$size <- params$size - } - if (!is.null(params$colour)) { - L$textfont$color <- params$colour - } - L - }, - bar=function(data, params) { - x <- if ("x.name" %in% names(data)) data$x.name else data$x - if (inherits(x, "POSIXt")) { - # Convert seconds into milliseconds - x <- as.numeric(x) * 1000 - } else if (inherits(x, "Date")) { - # Convert days into milliseconds - x <- as.numeric(x) * 24 * 60 * 60 * 1000 - } - # if there is more than one y-value for a particular combination of - # x, PANEL, and group; then take the _max_ y. - data$x <- x - dat <- plyr::ddply(data, c("x", "PANEL", if ("group" %in% names(data)) "group"), - plyr::summarise, count = max(y)) - L <- list( - x = dat$x, - y = dat$count, - type = "bar", - # text only makes sense if no dimension reduction occurred - text = if (nrow(dat) == nrow(data)) data$text else NULL, - name = params$name, - marker = list(color = toRGB(params$fill)) - ) - if (!is.null(params$colour)) { - L$marker$line <- list(color = toRGB(params$colour)) - L$marker$line$width <- params$size %||% 1 - } - if (!is.null(params$alpha)) L$opacity <- params$alpha - L - }, - step=function(data, params) { - list(x=data$x, - y=data$y, - name=params$name, - type="scatter", - mode="lines", - line=paramORdefault(params, aes2step, ggplot2::GeomPath$default_aes)) - }, - tile=function(data, params) { - list(x=unique(data$x), - y=unique(data$y), - z=t(matrix(data$fill.name, nrow=length(unique(data$x)), - ncol=length(unique(data$y)))), - name=params$name, - type="heatmap", - mode="lines", - line=paramORdefault(params, aes2line, ggplot2::GeomPath$default_aes)) - }, - boxplot=function(data, params) { - list( - y = data$y, - name = params$name, - type = "box", - # TODO: translate marker styling for outliers! - line = paramORdefault(params, aes2line, ggplot2::GeomBoxplot$default_aes), - fillcolor = toRGB(params$fill %||% "white") - ) - }, - contour=function(data, params) { - L <- list(x=unique(data$x), - y=unique(data$y), - z=t(matrix(data$z, nrow=length(unique(data$x)), - ncol=length(unique(data$y)))), - name=params$name, - type="contour", - line=paramORdefault(params, aes2line, ggplot2::GeomPath$default_aes)) - L$contours=list(coloring="lines") - L - }, - density2d=function(data, params) { - L <- list(x=data$x, - y=data$y, - name=params$name, - type="histogram2dcontour", - line=paramORdefault(params, aes2line, ggplot2::GeomPath$default_aes)) - L$contours=list(coloring="lines") - L - }, - errorbar=function(data, params) { - make.errorbar(data, params, "y") - }, - errorbarh=function(data, params) { - make.errorbar(data, params, "x") - }, - area=function(data, params) { - list( - x = c(data$x[1], data$x, tail(data$x, n = 1)), - y = c(0, data$y, 0), - name = params$name, - type = "scatter", - line = paramORdefault(params, aes2line, ggplot2::GeomRibbon$default_aes), - fill = "tozeroy", - fillcolor = toRGB(params$fill %||% "grey20", params$alpha) - ) - } -) diff --git a/R/utils.R b/R/utils.R index ae502809ee..b94a9a2ef6 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,68 +1,996 @@ -#' @importFrom grDevices col2rgb -#' @importFrom utils getFromNamespace modifyList data packageVersion browseURL -#' @importFrom stats setNames +# @staticimports pkg:staticimports +# is_installed get_package_version system_file -is.plotly <- function(x) inherits(x, "plotly") +is.plotly <- function(x) { + inherits(x, "plotly") +} -"%||%" <- function(x, y) { - if (length(x) > 0) x else y +is.formula <- function(f) { + inherits(f, "formula") +} + +is.colorbar <- function(tr) { + inherits(tr, "plotly_colorbar") +} + +is.evaled <- function(p) { + all(vapply(p$x$attrs, function(attr) inherits(attr, "plotly_eval"), logical(1))) +} + +is.webgl <- function(p) { + if (!is.evaled(p)) p <- plotly_build(p) + types <- vapply(p$x$data, function(tr) tr[["type"]] %||% "scatter", character(1)) + any(types %in% glTypes()) } +glTypes <- function() { + c( + "scattergl", "scatter3d", "mesh3d", "heatmapgl", "pointcloud", "parcoords", + "surface" + ) +} + +# just like ggplot2:::is.discrete() is.discrete <- function(x) { is.factor(x) || is.character(x) || is.logical(x) } -# special enviroment that tracks trace/layout information -plotlyEnv <- new.env(parent = emptyenv()) - -# hash plot info, assign it to the special plotly environment, & attach it to data -hash_plot <- function(df, p) { - if (missing(df) || is.null(df)) df <- data.frame() - hash <- digest::digest(p) - # terrible hack to ensure we can always find the most recent hash - hash <- paste(hash, length(ls(plotlyEnv)), sep = "#") - assign(hash, p, envir = plotlyEnv) - attr(df, "plotly_hash") <- hash - # add plotly class mainly for printing method - class(df) <- unique(c("plotly", class(df))) - # return a data frame to be compatible with things like dplyr - df -} - -#' Obtain underlying data of plotly object -#' -#' Given a data frame with a class of plotly, this function returns the arguments -#' and/or data used to create the plotly. If no data frame is provided, -#' the last plotly object created in this R session is returned (if it exists). -#' -#' @param data a data frame with a class of plotly (and a plotly_hash attribute). -#' @param last if no plotly attribute is found, return the last plot or NULL? -get_plot <- function(data = NULL, last = FALSE) { - hash <- attr(data, "plotly_hash") - if (!is.null(hash)) { - get(hash, envir = plotlyEnv) - } else if (last) { - envs <- strsplit(ls(plotlyEnv), "#") - last_env <- ls(plotlyEnv)[which.max(sapply(envs, "[[", 2))] - get(last_env, envir = plotlyEnv) - } else { - data %||% list() - } -} - -#' Retrive and create the last plotly (or ggplot). -#' -#' @seealso \link{plotly_build} -#' @param data (optional) a data frame with a class of plotly (and a plotly_hash attribute). -#' @export -last_plot <- function(data = NULL) { - p <- try(get_plot(data, last = TRUE), silent = TRUE) - if (inherits(p, "try-error")) p <- try(ggplotly(), silent = TRUE) - if (inherits(p, "try-error")) stop("The last plot doesn't exist") - structure( - p, - class = unique(c("plotly", class(p))) +"%||%" <- function(x, y) { + if (length(x) > 0 || is_blank(x)) x else y +} + +"%()%" <- function(x, y) { + if (is.function(x)) return(x()) + y +} + +# kind of like %||%, but only respects user-defined defaults +# (instead of defaults provided in the build step) +"%|D|%" <- function(x, y) { + if (!is.default(x)) x %||% y else y +} + +# standard way to specify a line break +br <- function() "
" + +is.default <- function(x) { + inherits(x, "plotly_default") +} + +default <- function(x) { + prefix_class(x %||% list(), "plotly_default") +} + +compact <- function(x) { + Filter(Negate(is.null), x) +} + +modify_list <- function(x, y, ...) { + modifyList(x %||% list(), y %||% list(), ...) +} + +# convert a vector of dates/date-times to milliseconds +to_milliseconds <- function(x) { + if (inherits(x, "Date")) return(as.numeric(x) * 86400000) + if (inherits(x, "POSIXt")) return(as.numeric(x) * 1000) + # throw warning? + x +} + +# apply a function to x, retaining class and "special" plotly attributes +retain <- function(x, f = identity) { + y <- structure(f(x), class = oldClass(x)) + attrs <- attributes(x) + # TODO: do we set any other "special" attributes internally + # (grepping "structure(" suggests no) + attrs <- attrs[names(attrs) %in% "apiSrc"] + if (length(attrs)) { + attributes(y) <- attrs + } + y +} + +deparse2 <- function(x) { + if (is.null(x) || !is.language(x)) return(NULL) + sub("^~", "", paste(deparse(x, 500L), collapse = "")) +} + +new_id <- function() { + basename(tempfile("")) +} + +names2 <- function(x) { + names(x) %||% rep("", length(x)) +} + +getLevels <- function(x) { + if (is.factor(x)) levels(x) else sort(unique(x)) +} + +tryNULL <- function(expr) tryCatch(expr, error = function(e) NULL) + +# Don't attempt to do "tidy" data training on these trace types +# Note that non-tidy traces expect/anticipate data_array's of varying lengths +is_tidy <- function(trace) { + type <- trace[["type"]] %||% "scatter" + !type %in% c( + "mesh3d", "heatmap", "histogram2d", "isosurface", + "histogram2dcontour", "contour", "surface" + ) +} + +# is grouping relevant for this geometry? (e.g., grouping doesn't effect a scatterplot) +has_group <- function(trace) { + inherits(trace, paste0("plotly_", c("segment", "path", "line", "polygon"))) || + (grepl("scatter", trace[["type"]]) && grepl("lines", trace[["mode"]])) +} + +# currently implemented non-positional scales in plot_ly() +npscales <- function() { + c("color", "stroke", "symbol", "linetype", "size", "span", "split") +} + +colorway <- function(p = NULL) { + colway <- p$x$layout$colorway %||% Schema$layout$layoutAttributes$colorway$dflt + lapply(as.list(colway), function(x) structure(x, class = "colorway")) +} + +# column name for crosstalk key +# TODO: make this more unique? +crosstalk_key <- function() ".crossTalkKey" + +# arrange data if the vars exist, don't throw error if they don't +arrange_safe <- function(data, vars) { + vars <- vars[vars %in% names(data)] + if (length(vars)) dplyr::arrange(data, !!!rlang::syms(vars)) else data +} + +is_mapbox <- function(p) { + identical(p$x$layout[["mapType"]], "mapbox") +} + +is_geo <- function(p) { + identical(p$x$layout[["mapType"]], "geo") +} + +is_type <- function(p, type) { + types <- vapply(p$x$data, function(tr) tr[["type"]] %||% "scatter", character(1)) + all(types %in% type) +} + +# Replace elements of a nested list +# +# @param x a named list +# @param indicies a vector of indices. +# A 1D list may be used to specify both numeric and non-numeric inidices +# @param val the value used to +# @examples +# +# x <- list(a = 1) +# # equivalent to `x$a <- 2` +# re_place(x, "a", 2) +# +# y <- list(a = list(list(b = 2))) +# +# # equivalent to `y$a[[1]]$b <- 2` +# y <- re_place(y, list("a", 1, "b"), 3) +# y + +re_place <- function(x, indicies = 1, val) { + + expr <- call("[[", quote(x), indicies[[1]]) + if (length(indicies) == 1) { + eval(call("<-", expr, val)) + return(x) + } + + for (i in seq(2, length(indicies))) { + expr <- call("[[", expr, indicies[[i]]) + } + + eval(call("<-", expr, val)) + x +} + + +# retrive mapbox token if one is set; otherwise, throw error +mapbox_token <- function() { + token <- Sys.getenv("MAPBOX_TOKEN", NA) + if (is.na(token)) { + stop( + "No mapbox access token found. Obtain a token here\n", + "https://www.mapbox.com/help/create-api-access-token/\n", + "Once you have a token, assign it to an environment variable \n", + "named 'MAPBOX_TOKEN', for example,\n", + "Sys.setenv('MAPBOX_TOKEN' = 'secret token')", call. = FALSE + ) + } + token +} + +fit_bounds <- function(p) { + # Compute layout.mapboxid._fitBounds, an internal attr that has special client-side logic + # PS. how the hell does mapbox not have a way to set initial map bounds? + # https://github.com/mapbox/mapbox-gl-js/issues/1970 + mapboxIDs <- grep("^mapbox", sapply(p$x$data, "[[", "subplot"), value = TRUE) + for (id in mapboxIDs) { + bboxes <- lapply(p$x$data, function(tr) if (identical(id, tr$subplot)) tr[["_bbox"]]) + rng <- bboxes2range(bboxes, f = 0.01) + if (!length(rng)) next + # intentionally an array of numbers in [west, south, east, north] order + # https://www.mapbox.com/mapbox-gl-js/api/#lnglatboundslike + p$x$layout[[id]]$`_fitBounds` <- list( + bounds = c( + min(rng$xrng), + min(rng$yrng), + max(rng$xrng), + max(rng$yrng) + ), + options = list( + padding = 10, + linear = FALSE, + # NOTE TO SELF: can do something like this to customize easing + # easing = htmlwidgets::JS("function(x) { return 1; }"), + offset = c(0, 0) + ) + ) + p$x$layout[[id]]$center$lat <- mean(rng$yrng) + p$x$layout[[id]]$center$lon <- mean(rng$xrng) + } + + # Compute layout.geoid.lonaxis.range & layout.geoid.lataxis.range + # for scattergeo + geoIDs <- grep("^geo", sapply(p$x$data, "[[", "geo"), value = TRUE) + for (id in geoIDs) { + bboxes <- lapply(p$x$data, function(tr) if (identical(id, tr$geo)) tr[["_bbox"]]) + rng <- bboxes2range(bboxes, f = 0.01) + if (!length(rng)) next + p$x$layout[[id]]$lataxis$range <- rng$yrng + p$x$layout[[id]]$lonaxis$range <- rng$xrng + } + + # Compute layout.axisid.scaleanchor & layout.axisid.scaleratio + # for scatter/scattergl + rows <- compact(lapply(p$x$data, function(x) c(x[["xaxis"]], x[["yaxis"]]))) + for (i in seq_along(rows)) { + xid <- rows[[i]][[1]] + yid <- rows[[i]][[2]] + bboxes <- lapply(p$x$data, function(tr) { + if (identical(xid, tr$xaxis) && identical(yid, tr$yaxis)) tr[["_bbox"]] + }) + rng <- bboxes2range(bboxes, f = 0.01) + if (!length(rng)) next + xname <- sub("x", "xaxis", xid) + yname <- sub("y", "yaxis", yid) + # default to empty axes + # TODO: is there a set of projections where it makes sense to show a cartesian grid? + eaxis <- list(showgrid = FALSE, zeroline = FALSE, ticks = "", showticklabels = FALSE) + p$x$layout[[xname]] <- modify_list(eaxis, p$x$layout[[xname]]) + p$x$layout[[yname]] <- modify_list(eaxis, p$x$layout[[yname]]) + # remove default axis titles + p$x$layout[[xname]]$title <- p$x$layout[[xname]]$title %|D|% NULL + p$x$layout[[yname]]$title <- p$x$layout[[yname]]$title %|D|% NULL + p$x$layout[[xname]]$scaleanchor <- yid + # TODO: only do this for lat/lon dat + p$x$layout[[xname]]$scaleratio <- cos(mean(rng$yrng) * pi/180) + } + + # Internal _bbox field no longer needed + #p$x$data <- lapply(p$x$data, function(tr) { tr[["_bbox"]] <- NULL; tr }) + p +} + +# find the x/y layout range of a collection of trace._bboxes +bboxes2range <- function(bboxes, ...) { + if (sum(lengths(bboxes)) == 0) return(NULL) + yrng <- c( + min(unlist(lapply(bboxes, "[[", "ymin")), na.rm = TRUE), + max(unlist(lapply(bboxes, "[[", "ymax")), na.rm = TRUE) + ) + xrng <- c( + min(unlist(lapply(bboxes, "[[", "xmin")), na.rm = TRUE), + max(unlist(lapply(bboxes, "[[", "xmax")), na.rm = TRUE) + ) + list( + yrng = grDevices::extendrange(yrng, ...), + xrng = grDevices::extendrange(xrng, ...) + ) +} + +# rename attrs (unevaluated arguments) from geo locations (lat/lon) to cartesian +geo2cartesian <- function(p) { + p$x$attrs <- lapply(p$x$attrs, function(tr) { + tr[["x"]] <- tr[["x"]] %||% tr[["lat"]] + tr[["y"]] <- tr[["y"]] %||% tr[["lon"]] + tr + }) + p +} + +cartesian2geo <- function(p) { + p$x$data <- lapply(p$x$data, function(tr) { + if (isTRUE(tr[["type"]] %in% c("scattermapbox", "scattergeo"))) { + tr[["lat"]] <- tr[["lat"]] %||% tr[["y"]] + tr[["lon"]] <- tr[["lon"]] %||% tr[["x"]] + tr[c("x", "y")] <- NULL + } + tr + }) + p +} + + +is_subplot <- function(p) { + isTRUE(p$x$subplot) +} + +supply_defaults <- function(p) { + # no need to supply defaults for subplots + if (is_subplot(p)) return(p) + # supply trace anchor defaults + anchors <- if (is_geo(p)) c("geo" = "geo") else if (is_mapbox(p)) c("subplot" = "mapbox") else c("xaxis" = "x", "yaxis" = "y") + + p$x$data <- lapply(p$x$data, function(tr) { + for (i in seq_along(anchors)) { + key <- names(anchors)[[i]] + if (!has_attr(tr[["type"]] %||% "scatter", key)) next + tr[[key]] <- sub("^y1$", "y", sub("^x1$", "x", tr[[key]][1])) %||% anchors[[i]] + } + tr + }) + # hack to avoid https://github.com/ropensci/plotly/issues/945 + if (is_type(p, "parcoords")) p$x$layout$margin$t <- NULL + + # supply domain defaults + geoDomain <- list(x = c(0, 1), y = c(0, 1)) + if (is_geo(p) || is_mapbox(p)) { + p$x$layout[grepl("^[x-y]axis", names(p$x$layout))] <- NULL + p$x$layout[[p$x$layout$mapType]] <- modify_list( + list(domain = geoDomain), p$x$layout[[p$x$layout$mapType]] + ) + } else if (!length(p$x$layout[["grid"]])) { + types <- vapply(p$x$data, function(tr) tr[["type"]] %||% "scatter", character(1)) + axes <- unlist(lapply(types, function(x) { + grep("^[a-z]axis$", names(Schema$traces[[x]]$attributes), value = TRUE) %||% NULL + })) + for (axis in axes) { + p$x$layout[[axis]] <- modify_list( + list(domain = c(0, 1), automargin = TRUE), p$x$layout[[axis]] + ) + } + } + p +} + +supply_highlight_attrs <- function(p) { + # set "global" options via crosstalk variable + p$x$highlight <- p$x$highlight %||% highlight_defaults() + + # Grab the special "crosstalk set" (i.e., group) for each trace + sets <- lapply(p$x$data, "[[", "set") + noSet <- vapply(sets, is.null, logical(1)) + + # If no sets are present, there's nothing more to do + if (all(noSet)) { + return(p) + } + + # Store the unique set of crosstalk sets (which gets looped over client-side) + p$x$highlight$ctGroups <- i(unique(unlist(sets))) + + # Build a set -> key mapping for each relevant trace, which we'll use + # to set default values and/or build the selectize.js payload (if relevant) + setDat <- p$x$data[!noSet] + keys <- setNames(lapply(setDat, "[[", "key"), sets[!noSet]) + + for (i in p$x$highlight$ctGroups) { + + # Get all the keys for this crosstalk group + k <- unique(unlist(keys[names(keys) %in% i], use.names = FALSE)) + k <- k[!is.null(k)] + if (length(k) == 0) next + + # set default values via crosstalk api + vals <- intersect(p$x$highlight$defaultValues, k) + if (length(vals)) { + p <- htmlwidgets::onRender( + p, sprintf( + "function(el, x) { crosstalk.group('%s').var('selection').set(%s) }", + i, jsonlite::toJSON(as.character(vals), auto_unbox = FALSE) + ) + ) + } + + # include one selectize dropdown per "valid" SharedData layer + selectize <- p$x$highlight$selectize %||% FALSE + if (!identical(selectize, FALSE)) { + options <- list(items = data.frame(value = k, label = k), group = i) + if (!is.logical(selectize)) { + options <- modify_list(options, selectize) + } + # Hash i (the crosstalk group id) so that it can be used + # as an HTML id client-side (i.e., key shouldn't contain spaces) + groupId <- rlang::hash(i) + + # If the selectize payload has already been built, use that already built payload + # (since it may have been modified at this point), unless there are new keys to consider + oldSelectize <- p$x$selectize[[groupId]] + if (length(oldSelectize) > 0) { + missingKeys <- setdiff(k, oldSelectize$items$value) + if (length(missingKeys) > 0) { + warning("Overwriting the existing selectize payload for group '", i, "'. If you've previously modified this payload in some way, consider modifying it again.") + } else { + options <- oldSelectize + } + } + + p$x$selectize[[groupId]] <- options + } + } + + # set a sensible dragmode default, & throw messages + p$x$layout$dragmode <- p$x$layout$dragmode %|D|% + default(switch(p$x$highlight$on %||% "", plotly_selected = "select", plotly_selecting = "select") %||% "zoom") + if (is.default(p$x$highlight$off)) { + message( + sprintf( + "Setting the `off` event (i.e., '%s') to match the `on` event (i.e., '%s'). You can change this default via the `highlight()` function.", + p$x$highlight$off, p$x$highlight$on + ) + ) + } + + p +} + + +# make sure plot attributes adhere to the plotly.js schema +verify_attr_names <- function(p) { + # some layout attributes (e.g., [x-y]axis can have trailing numbers) + attrs_name_check( + sub("[0-9]+$", "", names(p$x$layout)), + c(names(Schema$layout$layoutAttributes), c("boxmode", "barmode", "bargap", "mapType")), + "layout" + ) + attrs_name_check( + names(p$x$config), + names(Schema$config), + "config" + ) + for (tr in seq_along(p$x$data)) { + thisTrace <- p$x$data[[tr]] + attrSpec <- Schema$traces[[thisTrace$type %||% "scatter"]]$attributes + # make sure attribute names are valid + attrs_name_check( + names(thisTrace), + c(names(attrSpec), "key", "set", "frame", "transforms", "_isNestedKey", "_isSimpleKey", "_isGraticule", "_bbox"), + thisTrace$type + ) + } + invisible(p) +} + + + +# ensure both the layout and trace attributes adhere to the plot schema +verify_attr_spec <- function(p) { + if (!is.null(p$x$layout)) { + p$x$layout <- verify_attr( + p$x$layout, Schema$layout$layoutAttributes, layoutAttr = TRUE + ) + } + for (tr in seq_along(p$x$data)) { + thisTrace <- p$x$data[[tr]] + validAttrs <- Schema$traces[[thisTrace$type %||% "scatter"]]$attributes + p$x$data[[tr]] <- verify_attr(thisTrace, validAttrs) + # prevent these objects from sending null keys + p$x$data[[tr]][["xaxis"]] <- p$x$data[[tr]][["xaxis"]] %||% NULL + p$x$data[[tr]][["yaxis"]] <- p$x$data[[tr]][["yaxis"]] %||% NULL + } + + p +} + +verify_attr <- function(proposed, schema, layoutAttr = FALSE) { + for (attr in names(proposed)) { + attrSchema <- schema[[attr]] %||% schema[[sub("[0-9]+$", "", attr)]] + # if schema is missing (i.e., this is an un-official attr), move along + if (is.null(attrSchema)) next + + valType <- tryNULL(attrSchema[["valType"]]) %||% "" + role <- tryNULL(attrSchema[["role"]]) %||% "" + arrayOK <- tryNULL(attrSchema[["arrayOk"]]) %||% FALSE + isDataArray <- identical(valType, "data_array") + + # where applicable, reduce single valued vectors to a constant + # (while preserving attributes) + if (!isDataArray && !arrayOK && !identical(role, "object")) { + proposed[[attr]] <- retain(proposed[[attr]], uniq) + } + + # If we deliberately only want hover on fills, send a string to + # plotly.js so it does something sensible + if (identical(proposed[["hoveron"]], "fills")) { + proposed[["text"]] <- paste(uniq(proposed[["text"]]), collapse = "\n") + } + + # ensure data_arrays of length 1 are boxed up by to_JSON() + if (isDataArray) { + proposed[[attr]] <- i(proposed[[attr]]) + } + + # tag 'src-able' attributes (needed for api_create()) + # note that layout has 'src-able' attributes that shouldn't + # be turned into grids https://github.com/ropensci/plotly/pull/1489 + isSrcAble <- !is.null(schema[[paste0(attr, "src")]]) && length(proposed[[attr]]) > 1 + if ((isDataArray || isSrcAble) && !isTRUE(layoutAttr)) { + proposed[[attr]] <- structure(proposed[[attr]], apiSrc = TRUE) + } + + if (length(proposed[["name"]]) > 0) { + proposed$name <- uniq(proposed$name) + } + + # if marker.size was populated via `size` arg (i.e., internal map_size()), + # then it should _always_ be an array + # of appropriate length... + # (when marker.size is a constant, it always sets the diameter!) + # https://codepen.io/cpsievert/pen/zazXgw + # https://github.com/plotly/plotly.js/issues/2735 + if (is.default(proposed$marker$size)) { + s <- proposed$marker[["size"]] + if (length(s) == 1) { + # marker.size could be of length 1, but we may have multiple + # markers -- in that case, if marker.size is an array + # of length 1 will result in just one marker + # https://codepen.io/cpsievert/pen/aMmOza + n <- length(proposed[["x"]] %||% proposed[["y"]] %||% proposed[["lat"]] %||% proposed[["lon"]]) + proposed$marker[["size"]] <- default(i(rep(s, n))) + } + } + + # do the same for "sub-attributes" + if (identical(role, "object") && is.recursive(proposed[[attr]])) { + proposed[[attr]] <- verify_attr(proposed[[attr]], attrSchema, layoutAttr = layoutAttr) + } + } + + proposed +} + +attrs_name_check <- function(proposedAttrs, validAttrs, type = "scatter") { + illegalAttrs <- setdiff(proposedAttrs, validAttrs) + if ("titlefont" %in% illegalAttrs) { + warning("The titlefont attribute is deprecated. Use title = list(font = ...) instead.", call. = FALSE) + illegalAttrs <- setdiff(illegalAttrs, "titlefont") + } + if (length(illegalAttrs)) { + warning("'", type, "' objects don't have these attributes: '", + paste(illegalAttrs, collapse = "', '"), "'\n", + "Valid attributes include:\n'", + paste(validAttrs, collapse = "', '"), "'\n", + call. = FALSE) + } + invisible(proposedAttrs) +} + +# make sure trace type is valid +# TODO: add an argument to verify trace properties are valid (https://github.com/ropensci/plotly/issues/540) +verify_type <- function(trace) { + if (is.null(trace$type)) { + attrs <- names(trace) + attrLengths <- lengths(trace) + trace$type <- if (all(c("x", "y", "z") %in% attrs)) { + if (all(c("i", "j", "k") %in% attrs)) "mesh3d" else "scatter3d" + } else if (all(c("x", "y") %in% attrs)) { + xNumeric <- !is.discrete(trace[["x"]]) + yNumeric <- !is.discrete(trace[["y"]]) + if (xNumeric && yNumeric) { + if (any(attrLengths) > 15000) "scattergl" else "scatter" + } else if (xNumeric || yNumeric) { + "bar" + } else "histogram2d" + } else if ("y" %in% attrs || "x" %in% attrs) { + "histogram" + } else if ("z" %in% attrs) { + "heatmap" + } else { + warning("No trace type specified and no positional attributes specified", + call. = FALSE) + "scatter" + } + relay_type(trace$type) + } + if (!is.character(trace$type) || length(trace$type) != 1) { + stop("The trace type must be a character vector of length 1.\n", + call. = FALSE) + } + if (!trace$type %in% names(Schema$traces)) { + stop("Trace type must be one of the following: \n", + "'", paste(names(Schema$traces), collapse = "', '"), "'", + call. = FALSE) + } + # if scatter/scatter3d/scattergl, default to a scatterplot + if (grepl("scatter", trace$type) && is.null(trace$mode)) { + message( + "No ", trace$type, " mode specifed:\n", + " Setting the mode to markers\n", + " Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode" + ) + trace$mode <- "markers" + } + trace +} + +relay_type <- function(type) { + message( + "No trace type specified:\n", + " Based on info supplied, a '", type, "' trace seems appropriate.\n", + " Read more about this trace type -> https://plotly.com/r/reference/#", type ) + type +} + +# Searches a list for character strings and translates R linebreaks to HTML +# linebreaks (i.e., '\n' -> '
'). JavaScript function definitions created +# via `htmlwidgets::JS()` are ignored +translate_linebreaks <- function(p) { + recurse <- function(a) { + typ <- typeof(a) + if (typ == "list") { + # retain the class of list elements + # which is important for many things, such as colorbars + a[] <- lapply(a, recurse) + } else if (typ == "character" && !inherits(a, "JS_EVAL")) { + attrs <- attributes(a) + a <- gsub("\n", br(), a, fixed = TRUE) + attributes(a) <- attrs + } else if (is.factor(a)) { + levels(a) <- gsub("\n", br(), levels(a), fixed = TRUE) + } + a + } + p$x[] <- lapply(p$x, recurse) + p +} + +verify_orientation <- function(trace) { + xNumeric <- !is.discrete(trace[["x"]]) && !is.null(trace[["x"]] %||% NULL) + yNumeric <- !is.discrete(trace[["y"]]) && !is.null(trace[["y"]] %||% NULL) + if (xNumeric && !yNumeric) { + if (any(c("bar", "box") %in% trace[["type"]])) { + trace$orientation <- "h" + } + } + if (yNumeric && "histogram" %in% trace[["type"]]) { + trace$orientation <- "h" + } + trace +} + +verify_mode <- function(p) { + for (tr in seq_along(p$x$data)) { + trace <- p$x$data[[tr]] + if (grepl("scatter", trace$type %||% "scatter")) { + if (user_specified(trace$marker) && !grepl("markers", trace$mode %||% "")) { + message( + "A marker object has been specified, but markers is not in the mode\n", + "Adding markers to the mode..." + ) + p$x$data[[tr]]$mode <- paste0(p$x$data[[tr]]$mode, "+markers") + } + if (user_specified(trace$line) && !grepl("lines", trace$mode %||% "")) { + message( + "A line object has been specified, but lines is not in the mode\n", + "Adding lines to the mode..." + ) + p$x$data[[tr]]$mode <- paste0(p$x$data[[tr]]$mode, "+lines") + } + if (user_specified(trace$textfont) && !grepl("text", trace$mode %||% "")) { + warning( + "A textfont object has been specified, but text is not in the mode\n", + "Adding text to the mode..." + ) + p$x$data[[tr]]$mode <- paste0(p$x$data[[tr]]$mode, "+text") + } + } + } + p +} + + +verify_colorscale <- function(p) { + p$x$data <- lapply(p$x$data, function(trace) { + trace$colorscale <- colorscale_json(trace$colorscale) + trace$marker$colorscale <- colorscale_json(trace$marker$colorscale) + trace + }) + p +} + +# Coerce `x` into a data structure that can map to a colorscale attribute. +# Note that colorscales can either be the name of a scale (e.g., 'Rainbow') or +# a 2D array (e.g., [[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]) +colorscale_json <- function(x) { + if (!length(x)) return(x) + if (is.character(x)) return(x) + if (is.matrix(x)) { + if (ncol(x) != 2) stop("A colorscale matrix requires two columns") + x <- as.data.frame(x) + x[, 1] <- as.numeric(x[, 1]) + } + # ensure a list like this: list(list(0, 0.5, 1), list("red", "white", "blue")) + # converts to the correct dimensions: [[0, 'red'], [0.5, 'white'], [1, 'blue']] + if (is.list(x) && length(x) == 2) { + n1 <- length(x[[1]]) + n2 <- length(x[[2]]) + if (n1 != n2 || n1 == 0 || n2 == 0) { + warning("A colorscale list must of elements of the same (non-zero) length") + } else if (!is.data.frame(x) && can_be_numeric(x[[1]])) { + x <- data.frame( + val = as.numeric(x[[1]]), + col = as.character(x[[2]]), + stringsAsFactors = FALSE + ) + x <- setNames(x, NULL) + } + } + x +} + +can_be_numeric <- function(x) { + xnum <- suppressWarnings(as.numeric(x)) + sum(is.na(x)) == sum(is.na(xnum)) +} + +# if an object (e.g. trace.marker) contains a non-default attribute, it has been user-specified +user_specified <- function(obj = NULL) { + if (!length(obj)) return(FALSE) + !all(rapply(obj, is.default)) +} + +# populate categorical axes using categoryorder="array" & categoryarray=[] +populate_categorical_axes <- function(p) { + axes <- p$x$layout[grepl("^xaxis|^yaxis", names(p$x$layout))] %||% + list(xaxis = NULL, yaxis = NULL) + for (i in seq_along(axes)) { + axis <- axes[[i]] + axisName <- names(axes)[[i]] + axisType <- substr(axisName, 0, 1) + # ggplotly() populates these attributes...don't want to clobber that + if (!is.null(axis$ticktext) || !is.null(axis$tickvals)) next + # collect all the data that goes on this axis + d <- lapply(p$x$data, "[[", axisType) + isOnThisAxis <- function(tr) { + is.null(tr[["geo"]]) && sub("axis", "", axisName) %in% + (tr[[sub("[0-9]+", "", axisName)]] %||% axisType) && + # avoid reordering matrices (see #863) + !is.matrix(tr[["z"]]) + } + d <- d[vapply(p$x$data, isOnThisAxis, logical(1))] + if (length(d) == 0) next + isDiscrete <- vapply(d, is.discrete, logical(1)) + if (0 < sum(isDiscrete) & sum(isDiscrete) < length(d)) { + warning( + "Can't display both discrete & non-discrete data on same axis", + call. = FALSE + ) + next + } + if (sum(isDiscrete) == 0) next + categories <- lapply(d, getLevels) + categories <- unique(unlist(categories)) + if (any(!vapply(d, is.factor, logical(1)))) categories <- sort(categories) + p$x$layout[[axisName]]$type <- + p$x$layout[[axisName]]$type %||% "category" + p$x$layout[[axisName]]$categoryorder <- + p$x$layout[[axisName]]$categoryorder %||% "array" + p$x$layout[[axisName]]$categoryarray <- + p$x$layout[[axisName]]$categoryarray %||% categories + } + p +} + +verify_arrays <- function(p) { + for (i in c("annotations", "shapes", "images")) { + thing <- p$x$layout[[i]] + if (is.list(thing) && !is.null(names(thing))) { + p$x$layout[[i]] <- list(thing) + } + } + p +} + +verify_hovermode <- function(p) { + if (!is.null(p$x$layout$hovermode)) { + return(p) + } + types <- unlist(lapply(p$x$data, function(tr) tr$type %||% "scatter")) + modes <- unlist(lapply(p$x$data, function(tr) tr$mode %||% "lines")) + if (any(grepl("markers", modes) & types == "scatter") || + any(c("plotly_hover", "plotly_click") %in% p$x$highlight$on)) { + p$x$layout$hovermode <- "closest" + } + p +} + +verify_key_type <- function(p) { + keys <- lapply(p$x$data, "[[", "key") + for (i in seq_along(keys)) { + k <- keys[[i]] + if (is.null(k)) next + if ("select" %in% p$x$layout$clickmode && "plotly_click" %in% p$x$highlight$on) { + warning( + "`layout.clickmode` = 'select' is not designed to work well with ", + "the R package's linking framework (i.e. crosstalk support).", + call. = FALSE + ) + } + # does it *ever* make sense to have a missing key value? + uk <- uniq(k) + if (length(uk) == 1) { + # i.e., the key for this trace has one value. In this case, + # we don't have iterate through the entire key, so instead, + # we provide a flag to inform client side logic to match the _entire_ + # trace if this one key value is a match + p$x$data[[i]]$key <- uk[[1]] + p$x$data[[i]]$`_isSimpleKey` <- TRUE + p$x$data[[i]]$`_isNestedKey` <- FALSE + } + p$x$data[[i]]$`_isNestedKey` <- p$x$data[[i]]$`_isNestedKey` %||% !rlang::is_atomic(k) + # key values should always be strings + if (p$x$data[[i]]$`_isNestedKey`) { + p$x$data[[i]]$key <- lapply(p$x$data[[i]]$key, function(x) I(as.character(x))) + p$x$data[[i]]$key <- setNames(p$x$data[[i]]$key, NULL) + } else { + p$x$data[[i]]$key <- I(as.character(p$x$data[[i]]$key)) + } + } + p +} + +verify_webgl <- function(p) { + # see toWebGL + if (!isTRUE(p$x$.plotlyWebGl)) { + return(p) + } + types <- sapply(p$x$data, function(x) x[["type"]][1] %||% "scatter") + can_gl <- paste0(types, "gl") %in% names(Schema$traces) + already_gl <- grepl("gl$", types) + if (any(!can_gl & !already_gl)) { + warning( + "The following traces don't have a WebGL equivalent: ", + paste(which(!can_gl & !already_gl), collapse = ", ") + ) + } + for (i in which(can_gl)) { + p$x$data[[i]]$type <- paste0(p$x$data[[i]]$type, "gl") + } + p +} + +verify_showlegend <- function(p) { + # this attribute should be set in hide_legend() + # it ensures that "legend titles" go away in addition to showlegend = FALSE + if (isTRUE(p$x$.hideLegend)) { + p$x$layout$showlegend <- FALSE + } + show <- vapply(p$x$data, function(x) x$showlegend %||% TRUE, logical(1)) + # respect only _user-specified_ defaults + isSinglePie <- identical("pie", unlist(lapply(p$x$data, function(tr) tr$type))) + p$x$layout$showlegend <- p$x$layout$showlegend %|D|% + default(sum(show) > 1 || isTRUE(p$x$highlight$showInLegend) || isSinglePie) + p +} + +verify_guides <- function(p) { + + # since colorbars are implemented as "invisible" traces, prevent a "trivial" legend + if (has_colorbar(p) && has_legend(p) && length(p$x$data) <= 2) { + p$x$layout$showlegend <- default(FALSE) + } + + isVisibleBar <- function(tr) { + is.colorbar(tr) && (tr$showscale %||% TRUE) + } + isBar <- vapply(p$x$data, isVisibleBar, logical(1)) + nGuides <- sum(isBar) + has_legend(p) + + if (nGuides > 1) { + + # place legend at bottom since its scrolly + yanchor <- default("top") + y <- default(1 - ((nGuides - 1) / nGuides)) + p$x$layout$legend$yanchor <- p$x$layout$legend$yanchor %|D|% yanchor + p$x$layout$legend$y <- p$x$layout$legend[["y"]] %|D|% y + + # shrink/position colorbars + idx <- which(isBar) + for (i in seq_along(idx)) { + len <- default(1 / nGuides) + lenmode <- default("fraction") + y <- default(1 - ((i - 1) / nGuides)) + + j <- idx[[i]] + tr <- p$x$data[[j]] + if (inherits(tr, "zcolor")) { + p$x$data[[j]]$colorbar$len <- tr$colorbar$len %|D|% len + p$x$data[[j]]$colorbar$lenmode <- tr$colorbar$lenmode %|D|% lenmode + p$x$data[[j]]$colorbar$y <- tr$colorbar$y %|D|% y + p$x$data[[j]]$colorbar$yanchor <- tr$colorbar$yanchor %|D|% yanchor + } else { + p$x$data[[j]]$marker$colorbar$len <- tr$marker$colorbar$len %|D|% len + p$x$data[[j]]$marker$colorbar$lenmode <- tr$marker$colorbar$lenmode %|D|% lenmode + p$x$data[[j]]$marker$colorbar$y <- tr$marker$colorbar$y %|D|% y + p$x$data[[j]]$marker$colorbar$yanchor <- tr$marker$colorbar$yanchor %|D|% yanchor + } + } + + } + + p +} + +verify_mathjax <- function(p) { + hasMathjax <- "mathjax" %in% sapply(p$dependencies, "[[", "name") + if (hasMathjax) return(p) + + hasTeX <- any(rapply(p$x, is.TeX)) + if (!hasTeX) return(p) + + # TODO: it would be much better to add the dependency here, but + # htmlwidgets doesn't currently support adding dependencies at print-time! + warning( + "Detected the use of `TeX()`, but mathjax has not been specified. ", + "Try running `config(.Last.value, mathjax = 'cdn')`", + call. = FALSE + ) + p +} + +has_marker <- function(types, modes) { + is_scatter <- grepl("scatter", types) + ifelse(is_scatter, grepl("marker", modes), has_attr(types, "marker")) +} + +has_line <- function(types, modes) { + is_scatter <- grepl("scatter", types) + ifelse(is_scatter, grepl("line", modes), has_attr(types, "line")) +} + +has_text <- function(types, modes) { + is_scatter <- grepl("scatter", types) + ifelse(is_scatter, grepl("text", modes), has_attr(types, "textfont")) +} + +has_color_array <- function(types, mode = "marker") { + vapply(types, function(x) isTRUE(tryNULL(Schema$traces[[x]]$attributes[[mode]]$color$arrayOk)), logical(1)) +} + +has_attr <- function(types, attr = "marker") { + if (length(attr) != 1) stop("attr must be of length 1") + vapply(types, function(x) attr %in% names(Schema$traces[[x]]$attributes), logical(1)) +} + +has_legend <- function(p) { + showLegend <- function(tr) { + tr$showlegend %||% TRUE + } + any(vapply(p$x$data, showLegend, logical(1))) && + isTRUE(p$x$layout$showlegend %|D|% TRUE) +} + +has_colorbar <- function(p) { + isVisibleBar <- function(tr) { + is.colorbar(tr) && isTRUE(tr$showscale %||% TRUE) + } + any(vapply(p$x$data, isVisibleBar, logical(1))) +} + +# is a given trace type 3d? +is3d <- function(type = NULL) { + type <- type %||% "scatter" + type %in% c("mesh3d", "scatter3d", "surface") } # Check for credentials/configuration and throw warnings where appropriate @@ -98,60 +1026,21 @@ grab <- function(what = "username") { # try to grab an object key from a JSON file (returns empty string on error) try_file <- function(f, what) { - tryCatch(jsonlite::fromJSON(f)[[what]], error = function(e) NULL) + tryCatch(jsonlite::read_json(f)[[what]], error = function(e) NULL) } # preferred defaults for toJSON mapping to_JSON <- function(x, ...) { jsonlite::toJSON(x, digits = 50, auto_unbox = TRUE, force = TRUE, - null = "null", na = "null", ...) + null = "null", na = "null", + time_format = "%Y-%m-%d %H:%M:%OS6", ...) } # preferred defaults for toJSON mapping from_JSON <- function(x, ...) { - jsonlite::fromJSON(x, simplifyDataFrame = FALSE, simplifyMatrix = FALSE, ...) -} - -add_boxed <- function(x) { - for (i in seq_along(x$data)) { - # some object keys require an array, even if length one - # one way to ensure atomic vectors of length 1 are not automatically unboxed, - # by to_JSON(), is to attach a class of AsIs (via I()) - d <- x$data[[i]] - idx <- names(d) %in% get_boxed(d$type %||% "scatter") & sapply(d, length) == 1 - if (any(idx)) x$data[[i]][idx] <- lapply(d[idx], I) - # (safely) mark individual nested properties - x$data[[i]]$error_x$array <- i(d$error_x$array) - x$data[[i]]$error_y$array <- i(d$error_y$array) - x$data[[i]]$error_x$arrayminus <- i(d$error_x$arrayminus) - x$data[[i]]$error_y$arrayminus <- i(d$error_y$arrayminus) - } - x + jsonlite::parse_json(x, simplifyVector = TRUE, simplifyDataFrame = FALSE, simplifyMatrix = FALSE, ...) } -# plotlyjs properties that must _always_ be an array (even if length 1) -get_boxed <- function(type = "scatter") { - # if the trace type isn't found, provide some sensible defaults - boxers[[type]] %||% c("x", "y", "z", "lat", "lon", "text", "locations") -} - -# if this ever needs updating see -# https://github.com/ropensci/plotly/issues/415#issuecomment-173353138 -boxers <- list( - choropleth = c("locations", "z", "text"), - box = c("x", "y"), - heatmap = c("z", "text"), - histogram = c("x", "y"), - histogram2d = c("z", "color"), - mesh3d = c("x", "y", "z", "i", "j", "k", "intensity", "vertexcolor", "facecolor"), - # TODO: what to do about marker.colors? - pie = c("labels", "values", "text"), - scatter = c("x", "y", "r", "t"), - scatter3d = c("x", "y", "z"), - scattergeo = c("lon", "lat", "locations"), - surface = c("x", "y", "z", "text") -) - i <- function(x) { if (is.null(x)) { return(NULL) @@ -166,6 +1055,7 @@ rm_asis <- function(x) { # jsonlite converts NULL to {} and NA to null (plotly prefers null to {}) # https://github.com/jeroenooms/jsonlite/issues/29 if (is.null(x)) return(NA) + if (is.data.frame(x)) return(x) if (is.list(x)) lapply(x, rm_asis) # strip any existing 'AsIs' list elements of their 'AsIs' status. # this is necessary since ggplot_build(qplot(1:10, fill = I("red"))) @@ -178,16 +1068,27 @@ rm_asis <- function(x) { # add a class to an object only if it is new, and keep any existing classes of # that object -struct <- function(x, y, ...) { - structure(x, class = unique(c(class(x), y)), ...) -} +append_class <- function(x, y) { + structure(x, class = unique(c(class(x), y))) +} +prefix_class <- function(x, y) { + structure(x, class = unique(c(y, class(x)))) +} +replace_class <- function(x, new, old) { + class(x) <- sub(old, new, class(x)) + x +} +remove_class <- function(x, y) { + oldClass(x) <- setdiff(oldClass(x), y) + x +} # TODO: what are some other common configuration options we want to support?? -get_domain <- function(type = "main") { - if (type == "stream") { - Sys.getenv("plotly_streaming_domain", "http://stream.plot.ly") - } else if (type == "v2") { - Sys.getenv("plotly_domain", "https://api.plot.ly/v2/") +get_domain <- function(type = "") { + if (type == "api") { + # new onprem instances don't have an https://api-thiscompany.plot.ly + # but https://thiscompany.plot.ly seems to just work in that case... + Sys.getenv("plotly_api_domain", Sys.getenv("plotly_domain", "https://api.plot.ly")) } else { Sys.getenv("plotly_domain", "https://plot.ly") } @@ -195,52 +1096,27 @@ get_domain <- function(type = "main") { # plotly's special keyword arguments in POST body get_kwargs <- function() { - c("filename", "fileopt", "style", "traces", "layout", "world_readable") -} - -# POST header fields -#' @importFrom base64enc base64encode -plotly_headers <- function(type = "main") { - usr <- verify("username") - key <- verify("api_key") - v <- as.character(packageVersion("plotly")) - h <- if (type == "v2") { - auth <- base64enc::base64encode(charToRaw(paste(usr, key, sep = ":"))) - c( - "authorization" = paste("Basic", auth), - "plotly-client-platform" = paste("R", v), - "plotly_version" = v, - "content-type" = "application/json" - ) - } else { - c( - "plotly-username" = usr, - "plotly-apikey" = key, - "plotly-version" = v, - "plotly-platform" = "R" - ) - } - httr::add_headers(.headers = h) + c("filename", "fileopt", "style", "traces", "layout", "frames", "world_readable") } - -perform_eval <- function(x) { - if (should_eval(x)) do_eval(x) else x +# "common" POST header fields +api_headers <- function() { + v <- as.character(get_package_version("plotly")) + httr::add_headers( + plotly_version = v, + `Plotly-Client-Platform` = paste("R", v), + `Content-Type` = "application/json", + Accept = "*/*" + ) } -# env/enclos are special properties specific to the R API -# if they appear _and_ are environments, then evaluate arguments -# (sometimes figures return these properties but evaluation doesn't make sense) -should_eval <- function(x) { - any(vapply(x[c("env", "enclos")], is.environment, logical(1))) +api_auth <- function() { + httr::authenticate( + verify("username"), + verify("api_key") + ) } -# perform evaluation of arguments, keeping other list elements -do_eval <- function(x) { - y <- c(x, eval(x$args, as.list(x$env, all.names = TRUE), x$enclos)) - y[c("args", "env", "enclos")] <- NULL - y -} # try to write environment variables to an .Rprofile cat_profile <- function(key, value, path = "~") { @@ -262,3 +1138,42 @@ cat_profile <- function(key, value, path = "~") { message("Adding plotly_", key, " environment variable to ", r_profile) cat(snippet, file = r_profile, append = TRUE) } + + +# check that suggested packages are installed +try_library <- function(pkg, fun = NULL) { + if (is_installed(pkg)) { + return(invisible()) + } + stop("Package `", pkg, "` required", if (!is.null(fun)) paste0(" for `", fun, "`"), ".\n", + "Please install and try again.", call. = FALSE) +} + +# similar logic to rstudioapi::isAvailable() +is_rstudio <- function() { + identical(.Platform$GUI, "RStudio") +} + +# nchar() needs a non-empty character vector; sometimes x will be a +# factor, or an empty vector. +robust_nchar <- function(x, ...) { + if (length(x)) nchar(as.character(x), ...) + else 0 +} + +# Extract longest element, or blank if none +longest_element <- function(x) { + if (length(x)) + x[which.max(robust_nchar(x))] + else + "" +} + +# A dplyr::group_by wrapper for the add argument +group_by_add <- function(..., add = TRUE) { + if (get_package_version('dplyr') >= '1.0') { + dplyr::group_by(..., .add = add) + } else { + dplyr::group_by(..., add = add) + } +} diff --git a/README.md b/README.md index 771b143b06..5541472798 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,115 @@ -[![Build Status](https://travis-ci.org/ropensci/plotly.png?branch=master)](https://travis-ci.org/ropensci/plotly) -# plotly + -An R package for creating interactive web-based graphs via [plotly](https://plot.ly/)'s JavaScript graphing library. + + + +[![R-CMD-check](https://github.com/ropensci/plotly/workflows/R-CMD-check/badge.svg)](https://github.com/plotly/plotly.R/actions) +[![CRAN Status](https://www.r-pkg.org/badges/version/plotly)](https://cran.r-project.org/package=plotly) +[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/grand-total/plotly)](https://cranlogs.r-pkg.org/badges/grand-total/plotly) +[![monthly](https://cranlogs.r-pkg.org/badges/plotly)](https://cranlogs.r-pkg.org/badges/plotly) + + +An R package for creating interactive web graphics via the open source +JavaScript graphing library +[plotly.js](https://github.com/plotly/plotly.js). + + ## Installation Install from CRAN: -```r +``` r install.packages("plotly") ``` -Or install the latest development version (on GitHub) via devtools: +Or install the latest development version (on GitHub) via `{remotes}`: -```r -devtools::install_github("ropensci/plotly") +``` r +remotes::install_github("plotly/plotly") ``` -## Introduction +## Getting started -If you use [ggplot2](http://cran.r-project.org/package=ggplot2), use `ggplotly()` to convert your ggplot to an interactive, web-based version! +### Web-based ggplot2 graphics -```r +If you use [ggplot2](https://github.com/tidyverse/ggplot2), `ggplotly()` +converts your static plots to an interactive web-based version\! + +``` r library(plotly) -set.seed(100) -d <- diamonds[sample(nrow(diamonds), 1000), ] -p <- ggplot(data = d, aes(x = carat, y = price)) + - geom_point(aes(text = paste("Clarity:", clarity))) + - geom_smooth(aes(colour = cut, fill = cut)) + facet_wrap(~ cut) -(gg <- ggplotly(p)) +g <- ggplot(faithful, aes(x = eruptions, y = waiting)) + + stat_density_2d(aes(fill = ..level..), geom = "polygon") + + xlim(1, 6) + ylim(40, 100) +ggplotly(g) ``` -![https://plot.ly/~agvd/1153](http://i.imgur.com/tbKybEb.png) - -[Click here](https://plot.ly/~agvd/1153) to interact with the resulting graph (notice the custom hover text!) +![](https://i.imgur.com/G1rSArP.gif) -__plotly__ also supports certain chart types that ggplot2 doesn't support (such as 3D [surface](https://plot.ly/r/3d-surface-plots/), [point](https://plot.ly/r/3d-scatter-plots/), and [line](https://plot.ly/r/3d-line-plots/) plots). You can easily create these (or any other plotly) charts using the high-level interface. +By default, `ggplotly()` tries to replicate the static ggplot2 version +exactly (before any interaction occurs), but sometimes you need greater +control over the interactive behavior. The `ggplotly()` function itself +has some convenient “high-level” arguments, such as `dynamicTicks`, +which tells plotly.js to dynamically recompute axes, when appropriate. +The `style()` function also comes in handy for *modifying* the +underlying trace +attributes (e.g. [hoveron](https://plotly.com/r/reference/#scatter-hoveron)) used to generate the plot: -```r -plot_ly(z = volcano, type = "surface") +``` r +gg <- ggplotly(g, dynamicTicks = "y") +style(gg, hoveron = "points", hoverinfo = "x+y+text", hoverlabel = list(bgcolor = "white")) ``` -![https://plot.ly/~brnvg/1134](https://plot.ly/~brnvg/1134.png) - -The `ggplotly()` function converts a ggplot object to a plotly object, so if you like, you may 'post-process' your ggplot graphs to add custom plotly features, for example: - -```r -layout(gg, hovermode = "closest") +![](https://imgur.com/qRvLgea.gif) + +Moreover, since `ggplotly()` returns a plotly object, you can apply +essentially any function from the R package on that object. Some useful +ones include `layout()` (for [customizing the +layout](https://plotly-r.com/improving-ggplotly.html#modifying-layout)), +`add_traces()` (and its higher-level `add_*()` siblings, for example +`add_polygons()`, for [adding new +traces/data](https://plotly-r.com/improving-ggplotly.html#leveraging-statistical-output)), +`subplot()` (for [combining multiple plotly +objects](https://plotly-r.com/arranging-views.html#arranging-plotly-objects)), +and `plotly_json()` (for inspecting the underlying JSON sent to +plotly.js). + +The `ggplotly()` function will also respect some “unofficial” +**ggplot2** aesthetics, namely `text` (for [customizing the +tooltip](https://plotly-r.com/controlling-tooltips.html#tooltip-text-ggplotly)), +`frame` (for [creating +animations](https://plotly-r.com/animating-views.html)), +and `ids` (for ensuring sensible smooth transitions). + +### Using plotly without ggplot2 + +The `plot_ly()` function provides a more direct interface to plotly.js +so you can leverage more specialized chart types (e.g., [parallel +coordinates](https://plotly.com/r/parallel-coordinates-plot/) or +[maps](https://plotly.com/r/maps/)) or even some visualization that the +ggplot2 API won’t ever support (e.g., surface, +[mesh](https://plotly.com/r/3d-mesh/), +[trisurf](https://plotly.com/r/trisurf/), etc). + +``` r +plot_ly(z = ~volcano, type = "surface") ``` -## Documentation +![](https://plotly.com/~brnvg/1134.png) -* [An introduction to plotly's R API](https://cran.r-project.org/web/packages/plotly/vignettes/intro.html) -* Examples and vignettes on plotly's R homepage - -* The complete figure reference guide - +## Learn more -## Contributing +To learn more about special features that the plotly R package provides (e.g., [client-side linking](https://plotly-r.com/client-side-linking.html), [**shiny** integration](https://plotly-r.com/linking-views-with-shiny.html), [editing and generating static images](https://plotly-r.com/publish.html), [custom events in JavaScript](https://plotly-r.com/javascript.html), and more), see . You may already be familiar with existing plotly documentation (e.g., ), which is essentially a language-agnostic how-to guide for learning plotly.js, whereas is meant to be more wholistic tutorial written by and for the R user. The package itself ships with a number of demos (list them by running `demo(package = "plotly")`) and shiny/rmarkdown examples (list them by running `plotly_example("shiny")` or `plotly_example("rmd")`). [Carson](https://cpsievert.me) also keeps numerous [slide decks](https://talks.cpsievert.me) with useful examples and concepts. -Please read through our [contributing guidelines](https://github.com/ropensci/plotly/blob/master/CONTRIBUTING.md). Included are directions for opening issues, asking questions, contributing changes to plotly, and our code of conduct. - ---- +## Contributing -[![](http://ropensci.org/public_images/github_footer.png)](http://ropensci.org) +Please read through our [contributing +guidelines](https://github.com/plotly/plotly.R/blob/master/CONTRIBUTING.md). +Included are directions for opening issues, asking questions, +contributing changes to plotly, and our code of +conduct. diff --git a/data-raw/res-mn.R b/data-raw/res-mn.R new file mode 100644 index 0000000000..b85178d13a --- /dev/null +++ b/data-raw/res-mn.R @@ -0,0 +1,29 @@ +library(sf) + +f <- tempfile(fileext = ".zip") +download.file("https://www.dot.state.mn.us/maps/gdma/data/datafiles/statewide/indian_res.zip", f) +unzip(f, exdir = dirname(f)) +res <- st_read(file.path(dirname(f), "reservtn.shp")) + +# assuming this based on epsg provided from other shapefiles on +# https://www.dot.state.mn.us/maps/gdma/gis-data.html +st_crs(res) <- 26915 + +res_mn <- st_transform(res, 4326) + +# plot_mapbox(res_mn, text = ~INDRESNAME, hoverinfo = "text") +devtools::use_data(res_mn, overwrite = TRUE) + + +# f <- tempfile(fileext = ".zip") +# download.file("https://www.dot.state.mn.us/maps/gdma/data/datafiles/statewide/county.zip", f) +# unzip(f, exdir = dirname(f)) +# mn <- st_read(file.path(dirname(f), "MNCounties_MNDOT.shp")) +# +# mn <- mn %>% +# st_simplify(TRUE, 2000) %>% +# st_transform(4326) +# +# # plot_mapbox(mn) +# +# devtools::use_data(mn, overwrite = TRUE) diff --git a/data-raw/res-us.R b/data-raw/res-us.R new file mode 100644 index 0000000000..565988c956 --- /dev/null +++ b/data-raw/res-us.R @@ -0,0 +1,15 @@ +library(sf) + +# https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2017&layergroup=American+Indian+Area+Geography +# click 'American Indian/Alaska Native/Native Hawaiian Area' +res <- sf::st_read("~/Downloads/tl_2017_us_aiannh/tl_2017_us_aiannh.shp") + +# TODO: +# (1) simplify shape file!! +# (2) crosstalk highlight should set fillcolor... + +res %>% + highlight_key(~NAME) %>% + plot_ly(text = ~NAME) %>% + highlight(selectize = TRUE, dynamic = TRUE) + diff --git a/data/res_mn.rda b/data/res_mn.rda new file mode 100644 index 0000000000..e01d2b79ee Binary files /dev/null and b/data/res_mn.rda differ diff --git a/demo/00Index b/demo/00Index new file mode 100644 index 0000000000..a227f872aa --- /dev/null +++ b/demo/00Index @@ -0,0 +1,27 @@ +animation-tour-basic A basic example of a grand tour +animation-tour-USArrests Linking a dendrogram to a tour +crosstalk-highlight-intro An introduction to linked views +crosstalk-highlight-subplot Basic scatterplot brushing with subplot() +crosstalk-highlight-ggplotly Linking ggplot2 plots +crosstalk-highlight-leaflet Linking to leaflet +crosstalk-highlight-ggpairs Brushing a scatterplot matrix via ggpairs +crosstalk-highlight-pipeline Aggregating SharedData +crosstalk-highlight-binned-target-a Dynamic 2-way ANOVA +crosstalk-highlight-binned-target-b Dynamically re-rendering a boxplot, violin plot, and bar-chart based on selections +crosstalk-highlight-binned-target-c Dynamically re-rendering a histogram based on selection +crosstalk-highlight-epl Exploring English Premier League performace across seasons and teams +crosstalk-highlight-epl-2 A 'wormchart' version of the epl demo +crosstalk-filter-lines Using crosstalk's filter_select() to filter lines +crosstalk-filter-dynamic-axis Using crosstalk's filter_select() to dynamically change the y-axis +custom-javascript Using htmlwidgets::onRender() to add custom interactivity features (e.g google search on click) +rotate Using htmlwidgets::onRender() to rotate the camera of a 3D graph +ternary A basic ternary plot +sf-mapbox-data Mapping sf objects with mapbox +sf-mapbox-layout Mapping sf objects with mapbox (as a layer) +sf-mapbox-style Including a dropdown for mapbox's basemap style +sf-dt Linked querying of simple features with DT (datatables) +sf-plotly-3D-globe Exploring storms paths by linking a 3D globe with a 2D summary +sf-plotly-storms Linking multiple 2D views of 3D storm paths +sf-ggplot2 Mapping sf objects via ggplot2 and geom_sf() +sf-geo Mapping sf objects with scattergeo + diff --git a/demo/animation-tour-USArrests.R b/demo/animation-tour-USArrests.R new file mode 100644 index 0000000000..5d983d4b83 --- /dev/null +++ b/demo/animation-tour-USArrests.R @@ -0,0 +1,84 @@ +# adapted from https://github.com/rstudio/ggvis/blob/master/demo/tourr.r +library(plotly) + +data("USArrests") + +# Avoids R CMD check NOTE about using `tourr` without mentioning it in DESCRIPTION +# Install it via CRAN `install.packages("tourr")` +rescale <- getFromNamespace("rescale", "tourr") +new_tour <- getFromNamespace("new_tour", "tourr") +grand_tour <- getFromNamespace("grand_tour", "tourr") + +mat <- rescale(USArrests[, 1:4]) +tour <- new_tour(mat, grand_tour(), NULL) + +# projection of each observation +tour_dat <- function(step_size) { + step <- tour(step_size) + proj <- scale(mat %*% step$proj, center = TRUE, scale = FALSE) + data.frame(x = proj[,1], y = proj[,2], state = rownames(mat)) +} + +# projection of each variable's axis +proj_dat <- function(step_size) { + step <- tour(step_size) + data.frame( + x = step$proj[,1], y = step$proj[,2], variable = colnames(mat) + ) +} + +steps <- c(0, rep(1/15, 200)) +stepz <- cumsum(steps) + +# tidy version of tour data +tour_dats <- lapply(steps, tour_dat) +tour_datz <- Map(function(x, y) cbind(x, step = y), tour_dats, stepz) +tour_dat <- dplyr::bind_rows(tour_datz) + +# tidy version of tour projection data +proj_dats <- lapply(steps, proj_dat) +proj_datz <- Map(function(x, y) cbind(x, step = y), proj_dats, stepz) +proj_dat <- dplyr::bind_rows(proj_datz) + + +ax <- list( + title = "", showticklabels = FALSE, + zeroline = FALSE, showgrid = FALSE, + range = c(-1.1, 1.1) +) + +# for nicely formatted slider labels +options(digits = 3) + +tour_dat <- highlight_key(tour_dat, ~state, group = "A") + +tour <- proj_dat %>% + plot_ly(x = ~x, y = ~y, frame = ~step, color = I("black")) %>% + add_segments(xend = 0, yend = 0, color = I("gray80")) %>% + add_text(text = ~variable) %>% + add_markers(data = tour_dat, text = ~state, ids = ~state, hoverinfo = "text") %>% + layout(xaxis = ax, yaxis = ax) + +dend <- USArrests %>% + dist() %>% + hclust() %>% + as.dendrogram() %>% + plot_dendro(set = "A", xmin = -100, height = 900, width = 1100) + +USArrests$state <- rownames(USArrests) +USArrests$abb <- setNames(state.abb, state.name)[USArrests$state] + +map <- plot_geo(USArrests, color = I("black")) %>% + add_trace(locations = ~abb, locationmode = "USA-states", + key = ~state, set = "A") %>% + layout(geo = list( + scope = 'usa', + projection = list(type = 'albers usa'), + lakecolor = toRGB('white') + )) + +subplot(map, tour, nrows = 2, margin = 0) %>% + subplot(dend, shareY = FALSE, margin = 0) %>% + hide_legend() %>% + animation_opts(33, easing = "cubic", redraw = FALSE) %>% + highlight(persistent = TRUE, dynamic = TRUE) diff --git a/demo/animation-tour-basic.R b/demo/animation-tour-basic.R new file mode 100644 index 0000000000..0d337a77cb --- /dev/null +++ b/demo/animation-tour-basic.R @@ -0,0 +1,61 @@ +# adapted from https://github.com/rstudio/ggvis/blob/master/demo/tourr.r +library(plotly) + +# Avoids R CMD check NOTE about using `tourr` without mentioning it in DESCRIPTION +# Install it `install.packages("tourr")` +rescale <- getFromNamespace("rescale", "tourr") +new_tour <- getFromNamespace("new_tour", "tourr") +grand_tour <- getFromNamespace("grand_tour", "tourr") +lazyLoad( + file.path(system.file("data", package = "tourr"), "Rdata"), + filter = function(x) x == "flea" +) + +mat <- rescale(as.matrix(flea[1:6])) +tour <- new_tour(mat, grand_tour(), NULL) + +tour_dat <- function(step_size) { + step <- tour(step_size) + proj <- scale(mat %*% step$proj, center = TRUE, scale = FALSE) + data.frame(x = proj[,1], y = proj[,2], + species = flea$species) +} + +proj_dat <- function(step_size) { + step <- tour(step_size) + data.frame( + x = step$proj[,1], y = step$proj[,2], measure = colnames(mat) + ) +} + +steps <- c(0, rep(1/15, 50)) +stepz <- cumsum(steps) + +# tidy version of tour data +tour_dats <- lapply(steps, tour_dat) +tour_datz <- Map(function(x, y) cbind(x, step = y), tour_dats, stepz) +tour_dat <- dplyr::bind_rows(tour_datz) + +# tidy version of tour projection data +proj_dats <- lapply(steps, proj_dat) +proj_datz <- Map(function(x, y) cbind(x, step = y), proj_dats, stepz) +proj_dat <- dplyr::bind_rows(proj_datz) + + +ax <- list( + title = "", + range = c(-1, 1), + zeroline = FALSE +) + +# for nicely formatted slider labels +options(digits = 2) + +proj_dat %>% + plot_ly(x = ~x, y = ~y, frame = ~step, color = I("gray80")) %>% + add_segments(xend = 0, yend = 0) %>% + add_text(text = ~measure) %>% + add_markers(color = ~species, data = tour_dat) %>% + hide_legend() %>% + layout(xaxis = ax, yaxis = ax) %>% + animation_opts(33, redraw = FALSE) diff --git a/demo/crosstalk-filter-dynamic-axis.R b/demo/crosstalk-filter-dynamic-axis.R new file mode 100644 index 0000000000..a3662508a6 --- /dev/null +++ b/demo/crosstalk-filter-dynamic-axis.R @@ -0,0 +1,15 @@ +library(plotly) +library(tidyr) +library(crosstalk) + +m <- gather(mtcars, variable, value, -vs) +msd <- highlight_key(m, ~variable) +gg <- ggplot(msd, aes(factor(vs), value)) + + geom_jitter(alpha = 0.3) + +bscols( + widths = c(11, 6, 6), + filter_select("id", "Select a variable", msd, ~variable, multiple = FALSE), + ggplotly(gg, dynamicTicks = "y") %>% layout(margin = list(l = 30)), + plot_ly(msd, x = ~jitter(vs), y = ~value) %>% add_markers(alpha = 0.3) +) diff --git a/demo/crosstalk-filter-lines.R b/demo/crosstalk-filter-lines.R new file mode 100644 index 0000000000..6fb8aa90af --- /dev/null +++ b/demo/crosstalk-filter-lines.R @@ -0,0 +1,20 @@ +library(crosstalk) +library(ggplot2) +library(plotly) + +# Equivalent to data(gapminder, package = "gapminder"), but avoids R CMD check NOTE +# about `gapminder` not being in DESCRIPTION. Install it `install.packages("gapminder")` +lazyLoad( + file.path(system.file("data", package = "gapminder"), "Rdata"), + filter = function(x) x == "gapminder" +) + +sd <- highlight_key(gapminder) + +g <- ggplot(sd, aes(year, lifeExp, color = country, group = country)) + + geom_line() + +bscols(widths = c(12, 12), + filter_select("country", "Country:", sd, ~ country), + ggplotly(g) +) diff --git a/demo/crosstalk-highlight-binned-target-a.R b/demo/crosstalk-highlight-binned-target-a.R new file mode 100644 index 0000000000..ef1dd6d7b6 --- /dev/null +++ b/demo/crosstalk-highlight-binned-target-a.R @@ -0,0 +1,25 @@ +# These examples demonstrate ways to display binned/aggregated selections +library(plotly) + +d <- highlight_key(mpg) +dots <- plot_ly(d, colors = "Set1", color = ~class, x = ~displ, y = ~jitter(cyl)) %>% + layout( + xaxis = list(title = "Engine displacement"), + yaxis = list(title = "Number of cylinders") + ) +boxs <- plot_ly(d, colors = "Set1", color = ~class, x = ~class, y = ~cty) %>% + add_boxplot() %>% + layout( + xaxis = list(title = ""), + yaxis = list(title = "Miles per gallon (city)") + ) +bars <- plot_ly(d, colors = "Set1", x = ~class, color = ~class) + +subplot(dots, boxs, titleX = TRUE, titleY = TRUE) %>% + subplot(bars, nrows = 2, titleX = TRUE, titleY = TRUE) %>% + layout( + title = "Dynamic 2-way ANOVA (click & drag on scatterplot)", + barmode = "overlay", + showlegend = FALSE + ) %>% + highlight("plotly_selected", opacityDim = 0.6) diff --git a/demo/crosstalk-highlight-binned-target-b.R b/demo/crosstalk-highlight-binned-target-b.R new file mode 100644 index 0000000000..070f8ed3e7 --- /dev/null +++ b/demo/crosstalk-highlight-binned-target-b.R @@ -0,0 +1,23 @@ +# These examples demonstrate ways to display binned/aggregated selections +library(plotly) + +d <- highlight_key(mtcars) +sp <- plot_ly(d, x = ~mpg, y = ~disp) %>% + add_markers(color = I("black")) + +# 'statistical trace types' +hist <- plot_ly(d, x = ~factor(cyl)) %>% + add_histogram(color = I("black")) +box <- plot_ly(d, y = ~disp, color = I("black")) %>% + add_boxplot(name = " ") +violin <- plot_ly(d, y = ~disp, color = I("black")) %>% + add_trace(type = "violin", name = " ") + +subplot(sp, box, violin, shareY = TRUE, titleX = TRUE, titleY = TRUE) %>% + subplot(hist, widths = c(.75, .25), titleX = TRUE, titleY = TRUE) %>% + layout( + barmode = "overlay", + title = "Click and drag scatterplot", + showlegend = FALSE + ) %>% + highlight("plotly_selected") diff --git a/demo/crosstalk-highlight-binned-target-c.R b/demo/crosstalk-highlight-binned-target-c.R new file mode 100644 index 0000000000..1e737bd034 --- /dev/null +++ b/demo/crosstalk-highlight-binned-target-c.R @@ -0,0 +1,12 @@ +# These examples demonstrate ways to display binned/aggregated selections +library(plotly) + +tx <- highlight_key(txhousing, ~city) +p1 <- ggplot(tx, aes(date, median, group = city)) + geom_line() + xlab(NULL) +gg1 <- ggplotly(p1, tooltip = c("city", "date", "median")) +p2 <- plot_ly(tx, x = ~median, color = I("black")) %>% + add_histogram(histnorm = "probability density") + +subplot(gg1, p2, titleX = TRUE, titleY = TRUE) %>% + layout(barmode = "overlay") %>% + highlight(dynamic = TRUE, selected = attrs_selected(opacity = 0.3)) diff --git a/demo/crosstalk-highlight-epl-2.R b/demo/crosstalk-highlight-epl-2.R new file mode 100644 index 0000000000..38d9a94a3b --- /dev/null +++ b/demo/crosstalk-highlight-epl-2.R @@ -0,0 +1,42 @@ +library(engsoccerdata) +library(dplyr) +library(tidyr) +library(plotly) + +# shape data into desired format +dat <- england %>% + gather(location, team, home, visitor) %>% + # focus on tier 1 teams that are still playing in 2015 + filter(team %in% maketable_eng(england, 2015, 1)[["team"]]) %>% + mutate( + pts = ifelse(location == "home" & goaldif > 0, 3, + ifelse(location == "away" & goaldif < 0, 3, 1)) + ) %>% + arrange(Date) %>% + group_by(Season, team) %>% + mutate(gameno = row_number(), cumpts = cumsum(pts)) %>% + ungroup() %>% + group_by(gameno) %>% + mutate(meanP = mean(cumpts)) %>% + filter(Season > 2006) + +sd <- highlight_key(dat, ~team, "Select a team") + +# a 'wormchart' like fig 8 here http://www.gradaanwr.net/wp-content/uploads/2016/06/dataApr16.pdf +p <- ggplot(sd, aes(x = gameno, y = cumpts - meanP)) + + geom_line(aes(group = team), alpha = 0.5) + + facet_wrap(~ Season, ncol = 3) + + labs( + title = "English Premier League Performance", + x = "Game in season", + y = "Cumulative points (above/below) average" + ) + +gg <- ggplotly(p, tooltip = "team") + +highlight( + gg, + dynamic = TRUE, + selectize = TRUE, + color = RColorBrewer::brewer.pal(12, "Paired") +) diff --git a/demo/crosstalk-highlight-epl.R b/demo/crosstalk-highlight-epl.R new file mode 100644 index 0000000000..684de99299 --- /dev/null +++ b/demo/crosstalk-highlight-epl.R @@ -0,0 +1,29 @@ +library(engsoccerdata) +library(dplyr) +library(tidyr) +library(plotly) + +# shape data into desired format +dat <- england %>% + gather(location, team, home, visitor) %>% + # focus on tier 1 teams that are still playing in 2015 + filter(team %in% maketable_eng(england, 2015, 1)[["team"]]) %>% + mutate( + pts = ifelse(location == "home" & goaldif > 0, 3, + ifelse(location == "away" & goaldif < 0, 3, 1)) + ) %>% + arrange(Date) %>% + group_by(Season, team) %>% + mutate(gameno = row_number(), cumpts = cumsum(pts)) + +sd <- highlight_key(dat, ~Season, "Select a season") + +p <- ggplot(sd, aes(x = gameno, y = cumpts)) + + geom_line(aes(color = Season, group = Season), alpha = 0.5) + + facet_wrap(~ team) + ggtitle("English Premier League Performance (1888-2015)") + + xlab("Game in Season") + ylab("Cumulative Points") + +gg <- ggplotly(p, tooltip = "colour") + +highlight(gg, opacityDim = 0.05, selectize = TRUE) + diff --git a/demo/crosstalk-highlight-ggpairs.R b/demo/crosstalk-highlight-ggpairs.R new file mode 100644 index 0000000000..dd5be32645 --- /dev/null +++ b/demo/crosstalk-highlight-ggpairs.R @@ -0,0 +1,5 @@ +library(GGally) +d <- highlight_key(iris) +p <- ggpairs(d, aes(colour = Species), columns = 1:5) +ggplotly(p) %>% + highlight("plotly_selected") diff --git a/demo/crosstalk-highlight-ggplotly.R b/demo/crosstalk-highlight-ggplotly.R new file mode 100644 index 0000000000..5548a7d8f4 --- /dev/null +++ b/demo/crosstalk-highlight-ggplotly.R @@ -0,0 +1,27 @@ +library(plotly) + +# see https://vimeo.com/202647310 +d <- highlight_key(txhousing, ~city, "Select a city") +p <- ggplot(d, aes(date, median, group = city)) + geom_line() +ggplotly(p, tooltip = "city") %>% + layout(title = "Click on a line to highlight a year") %>% + highlight(dynamic = TRUE, selectize = TRUE) + +# crosstalk keys are automatically added to the group aesthetic... +# if you want to avoid adding the key to group for a layer, +# use the original data +p <- ggplot(d, aes(month, median)) + + geom_line(aes(group = city)) + + geom_smooth(data = txhousing, method = "gam") + + facet_wrap(~ year) +ggplotly(p) %>% + layout(title = "Click on a line to highlight a year") + +# perhaps a more useful example +sd <- highlight_key(txhousing, ~year) +p <- ggplot(sd, aes(month, median)) + + geom_line(aes(group = year)) + + geom_smooth(data = txhousing, method = "gam") + + facet_wrap(~ city) +ggplotly(p, height = 800, width = 1600) %>% + layout(title = "Click on a line to highlight a year") diff --git a/demo/crosstalk-highlight-intro.R b/demo/crosstalk-highlight-intro.R new file mode 100644 index 0000000000..74f1aeb934 --- /dev/null +++ b/demo/crosstalk-highlight-intro.R @@ -0,0 +1,68 @@ +library(plotly) + +nPatients <- 50 +nVisits <- 10 + +d <- data.frame( + perc = rnorm(n = nPatients * nVisits, mean = 50, sd = 10), + patient = rep(seq(nPatients), each = nVisits), + visit = rep(seq(nVisits), nPatients) +) + +# Define a 'primary key' variable (patient) for interactive queries +hd <- highlight_key(d, ~patient) + +# Create a "repeated measures" plot +p <- plot_ly(hd, x = ~visit, y = ~perc, color = I("black"), + text = ~paste("Patient:", patient)) %>% + group_by(patient) %>% + add_trace(mode = "markers+lines") + +# Since the data provided (hd) has a primary key definition of 'patient', +# **plotly** knows to highlight any lines/markers matching the selected patient(s). +# Go ahead and *click* on any marker and watch the entire 'patient' be highlighted +layout(p, title = "Click on a marker to highlight that patient") + +# By default, the "on event" is "plotly_click", but we can change that to +# "plotly_selected", which corresponds to click and drag mouse events. +p %>% + layout(title = "Click and drag to select patient") %>% + highlight("plotly_selecting") + +# Plotly provides two types of drag modes that will trigger a "plotly_selected" +# event: "lasso" and "select". You can change the dragmode interactively via +# the modebar and/or set the default dragmode via `layout()`. +p %>% + layout(title = "Click and drag to select patient", dragmode = "lasso") %>% + highlight("plotly_selecting") + +# The first argument of `highlight()`, `on`, sets the interaction type used +# trigger a "highlight selection". The second argument, `off`, sets the +# interaction required to clear the selection set and return to the original view. +# IF you don't provide an `off` event, a sensible one will be choosen based +# on the value of `on`. +p %>% + highlight(on = "plotly_hover", off = "plotly_doubleclick") %>% + layout(dragmode = "zoom") + +# By default, all selections are transient, meaning prior selections are +# removed from the selection set before new selections are added. To prevent +# prior selections from being removed, hold down the shift key while triggering +# the event +p %>% + layout(title = "Shift the key to accumulate selections") %>% + highlight("plotly_hover") + +# Sometimes its useful to compare two or more different selection sets. +# For example, how do patients with a high response on visit 1 compare to those +# with a low response? To make this sort of comparison, we can alter the color +# in multiple persistent selections. By setting the dynamic argument to `TRUE` +# a colourpicker will appear just above the plotly visualization. +# At any given time, the value of this widget controls the color of new selection(s). +highlight(p, dynamic = TRUE) + +# By default, the colourpicker widget uses colors from the "Set1" +# colour brewer palette (@RColorBrewer), but any set of valid R colors can +# be supplied to the color argument. +colors <- RColorBrewer::brewer.pal(4, "Dark2") +highlight(p, color = colors, dynamic = TRUE) diff --git a/demo/crosstalk-highlight-leaflet.R b/demo/crosstalk-highlight-leaflet.R new file mode 100644 index 0000000000..a5662de38e --- /dev/null +++ b/demo/crosstalk-highlight-leaflet.R @@ -0,0 +1,21 @@ +library(plotly) +library(crosstalk) +library(htmltools) + +# leaflet should respect these "global" highlight() options +options(opacityDim = 0.5) + +sd <- highlight_key(quakes) + +p <- plot_ly(sd, x = ~depth, y = ~mag) %>% + add_markers(alpha = 0.5) %>% + highlight("plotly_selected", dynamic = TRUE) + +# Requires devtools::install_github("rstudio/leaflet#346") +withr::with_namespace("leaflet", { + map <- leaflet(sd) %>% + addTiles() %>% + addCircles() +}) + +bscols(p, map) diff --git a/demo/crosstalk-highlight-pipeline.R b/demo/crosstalk-highlight-pipeline.R new file mode 100644 index 0000000000..6256c22f6f --- /dev/null +++ b/demo/crosstalk-highlight-pipeline.R @@ -0,0 +1,24 @@ +library(plotly) + +sd <- highlight_key(txhousing, ~city, "Select a city") + +base <- plot_ly(sd, color = I("black"), height = 400) %>% + group_by(city) + +p1 <- base %>% + summarise(miss = sum(is.na(median))) %>% + filter(miss > 0) %>% + add_markers(x = ~miss, y = ~forcats::fct_reorder(city, miss), hoverinfo = "x+y") %>% + layout( + barmode = "overlay", + xaxis = list(title = "Number of months missing"), + yaxis = list(title = "") + ) + +p2 <- base %>% + add_lines(x = ~date, y = ~median, alpha = 0.3) %>% + layout(xaxis = list(title = "")) + + subplot(p1, p2, titleX = TRUE, widths = c(0.3, 0.7)) %>% + hide_legend() %>% + highlight(dynamic = TRUE, selectize = TRUE) diff --git a/demo/crosstalk-highlight-subplot.R b/demo/crosstalk-highlight-subplot.R new file mode 100644 index 0000000000..8aa48af3fb --- /dev/null +++ b/demo/crosstalk-highlight-subplot.R @@ -0,0 +1,9 @@ +library(plotly) + +d <- highlight_key(mtcars) +s <- subplot( + qplot(data = d, x = mpg, y = wt), + qplot(data = d, x = mpg, y = vs) +) + +highlight(s, "plotly_selected") diff --git a/demo/custom-javascript.R b/demo/custom-javascript.R new file mode 100644 index 0000000000..6d1c3b692f --- /dev/null +++ b/demo/custom-javascript.R @@ -0,0 +1,98 @@ +library(plotly) +library(htmlwidgets) + +mtcars$url <- paste0( + "http://google.com/#q=", + rownames(mtcars) +) + +p <- plot_ly(mtcars, x = ~wt, y = ~mpg) %>% + add_markers(customdata = ~url) + +# open google search (on click) +onRender(p, " + function(el, x) { + el.on('plotly_click', function(d) { + var url = d.points[0].customdata; + window.open(url); + }); + } +") + +# annotate graph (on click) +onRender(p, " + function(el, x) { + el.on('plotly_click', function(d) { + var ann = { + text: d.points[0].customdata, + x: 0, + y: 0, + xref: 'paper', + yref: 'paper', + yshift: -40, + showarrow: false + } + Plotly.relayout(el.id, {annotations: [ann]}) + }); + } +") + +# annotate on hover +onRender(p, " + function(el, x) { + el.on('plotly_hover', function(d) { + var ann = { + text: d.points[0].customdata, + x: 0, + y: 0, + xref: 'paper', + yref: 'paper', + yshift: -40, + showarrow: false + } + Plotly.relayout(el.id, {annotations: [ann]}) + }); + } +") + +# combine highlight() api with custom javascript +mtcars %>% + highlight_key() %>% + plot_ly(x = ~wt, y = ~mpg, customdata = ~url) %>% + highlight(color = "red") %>% + onRender(" + function(el, x) { + el.on('plotly_click', function(d) { + var ann = { + text: d.points[0].customdata, + x: 0, + y: 0, + xref: 'paper', + yref: 'paper', + yshift: -40, + showarrow: false + } + Plotly.relayout(el.id, {annotations: [ann]}) + }); + } + ") + +# inspect different plotly.js events via browser console +# see also plotly.com/javascript/plotlyjs-events/ +onRender(p, " + function(el, x) { + el.on('plotly_hover', function(d) { + console.log('hover', d) + }); + el.on('plotly_click', function(d) { + console.log('click', d) + }); + el.on('plotly_selected', function(d) { + console.log('selected', d) + }); + el.on('plotly_relayout', function(d) { + console.log('relayout', d) + }); + }" +) + diff --git a/demo/rotate.R b/demo/rotate.R new file mode 100644 index 0000000000..61c5702120 --- /dev/null +++ b/demo/rotate.R @@ -0,0 +1,53 @@ +library(plotly) +library(htmlwidgets) + +# Thanks to Etienne Tetreault-Pinard +# http://codepen.io/etpinard/pen/jmvyxV?editors=0010 + +plot_ly(z = list(list(1,2,3), list(3,2,1)), type = "surface") %>% + onRender( + "function(el, x) { + + var gd = document.getElementById(el.id); + + var cnt = 0; + + function run() { + rotate('scene', Math.PI / 180); + requestAnimationFrame(run); + } + run(); + + function rotate(id, angle) { + var scene = gd._fullLayout[id]._scene; + var camera = scene.getCamera(); + + var rtz = xyz2rtz(camera.eye); + + rtz.t += angle; + + camera.eye = rtz2xyz(rtz); + + scene.setCamera(camera); + } + + // Math.atan2 will rotate the full 360, but it doesn't render for some reason? + function xyz2rtz(xyz) { + return { + r: Math.sqrt(xyz.x * xyz.x + xyz.y * xyz.y), + t: Math.atan(xyz.y / xyz.x), + z: xyz.z + }; + } + + function rtz2xyz(rtz) { + return { + x: rtz.r * Math.cos(rtz.t), + y: rtz.r * Math.sin(rtz.t), + z: rtz.z + }; + } + + }" + ) + diff --git a/demo/sf-dt.R b/demo/sf-dt.R new file mode 100644 index 0000000000..d3a37050f3 --- /dev/null +++ b/demo/sf-dt.R @@ -0,0 +1,13 @@ +library(plotly) +library(crosstalk) + +nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) +ncsd <- highlight_key(nc) + +map <- plot_ly(ncsd, split = ~NAME, color = I("gray"), hoveron = "fills") %>% + highlight(persistent = TRUE, color = "red", opacityDim = 1) %>% + layout(title = "Click on counties to query them", showlegend = FALSE) %>% + config(displayModeBar = FALSE) + +datatable <- getFromNamespace("datatable", "DT") +bscols(map, datatable(ncsd)) diff --git a/demo/sf-geo.R b/demo/sf-geo.R new file mode 100644 index 0000000000..302024707b --- /dev/null +++ b/demo/sf-geo.R @@ -0,0 +1,17 @@ +library(plotly) + +storms <- sf::st_read(system.file("shape/storms_xyz.shp", package = "sf"), quiet = TRUE) + +subplot( + nrows = 2, + plot_geo(storms, name = "2D storms"), + plot_geo(storms, name = "3D storms") %>% + layout( + geo = list( + projection = list(type = "orthographic"), + lonaxis = list(showgrid = TRUE, gridcolor = "gray"), + lataxis = list(showgrid = TRUE, gridcolor = "gray") + ) + ) +) + diff --git a/demo/sf-ggplot2.R b/demo/sf-ggplot2.R new file mode 100644 index 0000000000..33a0824ce0 --- /dev/null +++ b/demo/sf-ggplot2.R @@ -0,0 +1,30 @@ +library(plotly) +library(sf) + +nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) +p <- ggplot(nc) + geom_sf(aes(fill = AREA)) +ggplotly(p) + +# If not supplied, coord_sf() will take the CRS from the first layer +# and automatically transform all other layers to use that CRS. This +# ensures that all data will correctly line up +nc_3857 <- sf::st_transform(nc, "+init=epsg:3857") +p2 <- ggplot() + + geom_sf(data = nc) + + geom_sf(data = nc_3857, colour = "red", fill = NA) +ggplotly(p2) + +# Unfortunately if you plot other types of feature you'll need to use +# show.legend to tell ggplot2 what type of legend to use +nc_3857$mid <- sf::st_centroid(nc_3857$geometry) +p3 <- ggplot(nc_3857) + + geom_sf(colour = "white") + + geom_sf(aes(geometry = mid, size = AREA), show.legend = "point") +ggplotly(p3) + +# You can also use layers with x and y aesthetics: these are +# assumed to already be in the common CRS. +p4 <- ggplot(nc) + + geom_sf() + + annotate("point", x = -80, y = 35, colour = "red", size = 4) +ggplotly(p4) diff --git a/demo/sf-mapbox-data.R b/demo/sf-mapbox-data.R new file mode 100644 index 0000000000..2bf27040c0 --- /dev/null +++ b/demo/sf-mapbox-data.R @@ -0,0 +1,34 @@ +library(plotly) +library(crosstalk) + +# one trace +plot_mapbox(res_mn) +plot_mapbox(res_mn, stroke = I("#119dff"), span = I(1), color = I("#00cc96")) + +# multiple traces +plot_mapbox(res_mn, split = ~INDRESNAME, span = I(1)) +plot_mapbox(res_mn, split = ~INDRESNAME, color = ~AREA, stroke = ~PERIMETER, span = I(1)) + +# linking with DT +mn <- highlight_key(res_mn) +datatable <- getFromNamespace("datatable", "DT") +bscols( + plot_mapbox(mn, split = ~INDRESNAME, text = ~INDRESNAME, hoverinfo = "text", hoveron = "fills") %>% + layout(title = "Click a reservation", showlegend = FALSE), + datatable(mn) +) + +# linking with plotly +nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) +ncsd <- highlight_key(nc) + +# note that brushing counties is currently possible with plot_ly(), but isn't quite working +# yet with plot_mapbox() -- https://github.com/plotly/plotly.js/issues/2512 +bscols( + plot_mapbox(ncsd) %>% + highlight(dynamic = TRUE, persistent = TRUE), + plot_ly(ncsd, x = ~AREA) %>% + add_histogram(xbins = list(start = 0, end = 0.3, size = 0.02)) %>% + layout(barmode = "overlay") %>% + highlight("plotly_selected", persistent = TRUE) +) diff --git a/demo/sf-mapbox-layout.R b/demo/sf-mapbox-layout.R new file mode 100644 index 0000000000..b1bf48d940 --- /dev/null +++ b/demo/sf-mapbox-layout.R @@ -0,0 +1,36 @@ +library(sf) +library(plotly) + +nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) + +# TODO: is there a way to do this without writing to disk? +sf_to_geojson <- function(x) { + tmp <- tempfile(fileext = ".geojson") + st_write(x, tmp, driver = "GEOJSON") + geojson_read <- getFromNamespace("geojson_read", "geojsonio") + geojson_read(tmp, "local") +} + +# By converting sf to geojson and routing to mapbox.layers, rendering +# should be more performant (and correct in all cases). However, compared to +# `demo("sf-data-scattermapbox.R", package = "plotly")`, you lose the ability +# to interact with (and link) the features. +plot_mapbox(x = -80, y = 35) %>% + layout( + hovermode = 'closest', + mapbox = list( + layers = list( + list( + sourcetype = 'geojson', + source = sf_to_geojson(nc), + type = 'fill', + color = 'transparent' + ) + ), + bearing = 0, + center = list(lat = 35, lon = -80), + pitch = 0, + zoom = 5.2, + style = 'light' + ) + ) diff --git a/demo/sf-mapbox-style.R b/demo/sf-mapbox-style.R new file mode 100644 index 0000000000..7b09d7e112 --- /dev/null +++ b/demo/sf-mapbox-style.R @@ -0,0 +1,18 @@ +library(plotly) + +storms <- sf::st_read(system.file("shape/storms_xyz.shp", package = "sf"), quiet = TRUE) + +# obtain all the "pre-packaged" mapbox styles and use them to +# create a collection of buttons that will control the mapbox.style +# attribute via a dropdown -- https://plotly.com/r/dropdowns/ +styles <- schema(FALSE)$layout$layoutAttributes$mapbox$style$values +style_buttons <- lapply(styles, function(s) { + list(label = s, method = "relayout", args = list("mapbox.style", s)) +}) + +plot_mapbox(storms, color = I("red")) %>% + layout( + title = "Changing the base layer", + updatemenus = list(list(y = 0.8, buttons = style_buttons)) + ) + diff --git a/demo/sf-plotly-3D-globe.R b/demo/sf-plotly-3D-globe.R new file mode 100644 index 0000000000..f87965dbb1 --- /dev/null +++ b/demo/sf-plotly-3D-globe.R @@ -0,0 +1,120 @@ +library(plotly) +library(dplyr) + +# latitude, longitude, and altitiude of tropical storms +storms <- sf::st_read(system.file("shape/storms_xyz.shp", package = "sf"), quiet = TRUE) + +# even grid of lat/lons spanning the globe (for creating the globe surface) +nlat <- 200 +nlon <- 100 +lat <- seq(-180, 180, length.out = nlat) +lon <- seq(-90, 90, length.out = nlon) +lat <- matrix(rep(lat, nlon), nrow = nlat) +lon <- matrix(rep(lon, each = nlat), nrow = nlat) + +# helper function for converting polar (lat/lon) -> cartesian (x/y/z) +degrees2radians <- function(degree) degree * pi / 180 + +# show as little as possible when hovering over surface +empty_axis <- list( + showgrid = FALSE, + zeroline = FALSE, + showticklabels = FALSE, + showspikes = FALSE, + spikesides = FALSE, + title = "" +) + +# for centering camera/lighting on the center of the storm paths +xyzmean <- list(x = .41, y = -.71, z = 0.57) + + +# A 3D globe implemented with 3D lines and a spherical surface +# Note that the globe has a radius of 1, but project the lines with +# a radius of 1.001 so that we appear on top of the surface +globe <- plot_ly(height = 500) %>% + add_sf( + data = sf::st_as_sf(maps::map("world", plot = FALSE, fill = TRUE)), + x = ~ 1.001 * cos(degrees2radians(x)) * cos(degrees2radians(y)), + y = ~ 1.001 * sin(degrees2radians(x)) * cos(degrees2radians(y)), + z = ~ 1.001 * sin(degrees2radians(y)), + color = I("black"), size = I(1), + hoverinfo = "none" + ) %>% + add_sf( + data = highlight_key(storms, group = "storm paths"), + name = "storm paths", + x = ~ 1.001 * cos(degrees2radians(x)) * cos(degrees2radians(y)), + y = ~ 1.001 * sin(degrees2radians(x)) * cos(degrees2radians(y)), + z = ~ 1.001 * sin(degrees2radians(y)), + color = ~z, size = I(6), + text = ~paste("Latitude:", y, "
", "Longitude:", x, "
", "Altitude:", z), + hoverinfo = "text" + ) %>% + add_surface( + x = cos(degrees2radians(lon)) * cos(degrees2radians(lat)), + y = sin(degrees2radians(lon)) * cos(degrees2radians(lat)), + z = sin(degrees2radians(lat)), + # NOTE: you can map a value to surfacecolor to encode, say air temp + # for an example, see https://github.com/cpsievert/Weather_Stuff/blob/master/radiation-plot-3D.R + # But here is a trick to set the surface color to a constant white + surfacecolor = matrix(NA, nrow = nlat, ncol = nlon), + showscale = FALSE, hoverinfo = "skip", + lightposition = xyzmean, + contours = list( + x = list(highlight = FALSE), + y = list(highlight = FALSE), + z = list(highlight = FALSE) + ) + ) %>% + layout( + showlegend = FALSE, + scene = list( + xaxis = empty_axis, + yaxis = empty_axis, + zaxis = empty_axis, + aspectratio = list(x = 1, y = 1, z = 1), + camera = list(eye = xyzmean) + ) + ) + + +# spherical distance between the first point and every other point +# https://en.wikipedia.org/wiki/Great-circle_distance +arc_dist <- function(lon, lat) { + lon <- degrees2radians(lon) + lat <- degrees2radians(lat) + lon0 <- lon[1] + lat0 <- lat[1] + delta <- cos(abs(lon - lon0)) + acos(sin(lat0) * sin(lat) + cos(lat0) * cos(lat) * delta) +} + +# plot altitude of each storm versus the distance it has traveled +distanceByAlt <- storms %>% + sf::st_coordinates() %>% + as.data.frame() %>% + group_by(L1) %>% + mutate(dist = arc_dist(X, Y)) %>% + rename(altitude = Z) %>% + highlight_key(~L1, group = "storm paths") %>% + plot_ly(x = ~dist, y = ~altitude, height = 400) %>% + # plotly.js doesn't support color gradient along *2D* lines + add_lines(color = I("gray")) %>% + add_markers( + color = ~altitude, hoverinfo = "text", + text = ~paste("Distance:", round(dist, 2), "
", "Altitude:", altitude, "
", "Storm:", L1) + ) %>% + layout( + showlegend = FALSE, + title = "Tropical storm altitude by distance \n (click to highlight storm)", + font = list(size = 15, family = "Balta"), + margin = list(t = 60) + ) + +# force persistent selection +# TODO: persistence via shift should work with two separate graphs!! +options(persistent = TRUE) + +library(htmltools) +browsable(tagList(globe, distanceByAlt)) diff --git a/demo/sf-plotly-storms.R b/demo/sf-plotly-storms.R new file mode 100644 index 0000000000..59a6847c08 --- /dev/null +++ b/demo/sf-plotly-storms.R @@ -0,0 +1,64 @@ +library(plotly) + +storms <- sf::st_read(system.file("shape/storms_xyz.shp", package = "sf"), quiet = TRUE) +stormz <- highlight_key(storms) + +xy <- plot_ly(stormz, color = ~z, mode = "markers+lines", line = list(color = "gray"), hoverinfo = "none") +xz <- add_sf(xy, y = ~z, color = ~y) +yz <- add_sf(xy, x = ~z, color = ~x) +xyz2D <- subplot(xy, xz, yz, titleX = TRUE, titleY = TRUE) %>% + hide_legend() %>% + hide_colorbar() %>% + highlight(selected = attrs_selected(hoverinfo = "x+y")) + +xyz3D <- plot_ly(stormz, color = ~z, z = ~z) %>% + # this bit rotates the 3D graph + htmlwidgets::onRender( + "function(el, x) { + + var gd = document.getElementById(el.id); + + var cnt = 0; + + function run() { + rotate('scene', Math.PI / 180); + requestAnimationFrame(run); + } + run(); + + function rotate(id, angle) { + var scene = gd._fullLayout[id]._scene; + var camera = scene.getCamera(); + + var rtz = xyz2rtz(camera.eye); + + rtz.t += angle; + + camera.eye = rtz2xyz(rtz); + + scene.setCamera(camera); + } + + // Math.atan2 will rotate the full 360, but it doesn't render for some reason? + function xyz2rtz(xyz) { + return { + r: Math.sqrt(xyz.x * xyz.x + xyz.y * xyz.y), + t: Math.atan(xyz.y / xyz.x), + z: xyz.z + }; + } + + function rtz2xyz(rtz) { + return { + x: rtz.r * Math.cos(rtz.t), + y: rtz.r * Math.sin(rtz.t), + z: rtz.z + }; + } + + }" + ) + + +library(htmltools) +browsable(tagList(xyz2D, xyz3D)) diff --git a/demo/ternary.R b/demo/ternary.R new file mode 100644 index 0000000000..f52c61af7a --- /dev/null +++ b/demo/ternary.R @@ -0,0 +1,58 @@ +# An improvement on https://www.r-bloggers.com/ternary-plots-in-r-using-plotly/ + +library(plotly) + +# acquire data +ds <- jsonlite::fromJSON( + "https://gist.githubusercontent.com/davenquinn/988167471993bc2ece29/raw/f38d9cb3dd86e315e237fde5d65e185c39c931c2/data.json" +) +df <- dplyr::bind_rows(ds, .id = "id") + +# reusable function for creating annotation object +label <- function(txt) { + list( + text = txt, + x = 0.1, y = 1, + ax = 0, ay = 0, + xref = "paper", yref = "paper", + align = "center", + font = list(family = "serif", size = 15, color = "white"), + bgcolor = "#b3b3b3", bordercolor = "black", borderwidth = 2 + ) +} + +# reusable function for axis formatting +axis <- function(txt) { + list( + title = txt, tickformat = ".0%", tickfont = list(size = 10) + ) +} + +ternaryAxes <- list( + aaxis = axis("Clay"), + baxis = axis("Sand"), + caxis = axis("Silt") +) + +plot_ly( + df, a = ~clay, b = ~sand, c = ~silt, color = I("black"), type = "scatterternary" +) %>% + layout( + annotations = label("Ternary Markers"), ternary = ternaryAxes + ) + +plot_ly( + df, a = ~clay, b = ~sand, c = ~silt, color = I("black"), type = "scatterternary", + split = ~id, mode = "lines" +) %>% + layout( + annotations = label("Ternary Lines"), ternary = ternaryAxes + ) + +plot_ly( + df, a = ~clay, b = ~sand, c = ~silt, color = ~id, type = "scatterternary", + fill = "toself", mode = "lines" +) %>% + layout( + annotations = label("Ternary Contour"), ternary = ternaryAxes + ) diff --git a/inst/CITATION b/inst/CITATION new file mode 100644 index 0000000000..83739ac862 --- /dev/null +++ b/inst/CITATION @@ -0,0 +1,10 @@ +bibentry( + bibtype = "book", + author = "Carson Sievert", + title = "Interactive Web-Based Data Visualization with R, plotly, and shiny", + publisher = "Chapman and Hall/CRC", + year = "2020", + isbn = "9781138331457", + url = "https://plotly-r.com", + textVersion = "C. Sievert. Interactive Web-Based Data Visualization with R, plotly, and shiny. Chapman and Hall/CRC Florida, 2020." +) diff --git a/inst/arguments.R b/inst/arguments.R deleted file mode 100644 index 2df5e5340a..0000000000 --- a/inst/arguments.R +++ /dev/null @@ -1,180 +0,0 @@ -# This script grabs argument names from plotly documentation and provides some -# convenience functions for translating all those arguments to the R package - -library(rvest) -ref <- read_html("https://plot.ly/javascript-graphing-library/reference") -# complete set of args -argz <- ref %>% html_nodes(".gamma .link--impt") %>% html_text() %>% - gsub("\\n", "", .) %>% stringr::str_trim() - - -# function arguments -fun_args <- function(x) paste(x, "= NULL", collapse = ", ") -# argument documentation (put inside @param) -doc_args <- function(x) paste(x, collapse = ", ") -# put inside function body -in_args <- function(x) paste(x, "=", x, collapse = ", ") - -# scatter args -fun_args(argz[1:24]) -doc_args(argz[1:24]) -in_args(argz[1:24]) - -# bar args -fun_args(argz[26:43]) -doc_args(argz[26:43]) -in_args(argz[26:43]) - -# histogram args -fun_args(argz[45:68]) -doc_args(argz[45:68]) -in_args(argz[45:68]) - -# box args -fun_args(argz[70:89]) -doc_args(argz[70:89]) -in_args(argz[70:89]) - -# heatmap args -fun_args(argz[91:116]) -doc_args(argz[91:116]) -in_args(argz[91:116]) - -# contour args -fun_args(argz[118:145]) -doc_args(argz[118:145]) -in_args(argz[118:145]) - -# histogram2d args -fun_args(argz[147:173]) -doc_args(argz[147:173]) -in_args(argz[147:173]) - -# histogram2dcontour args -fun_args(argz[175:204]) -doc_args(argz[175:204]) -in_args(argz[175:204]) - -# area args -fun_args(argz[206:214]) -doc_args(argz[206:214]) -in_args(argz[206:214]) - -# scatter3d args -fun_args(argz[216:230]) -doc_args(argz[216:230]) -in_args(argz[216:230]) - -# surface args -fun_args(argz[232:240]) -doc_args(argz[232:240]) -in_args(argz[232:240]) - -# ---------------------------------------------------------------------- -# Trace auxiliary objects (in R/aux.R) -# ---------------------------------------------------------------------- - -# error_y args -fun_args(argz[241:251]) -doc_args(argz[241:251]) -in_args(argz[241:251]) - -# error_x args -fun_args(argz[252:263]) -doc_args(argz[252:263]) -in_args(argz[252:263]) - -# xbins args -fun_args(argz[264:266]) -doc_args(argz[264:266]) -in_args(argz[264:266]) - -# ybins args -fun_args(argz[267:269]) -doc_args(argz[267:269]) -in_args(argz[267:269]) - -# marker args -fun_args(argz[270:282]) -doc_args(argz[270:282]) -in_args(argz[270:282]) - -# line args -fun_args(argz[283:290]) -doc_args(argz[283:290]) -in_args(argz[283:290]) - -# contour args -fun_args(argz[291:295]) -doc_args(argz[291:295]) -in_args(argz[291:295]) - -# colorbar args -fun_args(argz[296:326]) -doc_args(argz[296:326]) -in_args(argz[296:326]) - -# stream args -fun_args(argz[327:328]) -doc_args(argz[327:328]) -in_args(argz[327:328]) - -# error_z args -fun_args(argz[329:339]) -doc_args(argz[329:339]) -in_args(argz[329:339]) - -# ---------------------------------------------------------------------- -# Axis objects (in R/axis.R) -# ---------------------------------------------------------------------- - -# xaxis/yaxis/zaxis args are identical -x <- fun_args(argz[340:378]) -y <- fun_args(argz[379:417]) -z <- fun_args(argz[444:482]) -identical(x, y) && identical(y, z) - -x -doc_args(argz[340:378]) -in_args(argz[340:378]) - - -# radialaxis/angularaxis args -fun_args(argz[418:437]) -doc_args(argz[418:437]) -in_args(argz[418:437]) - -# scene args -fun_args(argz[438:443]) -doc_args(argz[438:443]) -in_args(argz[438:443]) - - -# ---------------------------------------------------------------------- -# Layout objects (in R/layout.R) -# ---------------------------------------------------------------------- - -# layout args -fun_args(argz[483:512]) -doc_args(argz[483:512]) -in_args(argz[483:512]) - -# font args -fun_args(argz[513:516]) -doc_args(argz[513:516]) -in_args(argz[513:516]) - -# legend args -fun_args(argz[517:527]) -doc_args(argz[517:527]) -in_args(argz[517:527]) - -# annotation args -fun_args(argz[528:549]) -doc_args(argz[528:549]) -in_args(argz[528:549]) - -# margin args -fun_args(argz[550:557]) -doc_args(argz[550:557]) -in_args(argz[550:557]) diff --git a/inst/build-push-comment.R b/inst/build-push-comment.R deleted file mode 100644 index b38ea96ec6..0000000000 --- a/inst/build-push-comment.R +++ /dev/null @@ -1,73 +0,0 @@ -# ----------------------------------------------------------------------- -# Travis does two types of builds: -# -# (1) A so-called "push". This essentially does a checkout on the most -# recent commit of the pull request, but *doesn't* merge with master. -# In this case, $TRAVIS_PULL_REQUEST = "false" -# (2) A so-called "pr" (pull request). This *simulates* a merge with master. -# In this case, $TRAVIS_PULL_REQUEST contains the pull request number. -# And $TRAVIS_COMMIT is a SHA1 hash that won't match the HEAD of master or -# the branch we're testing. -# -# Since it makes more sense to visually compared what we'd see *after* we -# merge with master, we don't do anything here if it's a push build. -# -# For more info on Travis CI environment variables, see -# http://docs.travis-ci.com/user/ci-environment/#Environment-variables -# ----------------------------------------------------------------------- -library("httr") -library("testthat") - -# if this is a Travis pull request, make a comment on the pull request -comment <- grepl("^[0-9]+$", Sys.getenv("TRAVIS_PULL_REQUEST")) - -if (comment) { - # get the links to differences, if any - this_hash <- substr(Sys.getenv("TRAVIS_COMMIT"), 1, 7) - this_dir <- normalizePath(this_hash, mustWork = T) - links <- sprintf( - "http://cpsievert.github.io/plotly-test-table/%s/%s", - this_hash, dir(this_dir) - ) - # construct the message - build_link <- file.path('https://travis-ci.org/ropensci/plotly/builds', - Sys.getenv("TRAVIS_BUILD_ID")) - msg <- sprintf( - "> The message below was automatically generated after build %s \n\n Detected %s differences -> \n\n %s", - build_link, length(links), paste(links, collapse = "\n") - ) - # gistr is a good reference for talking to the github API via httr - # https://github.com/ropensci/gistr/blob/master/R/zzz.R - base <- 'https://api.github.com/repos/ropensci/plotly/' - header <- add_headers( - `User-Agent` = "plotly", - `Accept` = 'application/vnd.github.v3+json', - `Authorization` = paste0("token ", Sys.getenv("GITHUB_PAT")) - ) - commentz <- sprintf( - paste0(base, 'issues/%s/comments'), - Sys.getenv("TRAVIS_PULL_REQUEST") - ) - res <- GET(commentz, header) - warn_for_status(res) - old_body <- unlist(lapply(content(res), "[", "body")) - # only post a comment if this hash doesn't appear in any of the comments - # (needed since Travis sometimes randomly re-builds stuff) - if (!any(grepl(this_hash, old_body))) { - json <- jsonlite::toJSON(list(body = msg), auto_unbox = TRUE) - POST(url = commentz, header, body = json, encode = "json") - } else { - message("Link already posted") - } - # update plotly-test-table - system("git status") - system("git add *") - system(sprintf("git commit -q -m 'Pushed from %s'", build_link)) - # This post explains how this works -- http://rmflight.github.io/posts/2014/11/travis_ci_gh_pages.html - repo <- sprintf( - "https://%s@github.com/cpsievert/plotly-test-table.git", - Sys.getenv("GITHUB_PAT") - ) - system(paste("git pull", repo, "gh-pages")) - system(paste("git push -q", repo, "gh-pages")) -} diff --git a/inst/docs.R b/inst/docs.R index 1dc2137e5c..41f7bea577 100644 --- a/inst/docs.R +++ b/inst/docs.R @@ -2,11 +2,11 @@ # devtools::install_github("ropensci/plotly@carson-dsl") ################################################################################ -# Basic Charts (https://plot.ly/r/#basic-charts) +# Basic Charts (https://plotly.com/r/#basic-charts) ################################################################################ # ---------------------------------------------------------------------- -# https://plot.ly/r/3d-line-plots/ +# https://plotly.com/r/3d-line-plots/ # ---------------------------------------------------------------------- # initiate a 100 x 3 matrix filled with zeros @@ -24,7 +24,7 @@ library(plotly) plot_ly(df, x = x, y = y, z = z, color = time, type = "scatter3d") # ---------------------------------------------------------------------- -# https://plot.ly/r/3d-scatter-plots/ +# https://plotly.com/r/3d-scatter-plots/ # ---------------------------------------------------------------------- # variance-covariance matrix for a multivariate normal distribution @@ -40,7 +40,7 @@ library(plotly) plot_ly(df, x = x, y = y, z = z, type = "scatter3d", mode = "markers") # ---------------------------------------------------------------------- -# https://plot.ly/r/3d-surface-plots/ +# https://plotly.com/r/3d-surface-plots/ # ---------------------------------------------------------------------- library(plotly) @@ -53,7 +53,7 @@ with(kd, plot_ly(x = x, y = y, z = z, type = "surface")) # ---------------------------------------------------------------------- -# https://plot.ly/r/filled-area-plots/ +# https://plotly.com/r/filled-area-plots/ # ---------------------------------------------------------------------- library(plotly) @@ -62,7 +62,7 @@ add_trace(p, x = c(1, 2, 3, 4), y = c(3, 5, 1, 7), fill = "tonexty") # ---------------------------------------------------------------------- -# https://plot.ly/r/bar-charts/ +# https://plotly.com/r/bar-charts/ # ---------------------------------------------------------------------- library(plotly) @@ -95,7 +95,7 @@ ggplot2::diamonds %>% count(cut, clarity) %>% plot_ly(x = cut, y = n, type = "bar", color = clarity) # ---------------------------------------------------------------------- -# https://plot.ly/r/box-plots/ +# https://plotly.com/r/box-plots/ # ---------------------------------------------------------------------- library(plotly) @@ -113,10 +113,10 @@ plot_ly(ggplot2::diamonds, x = cut, y = price, color = clarity, type = "box") %> layout(boxmode = "group") # ---------------------------------------------------------------------- -# https://plot.ly/r/bubble-charts/ +# https://plotly.com/r/bubble-charts/ # ---------------------------------------------------------------------- -# IMO, this page should be a part of this page -> https://plot.ly/r/line-and-scatter/ +# IMO, this page should be a part of this page -> https://plotly.com/r/line-and-scatter/ library(plotly) d <- diamonds[sample(nrow(diamonds), 1000), ] # note how size is automatically scaled and added as hover text @@ -126,7 +126,7 @@ plot_ly(d, x = carat, y = price, text = paste("Clarity: ", clarity), mode = "markers", color = carat, size = carat, opacity = carat) # ---------------------------------------------------------------------- -# https://plot.ly/r/contour-plots/ +# https://plotly.com/r/contour-plots/ # ---------------------------------------------------------------------- #' Basic contour @@ -149,7 +149,7 @@ subplot( ) # ---------------------------------------------------------------------- -# https://plot.ly/r/error-bars/ +# https://plotly.com/r/error-bars/ # ---------------------------------------------------------------------- library(dplyr) @@ -170,7 +170,7 @@ add_trace(p, y = mn, error_y = list(value = sd), name = "City", data = df2) # ---------------------------------------------------------------------- -# https://plot.ly/r/heatmaps/ +# https://plotly.com/r/heatmaps/ # ---------------------------------------------------------------------- library(plotly) @@ -201,7 +201,7 @@ library(viridis) plot_ly(z = volcano, colors = viridis(256), type = "heatmap") # ---------------------------------------------------------------------- -# https://plot.ly/r/2D-Histogram/ +# https://plotly.com/r/2D-Histogram/ # ---------------------------------------------------------------------- library(plotly) @@ -210,7 +210,7 @@ obs <- mvtnorm::rmvnorm(500, sigma = s) plot_ly(x = obs[,1], y = obs[,2], type = "histogram2d") # ---------------------------------------------------------------------- -# https://plot.ly/r/histograms/ +# https://plotly.com/r/histograms/ # ---------------------------------------------------------------------- #' Basic histogram @@ -224,7 +224,7 @@ plot_ly(x = rnorm(500), opacity = 0.6, type = "histogram") %>% add_trace(x = rnorm(500)) # ---------------------------------------------------------------------- -# https://plot.ly/r/line-and-scatter/ +# https://plotly.com/r/line-and-scatter/ # ---------------------------------------------------------------------- #' Simple scatterplot @@ -273,7 +273,7 @@ plot_ly(x = x, y = y, name = "linear", line = list(shape = "linear")) %>% add_trace(y = y + 25, name = "hv", line = list(shape = "hv")) # ---------------------------------------------------------------------- -# https://plot.ly/r/log-plot/ +# https://plotly.com/r/log-plot/ # ---------------------------------------------------------------------- d <- diamonds[sample(nrow(diamonds), 1000), ] @@ -286,7 +286,7 @@ layout(p, xaxis = list(type = "log", autorange = T), yaxis = list(type = "log", autorange = T)) # --------------------------------------------------------------------- -# https://plot.ly/r/graphing-multiple-chart-types/ +# https://plotly.com/r/graphing-multiple-chart-types/ # ---------------------------------------------------------------------- #' Scatterplot with loess smoother @@ -315,7 +315,7 @@ p %>% fill = "tonexty", line = l) # ---------------------------------------------------------------------- -# https://plot.ly/r/polar-chart/ +# https://plotly.com/r/polar-chart/ # ---------------------------------------------------------------------- p <- plot_ly(plotly::mic, r = r, t = t, color = nms, mode = "lines") @@ -328,7 +328,7 @@ p <- plot_ly(plotly::wind, r = r, t = t, color = nms, type = "area") layout(p, radialaxis = list(ticksuffix = "%"), orientation = 270) # ---------------------------------------------------------------------- -# https://plot.ly/r/time-series/ +# https://plotly.com/r/time-series/ # ---------------------------------------------------------------------- #' POSIXlt date/time class @@ -353,7 +353,7 @@ y <- rnorm(length(x)) plot_ly(x = x, y = y, text = paste(tm, "days from today")) # ---------------------------------------------------------------------------- -# https://plot.ly/r/choropleth-maps/ (new) +# https://plotly.com/r/choropleth-maps/ (new) # ---------------------------------------------------------------------------- #' World Choropleth Map @@ -440,7 +440,7 @@ g2 <- c( plot_ly(df, type = 'scattergeo', mode = 'markers', locations = Country, locationmode = 'country names', text = paste(Value, "cases"), - color = as.ordered(abbrev), marker = list(size = Value/50), inherit = F) %>% + color = as.ordered(abbrev), marker = list(size = Value/50)) %>% add_trace(type = 'scattergeo', mode = 'text', geo = 'geo2', showlegend = F, lon = 21.0936, lat = 7.1881, text = 'Africa') %>% add_trace(type = 'choropleth', locations = Country, locationmode = 'country names', @@ -449,7 +449,7 @@ plot_ly(df, type = 'scattergeo', mode = 'markers', locations = Country, geo = g1, geo2 = g2) # ---------------------------------------------------------------------------- -# https://plot.ly/r/lines-on-maps/ (new) +# https://plotly.com/r/lines-on-maps/ (new) # ---------------------------------------------------------------------------- #' US Flight Paths Map @@ -470,8 +470,7 @@ geo <- list( ) plot_ly(air, lon = long, lat = lat, text = airport, type = 'scattergeo', - locationmode = 'USA-states', marker = list(size = 2, color = 'red'), - inherit = FALSE) %>% + locationmode = 'USA-states', marker = list(size = 2, color = 'red')) %>% add_trace(lon = list(start_lon, end_lon), lat = list(start_lat, end_lat), group = id, opacity = cnt/max(cnt), data = flights, mode = 'lines', line = list(width = 1, color = 'red'), @@ -560,7 +559,7 @@ layout(p, showlegend = FALSE, geo = geo, title = 'Contour lines over globe
(Click and drag to rotate)') # ---------------------------------------------------------------------------- -# https://plot.ly/r/scatter-plots-on-maps/ (new) +# https://plotly.com/r/scatter-plots-on-maps/ (new) # ---------------------------------------------------------------------------- #' US Airports Map @@ -636,7 +635,7 @@ plot_ly(df, lat = Lat, lon = Lon, text = hover, color = Globvalue, layout(title = 'US Precipitation 06-30-2015
Source: NOAA', geo = g) # ---------------------------------------------------------------------------- -# https://plot.ly/r/bubble-maps/ (new) +# https://plotly.com/r/bubble-maps/ (new) # ---------------------------------------------------------------------------- #' United States Bubble Map @@ -669,7 +668,7 @@ plot_ly(df, lon = lon, lat = lat, text = hover, # see 'Choropleth Inset Map' example # ---------------------------------------------------------------------------- -# https://plot.ly/r/map-subplots-and-small-multiples/ (new) +# https://plotly.com/r/map-subplots-and-small-multiples/ (new) # ---------------------------------------------------------------------------- #' US map small multiples @@ -711,12 +710,12 @@ p <- plot_ly(df, type = 'scattergeo', lon = LON, lat = LAT, group = YEAR, subplot(p, nrows = 9) ################################################################################ -# Multiple Axes, Subplots, and Insets (https://plot.ly/r/#multiple-axes-subplots-and-insets) +# Multiple Axes, Subplots, and Insets (https://plotly.com/r/#multiple-axes-subplots-and-insets) ################################################################################ # ---------------------------------------------------------------------------- -# https://plot.ly/r/subplots/ +# https://plotly.com/r/subplots/ # ---------------------------------------------------------------------------- #' Basic subplot @@ -738,7 +737,7 @@ subplot( ) %>% layout(showlegend = FALSE) # ---------------------------------------------------------------------------- -# https://plot.ly/r/multiple-axes/ +# https://plotly.com/r/multiple-axes/ # ---------------------------------------------------------------------------- library(plotly) @@ -753,7 +752,7 @@ plot_ly(x = 1:3, y = 10*(1:3), name = "slope of 10") %>% # ---------------------------------------------------------------------------- -# https://plot.ly/r/insets/ +# https://plotly.com/r/insets/ # ---------------------------------------------------------------------------- p1 <- plot_ly(x = c(1, 2, 3), y = c(4, 3, 2)) @@ -768,7 +767,7 @@ subplot(p1, p2) ################################################################################ # ---------------------------------------------------------------------------- -# https://plot.ly/r/setting-graph-size/ +# https://plotly.com/r/setting-graph-size/ # ---------------------------------------------------------------------------- library(plotly) @@ -783,7 +782,7 @@ plot_ly(x = seq(0, 8), y = seq(0, 8)) %>% layout(autosize = F, width = 500, height = 500, margin = m) # ---------------------------------------------------------------------------- -# https://plot.ly/r/legend/ +# https://plotly.com/r/legend/ # ---------------------------------------------------------------------------- #' Legend Names @@ -817,7 +816,7 @@ plot_ly(x = seq(0, 8), y = rnorm(8), showlegend = FALSE) %>% add_trace(y = rnorm(8), name = "Orange Trace", showlegend = TRUE) # ---------------------------------------------------------------------------- -# https://plot.ly/r/LaTeX/ +# https://plotly.com/r/LaTeX/ # ---------------------------------------------------------------------------- library(plotly) @@ -829,7 +828,7 @@ plot_ly(x = c(1, 2, 3, 4), y = c(1, 4, 9, 16), yaxis = list(title = "$d, r \\text{ (solar radius)}$")) # ---------------------------------------------------------------------------- -# https://plot.ly/r/figure-labels/ +# https://plotly.com/r/figure-labels/ # ---------------------------------------------------------------------------- # NOTE: title and link of this page could be improvded @@ -852,7 +851,7 @@ plot_ly(x = rnorm(10), y = rnorm(10), mode = "markers") %>% layout(xaxis = x, yaxis = y) # ---------------------------------------------------------------------------- -# https://plot.ly/r/font/ +# https://plotly.com/r/font/ # ---------------------------------------------------------------------------- library(plotly) @@ -865,7 +864,7 @@ plot_ly(x = 0:8, y = 0:8) %>% layout(title = "Global Font", font = f) # ---------------------------------------------------------------------------- -# https://plot.ly/r/axes/ +# https://plotly.com/r/axes/ # ---------------------------------------------------------------------------- #' Style Axes Ticks and Placement @@ -979,7 +978,7 @@ plot_ly(x = s, y = s) %>% ) # ---------------------------------------------------------------------------- -# https://plot.ly/r/text-and-annotations/ +# https://plotly.com/r/text-and-annotations/ # ---------------------------------------------------------------------------- #' Text mode @@ -1077,7 +1076,7 @@ plot_ly() %>% layout(annotations = a) ################################################################################ # ---------------------------------------------------------------------------- -# https://plot.ly/r/privacy/ +# https://plotly.com/r/privacy/ # ---------------------------------------------------------------------------- library(plotly) @@ -1095,7 +1094,7 @@ p$world_readable <- FALSE p # ---------------------------------------------------------------------------- -# https://plot.ly/r/file-options/ +# https://plotly.com/r/file-options/ # ---------------------------------------------------------------------------- library(plotly) @@ -1116,18 +1115,18 @@ plot_ly(x = c(1, 2), y = c(1, 2), filename = "myPlot", fileopt = "overwrite") # NOTE: filenames that contain "/" be treated as a Plotly directory and will be saved to your Plotly account in a folder tree. For example, to save your graphs to the folder my-graphs: ################################################################################ -# Get Requests, Static Image Export, and Interactive Embedding (https://plot.ly/r/#get-requests-static-image-export) +# Get Requests, Static Image Export, and Interactive Embedding (https://plotly.com/r/#get-requests-static-image-export) ################################################################################ # ---------------------------------------------------------------------------- -# https://plot.ly/r/embedding-plotly-graphs-in-HTML/ +# https://plotly.com/r/embedding-plotly-graphs-in-HTML/ # ---------------------------------------------------------------------------- # Maybe copy/paste relevant bits from this vignette? -> # https://github.com/ropensci/plotly/blob/carson-dsl/vignettes/intro.Rmd # ---------------------------------------------------------------------------- -# https://plot.ly/r/shiny-tutorial/ +# https://plotly.com/r/shiny-tutorial/ # ---------------------------------------------------------------------------- # Maybe link to an updated version of this blog post? @@ -1137,7 +1136,7 @@ plot_ly(x = c(1, 2), y = c(1, 2), filename = "myPlot", fileopt = "overwrite") # https://github.com/ropensci/plotly/tree/carson-dsl/inst/examples # ---------------------------------------------------------------------------- -# https://plot.ly/r/get-requests/ +# https://plotly.com/r/get-requests/ # ---------------------------------------------------------------------------- fig <- get_figure("cpsievert", "559") @@ -1148,7 +1147,7 @@ layout(fig, title = paste("Modified on ", Sys.time())) ################################################################################ # ---------------------------------------------------------------------------- -# https://plot.ly/r/static-image-export/ (currently no R page) +# https://plotly.com/r/static-image-export/ (currently no R page) # ---------------------------------------------------------------------------- # Use the curl package to download a static image of any publicly viewable figure diff --git a/inst/examples/UN_Advanced/server.R b/inst/examples/UN_Advanced/server.R deleted file mode 100644 index 8e255b8054..0000000000 --- a/inst/examples/UN_Advanced/server.R +++ /dev/null @@ -1,76 +0,0 @@ -#server script for United Nations Advanced Example -library(shiny) -library(plotly) -library(dplyr) - -shinyServer(function(input, output, session) { - - output$trendPlot <- renderPlotly({ - if (length(input$name) == 0) { - print("Please select at least one country") - } else { - df_trend <- ideal[ideal$Name == input$name, ] - - # Graph title - if (length(input$name) > 2) { - j_names_comma <- paste(input$name[-length(input$name)], collapse = ', ') - j_names <- paste0(j_names_comma, ", and ", input$name[length(input$name)]) - } else { - j_names <- paste(input$name, collapse = ' and ') - } - - graph_title <- paste("Ideal Points for ", j_names, sep="") - - ggideal_point <- ggplot(df_trend) + - geom_line(aes(x = Year, y = Ideal.point, by = Name, color = Name)) + - labs(x = "Year", y = "Ideology", title = graph_title) + - scale_colour_hue("clarity", l = 70, c = 150) + ggthemes::theme_few() + - theme(legend.direction = "horizontal", legend.position = "bottom") - - # Convert ggplot object to plotly - gg <- plotly_build(ggideal_point) - - # Use Plotly syntax to further edit the plot: - gg$layout$annotations <- NULL # Remove the existing annotations (the legend label) - gg$layout$annotations <- list() - - # Add colored text annotations next to the end of each line - # More about plotly annotations: https://plot.ly/r/reference/#annotation - # Each key that we update is documented in that link above. - for (i in 1:length(gg$data)) { # data is a list of the lines in the graph - gg$layout$annotations[[i]] <- list( - text = gg$data[[i]]$name, # The text label of the annotation, e.g. "Canada" - font = list(color = gg$data[[i]]$line$color), # Match the font color to the line color - showarrow = FALSE, # Don't show the annotation arrow - y = gg$data[[i]]$y[[length(gg$data[[i]]$y)]], # set the y position of the annotation to the last point of the line - yref = "y1", # the "y" coordinates above are with respect to the yaxis - x = 1, # set the x position of the graph to the right hand side of the graph - xref = "paper", # the x coordinates are with respect to the "paper", where 1 means the right hand side of the graph and 0 means the left hand side - xanchor = "left" # position the x coordinate with respect to the left of the text - ); - } - - gg$layout$showlegend <- FALSE # remove the legend - gg$layout$margin$r <- 170 # increase the size of the right margin to accommodate more room for the annotation labels - gg - - } - }) - - output$termPlot <- renderPlot({ - df_term <- ideal %>% filter(Name %in% input$name) %>% - group_by(Name) %>% summarise(terms = n()) - - trans_theme <- theme( - panel.grid.minor = element_blank(), - panel.grid.major = element_blank(), - panel.background = element_rect(fill = NA), - plot.background = element_rect(fill = NA) - ) - - ggplot(df_term, aes(x = reorder(Name, terms), y = terms))+ - geom_bar(stat = "identity", fill = "#2980b9") + coord_flip() + - theme_bw() + trans_theme + labs(y = "Terms (in years)", x = "") - - }, bg="transparent") -}) diff --git a/inst/examples/UN_Simple/.Rapp.history b/inst/examples/UN_Simple/.Rapp.history deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/inst/examples/brush/app.R b/inst/examples/brush/app.R deleted file mode 100644 index b3276133f0..0000000000 --- a/inst/examples/brush/app.R +++ /dev/null @@ -1,43 +0,0 @@ -library(shiny) -library(ggplot2) -library(dplyr) -library(plotly) - -ui <- fluidPage( - plotOutput("scatter1", brush = brushOpts("brush", direction = "xy")), - plotlyOutput("plot1") -) - -server <- function(input, output, session) { - output$scatter1 <- renderPlot({ - iris$selected <- 1 - if (!is.null(input$brush)) { - br <- input$brush - x <- iris$Sepal.Length <= br$xmin | br$xmax <= iris$Sepal.Length - y <- iris$Sepal.Width <= br$ymin | br$ymax <= iris$Sepal.Width - iris$selected[x | y] <- 0.3 - } - ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species, alpha = selected)) + - geom_point() + scale_alpha(guide = "none") - }) - - output$plot1 <- renderPlotly({ - p <- iris %>% - count(Species) %>% - plot_ly(x = Species, y = n, opacity = 0.5, type = "bar", - marker = list(color = toRGB("grey92"))) %>% - layout(barmode = "overlay", showlegend = FALSE) - if (!is.null(input$brush)) { - br <- input$brush - s <- iris %>% - filter(br$xmin <= Sepal.Length, Sepal.Length <= br$xmax) %>% - filter(br$ymin <= Sepal.Width, Sepal.Width <= br$ymax) %>% - count(Species) - p <- add_trace(p, x = Species, y = n, data = s, - marker = list(color = toRGB("steelblue"))) - } - p - }) -} - -shinyApp(ui, server) diff --git a/inst/examples/rmd/MathJax/index.Rmd b/inst/examples/rmd/MathJax/index.Rmd new file mode 100644 index 0000000000..21b390b0c7 --- /dev/null +++ b/inst/examples/rmd/MathJax/index.Rmd @@ -0,0 +1,33 @@ +--- +title: "Render plotly MathJax inside rmarkdown" +output: html_document +--- + +Some HTML-based MathJax: + +$$ \alpha+\beta $$ + +You _could_ print this **plotly** graph with SVG-based rendering, but it would break the HTML-based rendering of **rmarkdown**! + +```{r message = FALSE} +library(plotly) + +p <- plotly_empty() %>% + add_trace(x = 1, y = 1, text = TeX("\\alpha"), mode = "text", size = I(1000)) %>% + config(mathjax = "cdn") +``` + +Instead, use something like the **widgetframe** package to create a responsive iframe which ensure the SVG-based rendering that plotly requires is done independently of **rmarkdown**'s HTML-based rendering. + +```{r} +widgetframe::frameableWidget(p) +``` + +Or, do it the old-fashioned way: save your plotly graph to an HTML file via `htmlwidgets::saveWidget()` then use an HTML ` diff --git a/inst/examples/rmd/flexdashboard/index.Rmd b/inst/examples/rmd/flexdashboard/index.Rmd new file mode 100644 index 0000000000..9a3ece7a4d --- /dev/null +++ b/inst/examples/rmd/flexdashboard/index.Rmd @@ -0,0 +1,88 @@ +--- +title: "Flex Dashboard" +output: + flexdashboard::flex_dashboard: + orientation: rows +--- + + +```{r setup, include=FALSE} +library(plotly) +library(maps) +knitr::opts_chunk$set(message = FALSE) +``` + +Rows {data-height:600} +------------------------------------------------------------------------------ + +### Chart A + +```{r} +# This example modifies code from Hadley Wickham -- https://gist.github.com/hadley/233134 +# It also uses data from Nathan Yau's flowingdata site -- http://flowingdata.com/ +unemp <- read.csv("http://datasets.flowingdata.com/unemployment09.csv") +names(unemp) <- c("id", "state_fips", "county_fips", "name", "year", + "?", "?", "?", "rate") +unemp$county <- tolower(gsub(" County, [A-Z]{2}", "", unemp$name)) +unemp$state <- gsub("^.*([A-Z]{2}).*$", "\\1", unemp$name) +county_df <- map_data("county") +names(county_df) <- c("long", "lat", "group", "order", "state_name", "county") +county_df$state <- state.abb[match(county_df$state_name, tolower(state.name))] +county_df$state_name <- NULL +state_df <- map_data("state") +choropleth <- merge(county_df, unemp, by = c("state", "county")) +choropleth <- choropleth[order(choropleth$order), ] +choropleth$rate_d <- cut(choropleth$rate, breaks = c(seq(0, 10, by = 2), 35)) + +# provide a custom tooltip to plotly with the county name and actual rate +choropleth$text <- with(choropleth, paste0("County: ", name, "
Rate: ", rate)) +p <- ggplot(choropleth, aes(long, lat, group = group)) + + geom_polygon(aes(fill = rate_d, text = text), + colour = alpha("white", 1/2), size = 0.2) + + geom_polygon(data = state_df, colour = "white", fill = NA) + + scale_fill_brewer(palette = "PuRd") + theme_void() +# just show the text aesthetic in the tooltip +ggplotly(p, tooltip = "text") +``` + +### Chart B + +```{r} +crimes <- data.frame(state = tolower(rownames(USArrests)), USArrests) +crimesm <- tidyr::gather(crimes, variable, value, -state) +states_map <- map_data("state") +g <- ggplot(crimesm, aes(map_id = state)) + + geom_map(aes(fill = value), map = states_map) + + expand_limits(x = states_map$long, y = states_map$lat) + + facet_wrap( ~ variable) + theme_void() +ggplotly(g) +``` + +Rows {data-height:400} +------------------------------------------------------------------------------ + + +### Chart C + +```{r} +m <- ggplot(faithful, aes(x = eruptions, y = waiting)) + + stat_density_2d() + xlim(0.5, 6) + ylim(40, 110) +ggplotly(m) +``` + +### Chart D + +```{r} +m <- ggplot(faithful, aes(x = eruptions, y = waiting)) + + stat_density_2d(aes(fill = ..level..), geom = "polygon") + + xlim(0.5, 6) + ylim(40, 110) +ggplotly(m) +``` + + +### Chart E + +```{r} +m <- ggplot(faithful, aes(x = eruptions, y = waiting)) + geom_hex() +ggplotly(m) +``` diff --git a/inst/examples/rmd/onRenderHover/index.Rmd b/inst/examples/rmd/onRenderHover/index.Rmd new file mode 100644 index 0000000000..493586ac49 --- /dev/null +++ b/inst/examples/rmd/onRenderHover/index.Rmd @@ -0,0 +1,50 @@ +--- +title: "Using plotly with onRender" +author: "Carson Sievert" +date: "`r Sys.Date()`" +output: html_document +--- + +```{r, message = FALSE, warning = FALSE} +library(plotly) +library(htmlwidgets) + +set.seed(1056) + +nPatients <- 50 +nVisits <- 10 + +df <- data.frame( + fev1_perc = rnorm(n = nPatients * nVisits, mean = 100, sd = 10), + uin = rep(seq(nPatients), each = nVisits), + visit = rep(seq(nVisits), nPatients) +) +c1 <- list(color = toRGB("steelblue", 0.5)) +c2 <- list(color = toRGB("orange", 0.5)) + +# The color mapping is used only to generate multiple traces +# (which makes it easier to highlight lines on the JS side) +df %>% + plot_ly( + x = ~visit, y = ~fev1_perc, split = ~factor(uin), marker = c1, line = c2 + ) %>% + layout(hovermode = "closest", showlegend = FALSE) %>% + onRender(' + function(el, x) { + var graphDiv = document.getElementById(el.id); + // reduce the opacity of every trace except for the hover one + el.on("plotly_hover", function(e) { + var traces = []; + for (var i = 0; i < x.data.length; i++) { + if (i !== e.points[0].curveNumber) traces.push(i); + } + Plotly.restyle(graphDiv, "opacity", 0.2, traces); + }) + el.on("plotly_unhover", function(e) { + var traces = []; + for (var i = 0; i < x.data.length; i++) traces.push(i); + Plotly.restyle(graphDiv, "opacity", 1, traces); + }) + } + ') +``` diff --git a/inst/examples/rmd/printing/index.Rmd b/inst/examples/rmd/printing/index.Rmd new file mode 100644 index 0000000000..f89d6f1116 --- /dev/null +++ b/inst/examples/rmd/printing/index.Rmd @@ -0,0 +1,85 @@ +--- +title: "Printing plotly objects in a knitr/rmarkdown doc" +output: html_document +--- + +```{r, echo = FALSE} +knitr::opts_chunk$set( + message = FALSE, + fig.width = 10, + fig.height = 4, + comment = "#>", + collapse = TRUE +) +``` + +Printing anything created via the R package **plotly** should "just work" in a knitr/rmarkdown document -- including representations of things on your plotly account. However, the default print method that the package provides may not work for your purposes, so this document is designed to help you go beyond those defaults. This is especially useful for objects representing "remote files". + +## Remote files + +For example, if you create a plot or grid (via `api_create()`), then print the result, you get an HTML iframe pointing to that object on your account. + +```{r} +library(plotly) +d <- api_create(mtcars) +d +``` + + + +As it turns out, the `api_create()` function returns a bunch of metadata about that file on your account. A nice way to inspect that information is to leverage the `jsonedit()` function from the **listviewer** package. + +```{r} +listviewer::jsonedit(d) +``` + +Storing this information is a good idea since now you can [modify the "remote file"](https://api.plot.ly/v2/files#partial_update) at a later point. Let's rename the file using the "low-level" `api()` interface. + +```{r} +nm <- paste(sample(LETTERS, 20), collapse = "-") +d2 <- api( + file.path("files", d$fid), "PATCH", list(filename = nm) +) +identical(d2$filename, nm) +``` + +The `api_create()` function also understands how to "upload" ggplot2/plotly objects to the web platform. Printing in this case will again produce an HTML iframe pointing to the plot as it appears on the platform. + + +```{r} +p <- api_create(qplot(1:10, 1:10)) +p +``` + +The metadata returned for a plot is structured very much like a grid (i.e., what we saw previously), but now we can leverage some attributes unique to a plot, such as image urls. + +```{r} +library(htmltools) +tags$img(src = p$image_urls$default) +``` + +## Downloading files + +You can also download a plot or a grid already hosted on plotly's web platform (assuming they're public, or you have the proper crendentials). When you download a plot, it is converted to an htmlwidget, meaning that when you print it, the plot will render entirely locally (i.e., you don't need internet access for it to render). + +```{r} +p <- api_download_plot(200, "cpsievert") +layout( + p, title ="An htmlwidget version of this plot" +) +``` + +There is no guarantee a plotly grid will _always_ map back to an R data frame, so `api_download_grid()` returns the abstract list representation of the data, but will _try to_ convert it to a data frame when printing. + +```{r} +g <- api_download_grid(14681, "cpsievert") +g +``` + +```{r} +# note how the actual data is inside the 'preview' element +listviewer::jsonedit(g) +``` + + + diff --git a/inst/examples/shiny/DT/app.R b/inst/examples/shiny/DT/app.R new file mode 100644 index 0000000000..ecfd72c6c5 --- /dev/null +++ b/inst/examples/shiny/DT/app.R @@ -0,0 +1,39 @@ +library(plotly) +library(DT) +library(shiny) +library(crosstalk) + +m <- mtcars[, c("mpg", "wt", "disp")] %>% + tibble::rownames_to_column() + +ui <- fluidPage( + plotlyOutput("plots"), + DT::dataTableOutput("table") +) + +server <- function(input, output) { + + d <- SharedData$new(m, ~rowname) + + output$plots <- renderPlotly({ + subplot( + qplot(data = d, x = mpg, y = wt), + qplot(data = d, x = mpg, y = disp), + titleX = T, titleY = T, margin = 0.03 + ) %>% highlight("plotly_selected") + }) + + output$table <- DT::renderDataTable({ + m2 <- m[d$selection(),] + dt <- DT::datatable(m) + if (NROW(m2) == 0) { + dt + } else { + DT::formatStyle(dt, "rowname", target = "row", + color = DT::styleEqual(m2$rowname, rep("white", length(m2$rowname))), + backgroundColor = DT::styleEqual(m2$rowname, rep("black", length(m2$rowname)))) + } + }) +} + +shinyApp(ui = ui, server = server) diff --git a/inst/examples/Diamonds/server.R b/inst/examples/shiny/Diamonds/server.R similarity index 98% rename from inst/examples/Diamonds/server.R rename to inst/examples/shiny/Diamonds/server.R index 73c61c6036..5c197b1379 100644 --- a/inst/examples/Diamonds/server.R +++ b/inst/examples/shiny/Diamonds/server.R @@ -21,7 +21,7 @@ shinyServer(function(input, output, session) { facets <- paste(input$facet_row, '~', input$facet_col) if (facets != '. ~ .') p <- p + facet_grid(facets) # return the ggplot object and renderPlotly() will know how to handle it - p + toWebGL(p) }) }) diff --git a/inst/examples/Diamonds/ui.R b/inst/examples/shiny/Diamonds/ui.R similarity index 100% rename from inst/examples/Diamonds/ui.R rename to inst/examples/shiny/Diamonds/ui.R diff --git a/inst/examples/shiny/MathJax/app.R b/inst/examples/shiny/MathJax/app.R new file mode 100644 index 0000000000..815412ac38 --- /dev/null +++ b/inst/examples/shiny/MathJax/app.R @@ -0,0 +1,43 @@ +# Example of rendering both plotly's (SVG) MathJax inside a +# shiny app with it's own (HTML) MathJax. This currently requires +# bringing in the plotly graph with an iframe +library(shiny) +library(plotly) +library(htmlwidgets) +library(htmltools) + +addResourcePath("tmp", tempdir()) +f <- tempfile(fileext = ".html") + +ui <- fluidPage( + withMathJax(helpText('Dynamic output 1: $$\\alpha^2$$')), + uiOutput("p") +) + +server <- function(input, output, ...) { + + output$p <- renderUI({ + + plot_ly() %>% + add_lines(x = zoo::index(co2), y = co2) %>% + layout( + title = TeX("CO_2 \\text{measured in } \\frac{parts}{million}"), + xaxis = list(title = "Time"), + yaxis = list(title = TeX("\\text{Atmospheric concentraion of CO}_2")) + ) %>% + config(mathjax = "cdn") %>% + saveWidget(f) + + tags$iframe( + src = file.path("tmp", basename(f)), + width = "100%", + height = "400", + scrolling = "no", + seamless = "seamless", + frameBorder = "0" + ) + }) + +} + +shinyApp(ui, server) diff --git a/inst/.Rapp.history b/inst/examples/shiny/Movies/.Rapp.history similarity index 100% rename from inst/.Rapp.history rename to inst/examples/shiny/Movies/.Rapp.history diff --git a/inst/examples/Movies/server.R b/inst/examples/shiny/Movies/server.R similarity index 79% rename from inst/examples/Movies/server.R rename to inst/examples/shiny/Movies/server.R index 7acc26231b..3faa590bc2 100644 --- a/inst/examples/Movies/server.R +++ b/inst/examples/shiny/Movies/server.R @@ -1,7 +1,7 @@ library(shiny) library(plotly) +library(ggplot2movies) # movies is no longer contained within ggplot2 -data(movies, package = "ggplot2") minx <- min(movies$rating) maxx <- max(movies$rating) @@ -12,7 +12,7 @@ shinyServer(function(input, output) { size <- (maxx - minx) / input$bins # a simple histogram of movie ratings - p <- plot_ly(movies, x = rating, autobinx = F, type = "histogram", + p <- plot_ly(movies, x = ~rating, autobinx = F, type = "histogram", xbins = list(start = minx, end = maxx, size = size)) # style the xaxis layout(p, xaxis = list(title = "Ratings", range = c(minx, maxx), autorange = F, diff --git a/inst/examples/Movies/ui.R b/inst/examples/shiny/Movies/ui.R similarity index 100% rename from inst/examples/Movies/ui.R rename to inst/examples/shiny/Movies/ui.R diff --git a/inst/examples/Movies/.Rapp.history b/inst/examples/shiny/UN_Advanced/.Rapp.history similarity index 100% rename from inst/examples/Movies/.Rapp.history rename to inst/examples/shiny/UN_Advanced/.Rapp.history diff --git a/inst/examples/UN_Advanced/Data/UN_IdealPoints.csv b/inst/examples/shiny/UN_Advanced/Data/UN_IdealPoints.csv similarity index 100% rename from inst/examples/UN_Advanced/Data/UN_IdealPoints.csv rename to inst/examples/shiny/UN_Advanced/Data/UN_IdealPoints.csv diff --git a/inst/examples/UN_Advanced/global.R b/inst/examples/shiny/UN_Advanced/global.R similarity index 100% rename from inst/examples/UN_Advanced/global.R rename to inst/examples/shiny/UN_Advanced/global.R diff --git a/inst/examples/shiny/UN_Advanced/server.R b/inst/examples/shiny/UN_Advanced/server.R new file mode 100644 index 0000000000..27f127d282 --- /dev/null +++ b/inst/examples/shiny/UN_Advanced/server.R @@ -0,0 +1,56 @@ +#server script for United Nations Advanced Example +library(shiny) +library(plotly) +library(dplyr) + +shinyServer(function(input, output, session) { + + output$trendPlot <- renderPlotly({ + if (length(input$name) == 0) { + print("Please select at least one country") + } else { + df_trend <- ideal[ideal$Name == input$name, ] + + # Graph title + if (length(input$name) > 2) { + j_names_comma <- paste(input$name[-length(input$name)], collapse = ', ') + j_names <- paste0(j_names_comma, ", and ", input$name[length(input$name)]) + } else { + j_names <- paste(input$name, collapse = ' and ') + } + + graph_title <- paste("Ideal Points for ", j_names, sep="") + + ggideal_point <- ggplot(df_trend) + + geom_line(aes(x = Year, y = Ideal.point, color = Name)) + + labs(x = "Year", y = "Ideology", title = graph_title) + + scale_colour_hue("clarity", l = 70, c = 150) + ggthemes::theme_few() + + theme(legend.position = "none") + + # Convert ggplot object to plotly + ggplotly(ggideal_point) %>% + layout( + showlegend = FALSE, + # increase the size of the right margin to accommodate more room for the annotation labels + margin = list(r = 170) + ) + } + }) + + output$termPlot <- renderPlot({ + df_term <- ideal %>% filter(Name %in% input$name) %>% + group_by(Name) %>% summarise(terms = n()) + + trans_theme <- theme( + panel.grid.minor = element_blank(), + panel.grid.major = element_blank(), + panel.background = element_rect(fill = NA), + plot.background = element_rect(fill = NA) + ) + + ggplot(df_term, aes(x = reorder(Name, terms), y = terms))+ + geom_bar(stat = "identity", fill = "#2980b9") + coord_flip() + + theme_bw() + trans_theme + labs(y = "Terms (in years)", x = "") + + }, bg="transparent") +}) diff --git a/inst/examples/UN_Advanced/ui.R b/inst/examples/shiny/UN_Advanced/ui.R similarity index 100% rename from inst/examples/UN_Advanced/ui.R rename to inst/examples/shiny/UN_Advanced/ui.R diff --git a/inst/examples/UN_Advanced/.Rapp.history b/inst/examples/shiny/UN_Simple/.Rapp.history similarity index 100% rename from inst/examples/UN_Advanced/.Rapp.history rename to inst/examples/shiny/UN_Simple/.Rapp.history diff --git a/inst/examples/UN_Simple/Data/UN_IdealPoints.csv b/inst/examples/shiny/UN_Simple/Data/UN_IdealPoints.csv similarity index 100% rename from inst/examples/UN_Simple/Data/UN_IdealPoints.csv rename to inst/examples/shiny/UN_Simple/Data/UN_IdealPoints.csv diff --git a/inst/examples/UN_Simple/global.R b/inst/examples/shiny/UN_Simple/global.R similarity index 100% rename from inst/examples/UN_Simple/global.R rename to inst/examples/shiny/UN_Simple/global.R diff --git a/inst/examples/UN_Simple/server.R b/inst/examples/shiny/UN_Simple/server.R similarity index 86% rename from inst/examples/UN_Simple/server.R rename to inst/examples/shiny/UN_Simple/server.R index 3c99f90ca4..61746c41b5 100644 --- a/inst/examples/UN_Simple/server.R +++ b/inst/examples/shiny/UN_Simple/server.R @@ -10,7 +10,7 @@ shinyServer(function(input, output, session) { } else { df_trend <- ideal[ideal$Name == input$name, ] ggplot(df_trend) + - geom_line(aes(x = Year, y = Ideal.point, by = Name, color = Name)) + + geom_line(aes(x = Year, y = Ideal.point, color = Name)) + labs(x = "Year", y = "Ideology", title = "Ideal Points for Countries") + scale_colour_hue("clarity", l = 70, c = 150) + ggthemes::theme_few() } diff --git a/inst/examples/UN_Simple/ui.R b/inst/examples/shiny/UN_Simple/ui.R similarity index 100% rename from inst/examples/UN_Simple/ui.R rename to inst/examples/shiny/UN_Simple/ui.R diff --git a/inst/examples/shiny/async/app.R b/inst/examples/shiny/async/app.R new file mode 100644 index 0000000000..e38cb8b005 --- /dev/null +++ b/inst/examples/shiny/async/app.R @@ -0,0 +1,42 @@ +library(shiny) +library(plotly) +library(ggplot2) +library(promises) +library(future) +plan(multisession) + +ui <- fluidPage( + plotlyOutput("plot1"), + plotlyOutput("plot2"), + plotlyOutput("plot3"), + plotlyOutput("plot4") +) + +server <- function(input, output, session) { + output$plot1 <- renderPlotly({ + # Async plot_ly + future({ Sys.sleep(2); cars }) %...>% + plot_ly(x = ~speed, y = ~dist, type = "scatter", mode = "markers") + }) + + output$plot2 <- renderPlotly({ + # Async ggplotly + future({ Sys.sleep(2); mtcars }) %...>% + { ggplot(., aes(hp, mpg)) + geom_point() } %...>% + ggplotly() + }) + + output$plot3 <- renderPlotly({ + # Not async + plot_ly(iris, x = ~Sepal.Length, y = ~Sepal.Width, + type = "scatter", mode = "markers") + }) + + output$plot4 <- renderPlotly({ + # Ensure errors are handled properly (should be blank) + future({}) %...>% + { req(FALSE) } + }) +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/basic/DESCRIPTION b/inst/examples/shiny/basic/DESCRIPTION new file mode 100644 index 0000000000..ff7c2bdfbd --- /dev/null +++ b/inst/examples/shiny/basic/DESCRIPTION @@ -0,0 +1,4 @@ +Title: plotly/ggplot2/crosstalk/Shiny demo +Author: Joe Cheng +DisplayMode: Normal +Type: Shiny diff --git a/inst/examples/shiny/crossfilter/app.R b/inst/examples/shiny/crossfilter/app.R new file mode 100644 index 0000000000..4c23c07279 --- /dev/null +++ b/inst/examples/shiny/crossfilter/app.R @@ -0,0 +1,84 @@ +library(shiny) +library(plotly) +library(dplyr) +library(nycflights13) +# install from https://github.com/hadley/ggstat +library(ggstat) + +# Collect numeric variables to be shown as histograms in the crossfilter +d <- select(flights, arr_time, dep_time, arr_delay, dep_delay, air_time, distance) + +# Generate an output container per variable +ui <- fluidPage( + lapply(names(d), function(nm) plotlyOutput(nm, height = 200, width = "49%", inline = TRUE)) +) + +server <- function(input, output, session) { + + # These reactive values track the set of active brushes + # Each reactive value corresponds to a different variable + brush_ranges <- reactiveValues() + + # Filter the dataset based on every active brush range except for one (var) + d_filter <- function(d, var = "arr_time") { + for (nm in setdiff(names(d), var)) { + rng <- brush_ranges[[nm]] + if (is.null(rng)) next + d <- filter(d, between(d[[nm]], min(rng), max(rng))) + } + d + } + + # Implement same render logic for each variable + lapply(names(d), function(nm) { + + counts <- d[[nm]] %>% + bin_fixed(bins = 150) %>% + compute_stat(d[[nm]]) %>% + filter(!is.na(xmin_)) %>% + mutate(xmid = (xmin_ + xmax_) / 2) + + output[[nm]] <- renderPlotly({ + + plot_ly(counts, source = nm) %>% + add_bars(x = ~xmid, y = ~count_) %>% + layout( + dragmode = "select", + selectdirection = "h", + xaxis = list( + title = nm, + range = range(d[[nm]], na.rm = TRUE) + ), + yaxis = list(title = "") + ) + }) + + observeEvent(event_data("plotly_brushing", source = nm), ignoreNULL = FALSE, { + + # inform the world about the new brush range + brush_ranges[[nm]] <- event_data("plotly_brushing", source = nm)$x + + # update the bar heights of every view (except for the one being brushed) + for (var in setdiff(names(d), nm)) { + + # views respect every brush except for their own + d_filtered <- d_filter(d, var) + + # bin the filtered data based on the global binning definition + counts_filter <- d[[var]] %>% + bin_fixed(bins = 150) %>% + compute_stat(d_filtered[[var]]) %>% + filter(!is.na(xmin_)) %>% + mutate(xmid = (xmin_ + xmax_) / 2) + + # finally, update the bar heights + plotlyProxy(var, session) %>% + plotlyProxyInvoke("restyle", "y", list(counts_filter$count_), 0) + } + }) + + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/crossfilter_compare/app.R b/inst/examples/shiny/crossfilter_compare/app.R new file mode 100644 index 0000000000..88d173bf39 --- /dev/null +++ b/inst/examples/shiny/crossfilter_compare/app.R @@ -0,0 +1,133 @@ +library(shiny) +library(dplyr) +library(nycflights13) +library(colourpicker) +# install from https://github.com/hadley/ggstat +library(ggstat) + +# Select all the (numeric) variables to be shown as histograms +# in the crossfilter +d <- select(flights, arr_time, dep_time, arr_delay, dep_delay, air_time, distance) + +# Determing a color palette for the brush +n_colors <- 5 +color_codes <- RColorBrewer::brewer.pal(n_colors, "Dark2") + +# Generate an output container per variable +ui <- fluidPage( + fluidRow( + tags$div( + style = "display:inline-block; max-width:150px; margin-left:50px", + colourInput("brush_color", "Pick a brush color", color_codes[1], palette = "limited", allowedCols = color_codes) + ), + tags$div( + style = "display:inline-block", + actionButton("clear", "Clear Selection") + ) + ), + lapply(names(d), function(nm) plotlyOutput(nm, height = 200, width = "49%", inline = TRUE)) +) + +server <- function(input, output, session) { + + # Implement same render logic for each variable + lapply(names(d), function(nm) { + + # By letting R handle the binning, there is less data to send over the + # wire (and, thus, a more responsive app over back connections) + counts <- d[[nm]] %>% + bin_fixed(bins = 150) %>% + compute_stat(d[[nm]]) %>% + filter(!is.na(xmin_)) %>% + mutate( + xmid = (xmin_ + xmax_) / 2, + prop_ = count_ / sum(count_), + zeros = 0 + ) + + output[[nm]] <- renderPlotly({ + + # Draw two layers of bars, one for the overall (black) + # distribution, and one for the filtered data (red) + p <- plot_ly( + counts, x = ~xmid, alpha = I(0.5), + source = nm, unselected = list(marker = list(opacity = 1)) + ) %>% + add_bars(y = ~prop_, color = I("black")) %>% + layout( + dragmode = "select", + selectdirection = "h", + xaxis = list( + title = nm, + range = range(d[[nm]], na.rm = TRUE) + ), + yaxis = list( + title = "", + showticks = FALSE, + showticklabels = FALSE, + showgrid = FALSE + ), + barmode = "overlay", + showlegend = FALSE + ) + + for (col in color_codes) { + p <- add_bars(p, y = ~zeros, color = I(col)) + } + + p + }) + + # when the selection is cleared, return the selection layer bars to 0 + observeEvent(input$clear, { + plotlyProxy(nm, session) %>% + plotlyProxyInvoke("restyle", "y", list(counts$zeros), seq_along(color_codes)) + }) + + # each brush color code corresponds to a different trace index + trace_index <- reactive(match(input$brush_color, color_codes)) + + observe({ + b <- event_data("plotly_brushing", source = nm)$x + in_bounds <- between(d[[nm]], min(b), max(b)) + + lapply(names(d), function(var) { + p <- plotlyProxy(var, session) + + if (is.null(b)) { + + # brush has been cleared, return the selection bars to a zero height + plotlyProxyInvoke(p, "restyle", "y", list(counts$zeros), trace_index()) + + } else { + + # if the brush originates from the proxy target + # then don't compute a new marginal distribution, + # just highlight the range of interest + props <- if (nm == var) { + if_else( + between(counts$xmin_, min(b), max(b)) & + between(counts$xmax_, min(b), max(b)), + counts$prop_, + 0 + ) + } else { + d[[var]] %>% + bin_fixed(bins = 150) %>% + compute_stat(d[[var]][in_bounds]) %>% + filter(!is.na(xmin_)) %>% + mutate(prop_ = count_ / sum(count_)) %>% + pull(prop_) + } + + plotlyProxyInvoke(p, "restyle", "y", list(props), trace_index()) + } + }) + + }) + + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/crossfilter_kde/app.R b/inst/examples/shiny/crossfilter_kde/app.R new file mode 100644 index 0000000000..c7545681e5 --- /dev/null +++ b/inst/examples/shiny/crossfilter_kde/app.R @@ -0,0 +1,45 @@ +library(shiny) +library(plotly) +library(dplyr) +library(MASS) + +kde_full <- with(diamonds, kde2d(carat, price)) + +ui <- fluidPage( + plotlyOutput("bars", height = 300), + plotlyOutput("heat") +) + +server <- function(input, output, session) { + + output$bars <- renderPlotly({ + plot_ly(diamonds, x = ~depth, source = "bars") %>% + layout(dragmode = "select", selectdirection = "h") + }) + + output$heat <- renderPlotly({ + plot_ly() %>% + add_heatmap(x = kde_full$x, y = kde_full$y, z = sqrt(t(kde_full$z))) + }) + + observe({ + brush <- event_data("plotly_brushing", source = "bars") + p <- plotlyProxy("heat", session) + + # show full data if no brush exists + if (is.null(brush)) { + plotlyProxyInvoke(p, "restyle", "z", list(sqrt(t(kde_full$z)))) + return() + } + + d_filter <- filter(diamonds, between(depth, brush$x[1], brush$x[2])) + if (nrow(d_filter) < 10) return() + + kde_filter <- with(d_filter, kde2d(carat, price)) + + plotlyProxyInvoke(p, "restyle", "z", list(sqrt(t(kde_filter$z)))) + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/crossfilter_scatter/app.R b/inst/examples/shiny/crossfilter_scatter/app.R new file mode 100644 index 0000000000..b238199180 --- /dev/null +++ b/inst/examples/shiny/crossfilter_scatter/app.R @@ -0,0 +1,39 @@ +library(shiny) +library(plotly) +library(dplyr) + +ui <- fluidPage( + plotlyOutput("bars"), + plotlyOutput("markers") +) + +server <- function(input, output, session) { + + output$bars <- renderPlotly({ + plot_ly(diamonds, x = ~depth, source = "bars") %>% + layout( + dragmode = "select", + selectdirection = "h" + ) + }) + + output$markers <- renderPlotly({ + plot_ly(diamonds, x = ~carat, y = ~price, alpha = 0.2) %>% + toWebGL() + }) + + observe({ + brush <- event_data("plotly_brushing", source = "bars") + if (is.null(brush)) brush <- list(x = range(diamonds$depth)) + + is_within <- between(diamonds$depth, brush$x[1], brush$x[2]) + cols <- if_else(is_within, "rgba(31,119,180,0.2)", "transparent") + + plotlyProxy("markers", session) %>% + plotlyProxyInvoke("restyle", "marker.color", list(cols)) + }) + + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/drag_brush/app.R b/inst/examples/shiny/drag_brush/app.R new file mode 100644 index 0000000000..67a36cf62a --- /dev/null +++ b/inst/examples/shiny/drag_brush/app.R @@ -0,0 +1,142 @@ +library(shiny) +library(plotly) +library(dplyr) +library(crosstalk) + +ui <- fluidPage( + checkboxInput("persist", "Persistent?", FALSE), + plotlyOutput("p"), + verbatimTextOutput("dat") +) + +server <- function(input, output, session) { + + # change these variables to customize the app + data_shared <- SharedData$new(mtcars) + color_base <- "black" + color_select <- "red" + var_x <- "wt" + var_y <- "mpg" + + data_orig <- data_shared$origData() + + output$p <- renderPlotly({ + plot_ly(x = data_orig[[var_x]], y = data_orig[[var_y]]) %>% + add_markers( + color = I(color_base), + selected = list( + marker = list(color = color_select) + ) + ) %>% + layout( + dragmode = "select", + xaxis = list(title = var_x), + yaxis = list(title = var_y) + ) %>% + config( + displayModeBar = FALSE, + edits = list(shapePosition = TRUE) + ) %>% + toWebGL() + }) + + # listen to the brushing event and draw a + # rect shape that mimics the brush + observe({ + brush <- event_data("plotly_brushing") + + # if the brush is undefined, remove all shapes and exit + if (is.null(brush)) { + plotlyProxy("p", session) %>% + plotlyProxyInvoke("relayout", list(shapes = NULL)) + return() + } + + # mimc the brush as a rect shape + brush_rect <- list( + type = "rect", + x0 = brush$x[1], + x1 = brush$x[2], + y0 = brush$y[1], + y1 = brush$y[2], + fillcolor = NA, + line = list( + color = "black", + dash = "dot", + width = 1 + ) + ) + + # draw the rect shape and turn off brush coloring + # imposed by plotly.js + plotlyProxy("p", session) %>% + plotlyProxyInvoke("relayout", list(shapes = list(brush_rect))) %>% + plotlyProxyInvoke("restyle", "selectedpoints", list(list())) + }) + + # A reactive value that tracks the dimensions of the brush + brush <- reactiveVal() + + # Update the brush in response to changes to shapes + # NOTE: if you need more shapes in the plot your brushing, + # you'll need to be mindful of which shape the brush represents + observe({ + evt <- event_data("plotly_relayout") + val <- if (!is.null(evt$shapes)) { + evt$shapes + } else if (!is.null(evt[["shapes[0].x0"]])) { + list( + x0 = evt[["shapes[0].x0"]], + x1 = evt[["shapes[0].x1"]], + y0 = evt[["shapes[0].y0"]], + y1 = evt[["shapes[0].y1"]] + ) + } + brush(val) + }) + + # double-click clears the brush + observe({ + event_data("plotly_doubleclick", priority = "event") + event_data("plotly_deselect", priority = "event") + brush(NULL) + }) + + # map the brush limits to a data selection + observe({ + + # if brush isn't active, no selection is active + if (is.null(brush())) { + data_shared$selection(FALSE) + return() + } + + selection <- between(data_orig[[var_x]], brush()$x0, brush()$x1) & + between(data_orig[[var_y]], brush()$y0, brush()$y1) + + if (isTRUE(input$persist)) { + selection_old <- data_shared$selection() + # This should be fixed in crosstalk + if (is.null(selection_old)) selection_old <- FALSE + data_shared$selection(selection_old | selection) + } else { + data_shared$selection(selection) + } + }) + + # update the marker colors + observe({ + dat <- data_shared$data(withSelection = TRUE) + color <- if_else(dat$selected_, color_select, color_base) + plotlyProxy("p", session) %>% + plotlyProxyInvoke("restyle", "marker.color", list(color), 0) + }) + + # display the selected data + output$dat <- renderPrint({ + dat <- data_shared$data(withSelection = TRUE) + filter(dat, selected_) + }) +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/drag_lines/app.R b/inst/examples/shiny/drag_lines/app.R new file mode 100644 index 0000000000..eecd2c8e87 --- /dev/null +++ b/inst/examples/shiny/drag_lines/app.R @@ -0,0 +1,47 @@ +# see https://community.rstudio.com/t/sliding-a-point-on-a-plot-rather-than-sliderinput-to-update-plot-in-shiny/16405/7 +library(shiny) +library(plotly) + +ui <- fluidPage( + plotlyOutput("p"), + verbatimTextOutput("event") +) + +x <- seq(-10, 10) +y <- rnorm(length(x)) + + +server <- function(input, output, session) { + + output$p <- renderPlotly({ + + d <- event_data("plotly_relayout", source = "trajectory") + + selected_point <- if (!is.null(d[["shapes[0].x0"]])) { + xint <- d[["shapes[0].x0"]] + xpt <- x[which.min(abs(x - xint))] + list(x = xpt, y = y[which(x == xpt)]) + } else { + list(x = 1, y = y[which(x == 1)]) + } + + plot_ly(color = I("red"), source = "trajectory") %>% + add_lines(x = x, y = y) %>% + add_markers(x = selected_point$x, y = selected_point$y) %>% + layout( + shapes = list( + type = "line", + line = list(color = "gray", dash = "dot"), + x0 = selected_point$x, + x1 = selected_point$x, + y0 = 0, + y1 = 1, + yref = "paper" + ) + ) %>% + config(editable = TRUE) + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/drag_markers/app.R b/inst/examples/shiny/drag_markers/app.R new file mode 100644 index 0000000000..0418b441ca --- /dev/null +++ b/inst/examples/shiny/drag_markers/app.R @@ -0,0 +1,69 @@ +library(plotly) +library(purrr) +library(shiny) + +ui <- fluidPage( + fluidRow( + column(5, verbatimTextOutput("summary")), + column(7, plotlyOutput("p")) + ) +) + +server <- function(input, output, session) { + + rv <- reactiveValues( + x = mtcars$mpg, + y = mtcars$wt + ) + grid <- reactive({ + data.frame(x = seq(min(rv$x), max(rv$x), length = 10)) + }) + model <- reactive({ + d <- data.frame(x = rv$x, y = rv$y) + lm(y ~ x, d) + }) + + output$p <- renderPlotly({ + # creates a list of circle shapes from x/y data + circles <- map2(rv$x, rv$y, + ~list( + type = "circle", + # anchor circles at (mpg, wt) + xanchor = .x, + yanchor = .y, + # give each circle a 2 pixel diameter + x0 = -4, x1 = 4, + y0 = -4, y1 = 4, + xsizemode = "pixel", + ysizemode = "pixel", + # other visual properties + fillcolor = "blue", + line = list(color = "transparent") + ) + ) + + # plot the shapes and fitted line + plot_ly() %>% + add_lines(x = grid()$x, y = predict(model(), grid()), color = I("red")) %>% + layout(shapes = circles) %>% + config(edits = list(shapePosition = TRUE)) + }) + + output$summary <- renderPrint({a + summary(model()) + }) + + # update x/y reactive values in response to changes in shape anchors + observe({ + ed <- event_data("plotly_relayout") + shape_anchors <- ed[grepl("^shapes.*anchor$", names(ed))] + if (length(shape_anchors) != 2) return() + row_index <- unique(readr::parse_number(names(shape_anchors)) + 1) + pts <- as.numeric(shape_anchors) + rv$x[row_index] <- pts[1] + rv$y[row_index] <- pts[2] + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/drill_down/app.R b/inst/examples/shiny/drill_down/app.R new file mode 100644 index 0000000000..bfe91c3f4d --- /dev/null +++ b/inst/examples/shiny/drill_down/app.R @@ -0,0 +1,156 @@ +library(shiny) +library(plotly) +library(dplyr) + +data(sales, package = "plotlyBook") +categories <- unique(sales$category) +sub_categories <- unique(sales$sub_category) +ids <- unique(sales$id) + +ui <- fluidPage( + uiOutput("history"), + plotlyOutput("bars", height = 200), + plotlyOutput("lines", height = 300) +) + +server <- function(input, output, session) { + # These reactive values keep track of the drilldown state + # (NULL means inactive) + drills <- reactiveValues( + category = NULL, + sub_category = NULL, + id = NULL + ) + # filter the data based on active drill-downs + # also create a column, value, which keeps track of which + # variable we're interested in + sales_data <- reactive({ + if (!length(drills$category)) { + return(mutate(sales, value = category)) + } + sales <- filter(sales, category %in% drills$category) + if (!length(drills$sub_category)) { + return(mutate(sales, value = sub_category)) + } + sales <- filter(sales, sub_category %in% drills$sub_category) + mutate(sales, value = id) + }) + + # bar chart of sales by 'current level of category' + output$bars <- renderPlotly({ + d <- count(sales_data(), value, wt = sales) + + p <- plot_ly(d, x = ~value, y = ~n, source = "bars") %>% + layout( + yaxis = list(title = "Total Sales"), + xaxis = list(title = "") + ) + + if (!length(drills$sub_category)) { + add_bars(p, color = ~value) + } else if (!length(drills$id)) { + add_bars(p) %>% + layout( + hovermode = "x", + xaxis = list(showticklabels = FALSE) + ) + } else { + # add a visual cue of which ID is selected + add_bars(p) %>% + filter(value %in% drills$id) %>% + add_bars(color = I("black")) %>% + layout( + hovermode = "x", xaxis = list(showticklabels = FALSE), + showlegend = FALSE, barmode = "overlay" + ) + } + }) + + # time-series chart of the sales + output$lines <- renderPlotly({ + p <- if (!length(drills$sub_category)) { + sales_data() %>% + count(order_date, value, wt = sales) %>% + plot_ly(x = ~order_date, y = ~n) %>% + add_lines(color = ~value) + } else if (!length(drills$id)) { + sales_data() %>% + count(order_date, wt = sales) %>% + plot_ly(x = ~order_date, y = ~n) %>% + add_lines() + } else { + sales_data() %>% + filter(id %in% drills$id) %>% + select(-value) %>% + plot_ly() %>% + add_table() + } + p %>% + layout( + yaxis = list(title = "Total Sales"), + xaxis = list(title = "") + ) + }) + + # control the state of the drilldown by clicking the bar graph + observeEvent(event_data("plotly_click", source = "bars"), { + x <- event_data("plotly_click", source = "bars")$x + if (!length(x)) return() + + if (!length(drills$category)) { + drills$category <- x + } else if (!length(drills$sub_category)) { + drills$sub_category <- x + } else { + drills$id <- x + } + }) + + # populate a `selectInput()` for each active drilldown + output$history <- renderUI({ + if (!length(drills$category)) return("Click the bar chart to drilldown") + categoryInput <- selectInput( + "category", "Category", + choices = categories, selected = drills$category + ) + if (!length(drills$sub_category)) return(categoryInput) + sd <- filter(sales, category %in% drills$category) + subCategoryInput <- selectInput( + "sub_category", "Sub-category", + choices = unique(sd$sub_category), + selected = drills$sub_category + ) + if (!length(drills$id)) { + return(fluidRow( + column(3, categoryInput), + column(3, subCategoryInput) + )) + } + sd <- filter(sd, sub_category %in% drills$sub_category) + idInput <- selectInput( + "id", "Product ID", + choices = unique(sd$id), selected = drills$id + ) + fluidRow( + column(3, categoryInput), + column(3, subCategoryInput), + column(3, idInput) + ) + }) + + # control the state of the drilldown via the `selectInput()`s + observeEvent(input$category, { + drills$category <- input$category + drills$sub_category <- NULL + drills$id <- NULL + }) + observeEvent(input$sub_category, { + drills$sub_category <- input$sub_category + drills$id <- NULL + }) + observeEvent(input$id, { + drills$id <- input$id + }) +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/event_data/DESCRIPTION b/inst/examples/shiny/event_data/DESCRIPTION new file mode 100644 index 0000000000..bdc8950141 --- /dev/null +++ b/inst/examples/shiny/event_data/DESCRIPTION @@ -0,0 +1,8 @@ +Title: Passing plotly selections to shiny via crosstalk +Author: Plotly, Inc. +AuthorUrl: https://plotly.com/r/ +License: MIT +DisplayMode: Showcase +Tags: plotly, crosstalk, shiny +Type: Shiny + diff --git a/inst/examples/shiny/event_data/app.R b/inst/examples/shiny/event_data/app.R new file mode 100644 index 0000000000..489b5e2db5 --- /dev/null +++ b/inst/examples/shiny/event_data/app.R @@ -0,0 +1,62 @@ +library(shiny) +library(plotly) + +ui <- fluidPage( + radioButtons("plotType", "Plot Type:", choices = c("ggplotly", "plotly")), + plotlyOutput("plot"), + verbatimTextOutput("hover"), + verbatimTextOutput("click"), + verbatimTextOutput("brushing"), + verbatimTextOutput("selecting"), + verbatimTextOutput("brushed"), + verbatimTextOutput("selected") +) + +server <- function(input, output, session) { + + nms <- row.names(mtcars) + + output$plot <- renderPlotly({ + p <- if (identical(input$plotType, "ggplotly")) { + ggplotly(ggplot(mtcars, aes(x = mpg, y = wt, customdata = nms)) + geom_point()) + } else { + plot_ly(mtcars, x = ~mpg, y = ~wt, customdata = nms) + } + p %>% + layout(dragmode = "select") %>% + event_register("plotly_selecting") + }) + + output$hover <- renderPrint({ + d <- event_data("plotly_hover") + if (is.null(d)) "Hover events appear here (unhover to clear)" else d + }) + + output$click <- renderPrint({ + d <- event_data("plotly_click") + if (is.null(d)) "Click events appear here (double-click to clear)" else d + }) + + output$brushing <- renderPrint({ + d <- event_data("plotly_brushing") + if (is.null(d)) "Brush extents appear here (double-click to clear)" else d + }) + + output$selecting <- renderPrint({ + d <- event_data("plotly_selecting") + if (is.null(d)) "Brush points appear here (double-click to clear)" else d + }) + + output$brushed <- renderPrint({ + d <- event_data("plotly_brushed") + if (is.null(d)) "Brush extents appear here (double-click to clear)" else d + }) + + output$selected <- renderPrint({ + d <- event_data("plotly_selected") + if (is.null(d)) "Brushed points appear here (double-click to clear)" else d + }) + +} + +shinyApp(ui, server, options = list(display.mode = "showcase")) diff --git a/inst/examples/shiny/event_data/tests/testthat.R b/inst/examples/shiny/event_data/tests/testthat.R new file mode 100644 index 0000000000..7d25b5b9e4 --- /dev/null +++ b/inst/examples/shiny/event_data/tests/testthat.R @@ -0,0 +1 @@ +shinytest2::test_app() diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001.json b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001.json new file mode 100644 index 0000000000..3d39284fe3 --- /dev/null +++ b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001.json @@ -0,0 +1,477 @@ +{ + "input": { + ".clientValue-default-plotlyCrosstalkOpts": { + "on": "plotly_click", + "persistent": false, + "dynamic": false, + "selectize": false, + "opacityDim": 0.2, + "selected": { + "opacity": 1 + }, + "debounce": 0, + "color": [ + + ] + }, + "plotType": "ggplotly", + "plotly_afterplot-A": "\"plot\"" + }, + "output": { + "brushed": "[1] \"Brush extents appear here (double-click to clear)\"", + "brushing": "[1] \"Brush extents appear here (double-click to clear)\"", + "click": "[1] \"Click events appear here (double-click to clear)\"", + "hover": "[1] \"Hover events appear here (unhover to clear)\"", + "plot": { + "x": { + "data": [ + { + "x": [ + 21, + 21, + 22.800000000000001, + 21.399999999999999, + 18.699999999999999, + 18.100000000000001, + 14.300000000000001, + 24.399999999999999, + 22.800000000000001, + 19.199999999999999, + 17.800000000000001, + 16.399999999999999, + 17.300000000000001, + 15.199999999999999, + 10.4, + 10.4, + 14.699999999999999, + 32.399999999999999, + 30.399999999999999, + 33.899999999999999, + 21.5, + 15.5, + 15.199999999999999, + 13.300000000000001, + 19.199999999999999, + 27.300000000000001, + 26, + 30.399999999999999, + 15.800000000000001, + 19.699999999999999, + 15, + 21.399999999999999 + ], + "y": [ + 2.6200000000000001, + 2.875, + 2.3199999999999998, + 3.2149999999999999, + 3.4399999999999999, + 3.46, + 3.5699999999999998, + 3.1899999999999999, + 3.1499999999999999, + 3.4399999999999999, + 3.4399999999999999, + 4.0700000000000003, + 3.73, + 3.7799999999999998, + 5.25, + 5.4240000000000004, + 5.3449999999999998, + 2.2000000000000002, + 1.615, + 1.835, + 2.4649999999999999, + 3.52, + 3.4350000000000001, + 3.8399999999999999, + 3.8450000000000002, + 1.9350000000000001, + 2.1400000000000001, + 1.5129999999999999, + 3.1699999999999999, + 2.77, + 3.5699999999999998, + 2.7799999999999998 + ], + "text": [ + "mpg: 21.0
wt: 2.620
nms: Mazda RX4", + "mpg: 21.0
wt: 2.875
nms: Mazda RX4 Wag", + "mpg: 22.8
wt: 2.320
nms: Datsun 710", + "mpg: 21.4
wt: 3.215
nms: Hornet 4 Drive", + "mpg: 18.7
wt: 3.440
nms: Hornet Sportabout", + "mpg: 18.1
wt: 3.460
nms: Valiant", + "mpg: 14.3
wt: 3.570
nms: Duster 360", + "mpg: 24.4
wt: 3.190
nms: Merc 240D", + "mpg: 22.8
wt: 3.150
nms: Merc 230", + "mpg: 19.2
wt: 3.440
nms: Merc 280", + "mpg: 17.8
wt: 3.440
nms: Merc 280C", + "mpg: 16.4
wt: 4.070
nms: Merc 450SE", + "mpg: 17.3
wt: 3.730
nms: Merc 450SL", + "mpg: 15.2
wt: 3.780
nms: Merc 450SLC", + "mpg: 10.4
wt: 5.250
nms: Cadillac Fleetwood", + "mpg: 10.4
wt: 5.424
nms: Lincoln Continental", + "mpg: 14.7
wt: 5.345
nms: Chrysler Imperial", + "mpg: 32.4
wt: 2.200
nms: Fiat 128", + "mpg: 30.4
wt: 1.615
nms: Honda Civic", + "mpg: 33.9
wt: 1.835
nms: Toyota Corolla", + "mpg: 21.5
wt: 2.465
nms: Toyota Corona", + "mpg: 15.5
wt: 3.520
nms: Dodge Challenger", + "mpg: 15.2
wt: 3.435
nms: AMC Javelin", + "mpg: 13.3
wt: 3.840
nms: Camaro Z28", + "mpg: 19.2
wt: 3.845
nms: Pontiac Firebird", + "mpg: 27.3
wt: 1.935
nms: Fiat X1-9", + "mpg: 26.0
wt: 2.140
nms: Porsche 914-2", + "mpg: 30.4
wt: 1.513
nms: Lotus Europa", + "mpg: 15.8
wt: 3.170
nms: Ford Pantera L", + "mpg: 19.7
wt: 2.770
nms: Ferrari Dino", + "mpg: 15.0
wt: 3.570
nms: Maserati Bora", + "mpg: 21.4
wt: 2.780
nms: Volvo 142E" + ], + "customdata": [ + "Mazda RX4", + "Mazda RX4 Wag", + "Datsun 710", + "Hornet 4 Drive", + "Hornet Sportabout", + "Valiant", + "Duster 360", + "Merc 240D", + "Merc 230", + "Merc 280", + "Merc 280C", + "Merc 450SE", + "Merc 450SL", + "Merc 450SLC", + "Cadillac Fleetwood", + "Lincoln Continental", + "Chrysler Imperial", + "Fiat 128", + "Honda Civic", + "Toyota Corolla", + "Toyota Corona", + "Dodge Challenger", + "AMC Javelin", + "Camaro Z28", + "Pontiac Firebird", + "Fiat X1-9", + "Porsche 914-2", + "Lotus Europa", + "Ford Pantera L", + "Ferrari Dino", + "Maserati Bora", + "Volvo 142E" + ], + "type": "scatter", + "mode": "markers", + "marker": { + "autocolorscale": false, + "color": "rgba(0,0,0,1)", + "opacity": 1, + "size": 5.6692913385826778, + "symbol": "circle", + "line": { + "width": 1.8897637795275593, + "color": "rgba(0,0,0,1)" + } + }, + "hoveron": "points", + "showlegend": false, + "xaxis": "x", + "yaxis": "y", + "hoverinfo": "text", + "frame": null + } + ], + "layout": { + "margin": { + "t": 23.305936073059364, + "r": 7.3059360730593621, + "b": 37.260273972602747, + "l": 31.415525114155255 + }, + "plot_bgcolor": "rgba(235,235,235,1)", + "paper_bgcolor": "rgba(255,255,255,1)", + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 14.611872146118724 + }, + "xaxis": { + "domain": [ + 0, + 1 + ], + "automargin": true, + "type": "linear", + "autorange": false, + "range": [ + 9.2249999999999996, + 35.074999999999996 + ], + "tickmode": "array", + "ticktext": [ + "10", + "15", + "20", + "25", + "30", + "35" + ], + "tickvals": [ + 10, + 15, + 20, + 25, + 30, + 35 + ], + "categoryorder": "array", + "categoryarray": [ + "10", + "15", + "20", + "25", + "30", + "35" + ], + "nticks": null, + "ticks": "outside", + "tickcolor": "rgba(51,51,51,1)", + "ticklen": 3.6529680365296811, + "tickwidth": 0.66417600664176002, + "showticklabels": true, + "tickfont": { + "color": "rgba(77,77,77,1)", + "family": "", + "size": 11.68949771689498 + }, + "tickangle": 0, + "showline": false, + "linecolor": null, + "linewidth": 0, + "showgrid": true, + "gridcolor": "rgba(255,255,255,1)", + "gridwidth": 0.66417600664176002, + "zeroline": false, + "anchor": "y", + "title": { + "text": "mpg", + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 14.611872146118724 + } + }, + "hoverformat": ".2f" + }, + "yaxis": { + "domain": [ + 0, + 1 + ], + "automargin": true, + "type": "linear", + "autorange": false, + "range": [ + 1.3174499999999998, + 5.6195500000000003 + ], + "tickmode": "array", + "ticktext": [ + "2", + "3", + "4", + "5" + ], + "tickvals": [ + 2, + 3, + 4, + 5 + ], + "categoryorder": "array", + "categoryarray": [ + "2", + "3", + "4", + "5" + ], + "nticks": null, + "ticks": "outside", + "tickcolor": "rgba(51,51,51,1)", + "ticklen": 3.6529680365296811, + "tickwidth": 0.66417600664176002, + "showticklabels": true, + "tickfont": { + "color": "rgba(77,77,77,1)", + "family": "", + "size": 11.68949771689498 + }, + "tickangle": 0, + "showline": false, + "linecolor": null, + "linewidth": 0, + "showgrid": true, + "gridcolor": "rgba(255,255,255,1)", + "gridwidth": 0.66417600664176002, + "zeroline": false, + "anchor": "x", + "title": { + "text": "wt", + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 14.611872146118724 + } + }, + "hoverformat": ".2f" + }, + "shapes": [ + + ], + "showlegend": false, + "legend": { + "bgcolor": "rgba(255,255,255,1)", + "bordercolor": "transparent", + "borderwidth": 1.8897637795275593, + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 11.68949771689498 + } + }, + "hovermode": "closest", + "barmode": "relative", + "dragmode": "select" + }, + "config": { + "doubleClick": "reset", + "modeBarButtonsToAdd": [ + "hoverclosest", + "hovercompare" + ], + "showSendToCloud": false + }, + "source": "A", + "shinyEvents": [ + "plotly_hover", + "plotly_click", + "plotly_selected", + "plotly_relayout", + "plotly_brushed", + "plotly_brushing", + "plotly_clickannotation", + "plotly_doubleclick", + "plotly_deselect", + "plotly_afterplot", + "plotly_sunburstclick", + "plotly_selecting" + ], + "highlight": { + "on": "plotly_click", + "persistent": false, + "dynamic": false, + "selectize": false, + "opacityDim": 0.20000000000000001, + "selected": { + "opacity": 1 + }, + "debounce": 0 + }, + "base_url": "https://plot.ly" + }, + "evals": [ + + ], + "jsHooks": [ + + ], + "deps": [ + { + "name": "setprototypeof", + "version": "0.1", + "src": { + "href": "setprototypeof-0.1" + }, + "meta": null, + "script": "setprototypeof.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": false + }, + { + "name": "typedarray", + "version": "0.1", + "src": { + "href": "typedarray-0.1" + }, + "meta": null, + "script": "typedarray.min.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": false + }, + { + "name": "jquery", + "version": "3.5.1", + "src": { + "href": "jquery-3.5.1" + }, + "meta": null, + "script": "jquery.min.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": true + }, + { + "name": "crosstalk", + "version": "1.2.2", + "src": { + "href": "crosstalk-1.2.2" + }, + "meta": null, + "script": "js/crosstalk.min.js", + "stylesheet": "css/crosstalk.min.css", + "head": null, + "attachment": null, + "all_files": true + }, + { + "name": "plotly-htmlwidgets-css", + "version": "2.25.2", + "src": { + "href": "plotly-htmlwidgets-css-2.25.2" + }, + "meta": null, + "script": null, + "stylesheet": "plotly-htmlwidgets.css", + "head": null, + "attachment": null, + "all_files": false + }, + { + "name": "plotly-main", + "version": "2.25.2", + "src": { + "href": "plotly-main-2.25.2" + }, + "meta": null, + "script": "plotly-latest.min.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": false + } + ] + }, + "selected": "[1] \"Brushed points appear here (double-click to clear)\"", + "selecting": "[1] \"Brush points appear here (double-click to clear)\"" + }, + "export": { + + } +} diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001_.png b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001_.png new file mode 100644 index 0000000000..346330c011 Binary files /dev/null and b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001_.png differ diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002.json b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002.json new file mode 100644 index 0000000000..681c414148 --- /dev/null +++ b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002.json @@ -0,0 +1,480 @@ +{ + "input": { + ".clientValue-default-plotlyCrosstalkOpts": { + "on": "plotly_click", + "persistent": false, + "dynamic": false, + "selectize": false, + "opacityDim": 0.2, + "selected": { + "opacity": 1 + }, + "debounce": 0, + "color": [ + + ] + }, + "plotType": "ggplotly", + "plotly_afterplot-A": "\"plot\"", + "plotly_click-A": "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", + "plotly_hover-A": null, + "plotly_relayout-A": "" + }, + "output": { + "brushed": "[1] \"Brush extents appear here (double-click to clear)\"", + "brushing": "[1] \"Brush extents appear here (double-click to clear)\"", + "click": " curveNumber pointNumber x y customdata\n1 0 7 24.4 3.19 Merc 240D", + "hover": "[1] \"Hover events appear here (unhover to clear)\"", + "plot": { + "x": { + "data": [ + { + "x": [ + 21, + 21, + 22.800000000000001, + 21.399999999999999, + 18.699999999999999, + 18.100000000000001, + 14.300000000000001, + 24.399999999999999, + 22.800000000000001, + 19.199999999999999, + 17.800000000000001, + 16.399999999999999, + 17.300000000000001, + 15.199999999999999, + 10.4, + 10.4, + 14.699999999999999, + 32.399999999999999, + 30.399999999999999, + 33.899999999999999, + 21.5, + 15.5, + 15.199999999999999, + 13.300000000000001, + 19.199999999999999, + 27.300000000000001, + 26, + 30.399999999999999, + 15.800000000000001, + 19.699999999999999, + 15, + 21.399999999999999 + ], + "y": [ + 2.6200000000000001, + 2.875, + 2.3199999999999998, + 3.2149999999999999, + 3.4399999999999999, + 3.46, + 3.5699999999999998, + 3.1899999999999999, + 3.1499999999999999, + 3.4399999999999999, + 3.4399999999999999, + 4.0700000000000003, + 3.73, + 3.7799999999999998, + 5.25, + 5.4240000000000004, + 5.3449999999999998, + 2.2000000000000002, + 1.615, + 1.835, + 2.4649999999999999, + 3.52, + 3.4350000000000001, + 3.8399999999999999, + 3.8450000000000002, + 1.9350000000000001, + 2.1400000000000001, + 1.5129999999999999, + 3.1699999999999999, + 2.77, + 3.5699999999999998, + 2.7799999999999998 + ], + "text": [ + "mpg: 21.0
wt: 2.620
nms: Mazda RX4", + "mpg: 21.0
wt: 2.875
nms: Mazda RX4 Wag", + "mpg: 22.8
wt: 2.320
nms: Datsun 710", + "mpg: 21.4
wt: 3.215
nms: Hornet 4 Drive", + "mpg: 18.7
wt: 3.440
nms: Hornet Sportabout", + "mpg: 18.1
wt: 3.460
nms: Valiant", + "mpg: 14.3
wt: 3.570
nms: Duster 360", + "mpg: 24.4
wt: 3.190
nms: Merc 240D", + "mpg: 22.8
wt: 3.150
nms: Merc 230", + "mpg: 19.2
wt: 3.440
nms: Merc 280", + "mpg: 17.8
wt: 3.440
nms: Merc 280C", + "mpg: 16.4
wt: 4.070
nms: Merc 450SE", + "mpg: 17.3
wt: 3.730
nms: Merc 450SL", + "mpg: 15.2
wt: 3.780
nms: Merc 450SLC", + "mpg: 10.4
wt: 5.250
nms: Cadillac Fleetwood", + "mpg: 10.4
wt: 5.424
nms: Lincoln Continental", + "mpg: 14.7
wt: 5.345
nms: Chrysler Imperial", + "mpg: 32.4
wt: 2.200
nms: Fiat 128", + "mpg: 30.4
wt: 1.615
nms: Honda Civic", + "mpg: 33.9
wt: 1.835
nms: Toyota Corolla", + "mpg: 21.5
wt: 2.465
nms: Toyota Corona", + "mpg: 15.5
wt: 3.520
nms: Dodge Challenger", + "mpg: 15.2
wt: 3.435
nms: AMC Javelin", + "mpg: 13.3
wt: 3.840
nms: Camaro Z28", + "mpg: 19.2
wt: 3.845
nms: Pontiac Firebird", + "mpg: 27.3
wt: 1.935
nms: Fiat X1-9", + "mpg: 26.0
wt: 2.140
nms: Porsche 914-2", + "mpg: 30.4
wt: 1.513
nms: Lotus Europa", + "mpg: 15.8
wt: 3.170
nms: Ford Pantera L", + "mpg: 19.7
wt: 2.770
nms: Ferrari Dino", + "mpg: 15.0
wt: 3.570
nms: Maserati Bora", + "mpg: 21.4
wt: 2.780
nms: Volvo 142E" + ], + "customdata": [ + "Mazda RX4", + "Mazda RX4 Wag", + "Datsun 710", + "Hornet 4 Drive", + "Hornet Sportabout", + "Valiant", + "Duster 360", + "Merc 240D", + "Merc 230", + "Merc 280", + "Merc 280C", + "Merc 450SE", + "Merc 450SL", + "Merc 450SLC", + "Cadillac Fleetwood", + "Lincoln Continental", + "Chrysler Imperial", + "Fiat 128", + "Honda Civic", + "Toyota Corolla", + "Toyota Corona", + "Dodge Challenger", + "AMC Javelin", + "Camaro Z28", + "Pontiac Firebird", + "Fiat X1-9", + "Porsche 914-2", + "Lotus Europa", + "Ford Pantera L", + "Ferrari Dino", + "Maserati Bora", + "Volvo 142E" + ], + "type": "scatter", + "mode": "markers", + "marker": { + "autocolorscale": false, + "color": "rgba(0,0,0,1)", + "opacity": 1, + "size": 5.6692913385826778, + "symbol": "circle", + "line": { + "width": 1.8897637795275593, + "color": "rgba(0,0,0,1)" + } + }, + "hoveron": "points", + "showlegend": false, + "xaxis": "x", + "yaxis": "y", + "hoverinfo": "text", + "frame": null + } + ], + "layout": { + "margin": { + "t": 23.305936073059364, + "r": 7.3059360730593621, + "b": 37.260273972602747, + "l": 31.415525114155255 + }, + "plot_bgcolor": "rgba(235,235,235,1)", + "paper_bgcolor": "rgba(255,255,255,1)", + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 14.611872146118724 + }, + "xaxis": { + "domain": [ + 0, + 1 + ], + "automargin": true, + "type": "linear", + "autorange": false, + "range": [ + 9.2249999999999996, + 35.074999999999996 + ], + "tickmode": "array", + "ticktext": [ + "10", + "15", + "20", + "25", + "30", + "35" + ], + "tickvals": [ + 10, + 15, + 20, + 25, + 30, + 35 + ], + "categoryorder": "array", + "categoryarray": [ + "10", + "15", + "20", + "25", + "30", + "35" + ], + "nticks": null, + "ticks": "outside", + "tickcolor": "rgba(51,51,51,1)", + "ticklen": 3.6529680365296811, + "tickwidth": 0.66417600664176002, + "showticklabels": true, + "tickfont": { + "color": "rgba(77,77,77,1)", + "family": "", + "size": 11.68949771689498 + }, + "tickangle": 0, + "showline": false, + "linecolor": null, + "linewidth": 0, + "showgrid": true, + "gridcolor": "rgba(255,255,255,1)", + "gridwidth": 0.66417600664176002, + "zeroline": false, + "anchor": "y", + "title": { + "text": "mpg", + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 14.611872146118724 + } + }, + "hoverformat": ".2f" + }, + "yaxis": { + "domain": [ + 0, + 1 + ], + "automargin": true, + "type": "linear", + "autorange": false, + "range": [ + 1.3174499999999998, + 5.6195500000000003 + ], + "tickmode": "array", + "ticktext": [ + "2", + "3", + "4", + "5" + ], + "tickvals": [ + 2, + 3, + 4, + 5 + ], + "categoryorder": "array", + "categoryarray": [ + "2", + "3", + "4", + "5" + ], + "nticks": null, + "ticks": "outside", + "tickcolor": "rgba(51,51,51,1)", + "ticklen": 3.6529680365296811, + "tickwidth": 0.66417600664176002, + "showticklabels": true, + "tickfont": { + "color": "rgba(77,77,77,1)", + "family": "", + "size": 11.68949771689498 + }, + "tickangle": 0, + "showline": false, + "linecolor": null, + "linewidth": 0, + "showgrid": true, + "gridcolor": "rgba(255,255,255,1)", + "gridwidth": 0.66417600664176002, + "zeroline": false, + "anchor": "x", + "title": { + "text": "wt", + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 14.611872146118724 + } + }, + "hoverformat": ".2f" + }, + "shapes": [ + + ], + "showlegend": false, + "legend": { + "bgcolor": "rgba(255,255,255,1)", + "bordercolor": "transparent", + "borderwidth": 1.8897637795275593, + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 11.68949771689498 + } + }, + "hovermode": "closest", + "barmode": "relative", + "dragmode": "select" + }, + "config": { + "doubleClick": "reset", + "modeBarButtonsToAdd": [ + "hoverclosest", + "hovercompare" + ], + "showSendToCloud": false + }, + "source": "A", + "shinyEvents": [ + "plotly_hover", + "plotly_click", + "plotly_selected", + "plotly_relayout", + "plotly_brushed", + "plotly_brushing", + "plotly_clickannotation", + "plotly_doubleclick", + "plotly_deselect", + "plotly_afterplot", + "plotly_sunburstclick", + "plotly_selecting" + ], + "highlight": { + "on": "plotly_click", + "persistent": false, + "dynamic": false, + "selectize": false, + "opacityDim": 0.20000000000000001, + "selected": { + "opacity": 1 + }, + "debounce": 0 + }, + "base_url": "https://plot.ly" + }, + "evals": [ + + ], + "jsHooks": [ + + ], + "deps": [ + { + "name": "setprototypeof", + "version": "0.1", + "src": { + "href": "setprototypeof-0.1" + }, + "meta": null, + "script": "setprototypeof.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": false + }, + { + "name": "typedarray", + "version": "0.1", + "src": { + "href": "typedarray-0.1" + }, + "meta": null, + "script": "typedarray.min.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": false + }, + { + "name": "jquery", + "version": "3.5.1", + "src": { + "href": "jquery-3.5.1" + }, + "meta": null, + "script": "jquery.min.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": true + }, + { + "name": "crosstalk", + "version": "1.2.2", + "src": { + "href": "crosstalk-1.2.2" + }, + "meta": null, + "script": "js/crosstalk.min.js", + "stylesheet": "css/crosstalk.min.css", + "head": null, + "attachment": null, + "all_files": true + }, + { + "name": "plotly-htmlwidgets-css", + "version": "2.25.2", + "src": { + "href": "plotly-htmlwidgets-css-2.25.2" + }, + "meta": null, + "script": null, + "stylesheet": "plotly-htmlwidgets.css", + "head": null, + "attachment": null, + "all_files": false + }, + { + "name": "plotly-main", + "version": "2.25.2", + "src": { + "href": "plotly-main-2.25.2" + }, + "meta": null, + "script": "plotly-latest.min.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": false + } + ] + }, + "selected": "[1] \"Brushed points appear here (double-click to clear)\"", + "selecting": "[1] \"Brush points appear here (double-click to clear)\"" + }, + "export": { + + } +} diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002_.png b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002_.png new file mode 100644 index 0000000000..39cca6f381 Binary files /dev/null and b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002_.png differ diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003.json b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003.json new file mode 100644 index 0000000000..0165d57470 --- /dev/null +++ b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003.json @@ -0,0 +1,484 @@ +{ + "input": { + ".clientValue-default-plotlyCrosstalkOpts": { + "on": "plotly_click", + "persistent": false, + "dynamic": false, + "selectize": false, + "opacityDim": 0.2, + "selected": { + "opacity": 1 + }, + "debounce": 0, + "color": [ + + ] + }, + "plotType": "ggplotly", + "plotly_afterplot-A": "\"plot\"", + "plotly_brushed-A": "{\"x\":[23.95978500551268,25.98332414553473],\"y\":[3.0020072289156627,3.5073743975903615]}", + "plotly_brushing-A": "{\"x\":[23.95978500551268,25.98332414553473],\"y\":[3.0020072289156627,3.5073743975903615]}", + "plotly_click-A": "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", + "plotly_hover-A": null, + "plotly_relayout-A": "", + "plotly_selected-A": "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", + "plotly_selecting-A": "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]" + }, + "output": { + "brushed": "$x\n[1] 23.95979 25.98332\n\n$y\n[1] 3.002007 3.507374", + "brushing": "$x\n[1] 23.95979 25.98332\n\n$y\n[1] 3.002007 3.507374", + "click": " curveNumber pointNumber x y customdata\n1 0 7 24.4 3.19 Merc 240D", + "hover": "[1] \"Hover events appear here (unhover to clear)\"", + "plot": { + "x": { + "data": [ + { + "x": [ + 21, + 21, + 22.800000000000001, + 21.399999999999999, + 18.699999999999999, + 18.100000000000001, + 14.300000000000001, + 24.399999999999999, + 22.800000000000001, + 19.199999999999999, + 17.800000000000001, + 16.399999999999999, + 17.300000000000001, + 15.199999999999999, + 10.4, + 10.4, + 14.699999999999999, + 32.399999999999999, + 30.399999999999999, + 33.899999999999999, + 21.5, + 15.5, + 15.199999999999999, + 13.300000000000001, + 19.199999999999999, + 27.300000000000001, + 26, + 30.399999999999999, + 15.800000000000001, + 19.699999999999999, + 15, + 21.399999999999999 + ], + "y": [ + 2.6200000000000001, + 2.875, + 2.3199999999999998, + 3.2149999999999999, + 3.4399999999999999, + 3.46, + 3.5699999999999998, + 3.1899999999999999, + 3.1499999999999999, + 3.4399999999999999, + 3.4399999999999999, + 4.0700000000000003, + 3.73, + 3.7799999999999998, + 5.25, + 5.4240000000000004, + 5.3449999999999998, + 2.2000000000000002, + 1.615, + 1.835, + 2.4649999999999999, + 3.52, + 3.4350000000000001, + 3.8399999999999999, + 3.8450000000000002, + 1.9350000000000001, + 2.1400000000000001, + 1.5129999999999999, + 3.1699999999999999, + 2.77, + 3.5699999999999998, + 2.7799999999999998 + ], + "text": [ + "mpg: 21.0
wt: 2.620
nms: Mazda RX4", + "mpg: 21.0
wt: 2.875
nms: Mazda RX4 Wag", + "mpg: 22.8
wt: 2.320
nms: Datsun 710", + "mpg: 21.4
wt: 3.215
nms: Hornet 4 Drive", + "mpg: 18.7
wt: 3.440
nms: Hornet Sportabout", + "mpg: 18.1
wt: 3.460
nms: Valiant", + "mpg: 14.3
wt: 3.570
nms: Duster 360", + "mpg: 24.4
wt: 3.190
nms: Merc 240D", + "mpg: 22.8
wt: 3.150
nms: Merc 230", + "mpg: 19.2
wt: 3.440
nms: Merc 280", + "mpg: 17.8
wt: 3.440
nms: Merc 280C", + "mpg: 16.4
wt: 4.070
nms: Merc 450SE", + "mpg: 17.3
wt: 3.730
nms: Merc 450SL", + "mpg: 15.2
wt: 3.780
nms: Merc 450SLC", + "mpg: 10.4
wt: 5.250
nms: Cadillac Fleetwood", + "mpg: 10.4
wt: 5.424
nms: Lincoln Continental", + "mpg: 14.7
wt: 5.345
nms: Chrysler Imperial", + "mpg: 32.4
wt: 2.200
nms: Fiat 128", + "mpg: 30.4
wt: 1.615
nms: Honda Civic", + "mpg: 33.9
wt: 1.835
nms: Toyota Corolla", + "mpg: 21.5
wt: 2.465
nms: Toyota Corona", + "mpg: 15.5
wt: 3.520
nms: Dodge Challenger", + "mpg: 15.2
wt: 3.435
nms: AMC Javelin", + "mpg: 13.3
wt: 3.840
nms: Camaro Z28", + "mpg: 19.2
wt: 3.845
nms: Pontiac Firebird", + "mpg: 27.3
wt: 1.935
nms: Fiat X1-9", + "mpg: 26.0
wt: 2.140
nms: Porsche 914-2", + "mpg: 30.4
wt: 1.513
nms: Lotus Europa", + "mpg: 15.8
wt: 3.170
nms: Ford Pantera L", + "mpg: 19.7
wt: 2.770
nms: Ferrari Dino", + "mpg: 15.0
wt: 3.570
nms: Maserati Bora", + "mpg: 21.4
wt: 2.780
nms: Volvo 142E" + ], + "customdata": [ + "Mazda RX4", + "Mazda RX4 Wag", + "Datsun 710", + "Hornet 4 Drive", + "Hornet Sportabout", + "Valiant", + "Duster 360", + "Merc 240D", + "Merc 230", + "Merc 280", + "Merc 280C", + "Merc 450SE", + "Merc 450SL", + "Merc 450SLC", + "Cadillac Fleetwood", + "Lincoln Continental", + "Chrysler Imperial", + "Fiat 128", + "Honda Civic", + "Toyota Corolla", + "Toyota Corona", + "Dodge Challenger", + "AMC Javelin", + "Camaro Z28", + "Pontiac Firebird", + "Fiat X1-9", + "Porsche 914-2", + "Lotus Europa", + "Ford Pantera L", + "Ferrari Dino", + "Maserati Bora", + "Volvo 142E" + ], + "type": "scatter", + "mode": "markers", + "marker": { + "autocolorscale": false, + "color": "rgba(0,0,0,1)", + "opacity": 1, + "size": 5.6692913385826778, + "symbol": "circle", + "line": { + "width": 1.8897637795275593, + "color": "rgba(0,0,0,1)" + } + }, + "hoveron": "points", + "showlegend": false, + "xaxis": "x", + "yaxis": "y", + "hoverinfo": "text", + "frame": null + } + ], + "layout": { + "margin": { + "t": 23.305936073059364, + "r": 7.3059360730593621, + "b": 37.260273972602747, + "l": 31.415525114155255 + }, + "plot_bgcolor": "rgba(235,235,235,1)", + "paper_bgcolor": "rgba(255,255,255,1)", + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 14.611872146118724 + }, + "xaxis": { + "domain": [ + 0, + 1 + ], + "automargin": true, + "type": "linear", + "autorange": false, + "range": [ + 9.2249999999999996, + 35.074999999999996 + ], + "tickmode": "array", + "ticktext": [ + "10", + "15", + "20", + "25", + "30", + "35" + ], + "tickvals": [ + 10, + 15, + 20, + 25, + 30, + 35 + ], + "categoryorder": "array", + "categoryarray": [ + "10", + "15", + "20", + "25", + "30", + "35" + ], + "nticks": null, + "ticks": "outside", + "tickcolor": "rgba(51,51,51,1)", + "ticklen": 3.6529680365296811, + "tickwidth": 0.66417600664176002, + "showticklabels": true, + "tickfont": { + "color": "rgba(77,77,77,1)", + "family": "", + "size": 11.68949771689498 + }, + "tickangle": 0, + "showline": false, + "linecolor": null, + "linewidth": 0, + "showgrid": true, + "gridcolor": "rgba(255,255,255,1)", + "gridwidth": 0.66417600664176002, + "zeroline": false, + "anchor": "y", + "title": { + "text": "mpg", + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 14.611872146118724 + } + }, + "hoverformat": ".2f" + }, + "yaxis": { + "domain": [ + 0, + 1 + ], + "automargin": true, + "type": "linear", + "autorange": false, + "range": [ + 1.3174499999999998, + 5.6195500000000003 + ], + "tickmode": "array", + "ticktext": [ + "2", + "3", + "4", + "5" + ], + "tickvals": [ + 2, + 3, + 4, + 5 + ], + "categoryorder": "array", + "categoryarray": [ + "2", + "3", + "4", + "5" + ], + "nticks": null, + "ticks": "outside", + "tickcolor": "rgba(51,51,51,1)", + "ticklen": 3.6529680365296811, + "tickwidth": 0.66417600664176002, + "showticklabels": true, + "tickfont": { + "color": "rgba(77,77,77,1)", + "family": "", + "size": 11.68949771689498 + }, + "tickangle": 0, + "showline": false, + "linecolor": null, + "linewidth": 0, + "showgrid": true, + "gridcolor": "rgba(255,255,255,1)", + "gridwidth": 0.66417600664176002, + "zeroline": false, + "anchor": "x", + "title": { + "text": "wt", + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 14.611872146118724 + } + }, + "hoverformat": ".2f" + }, + "shapes": [ + + ], + "showlegend": false, + "legend": { + "bgcolor": "rgba(255,255,255,1)", + "bordercolor": "transparent", + "borderwidth": 1.8897637795275593, + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 11.68949771689498 + } + }, + "hovermode": "closest", + "barmode": "relative", + "dragmode": "select" + }, + "config": { + "doubleClick": "reset", + "modeBarButtonsToAdd": [ + "hoverclosest", + "hovercompare" + ], + "showSendToCloud": false + }, + "source": "A", + "shinyEvents": [ + "plotly_hover", + "plotly_click", + "plotly_selected", + "plotly_relayout", + "plotly_brushed", + "plotly_brushing", + "plotly_clickannotation", + "plotly_doubleclick", + "plotly_deselect", + "plotly_afterplot", + "plotly_sunburstclick", + "plotly_selecting" + ], + "highlight": { + "on": "plotly_click", + "persistent": false, + "dynamic": false, + "selectize": false, + "opacityDim": 0.20000000000000001, + "selected": { + "opacity": 1 + }, + "debounce": 0 + }, + "base_url": "https://plot.ly" + }, + "evals": [ + + ], + "jsHooks": [ + + ], + "deps": [ + { + "name": "setprototypeof", + "version": "0.1", + "src": { + "href": "setprototypeof-0.1" + }, + "meta": null, + "script": "setprototypeof.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": false + }, + { + "name": "typedarray", + "version": "0.1", + "src": { + "href": "typedarray-0.1" + }, + "meta": null, + "script": "typedarray.min.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": false + }, + { + "name": "jquery", + "version": "3.5.1", + "src": { + "href": "jquery-3.5.1" + }, + "meta": null, + "script": "jquery.min.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": true + }, + { + "name": "crosstalk", + "version": "1.2.2", + "src": { + "href": "crosstalk-1.2.2" + }, + "meta": null, + "script": "js/crosstalk.min.js", + "stylesheet": "css/crosstalk.min.css", + "head": null, + "attachment": null, + "all_files": true + }, + { + "name": "plotly-htmlwidgets-css", + "version": "2.25.2", + "src": { + "href": "plotly-htmlwidgets-css-2.25.2" + }, + "meta": null, + "script": null, + "stylesheet": "plotly-htmlwidgets.css", + "head": null, + "attachment": null, + "all_files": false + }, + { + "name": "plotly-main", + "version": "2.25.2", + "src": { + "href": "plotly-main-2.25.2" + }, + "meta": null, + "script": "plotly-latest.min.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": false + } + ] + }, + "selected": " curveNumber pointNumber x y customdata\n1 0 7 24.4 3.19 Merc 240D", + "selecting": " curveNumber pointNumber x y customdata\n1 0 7 24.4 3.19 Merc 240D" + }, + "export": { + + } +} diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003_.png b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003_.png new file mode 100644 index 0000000000..8a94c96461 Binary files /dev/null and b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003_.png differ diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004.json b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004.json new file mode 100644 index 0000000000..4dd8e641f0 --- /dev/null +++ b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004.json @@ -0,0 +1,485 @@ +{ + "input": { + ".clientValue-default-plotlyCrosstalkOpts": { + "on": "plotly_click", + "persistent": false, + "dynamic": false, + "selectize": false, + "opacityDim": 0.2, + "selected": { + "opacity": 1 + }, + "debounce": 0, + "color": [ + + ] + }, + "plotType": "ggplotly", + "plotly_afterplot-A": "\"plot\"", + "plotly_brushed-A": null, + "plotly_brushing-A": null, + "plotly_click-A": null, + "plotly_deselect-A": "\"plot\"", + "plotly_hover-A": null, + "plotly_relayout-A": "", + "plotly_selected-A": null, + "plotly_selecting-A": null + }, + "output": { + "brushed": "[1] \"Brush extents appear here (double-click to clear)\"", + "brushing": "[1] \"Brush extents appear here (double-click to clear)\"", + "click": "[1] \"Click events appear here (double-click to clear)\"", + "hover": "[1] \"Hover events appear here (unhover to clear)\"", + "plot": { + "x": { + "data": [ + { + "x": [ + 21, + 21, + 22.800000000000001, + 21.399999999999999, + 18.699999999999999, + 18.100000000000001, + 14.300000000000001, + 24.399999999999999, + 22.800000000000001, + 19.199999999999999, + 17.800000000000001, + 16.399999999999999, + 17.300000000000001, + 15.199999999999999, + 10.4, + 10.4, + 14.699999999999999, + 32.399999999999999, + 30.399999999999999, + 33.899999999999999, + 21.5, + 15.5, + 15.199999999999999, + 13.300000000000001, + 19.199999999999999, + 27.300000000000001, + 26, + 30.399999999999999, + 15.800000000000001, + 19.699999999999999, + 15, + 21.399999999999999 + ], + "y": [ + 2.6200000000000001, + 2.875, + 2.3199999999999998, + 3.2149999999999999, + 3.4399999999999999, + 3.46, + 3.5699999999999998, + 3.1899999999999999, + 3.1499999999999999, + 3.4399999999999999, + 3.4399999999999999, + 4.0700000000000003, + 3.73, + 3.7799999999999998, + 5.25, + 5.4240000000000004, + 5.3449999999999998, + 2.2000000000000002, + 1.615, + 1.835, + 2.4649999999999999, + 3.52, + 3.4350000000000001, + 3.8399999999999999, + 3.8450000000000002, + 1.9350000000000001, + 2.1400000000000001, + 1.5129999999999999, + 3.1699999999999999, + 2.77, + 3.5699999999999998, + 2.7799999999999998 + ], + "text": [ + "mpg: 21.0
wt: 2.620
nms: Mazda RX4", + "mpg: 21.0
wt: 2.875
nms: Mazda RX4 Wag", + "mpg: 22.8
wt: 2.320
nms: Datsun 710", + "mpg: 21.4
wt: 3.215
nms: Hornet 4 Drive", + "mpg: 18.7
wt: 3.440
nms: Hornet Sportabout", + "mpg: 18.1
wt: 3.460
nms: Valiant", + "mpg: 14.3
wt: 3.570
nms: Duster 360", + "mpg: 24.4
wt: 3.190
nms: Merc 240D", + "mpg: 22.8
wt: 3.150
nms: Merc 230", + "mpg: 19.2
wt: 3.440
nms: Merc 280", + "mpg: 17.8
wt: 3.440
nms: Merc 280C", + "mpg: 16.4
wt: 4.070
nms: Merc 450SE", + "mpg: 17.3
wt: 3.730
nms: Merc 450SL", + "mpg: 15.2
wt: 3.780
nms: Merc 450SLC", + "mpg: 10.4
wt: 5.250
nms: Cadillac Fleetwood", + "mpg: 10.4
wt: 5.424
nms: Lincoln Continental", + "mpg: 14.7
wt: 5.345
nms: Chrysler Imperial", + "mpg: 32.4
wt: 2.200
nms: Fiat 128", + "mpg: 30.4
wt: 1.615
nms: Honda Civic", + "mpg: 33.9
wt: 1.835
nms: Toyota Corolla", + "mpg: 21.5
wt: 2.465
nms: Toyota Corona", + "mpg: 15.5
wt: 3.520
nms: Dodge Challenger", + "mpg: 15.2
wt: 3.435
nms: AMC Javelin", + "mpg: 13.3
wt: 3.840
nms: Camaro Z28", + "mpg: 19.2
wt: 3.845
nms: Pontiac Firebird", + "mpg: 27.3
wt: 1.935
nms: Fiat X1-9", + "mpg: 26.0
wt: 2.140
nms: Porsche 914-2", + "mpg: 30.4
wt: 1.513
nms: Lotus Europa", + "mpg: 15.8
wt: 3.170
nms: Ford Pantera L", + "mpg: 19.7
wt: 2.770
nms: Ferrari Dino", + "mpg: 15.0
wt: 3.570
nms: Maserati Bora", + "mpg: 21.4
wt: 2.780
nms: Volvo 142E" + ], + "customdata": [ + "Mazda RX4", + "Mazda RX4 Wag", + "Datsun 710", + "Hornet 4 Drive", + "Hornet Sportabout", + "Valiant", + "Duster 360", + "Merc 240D", + "Merc 230", + "Merc 280", + "Merc 280C", + "Merc 450SE", + "Merc 450SL", + "Merc 450SLC", + "Cadillac Fleetwood", + "Lincoln Continental", + "Chrysler Imperial", + "Fiat 128", + "Honda Civic", + "Toyota Corolla", + "Toyota Corona", + "Dodge Challenger", + "AMC Javelin", + "Camaro Z28", + "Pontiac Firebird", + "Fiat X1-9", + "Porsche 914-2", + "Lotus Europa", + "Ford Pantera L", + "Ferrari Dino", + "Maserati Bora", + "Volvo 142E" + ], + "type": "scatter", + "mode": "markers", + "marker": { + "autocolorscale": false, + "color": "rgba(0,0,0,1)", + "opacity": 1, + "size": 5.6692913385826778, + "symbol": "circle", + "line": { + "width": 1.8897637795275593, + "color": "rgba(0,0,0,1)" + } + }, + "hoveron": "points", + "showlegend": false, + "xaxis": "x", + "yaxis": "y", + "hoverinfo": "text", + "frame": null + } + ], + "layout": { + "margin": { + "t": 23.305936073059364, + "r": 7.3059360730593621, + "b": 37.260273972602747, + "l": 31.415525114155255 + }, + "plot_bgcolor": "rgba(235,235,235,1)", + "paper_bgcolor": "rgba(255,255,255,1)", + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 14.611872146118724 + }, + "xaxis": { + "domain": [ + 0, + 1 + ], + "automargin": true, + "type": "linear", + "autorange": false, + "range": [ + 9.2249999999999996, + 35.074999999999996 + ], + "tickmode": "array", + "ticktext": [ + "10", + "15", + "20", + "25", + "30", + "35" + ], + "tickvals": [ + 10, + 15, + 20, + 25, + 30, + 35 + ], + "categoryorder": "array", + "categoryarray": [ + "10", + "15", + "20", + "25", + "30", + "35" + ], + "nticks": null, + "ticks": "outside", + "tickcolor": "rgba(51,51,51,1)", + "ticklen": 3.6529680365296811, + "tickwidth": 0.66417600664176002, + "showticklabels": true, + "tickfont": { + "color": "rgba(77,77,77,1)", + "family": "", + "size": 11.68949771689498 + }, + "tickangle": 0, + "showline": false, + "linecolor": null, + "linewidth": 0, + "showgrid": true, + "gridcolor": "rgba(255,255,255,1)", + "gridwidth": 0.66417600664176002, + "zeroline": false, + "anchor": "y", + "title": { + "text": "mpg", + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 14.611872146118724 + } + }, + "hoverformat": ".2f" + }, + "yaxis": { + "domain": [ + 0, + 1 + ], + "automargin": true, + "type": "linear", + "autorange": false, + "range": [ + 1.3174499999999998, + 5.6195500000000003 + ], + "tickmode": "array", + "ticktext": [ + "2", + "3", + "4", + "5" + ], + "tickvals": [ + 2, + 3, + 4, + 5 + ], + "categoryorder": "array", + "categoryarray": [ + "2", + "3", + "4", + "5" + ], + "nticks": null, + "ticks": "outside", + "tickcolor": "rgba(51,51,51,1)", + "ticklen": 3.6529680365296811, + "tickwidth": 0.66417600664176002, + "showticklabels": true, + "tickfont": { + "color": "rgba(77,77,77,1)", + "family": "", + "size": 11.68949771689498 + }, + "tickangle": 0, + "showline": false, + "linecolor": null, + "linewidth": 0, + "showgrid": true, + "gridcolor": "rgba(255,255,255,1)", + "gridwidth": 0.66417600664176002, + "zeroline": false, + "anchor": "x", + "title": { + "text": "wt", + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 14.611872146118724 + } + }, + "hoverformat": ".2f" + }, + "shapes": [ + + ], + "showlegend": false, + "legend": { + "bgcolor": "rgba(255,255,255,1)", + "bordercolor": "transparent", + "borderwidth": 1.8897637795275593, + "font": { + "color": "rgba(0,0,0,1)", + "family": "", + "size": 11.68949771689498 + } + }, + "hovermode": "closest", + "barmode": "relative", + "dragmode": "select" + }, + "config": { + "doubleClick": "reset", + "modeBarButtonsToAdd": [ + "hoverclosest", + "hovercompare" + ], + "showSendToCloud": false + }, + "source": "A", + "shinyEvents": [ + "plotly_hover", + "plotly_click", + "plotly_selected", + "plotly_relayout", + "plotly_brushed", + "plotly_brushing", + "plotly_clickannotation", + "plotly_doubleclick", + "plotly_deselect", + "plotly_afterplot", + "plotly_sunburstclick", + "plotly_selecting" + ], + "highlight": { + "on": "plotly_click", + "persistent": false, + "dynamic": false, + "selectize": false, + "opacityDim": 0.20000000000000001, + "selected": { + "opacity": 1 + }, + "debounce": 0 + }, + "base_url": "https://plot.ly" + }, + "evals": [ + + ], + "jsHooks": [ + + ], + "deps": [ + { + "name": "setprototypeof", + "version": "0.1", + "src": { + "href": "setprototypeof-0.1" + }, + "meta": null, + "script": "setprototypeof.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": false + }, + { + "name": "typedarray", + "version": "0.1", + "src": { + "href": "typedarray-0.1" + }, + "meta": null, + "script": "typedarray.min.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": false + }, + { + "name": "jquery", + "version": "3.5.1", + "src": { + "href": "jquery-3.5.1" + }, + "meta": null, + "script": "jquery.min.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": true + }, + { + "name": "crosstalk", + "version": "1.2.2", + "src": { + "href": "crosstalk-1.2.2" + }, + "meta": null, + "script": "js/crosstalk.min.js", + "stylesheet": "css/crosstalk.min.css", + "head": null, + "attachment": null, + "all_files": true + }, + { + "name": "plotly-htmlwidgets-css", + "version": "2.25.2", + "src": { + "href": "plotly-htmlwidgets-css-2.25.2" + }, + "meta": null, + "script": null, + "stylesheet": "plotly-htmlwidgets.css", + "head": null, + "attachment": null, + "all_files": false + }, + { + "name": "plotly-main", + "version": "2.25.2", + "src": { + "href": "plotly-main-2.25.2" + }, + "meta": null, + "script": "plotly-latest.min.js", + "stylesheet": null, + "head": null, + "attachment": null, + "all_files": false + } + ] + }, + "selected": "[1] \"Brushed points appear here (double-click to clear)\"", + "selecting": "[1] \"Brush points appear here (double-click to clear)\"" + }, + "export": { + + } +} diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004_.png b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004_.png new file mode 100644 index 0000000000..e119bcdcc7 Binary files /dev/null and b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004_.png differ diff --git a/inst/examples/shiny/event_data/tests/testthat/setup-shinytest2.R b/inst/examples/shiny/event_data/tests/testthat/setup-shinytest2.R new file mode 100644 index 0000000000..be65b4f035 --- /dev/null +++ b/inst/examples/shiny/event_data/tests/testthat/setup-shinytest2.R @@ -0,0 +1,2 @@ +# Load application support files into testing environment +shinytest2::load_app_env() diff --git a/inst/examples/shiny/event_data/tests/testthat/test-shinytest2.R b/inst/examples/shiny/event_data/tests/testthat/test-shinytest2.R new file mode 100644 index 0000000000..080ff2e021 --- /dev/null +++ b/inst/examples/shiny/event_data/tests/testthat/test-shinytest2.R @@ -0,0 +1,45 @@ +library(shinytest2) +app <- AppDriver$new( + "../../", view = interactive(), + options = list(display.mode = "normal") +) + +# Scrub width/height from plotly_relayout-A since it varies by environment +scrub_relayout <- function(json) { + gsub( + '"plotly_relayout-A": "\\{[^}]*\\}"', + '"plotly_relayout-A": ""', + json + ) +} + +test_that("Plotly input values in Shiny", { + app$expect_values(transform = scrub_relayout) + app$set_inputs(`plotly_hover-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_click-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_hover-A` = character(0), allow_no_input_binding_ = TRUE) + Sys.sleep(1) + app$expect_values(transform = scrub_relayout) + app$set_inputs(`plotly_brushing-A` = "{\"x\":[25.726819184123485,25.98332414553473],\"y\":[1.3174499999999998,5.61955]}", allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_selecting-A` = "[]", allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_brushing-A` = "{\"x\":[24.64379823594267,25.98332414553473],\"y\":[3.2093373493975905,3.5073743975903615]}", allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_brushing-A` = "{\"x\":[24.045286659316428,25.98332414553473],\"y\":[3.040881626506024,3.5073743975903615]}", allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_selecting-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_brushing-A` = "{\"x\":[23.95978500551268,25.98332414553473],\"y\":[3.0020072289156627,3.5073743975903615]}", allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_selected-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_brushed-A` = "{\"x\":[23.95978500551268,25.98332414553473],\"y\":[3.0020072289156627,3.5073743975903615]}", allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_hover-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_hover-A` = character(0), allow_no_input_binding_ = TRUE) + Sys.sleep(1) + app$expect_values(transform = scrub_relayout) + app$set_inputs(`plotly_selected-A` = character(0), allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_brushed-A` = character(0), allow_no_input_binding_ = TRUE) + #app$set_inputs(`plotly_selected-A` = character(0), allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_selecting-A` = character(0), allow_no_input_binding_ = TRUE) + #app$set_inputs(`plotly_brushed-A` = character(0), allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_brushing-A` = character(0), allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_click-A` = character(0), allow_no_input_binding_ = TRUE) + app$set_inputs(`plotly_deselect-A` = "\"plot\"", allow_no_input_binding_ = TRUE) + Sys.sleep(1) + app$expect_values(transform = scrub_relayout) +}) diff --git a/inst/examples/shiny/event_data_3D/app.R b/inst/examples/shiny/event_data_3D/app.R new file mode 100644 index 0000000000..31e2cde3c8 --- /dev/null +++ b/inst/examples/shiny/event_data_3D/app.R @@ -0,0 +1,48 @@ +library(plotly) +library(shiny) + +ui <- fluidPage( + plotlyOutput("plot"), + verbatimTextOutput("hover"), + verbatimTextOutput("click"), + verbatimTextOutput("legendclick"), + verbatimTextOutput("legend2click"), + verbatimTextOutput("relayout") +) + +server <- function(input, output, session) { + + output$plot <- renderPlotly({ + plot_ly(mtcars, x = ~wt, y = ~mpg, z = ~disp, color = ~factor(cyl)) %>% + event_register("plotly_legendclick") %>% + event_register("plotly_legenddoubleclick") + }) + + output$hover <- renderPrint({ + d <- event_data("plotly_hover") + if (is.null(d)) "Hover events appear here" else d + }) + + output$click <- renderPrint({ + d <- event_data("plotly_click") + if (is.null(d)) "Click events appear here" else d + }) + + output$legendclick <- renderPrint({ + d <- event_data("plotly_legendclick")$name + if (is.null(d)) "Legend click" else d + }) + + output$legend2click <- renderPrint({ + d <- event_data("plotly_legenddoubleclick")$name + if (is.null(d)) "Legend double-click" else d + }) + + output$relayout <- renderPrint({ + d <- event_data("plotly_relayout")$scene.camera$eye + if (is.null(d)) "Camera eye info" else d + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/event_data_annotation/app.R b/inst/examples/shiny/event_data_annotation/app.R new file mode 100644 index 0000000000..b2e1fedb09 --- /dev/null +++ b/inst/examples/shiny/event_data_annotation/app.R @@ -0,0 +1,27 @@ +library(shiny) +library(plotly) + +ui <- fluidPage( + plotlyOutput("p"), + checkboxInput("edit", "Enable edit mode? Capturing annotation click events in edit mode is not possible.", FALSE), + verbatimTextOutput("data") +) + +server <- function(input, output, session) { + + output$p <- renderPlotly({ + plot_ly(mtcars) %>% + add_annotations(x = ~wt, y = ~mpg, text = row.names(mtcars), captureevents = TRUE) + }) + + observeEvent(input$edit, { + plotlyProxy("p", session) %>% + plotlyProxyInvoke("reconfig", editable = input$edit) + }) + + output$data <- renderPrint({ + event_data("plotly_clickannotation") + }) +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/event_data_click/DESCRIPTION b/inst/examples/shiny/event_data_click/DESCRIPTION new file mode 100644 index 0000000000..bdc8950141 --- /dev/null +++ b/inst/examples/shiny/event_data_click/DESCRIPTION @@ -0,0 +1,8 @@ +Title: Passing plotly selections to shiny via crosstalk +Author: Plotly, Inc. +AuthorUrl: https://plotly.com/r/ +License: MIT +DisplayMode: Showcase +Tags: plotly, crosstalk, shiny +Type: Shiny + diff --git a/inst/examples/shiny/event_data_click/app.R b/inst/examples/shiny/event_data_click/app.R new file mode 100644 index 0000000000..cb0f5a4951 --- /dev/null +++ b/inst/examples/shiny/event_data_click/app.R @@ -0,0 +1,62 @@ +library(plotly) +library(shiny) + +# cache computation of a correlation matrix +correlation <- round(cor(mtcars), 3) + +ui <- fluidPage( + mainPanel( + plotlyOutput("heat"), + plotlyOutput("scatterplot") + ), + verbatimTextOutput("selection") +) + +server <- function(input, output, session) { + + output$heat <- renderPlotly({ + plot_ly(source = "heatmap") %>% + add_heatmap( + x = names(mtcars), + y = names(mtcars), + z = correlation + ) %>% + layout( + xaxis = list(title = ""), + yaxis = list(title = "") + ) + }) + + output$selection <- renderPrint({ + s <- event_data("plotly_click", source = "heatmap") + if (length(s) == 0) { + "Click on a cell in the heatmap to display a scatterplot" + } else { + cat("You selected: \n\n") + as.list(s) + } + }) + + output$scatterplot <- renderPlotly({ + clickData <- event_data("plotly_click", source = "heatmap") + if (is.null(clickData)) return(NULL) + + # get the clicked x/y variables and fit model to those 2 vars + vars <- c(clickData[["x"]], clickData[["y"]]) + d <- setNames(mtcars[vars], c("x", "y")) + yhat <- fitted(lm(y ~ x, data = d)) + + # scatterplot with fitted line + plot_ly(d, x = ~x) %>% + add_markers(y = ~y) %>% + add_lines(y = ~yhat) %>% + layout( + xaxis = list(title = clickData[["x"]]), + yaxis = list(title = clickData[["y"]]), + showlegend = FALSE + ) + }) + +} + +shinyApp(ui, server, options = list(display.mode = "showcase")) diff --git a/inst/examples/shiny/event_data_click_map/app.R b/inst/examples/shiny/event_data_click_map/app.R new file mode 100644 index 0000000000..3cd87c30fc --- /dev/null +++ b/inst/examples/shiny/event_data_click_map/app.R @@ -0,0 +1,30 @@ +library(shiny) +library(plotly) + +ui <- fluidPage( + plotlyOutput("plot"), + verbatimTextOutput("click") +) + +server <- function(input, output, session) { + + output$plot <- renderPlotly({ + # specify some map projection/options + g <- list( + scope = 'usa', + projection = list(type = 'albers usa'), + lakecolor = toRGB('white') + ) + plot_ly(z = state.area, text = state.name, locations = state.abb, + type = 'choropleth', locationmode = 'USA-states') %>% + layout(geo = g) + }) + + output$click <- renderPrint({ + d <- event_data("plotly_click") + if (is.null(d)) "Click on a state to view event data" else d + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/event_data_legends/app.R b/inst/examples/shiny/event_data_legends/app.R new file mode 100644 index 0000000000..3ce4281f5f --- /dev/null +++ b/inst/examples/shiny/event_data_legends/app.R @@ -0,0 +1,29 @@ +library(shiny) + +ui <- fluidPage( + plotlyOutput("gg"), + verbatimTextOutput("click"), + verbatimTextOutput("doubleclick") +) + +server <- function(input, output, session) { + + output$gg <- renderPlotly({ + p <- ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) + + geom_point() + + facet_wrap(~vs) + ggplotly(p) %>% + event_register("plotly_legendclick") %>% + event_register("plotly_legenddoubleclick") + }) + + output$click <- renderPrint({ + event_data("plotly_legendclick") + }) + + output$doubleclick <- renderPrint({ + event_data("plotly_legenddoubleclick") + }) +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/event_data_modules/app.R b/inst/examples/shiny/event_data_modules/app.R new file mode 100644 index 0000000000..e96a82c51a --- /dev/null +++ b/inst/examples/shiny/event_data_modules/app.R @@ -0,0 +1,48 @@ +library(shiny) +library(plotly) + +reusableUI <- function(id = NULL) { + ns <- NS(id) + + fluidRow( + column(4, plotlyOutput(ns("p1"))), + column(4, plotlyOutput(ns("p2"))), + column(4, verbatimTextOutput(ns("ev1"))), + column(4, verbatimTextOutput(ns("ev2"))) + ) +} + +viz <- function(input, output, session, src) { + + # if you want, you can distinguish between events *within* a module + src2 <- paste0(src, "2") + + output$p1 <- renderPlotly({ + plot_ly(mtcars, x = ~mpg, y = ~disp, + key = row.names(mtcars), source = src) + }) + output$p2 <- renderPlotly({ + plot_ly(mtcars, x = ~mpg, y = ~disp, + key = row.names(mtcars), source = src2) + }) + output$ev1 <- renderPrint({ + event_data("plotly_hover", source = src) + }) + output$ev2 <- renderPrint({ + event_data("plotly_hover", source = src2) + }) + +} + +ui <- fluidPage( + reusableUI("one"), + reusableUI("two") +) + +server <- function(input, output, session) { + # use the src argument to namespace plotly events + callModule(viz, "one", src = "A") + callModule(viz, "two", src = "B") +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/event_data_parcoords/app.R b/inst/examples/shiny/event_data_parcoords/app.R new file mode 100644 index 0000000000..39eb0fab44 --- /dev/null +++ b/inst/examples/shiny/event_data_parcoords/app.R @@ -0,0 +1,72 @@ +library(plotly) +library(shiny) + +ui <- fluidPage( + plotlyOutput("parcoords"), + verbatimTextOutput("data") +) + +server <- function(input, output, session) { + + iris_numeric <- dplyr::select_if(iris, is.numeric) + + output$parcoords <- renderPlotly({ + dims <- Map(function(x, y) { + list(values = x, range = range(x), label = y) + }, iris_numeric, names(iris_numeric), USE.NAMES = FALSE) + plot_ly(type = 'parcoords', dimensions = dims, source = "pcoords") %>% + layout(margin = list(r = 30)) %>% + event_register("plotly_restyle") + }) + + # maintain a collection of selection ranges + # since each parcoord dimension is allowed to have multiple + # selected ranges, this reactive values data structure is + # allowed + # list( + # var1 = list(c(min1, max1), c(min2, max2), ...), + # var2 = list(c(min1, max1)), + # ... + # ) + ranges <- reactiveValues() + observeEvent(event_data("plotly_restyle", source = "pcoords"), { + d <- event_data("plotly_restyle", source = "pcoords") + # what is the relevant dimension (i.e. variable)? + dimension <- as.numeric(stringr::str_extract(names(d[[1]]), "[0-9]+")) + # If the restyle isn't related to a dimension, exit early. + if (!length(dimension)) return() + # careful of the indexing in JS (0) versus R (1)! + dimension_name <- names(iris_numeric)[[dimension + 1]] + # a given dimension can have multiple selected ranges + # these will come in as 3D arrays, but a list of vectors + # is nicer to work with + info <- d[[1]][[1]] + + ranges[[dimension_name]] <- if (length(dim(info)) == 3) { + lapply(seq_len(dim(info)[2]), function(i) info[,i,]) + } else { + list(as.numeric(info)) + } + }) + + ## filter the dataset down to the rows that match the selection ranges + iris_selected <- reactive({ + keep <- TRUE + for (i in names(ranges)) { + range_ <- ranges[[i]] + keep_var <- FALSE + for (j in seq_along(range_)) { + rng <- range_[[j]] + keep_var <- keep_var | dplyr::between(iris[[i]], min(rng), max(rng)) + } + keep <- keep & keep_var + } + iris[keep, ] + }) + + output$data <- renderPrint({ + tibble::as_tibble(iris_selected()) + }) +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/event_data_persist/app.R b/inst/examples/shiny/event_data_persist/app.R new file mode 100644 index 0000000000..043b0cbbe4 --- /dev/null +++ b/inst/examples/shiny/event_data_persist/app.R @@ -0,0 +1,47 @@ +library(shiny) +library(plotly) + +ui <- fluidPage( + plotlyOutput("p"), + tableOutput("table") +) + +server <- function(input, output, session) { + + # keep track of which cars have been hovered on + cars <- reactiveVal() + + # On hover, the key field of the event data contains the car name + # Add that name to the set of all "selected" cars + observeEvent(event_data("plotly_hover"), { + car <- event_data("plotly_hover")$customdata + cars_old_new <- c(cars(), car) + cars(unique(cars_old_new)) + }) + + # clear the set of cars when a double-click occurs + observeEvent(event_data("plotly_doubleclick"), { + cars(NULL) + }) + + output$p <- renderPlotly({ + + # if the car is selected, paint it red + cols <- ifelse(row.names(mtcars) %in% cars(), "red", "black") + + mtcars %>% + plot_ly( + x = ~wt, y = ~mpg, + customdata = row.names(mtcars), + marker = list(color = cols) + ) %>% + add_markers() + }) + + output$table <- renderTable({ + filter(mtcars, row.names(mtcars) %in% cars()) + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/event_data_select/app.R b/inst/examples/shiny/event_data_select/app.R new file mode 100644 index 0000000000..aaf8c32451 --- /dev/null +++ b/inst/examples/shiny/event_data_select/app.R @@ -0,0 +1,82 @@ +library(plotly) +library(shiny) + +# user interface +ui <- fluidPage( + titlePanel("Linked highlighting with plotly and shiny"), + mainPanel( + htmltools::div(style = "display:inline-block", plotlyOutput("x", width = 400, height = 250)), + wellPanel( + style = "display:inline-block; vertical-align:top;", + sliderInput("xbins", "Number of x bins", + min = 1, max = 50, value = 20, width = 250), + sliderInput("ybins", "Number of y bins", + min = 1, max = 50, value = 20, width = 250) + ), + br(), + htmltools::div(style = "display:inline-block", plotlyOutput("xy", width = 400, height = 400)), + htmltools::div(style = "display:inline-block", plotlyOutput("y", width = 250, height = 400)) + ) +) + +# marker objects +m <- list(color = toRGB("black")) +m2 <- list(color = toRGB("black", 0.2)) + +server <- function(input, output, session) { + + # convenience function for computing xbin/ybin object given a number of bins + compute_bins <- function(x, n) { + list( + start = min(x), + end = max(x), + size = (max(x) - min(x)) / n + ) + } + + # the 'x' histogram + output$x <- renderPlotly({ + x <- cars$speed + xbins <- compute_bins(x, input$xbins) + p <- plot_ly(x = x, type = "histogram", autobinx = F, + xbins = xbins, marker = m2) + # obtain plotlyjs selection + s <- event_data("plotly_selected") + # if points are selected, subset the data, and highlight + if (length(s$x) > 0) { + p <- add_trace(p, x = s$x, type = "histogram", autobinx = F, + xbins = xbins, marker = m) + } + p %>% + config(displayModeBar = F, showLink = F) %>% + layout(showlegend = F, barmode = "overlay", yaxis = list(title = "count"), + xaxis = list(title = "", showticklabels = F)) + }) + + # basically the same as 'x' histogram + output$y <- renderPlotly({ + y <- cars$dist + ybins <- compute_bins(y, input$ybins) + p <- plot_ly(y = y, type = "histogram", autobiny = F, + ybins = ybins, marker = m2) + s <- event_data("plotly_selected") + if (length(s$y) > 0) { + p <- add_trace(p, y = s$y, type = "histogram", autobiny = F, + ybins = ybins, marker = m) + } + p %>% + config(displayModeBar = F, showLink = F) %>% + layout(showlegend = F, barmode = "overlay", xaxis = list(title = "count"), + yaxis = list(title = "", showticklabels = F)) + }) + + output$xy <- renderPlotly({ + cars %>% + plot_ly(x = ~speed, y = ~dist, + mode = "markers", marker = m) %>% + layout(dragmode = "select") + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/event_priority/app.R b/inst/examples/shiny/event_priority/app.R new file mode 100644 index 0000000000..0ff5d11fb7 --- /dev/null +++ b/inst/examples/shiny/event_priority/app.R @@ -0,0 +1,29 @@ +library(shiny) +library(plotly) + +ui <- fluidPage( + plotlyOutput("p"), + textOutput("time1"), + textOutput("time2") +) + +server <- function(input, output, session) { + + output$p <- renderPlotly({ + plot_ly(x = 1, y = 1, marker = list(size = 100)) %>% + add_trace(text = "Click me", mode = "markers+text") + }) + + output$time1 <- renderText({ + event_data("plotly_click") + paste("Input priority: ", Sys.time()) + }) + + output$time2 <- renderText({ + event_data("plotly_click", priority = "event") + paste("Event priority: ", Sys.time()) + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/ggplotly_sizing/app.R b/inst/examples/shiny/ggplotly_sizing/app.R new file mode 100644 index 0000000000..c32a024b43 --- /dev/null +++ b/inst/examples/shiny/ggplotly_sizing/app.R @@ -0,0 +1,24 @@ +library(shiny) +library(plotly) + +ui <- fluidPage( + plotlyOutput("pid") +) + +server <- function(input, output, session, ...) { + + # to relay the height/width of the plot's container, we'll query this + # session's client data http://shiny.rstudio.com/articles/client-data.html + cdata <- session$clientData + + output$pid <- renderPlotly({ + p <- ggplot(iris) + + geom_point(aes(Sepal.Length, Sepal.Width)) + + facet_wrap(~Species) + + ggplotly(p, width = cdata$output_pid_width, height = cdata$output_pid_height) + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/lmGadget/app.R b/inst/examples/shiny/lmGadget/app.R new file mode 100644 index 0000000000..c82ab895cb --- /dev/null +++ b/inst/examples/shiny/lmGadget/app.R @@ -0,0 +1,89 @@ + +# Many thanks to RStudio for shiny gadgets +# And special thanks to Winston Chang for the inspiration +# https://gist.github.com/wch/c4b857d73493e6550cba +library(shiny) +library(miniUI) +library(plotly) + +#' Shiny gadget for interactive linear model fitting +#' +#' Click on points to add/remove them from consideration +#' +#' @param dat a data.frame +#' @param x a formula specifying the x variable +#' @param y a formula specifying the y variable +#' @param key a vector specifying unique attributes for each row + +lm_app <- function(dat, x, y, key = row.names(dat)) { + + ui <- miniPage( + gadgetTitleBar("Interactive lm"), + miniContentPanel( + fillRow( + flex = c(NA, 1), + fillCol( + width = "100px", + selectInput("degree", "Polynomial degree", c(1, 2, 3, 4)) + ), + plotlyOutput("plot1", height = "100%") + ) + ) + ) + + server <- function(input, output, session) { + + # mechanism for managing selected points + keys <- reactiveVal() + + observeEvent(event_data("plotly_click"), { + key_new <- event_data("plotly_click")$key + key_old <- keys() + + if (key_new %in% key_old) { + keys(setdiff(key_old, key_new)) + } else { + keys(c(key_new, key_old)) + } + }) + + output$plot1 <- renderPlotly({ + req(input$degree) + is_outlier <- key %in% keys() + modelDat <- dat[!is_outlier, ] + formula <- substitute( + y ~ poly(x, degree = degree), + list( + y = y[[2]], + x = x[[2]], + degree = input$degree + ) + ) + m <- lm(formula, modelDat) + modelDat$yhat <- as.numeric(fitted(m)) + + cols <- ifelse(is_outlier, "gray90", "black") + + dat %>% + plot_ly(x = ~wt, y = ~mpg) %>% + add_markers(key = row.names(mtcars), color = I(cols), marker = list(size = 10)) %>% + add_lines(y = ~yhat, data = modelDat) %>% + layout(showlegend = FALSE) + }) + + # Return the most recent fitted model, when we press "done" + observeEvent(input$done, { + modelDat <- dat[!key %in% keys(), ] + formula <- as.formula( + sprintf("%s ~ poly(%s, degree = %s)", as.character(y)[2], as.character(x)[2], input$degree) + ) + m <- lm(formula, modelDat) + print(summary(m)) + stopApp(m) + }) + } + + shinyApp(ui, server) +} + +lm_app(mtcars, x = ~wt, y = ~mpg) diff --git a/inst/examples/shiny/proxy_mapbox/app.R b/inst/examples/shiny/proxy_mapbox/app.R new file mode 100644 index 0000000000..b707c74d6e --- /dev/null +++ b/inst/examples/shiny/proxy_mapbox/app.R @@ -0,0 +1,28 @@ +library(shiny) +library(plotly) + +# get all the available mapbox styles +mapStyles <- schema()$layout$layoutAttributes$mapbox$style$values + +ui <- fluidPage( + selectInput("style", "Select a mapbox style", mapStyles), + plotlyOutput("map") +) + +server <- function(input, output, session) { + + output$map <- renderPlotly({ + plot_mapbox() + }) + + observeEvent(input$style, { + plotlyProxy("map", session) %>% + plotlyProxyInvoke( + "relayout", + list(mapbox = list(style = input$style)) + ) + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/proxy_relayout/app.R b/inst/examples/shiny/proxy_relayout/app.R new file mode 100644 index 0000000000..8f4da760fd --- /dev/null +++ b/inst/examples/shiny/proxy_relayout/app.R @@ -0,0 +1,45 @@ +library(shiny) +library(plotly) + +ui <- fluidPage( + plotlyOutput("plot") +) + +server <- function(input, output, session) { + + p <- ggplot(txhousing) + + geom_line(aes(date, median, group = city)) + + output$plot <- renderPlotly({ + ggplotly(p, dynamicTicks = TRUE) %>% + rangeslider() + }) + + observeEvent(event_data("plotly_relayout"), { + d <- event_data("plotly_relayout") + # unfortunately, the data structure emitted is different depending on + # whether the relayout is triggered from the rangeslider or the plot + xmin <- if (length(d[["xaxis.range[0]"]])) d[["xaxis.range[0]"]] else d[["xaxis.range"]][1] + xmax <- if (length(d[["xaxis.range[1]"]])) d[["xaxis.range[1]"]] else d[["xaxis.range"]][2] + if (is.null(xmin) || is.null(xmax)) return(NULL) + + # compute the y-range based on the new x-range + idx <- with(txhousing, xmin <= date & date <= xmax) + yrng <- extendrange(txhousing$median[idx]) + + plotlyProxy("plot", session) %>% + plotlyProxyInvoke("relayout", list(yaxis = list(range = yrng))) + }) + + yRange <- range(txhousing$median, na.rm = TRUE) + observeEvent(event_data("plotly_doubleclick"), { + + plotlyProxy("plot", session) %>% + plotlyProxyInvoke("relayout", list(yaxis = list(range = yRange))) + + }) + + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/proxy_restyle_canada/app.R b/inst/examples/shiny/proxy_restyle_canada/app.R new file mode 100644 index 0000000000..41d00edea4 --- /dev/null +++ b/inst/examples/shiny/proxy_restyle_canada/app.R @@ -0,0 +1,36 @@ +library(shiny) +library(plotly) + +ui <- fluidPage( + selectInput("color", "Canada's fillcolor", colors(), selected = "black"), + plotlyOutput("map") +) + +server <- function(input, output, session) { + + output$map <- renderPlotly({ + + map_data("world", "canada") %>% + group_by(group) %>% + plot_mapbox(x = ~long, y = ~lat, color = I("black")) %>% + add_polygons() %>% + layout( + mapbox = list( + center = list(lat = ~median(lat), lon = ~median(long)) + ) + ) + + }) + + observeEvent(input$color, { + + plotlyProxy("map", session) %>% + plotlyProxyInvoke( + "restyle", list(fillcolor = toRGB(input$color)) + ) + + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/proxy_restyle_economics/app.R b/inst/examples/shiny/proxy_restyle_economics/app.R new file mode 100644 index 0000000000..717aaefd86 --- /dev/null +++ b/inst/examples/shiny/proxy_restyle_economics/app.R @@ -0,0 +1,39 @@ +library(shiny) +library(plotly) + +ui <- fluidPage( + sliderInput("marker", "Marker size", min = 0, max = 20, value = 8), + sliderInput("path", "Path size", min = 0, max = 30, value = 2), + plotlyOutput("p") +) + +server <- function(input, output, session) { + + output$p <- renderPlotly({ + plot_ly( + economics, x = ~pce, y = ~psavert, z = ~unemploy, + color = ~as.numeric(date), mode = "markers+lines" + ) + }) + + observeEvent(input$marker, { + plotlyProxy("p", session) %>% + plotlyProxyInvoke( + "restyle", + # could also do list(marker = list(size = input$marker)) + # but that overwrites the existing marker definition + # https://github.com/plotly/plotly.js/issues/1866#issuecomment-314115744 + list(marker.size = input$marker) + ) + }) + + observeEvent(input$path, { + plotlyProxy("p", session) %>% + plotlyProxyInvoke( + "restyle", list(line.width = input$path) + ) + }) + +} + +shinyApp(ui, server) diff --git a/inst/examples/shiny/stream/app.R b/inst/examples/shiny/stream/app.R new file mode 100644 index 0000000000..342a3a6f41 --- /dev/null +++ b/inst/examples/shiny/stream/app.R @@ -0,0 +1,60 @@ +library(shiny) +library(plotly) + +ui <- fluidPage( + actionButton("stream", "Turn stream on/off"), + plotlyOutput("plot") +) + +server <- function(input, output, session) { + + # initial values + yint <- c(0, 1) + + # initiate graph with initial values + output$plot <- renderPlotly({ + plot_ly(y = yint, x = seq_along(yint)) %>% + add_lines() + }) + + # reactiveValues() act very much like input values, but may be used to + # maintain state (e.g., are we currently streaming?) + rv <- reactiveValues( + stream = FALSE, + yend = sum(yint), + n = length(yint) + ) + + # turn streaming on/off when the button is pressed + observeEvent(input$stream, { + rv$stream <- if (rv$stream) FALSE else TRUE + }) + + observe({ + # if we're not streaming, don't do anything + if (!rv$stream) return() + + # re-execute this code block to every 100 milliseconds + invalidateLater(100, session) + # changing a reactive value "invalidates" it, so isolate() is needed + # to avoid recursion + isolate({ + rv$n <- rv$n + 1 + rv$yend <- rv$yend + sample(c(-1, 1), 1) + }) + + # add the new value to the plot + plotlyProxy("plot", session) %>% + plotlyProxyInvoke( + "extendTraces", + list( + y = list(list(rv$yend)), + x = list(list(rv$n)) + ), + list(0) + ) + }) + +} + +shinyApp(ui, server) diff --git a/inst/htmlwidgets/lib/colourpicker/LICENSE b/inst/htmlwidgets/lib/colourpicker/LICENSE new file mode 100644 index 0000000000..81760b1049 --- /dev/null +++ b/inst/htmlwidgets/lib/colourpicker/LICENSE @@ -0,0 +1,7 @@ +Copyright 2016 Dean Attali + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/inst/htmlwidgets/lib/colourpicker/colourpicker.min.css b/inst/htmlwidgets/lib/colourpicker/colourpicker.min.css new file mode 100644 index 0000000000..6275b1066f --- /dev/null +++ b/inst/htmlwidgets/lib/colourpicker/colourpicker.min.css @@ -0,0 +1 @@ +.colourpicker{position:relative}.cp-clearfix:after{content:"";display:table;clear:both}.colourpicker.input-group .colourpicker-input{float:none}.colourpicker.input-group.istransparent .colourpicker-input{color:transparent!important;background-color:#DDD!important}.colourpicker .colourpicker-input[disabled]{background-color:#EEE!important}.colourpicker .colourpicker-input[readonly]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.colourpicker-panel{position:absolute;background:#fff;border:1px solid #CCC;box-shadow:0 0 20px rgba(0,0,0,.2);z-index:99999;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;display:none;left:0;top:auto}.palette-square .colourpicker-panel{width:173px;height:152px}.palette-limited .colourpicker-panel{width:181px;height:auto;padding:5px;background-color:#F8F8F8}.colourpicker .cp-list-row{margin-top:3px}.colourpicker .cp-list-row:first-child{margin-top:0}.colourpicker .cp-list-col{width:20px;height:20px;float:left;margin-left:3px;border:1px solid #DDD;cursor:pointer}.colourpicker .cp-list-col:hover{border-color:#444}.colourpicker .cp-list-col:first-child{margin-left:0}.colourpicker .cp-list-col.selected-col.light{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.colourpicker .cp-list-col.selected-col.dark{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=)}.colourpicker .colourpicker-grid{position:absolute;top:1px;left:1px;width:150px;height:150px;cursor:crosshair;background:linear-gradient(to right,#FFF,rgba(255,255,255,0))}.colourpicker .colourpicker-grid-inner{width:100%;height:100%;background:linear-gradient(rgba(0,0,0,0),#000)}.colourpicker-grid .colourpicker-picker{position:absolute;top:70px;left:70px;width:8px;height:8px;margin-top:-4px;margin-left:-4px}.colourpicker-grid .colourpicker-picker>div{position:absolute;top:0;left:0;width:8px;height:8px;border-radius:8px;border:1px solid #fff;background-color:#111;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.colourpicker-slider{position:absolute;top:1px;left:152px;width:20px;height:150px;background:linear-gradient(red 0,#f0f 17%,#00f 33%,#0ff 50%,#0f0 67%,#ff0 83%,red 100%);cursor:row-resize}.colourpicker-slider-picker{position:absolute;top:0;left:0;width:18px;height:2px;background:#fff;border:1px solid #000;margin-top:-2px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.colourpicker-istransparent,.colourpicker-transparent-text{vertical-align:middle}@media screen\0{.colourpicker-sprite{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAACWCAYAAABOzhNUAAA2XUlEQVR42u19C9AtVXXm7r5XlNGhMI7RYfAFIQQkMAZlCIYQR2NhjI8iPsZIOUjFV3yUgzpGyhBGpShLR7QsS6yoEY1FQRgph8IYKQZiJIyGOBLEGAV5FQEul7dw/3vv+U9P7z69+l/97W+tvfv8/3+9Vnlu3frP6dPdp0+fr7/1rW+tvbtaXV1twtpjbvyPjxm8Zu8HY1tzv03TzDPb6OczZ3/BOe6QW1cdR+48xL+r3ueT7+R+Pnx2cp69c9S/5+1veN3+nalzju91y+bz+Uyex7/xIX/jo8VL995sNpvH/7t27Zrv2LFj/tBDD83vvvtu2W/4g1e9amcdNuYRd1rt3r27yQCgCGx1XQ/rxUfptiXLGYj6zxv+Lz7SB7z8UKXHwUCgQFoETALCHMCs7z66sB0wjt7Tr+W5BqIG4/DjyclU4Iz/IzBbvHTvRYDu3LmzA+lPf/rT+b777jvfvn37/JZbbukO6M/OPHNH2MBH1X5gMVDjIwKEXJGjH6Gqqix76X0I6DxWw5MvzzVg8UeFiyauOyPgnePFBRdB6FlEH+/AqPo9PBb5weNyWU9f0Gr7Ydv4WtbpL6xueQuSsGXLlg4s8W+7XveaADTIOvL9Irh6MplpgGqm1AwqxxSfx33JORCgtsDsji2CNL738MMPzx944IGOUW+++eZu2V984QsbC9SVlZUioDIQTA39mZAYJsqD4cJ3gN6FMg0EgyWznwfbrVphGfcPr2eEFem6yJz4Hl7sehljTc2YGqDxuQZmfC4nNgIzvo7glP9xeWTSFjfzRx55pHsdw34E6rZt2+a33XZbt+x/X3LJwxsK1PbDTKA6P2oWqAY7Tgmx7PNM0BrAweMyNbEBuLnFwBGs7OLVy6woYL2HYRpBqJdbYIz/hWkjC2tgbt26tfvbAi7o1xGMbWQdgBq3b8EYBKSiReP/+F7LoCECNV78LUhDDP33339/x6hxnXhMF/7VZQ+FsDsDv0fB693melX7IRZQs6DQr9twPwuK5iaAaW59trCgDt8aBBIiddh29PJwjJqN5VjiNjoE6mX4WQKQKAF0SNdhG5YHvY4FwP7zEhDKtjkm1ccvQI3Aig8BmTwErL2M6IAqII1/I1B1whSXiy5tyS3EsB8lXpQBAtS43V133dUdw9f++tYHFocouXoVxq/1sqDeq8g27bP2ilgaqPH9eLDAiIGEaNGtoWA/81J2j78LCft4/CN9rSTBAA7Qqagpg9aiGmwCVA1O1Jo9gIL+HEhkggYh6k2LSXEd+T5WcoQJkk6S5Pvov8KkOnnSCZQkUfG9Bx98sNvHPffcEwHbnfArrpzd154hyN3lUcPrkHmvDlWrLRqSjRaFYiNkh1Bu+4R1WC9eWLYyfSs8h5y1Y2Tdq1YmbmlMxoYCfhbW43sRMBjau0DZJ0n6wpP9SQjWOlSDVV7LZwujxs/qtw9alwpIRZ/GfUaNGmVA1Khxu3vvvXfegrb7cn9/9X73pKypGbMi7NoYLNsuve+++xrl3cXwOPfCtzrRrkdpAdQAmukX6h9MW1CaDfUPrEM4Cakz9Iz1Nggi/ZniZBAGFVYNKnIkNlHcj0gP/V6UBfq79OsNwMXv1IMOt6FMKhpVHrKfnjHlnApzDqFeAzUeS3yugRrZVIAaZYAAtcVSp1nj45p/fNrdmfQoASMP+z1Q26tgAGr74W7iIycrYz8FxkIS3p3l2XCPIVSHao8ldXhU1s/IbovfXbMbhnMnI1/FMM1CdtyPBipLopB1Mcxr1tRCmxnzLNTLceiwr7P7+LwF4UyWRaAKMwtQ4y5bRu00arSlYviPoT+uE3Vqv04L1MPvHjNkY+hSC6hjpq22b99eHPrlap8gA3CbLLuyz2DHlLGBEn8X35fIYXjCc62ddUKmj0WYL7KqBiRsO7oANAB1oiUaXdbXoNTglPXidlpnR/aU7WQdYVQd9rUulWMSRu3fn8XnEvYFqALSnlU7oEZGjUCN20ewRhkgQL32n469ywbm1EcL1G3btjXo7xUy5RzkgiUVQoksYJ8tTCtA0eyrf2xkRP0akr0h9Gt9xhIdxXQDIHWipXVlXwAI2pOERC2odWm41+CU5bKeBqd+jYzag3KQIALUuL8IIAXM4TtpoMa/Euol25fXEvbjZ0Wgio8at0dWjX+/f/3v3jFOjGqlQedhnGixommtnre/wZ133tkBtT2g4JQ+S0BKWVlOqmYrDR5ZV2m7ZBv1erR9/6MFXQmywjTIhpBJfqjpjokOataIExLK5+rimDET3nodQae/a8++M50kRdCJ1tThfhbfUFq1lx4jjSpgFaD24BZzv9u8Z1Ux+We9DAiS+QtQo05tXw+M+sN/+YPbQ9hihHdrmSUP2vNwxx13ZBkVWNGygCbVsZmOtDJyBLZ+LSdXgB6BC2F3pvYx+o46cWT+JIJYhfpR0iOvIwa0BhYWVYlYyNlM+P3id1PsH/C51qbIojr0a+tJ/sf1IyAFrP3nDaEfbameTTtGjfuNQI16NWrVCNS4TUyu4uPHN5x6m+WJjh2AkNGsfei//fbbXaB61SlgzpkCQgAguBaQlg4Y7uVHxkROfhi1XYBeggAaMxjPLbYfflytsXVtX2fnPVhX0Rf1Kklgzg8AlO8lFyFm85pBSQNJ0PX6eKH2wAyYPMn+hXzj3xZssz7sC6MGBKrU+EWnxvUjUCNohVF/fMNbb/PDe1HhtAdtey5uu+22SUBFIKkfN2iWUyFqlByh+a8AGaxMH6RBIg/U/rofRq8jH4IFBe0cgHwI+rOM+joN2WJRsn1YJr3oU2RRT4dmOp0wzA9va02qG000WHujf/BoJfTH5xGwUZvG1/GvVLAkqYrrRrDGx003n36TzZgsu/cb/apbb711GUYNlhGeCe9zg3ED66ySCwB0KQ3/GowapBL6kYFzod7TpfL5OnFSQF/1avEeaPVrrU9Zh1OJBSVSgIV+DdaeTQeACpNK1q8zfzH840NAGv/HdSOrCrRuuvmDPVBrUjqd3pFa3XLLLZOAyrSlNrpLQMxAwJIptKvwPf3DIXsyawzX0wyvs3t8rWv9mNmri0ZLjVVds9c2FXmevBZmVxcXtuEFtW1ScZL3exkwA4B2FpRqfu5km4BUGLXXp7MI0ghaCfvxEev7ff9At19hVCmpxsctd5xzYwfUfXqg7urf2Kf/u8soqcb1d0EJdXf7W/zkJz9pck26FgMaMgArNBaok9DPCgBeNp4z2fGzPNYUgJJQH7A3VcsOlCFycUTMwOuRp4sZveANQ77IAGRPUrcfLiytUWV5BJ3sT4d9Aa84CFGjSiIVXwujalaNj8iqolX7UmoH1Miy8bHtkfN+HPbZogDah/td8lw9Ykv0AGD1ftcqHbdpv8ONN97YWD6mx4ReBch6Tcz8kLOIStcDt0Bn1zNM2pRkmOnXXoe8VX3K9H6uIotibZ6FfszkxS1gIBU3AV9r4Ep4F/3KNKoC52B7RXD2OnUArDCpJFXCqhGo8b8Aelt90Y/Xn0z1kqHdZXXDDTcUA5UxlNKDZqatgIV6ktlTAatGehvQm0lWjma95eFqrRrr9CqbH23HtKlmPm3Y6333+nAVCxQQ0gdQ6u/maVQv01dJ06gTSsK/6FXxWON6PWi7RcKsWgJIEhWBKSCMbCrJFAJVGPXux1z6L4OPurVnyFljPO8BuVUx7azXtFvj8/Zc/OhHP2oyYd8KneidBqciZSYp+jm2DBayaCChPkmC8D0dwrV5r49FRwGsMHmMCsy9yjJ9Vm2S99BC01IAwantP0mEIPSPnouU6IEp7KpfB5XtD68toEpFS5IqAer2/f72nztGjY7KvFlL9isFRlleO2XWiKP29FU//OEPmxJ9mnk9CrEIUhXyA4Zop54fjBa5pPKldPOQPKjPnbEsfIoWxa4tWRe3ZQwrLoAuPoB2TS4mCc06V9L+cXxtte3prB8NfuWhBpXpz5WHqo3/GN5numcgMqY0Xcf9RbAKUKVJpfdfwz37f+f6ULeM2lS2M1UpMEYAN42d9f/gBz9YD1CD1fcZX/cJUsDM2GJGaKIOGBKNBM57L+ky0raSN7QjN+yD6U6r015bVnI4zCPVckBl7aP35AJS4d5sPNGvUZeKZlVgFe90kAE9KAe92ltSw+gAAapk/vG/APXeJ3z/ug6ogsZ5H9499qQtAE080lBdf/31zYSwnwWtFfKJZvUy+MRasthVhdFER8eTLmSLtpa2odhxoAWVG6ukP0MDRF08qxDCR4zaS4DEFchl+DisWXujEqpRBsj+4/+Y5WurSkx/XUKV2r8MaZHqk0gAHf5lu3ufeON1oapjF88YhHNSPq1xEEDTL+vpN56r6667LgvU0kFqDEge0CH0U41b0uvp6Vb942MUUBUcbyRoKDTrB52rZY6wFepVVmHCPlPL2AcfOBBLauQGyIUnSZYAlWlUYVZMpkhfaqJVpZzaAfVJt1/bAVUDsrQgNepR6Uuo1157bbNOBs01cujQHLC+jkkLMq+WC1LqVPuwWgwZYwZrYJyWBVY4J+F9OEa9HQn7I6AaIB1FCAz9fb0+aB2rM30x9nuAxiEHM10+lYStB+rgAMQYL+8JUPVzAWcErXRhCVDFf41Ale6r2F0lfa33HfCv/29Bi1XaF53rRcGFLUSq733ve80SDMrC7NB2lzPkNWOSZpNAJpAIWOtnbgL2jrIqFr4HiVDSqQUd+qNkSb4HeqLMeupf79b9sJjNT2VUHI/fM+toMCKyqEgMZU1JtWqIABK+JfOXi0J0amznExaP3VKie+Ny2fb+/3DnP4ZqCwdjCbMOrLr4+arvfve7xUBdD7NCyGaZfcDGaCvRgqHOQQOOXTx6ezT4oUCQJHwIZGRJdAb0hSCSQPu+yqBYzTWYLANWZkkBaEdAFXAKY8cKlgBXkikGVPk8zapxuYT+uw+88x+2tqG/av81FmsyQ6ABB6vdYDXaU9dcc81SQJ36PMeMrNSKx2SB1EiuzEqSto+8cG+FenyOnVcEoLo5Rr7bqmFBjfSnVc/XuEVAim7VlhRjV9SowqoanNJFpTP/3roarCppVJGkKn7m7U+769tVWAB1wGd/jVaQ2cczHZfJ34FIu3Xb8xgZ9Tvf+U4JUIuYEkYJBMKGCatayZdlMTEtyhqwsSmEsaYV5qXMLh/Ztw4GdDCs6XI8y0n2KTJAm/yiPVm2r9v1NHtrF6EH56zXqV3Fqf3baVatU8VD1ayqpMBomDQCVSdVwqgRqOIaRMDG9294+l1XV03dQdWcXqKytWmjns0jo377299uJoZ3E8wl7xuD5UJmyMeIPboCG1hiUClLmkcsr5QtN6RFYjnpjB9nWVHLkucCFC0BpLs+gowwqi5iCNuZjKqap/VnJaFfJWEBvNSuwiTfT/eoCjjFU5VGlT78D/v5fgvUOvQ+atVH+RJ9Cu83VQRqe/FeffXVzcQwbobsZq2yMPfCc6bEGTzf1ClVJiHYCutMv2qLiWlT1KWsrxVLpM7zoMbaryo5oEP1qH4v6yhNqll1eJ7RqQHNfmRTSaZ0sQF1qgaq9A8gUP/hoLuvqqNGnSuNGiuqjQBw7Xkg2nQM1Pa8XXXVVZOASuyg0WQUOKcTggJLnlYmj+16gU8T6SZlMIQ5sKZsFspZooRgZOxp2VQYszWg++Nf1W6HflMPRdGAxs9RXupw7sQqmi12MpSY1fIhmYIiwEgC6DKq1qkC2r7Tf6hSxW2/efD2v6uhzIRgFF6T6ikFqoT+b33rW5MZFTNtL6tnQMTEITfQD8diMfBaSZOlQzWzYRKGvQnAtqPESJqOWSVMDTpE+6kDjALPMEGwbkrB0qgO95g4KbCO3Ac1uYRmTi0D5sisAnjxTzV4EahMp8bH3xy8/W8jow7oa5wpKASo1GZtgRp91G9+85tFGpVVk9hy0gMwH+dC5izRpi5kgGeVJg+gTp2eZe00q2fVLLSjMLyr5zMta9Ii0xqzysUjQ5aBfTU4E6Bak/A6nqpuThkBVT9HP5UlVPG7ypipiw/ZfkWnUatqKDBVznwUmlGbJihdG7P+VqNeeeWVTa5UaWXzGXcgoKeJoyjREdAD7byEhgxFSfpec6Ecl2ntp0FOMvmRfIF6/twrkTIpgKy+lgt21aUaHJDEniIaNeix/XEfurKly6nCpFLH78P9MHYfWwpFq2qdKkDtlw2f/4VD7rl8S9SoTQ/UKi1O6dAfyOseAAt76oorrpgU+nVYZ0A0tGLSsBK/kDPNehLusZzqtexpIBpj5mscQ68ujCSJAiCyZYmfqo8RJQAJ/xrIoR9zlXTyiyPQgxiBGsgUkgmL6rAvny/MGZ/rTn8d9uWv9LJqCdA3UA/P4/bn/uq9l0/t8OeGQF/rv/zyy5sJ4KRVJQMwwdK0ucYPplEhw09ADV33NCNnx8GSJGvoiOVUyBQ5YpxrUGp9i7EeGla0JbWqq1iEUbHOP9cD/yygCih1gsiyfx36da1fPktbVbL/vv4/bPPRQ++7DIFaVWtaVbefVu5EKZGc2t/2sssum8KodBlh1qT9zpraBpa7Q5QJ2ybzCbDRnnrItcqKaRsgA6uqLNWSPAEYA5l0TXzRxJLS7CyrYhIlI1kF0Go2llE/rTAqeKi6ryEZmoKWlCRselof7cXq+r+AU4Aqs6aoEa7demcedu/fRMN/IyZJa2Iy9Y1vfKPxWNRKjgizugys1mGN1MkIVAe0SfIDsoB9B3QXAmpTVlHCcM9q+Jahr9lf+5coMVCvgm+qZQCCs+6fz6AyNQKk7EdPMSRg1vaU7v7XiZgO+ypC1LPFI2BiJYz+7sPu/eu6A+qCVRtQARWMiI7vyzJZt/8FFln/17/+9WWAumzYT0YCoCeJY4UgwaH9rDCoMOj1sChghX7SnkctNOzSx2014Ei/aWKvaTVgNJ6sQjPLKIESppNj1tNe9q9HoIXe1OH7SkLFyqmW+S/7hhmru4N88zPvuzQO7mv6oSjV0sTayr7Y4f+1r32tmdLh5A3MU2ODLLsr6Ud1xuAHMjkEXjyuFsVMG7UnOwYAc5c147BqAKbMu1ULuzmgHelOZFHdtKJDvZYBVujXLgS6GJI0IWi1PaVBK0DVgBQQa5sKq1WaUU8+/L5LIlB7F4cOh9LMSTVrX5kKsf/h0ksvbQqTppBh3gA2U8LKZPqeAKVX3QiS1cqoVUlHv279q7Um1eOn9OQXMVap9WiWD2Ou3FCv3wfmHNhfD4mOxykNJegSxD5nDU4FZgbQgfFk8jXZDsM9JFKjRhlhbJEDikUDeKwjLfyyZ95/SYPdU1b/dMULAs1QKWjJ4JJLLmkyZn626cQqc6ItRapL0mASLJYWFoURr6ZbYIVz3QWFVabIhoo1kzItzqKijsn1S9HQxwVGL2rSZ9pPIVn3HVejbimY238U3vVFKa91AsVYVGtVsdXQDdAAVfJgpFF/55n3f3UYLm20oDYMmVVameqy/q9+9asJUNHzc5KUpImENW5gVUonVpkCwcCUuQvBKQwEZsIz7WpZUNY+yEQStF7POvc9lkXQAuilejWqjOkMH/1VbUlhQiXsKnOlyl/dGCP6FYGKZVUBbnwc/cz7L57HG3Co4dI4Ihp1K6v3x3NaR3l18cUXN14ClfNNLdZlJn8OSEzregP42IWkS6Be5xTo5ZDzSyG7t9yEuQYR6FIJt7WWqMagvVHUEaBB/+qqAmbS4Q/WGr43HKe+NZDuWWUlVQuowqgaqE//9Qf+VxPK7Cm/86/dS2TUr3zlK5OAmjP/SYYeSNdV8mOiXvVAyrJ7Q5cGzOD1RLysJAqhPyBANfOSzB5162gZtAwm0gCGP48iic70ewCtQpPLiEmthIrZU8iw4LHOAKTad0UHYNCo8yMe+Kt5VYfdGPrn3KqKy7YqtK7KjD5tMvXoCNSLLrqoKfFGM35psLJ4BLbFblB+pMNJEMTYRILh2LCmTDY2pI5Zw2c2ladDkXGNxpRA5jodEifdjKLdAL0cNSo0oiRZP7Ips6ugJ3ZUrcLkKj52/PoDFyzGl1T2DCnY+k+HAfTJ1IUXXugClQAuWFm8B0BMmMh6tPEFu5m0CW/1FyBbQuJDL0J8DzN5y55CXWkAk9pa+tyowsNowjbdHSXvwZCVAbAahHqYtH5PJ1JaGul1WTLlARX/dkA98sHzFy6+MQLVut1UckO/HqgXXHBBM6XaVMK6sM6oSwnAQEd/6u205ZU7Lix/kmYWb8iIxe5Um7LmZQO0LPtPXADNqDivlIzD1/IAQdx3XM0JYBPDX1tQGpzMrsJxXVqXKhkwYtWeUc8fJqDw7oVWYPh3QD3//PMnhX62Dhtf7yVdRvMJtsxRNmWAy1WfcCw9shrrLVCD6dh8BiGnTdl7bMg1WXdUFFHrj0x9va0K86vInjLbCQJVOwEA2tEyAthBFngJ1q5n//TLIayj1j9M89N3T335y19uSliTlEdpmC8BbMYxCF44n7CPuecc4CQSwJABEy7Ndvp25RpkcoNdVphgejTns2b0KUoPOdZVzPjxrzL2R+DUx66rVv2xjNoBdUUMS6rddD+/+eCX1gVUbPP70pe+1JSwpm7GMHxTGnrR3jGGqliZd9DZu8WqLNRbrXus15WF8EymH3C4di6jZ/vrl9Uyqlazpr5PlB5Z67GqWme115a1HpGgwYWtfkwW6OYUXWZFJoX5r7pjXTnhofPGN0Rb9tHPlPLFL36xCKiZKpU3KcTIkvLGXlndTnFGaKceP2f7IKHeLHmS0QQJyBCI+nPU0GdrWh6TSa1KmKVddQ6L46mgMWWVhX4NVG1fMY2KLgAM4R6AryYQDgNQf/fBv1gwas0NU+t5YrJGjdomjuedd16T80AtFtM/LE6Epv9iF5Q1FxTYTN44rSFLhzLryC9F1sQeU2R1y4LCdj82P5YD3OTiwvmmdNYvTKrBKRECx0npih+AdAArMKWeLA1vupZUwnAkrLa0dA+AjD7VB7Ty0gjULak95WX7wWqgboH6+c9/vvH8ykI9Grzafk6L6llUkNW8Ui42sDAHwAv1cjGJDtQd8wIanVQxOUJCO7WkrL/EKRgVJfRzAqSgb0Yhx6dAlLgCCnhDEzuGe5QE8J6uanV9EugGdH//8OHPLSZJK5jNrwk264aeUT/3uc8tBVSDYRkw6KRjjiMQGBvh/ZbIcQbW1eR4o6w5O2Ay6O0bJ47QYDWzJcPg1+/rY0EjH20pkBEjtsXbCWHnlGdXIXDZX31B6BupdUA99ZE/HyVTJbdCtXzUqFE/+9nPLgVUDO9YozYYNum66odZYMKCw0qS8Injo0Tv6aRPLp6+A2kIo3hh6PWs17od0Mr4Mexb1hSxqpBhR2FffyZsgxJhFOIx41fDsUejWeVcs6yfJVeiQ3FMlb6Adv9xC9SKZP2NU/Cn6/RA/cxnPtNYbImZON4QzWItPRiP/WUsSJyDpC6PyRvL4i32ZLNNEx81kEGDZkseghBKoMGSAbgcGVYDBvcD9X1cD8f2j3SxBViWaEHWX2sHQMI+sOlQBOien/bIpxfTohcY/l5S1S1rcXPuuec2mXBOM3vPxDe0plvrd0qqgc2uYo0stZwBB5R6kjUGRvRO6XASnNG6NOvHYxYWhZlckmigkyyZckfbUEgi2PanXIHRBc0SK31haM9Va1gJ+8P8AH/aArWCrH9ZeyoC9dOf/nSTaRQxWdPrTTUA7Y0uHSUUgdxdGuycwDroMwAd2EcmwWDszNjYs6wYE7ILhk245oR/Vv1i/amsTJqEfmRNJR1WiWaliRVrUEHTf2DUs1Y+lUyEupTf3yyy/k996lPFQC35S+5SgqVQd3toARyFanW7checxEulYGR6lb1m+2PgRbDltKkGKZ471Kd6uX5N/NMkuSJaFW/ps6olhKdRrb8JUM/Z8Ula689NOZnIgf6uKJ/85CebnFGfsaAm/4XZp0ejK/VruNGZy9gwCa8pCSyQs9dWqdSyzays3tKkxJPFMVkjrxWOZTQBBumBHSQBywe0VFD1/xFgS5wAxrAdUM/d8QmaTHmApct7oH7iE59oSurmHmuxcIwhHcfJe/4sGNnJD25paq9bn3mzZH7+pAxrtOaZx4BgFbBbzEuYOzH5hT1VIWB4jUN+kF0Zq6I7gBeABdjSvx1Qv7ByznCPqVybn+etVmEB1I9//OPNhASH9XoGlh1nxl2ZoViF+sHyIZOIMUYNXujPuRVs/iljSMzkMG8lTBZINcPqoSOYWGomlf0wpsTZWRRTJgmT9ApoVtbWFTawMLB2QL1wxzmLO/dtRLm/1agf+9jHihiVmfiWA5D7azSnBAz9JayJ+2PHiAxt9ZZ6n6kzfgQOgo5pWUwosQEH9SrzUZEo0JnQ50/7wB67shCvlq/qClgJmw7Vr0t3/s8u9FdOJ3/JQxj1ox/9aDOl1LkMMAnzmaBjbX45EDNNadhVNPRb3f8wdn4Ok0tYPQIM6HjbyqLkCsA12o9lTVkSQBiYhXvWqwoX7DBGCybQoHq1A+r/2fkRM/TnfFQEd7TrPvKRjzQT+kMnMaalX3PMZYT3ovANDEnXzYR+q2OqxOA3PV4ry0cZ5CVvGqDMkrIkgMOoo+PV28AdBTugakdAtoneqU7WBq/2ql0f7m7QS+8mzcfzm4wbGfXDH/7whgEV6/SWfYUVJmPMFK4/mvrfyPw97UtB6vmty4LU06zQeJJ0fzH9qrRyIj1weLeapn2UEGIpFkO/XteSBRqwTJfq45p9d9fZ3SD92gj1VSi79eRimulQnX322c2yAO0rKEX2FdgtdATB+B4UY3vKGkLCQIs2lMq8zeYSNlaLMSyeH5m6h0UPr//UY1eUCCgFBIyY8LGyKmM7zxnQhQsGWCUhRoBNgPrPu84abnleZdr53Fp/D9SzzjrLq/W75Uq5CrF7Xk0p6VpczENEYFqywCu7egkSOgRgnlNXw+gZGHmceqwV0Ys44tX1UtFHxaSJMG0CFD3NJIIOZYT2bnGuAKZbYSaXwc4aAfWmXR8cMWppAlWRBv84g8qHPvQhL/QHZyxVMYM6EiEZWclkgNhVcI9T5q96utUL/YnsKJEFzEvFkGxdaJb2RCCwSpUCO8qLObKcFfql+59ZWWBhYa0/kFlbNMMu9n377g9OGjJlFQEWFdRQfeADH2i8RGgiUM2qjZX1Oz8mAmqUWAU+ZXqwkitkK6d06jkBrka1xkqxBmgGVsuu0p8voReaqZMmFhjPH7DR3CqtMv3qyQCiVxfNLvfs/h9y4750UolgT+/H5EEE6plnntl4FacSoJZoWq/LyWhECU6nViBzVBXZUex4yB0AR72ozJ5iWTlLoLCZBnSny67szjBoVRmTXxS9x6pSJMEaJWgGsyaJ1ezh3WcMjFplOvmt8N8M7aihOuOMM5p1MChlsZx8IPc4xYYUt7TKyrFeeGcXlpXkEdCbpr5Xfcp08ntVLG/IdlLdYpGCFQNy9hTTqB4wnZ7ZhUbdufL+DatMxaEo73//+5cGaqE7YK1PR34C8PWPR5s9MGnTDRyoaa1RpuxiK9ClXgM0lalkFEQy/AR0Mx0WgxYXs7J0yMeLAypYiTa1rCoGVExe14B63+lD43SRGA12V3XsRz399NObZUM9A2quTGrpUZhTla07H7cpNmYo95ZZWpYxaylrWuuzRI6BqkSnojyCahS11Zj5X6pRLb2K7zG2XQD1X/9kwahVQd3Uau2X7qn2+N/3vvdNBiobUuIZ/obnmmT9CFQrSVsm3LNjRGZhDGQ5B15SaIT9JAFj5wjvls3GSrHfw0oOYQxVUu4FBk1u7Y5SDPRqomfXgHrTn3BGncCkAtiIt/e+973NVB1aGuo9FwDX02P+Pc3qGfAlmtQx8QO5Y3XWFfD2Z7GnBWCLUXVlihQjLCCjN1yU5bMCQAmrpkD9wX8fa9QqA8rK7lyJ3VPvec97TKCWZPeZxurcepZWpeHes7yM6pfXsW8mU6z4UAJIZvRbWb+VOCFg2U2D8aK0PGTSh0rPD9OhcNO3Sf7qAqjXvHst9Ifg326i8ctTEajvete7LKAuo0lNf9MDFWIR2JNOF+70BFhdUrQbTF8wuQYVxtrWtJZok5XoVRbe9XTxMjwEq1ce+zLAGiNUExBjL6+1HwrUlb87rQv9VW7oaYZtm74p5bTTTisGaq5LKtO7WsKkrFtK//CsFJtLnkztysDEgBWMkaMWAC0GL2FUVrxAPaoraXoZ7hemzsxl/Ukp3PBjTVbVucds5RvvXAC1Nlr8rXaqhgP1ne9859JAXUIa0OoTnExaEPCGqGAVyGPTHLC87dkQG7ashHm9ZVaIJwlbMnEH3Os1KZXib2cxaG5ZHqiXvGMBVH0DqSqjUdUdfRGo73jHO7JALag0ZZmUnXRmUVnHYjSYFNlTBODuPAJeZcmpTuUyfeqfsqIGqV4N0QcrUyyBIqE9+e5WAqXLoiUJFob/4YJZueBtHVBr4x49jWLS4b4+Fe9RjX0eb3/7212gspPMQnkGqLmqFJuJxQOcaU+VgJKF3xyoc+E9p0WnvI9essWoVgEACx/s+03Rp9b7JPtfczB2nve2BUgrI09SN5VqMn2q7deq3vrWt5pAJZ35AW+dAyALlixgLYPkhx+kAI4CNdbP2lOoKfH4S5MmjyVJ5cltT8TtSpMqB7Cjc4pVKSuxKgUv2nfMY02AunLuH3dA1cNRukMwbKjuDiqNej4f+6hvectbSoDKxjm5HqvT7R+sVj41K0pgDcX6YsiNFCBgzpVNiyVDjhFzydkUe8opm9KbcyC4DVkwJwUDs4GlBOBJf8HKOW8ehqKwKtRIh5KKlbwf5/CPTSlvetObGvaDL5kcFVlRWKFykiZrLqoSVyGbPOFFA4nh6DnTqsSpwOErSRM0JJEsERll8rie1a5o+b5WkzUyZw6EkLjVZG5YAOrZb+RA9ewpskxC/xvf+MZ1AdVomxut48gCC1zM8E88TwvojlORPO+no7SavYtZcb3P8WZwOmkyAMqkS5JMWZZXbh0M84U6VW6h2QL1jD9aG9zX+Fm/N+O0APUNb3iDCVSZ+1QOqgcg9UPZmCH9hdbu2z5kl6b1Ij9WjnHx5OM+vaSJyQdsUGZM5hUsDAcg8X4drzS5kJE5GXsS7zSwEJ4J/RS82l0I/fST+jkwrGLUd/dALaj167v1Dq5AMx4zdeqppyJQ9chIK5yb3f06bPZznOKPRdlT61LroiHFhWGckpX05Rh1qj7FCwMmG06eW6MOcJ+5cVMsm9eTE1sXIniz7JwG1o+gh0R77MuA3X3WjredErZU/L7nmO3n2gAio77+9a9vLBCV+KaYJHmyQLMVY0v5kZHJ9A0rPBbOuQKa3RFIOfeAZetekmXYTdQBYDIpZ/RjMmolU7rhRyVNowsZbS0M+TBiwpUCa0D9o1NGN0Wx+k5YwQqtqjgU5ZRTTlkvUL22OqtNcI4XDpliPdmXDseW+4AXDg5LYZ9vSQGWWDlVLN0FFWSKTCsBYyY8lkPxFOlaP0uaLKsMJQf7DZlTksv6fUY9+XXmUJQqlA2dbtbOcPW6172usYCXAWGi20R75rqn9A+ntCu7/ST9YQ2tbGni4E0WjNtYTD9BhyZ9u7o65BUwsMvKKnrohJX5wOCasNkNg9UqaHVXTZABi33sfOXJyWTTJfNO0cpU+31PPvnkSUDNMa9jEzHtOBpWYp3gYIxOZRmy0YuQdHMx5tLA8r4HA5K+SLHmzi4QtS+3b4KBhOUFrFLldK+5FhRpMZyuV1deerI7XNqbI1WDOX72vArVa1/72ixQMXlRWbupbVhoLdk3G7BGPssNYcbF4zoGeLxEBlBNy0z5kuQNAaJ1OxvMp4EsiQ4UQHA9Ngcru2iS2WOs4dWsZxlttOH5yol/GOrGzvo9Tco06mte85qGdbV7P3aOUZkRzt7z5ISX1DB2t0K6VUBgwLE0KY42YLNft6Cp4Y7XNZlB202krGPS2rQHdK2lCjuPXpTBRmvLO2alZqvalYB25/P/y9L3mRgNl+4Z9dWvfnUOqPRH835oS8N676EYx/tRWYzEPsPSjWqbmiU0mewdgWzKDJw2yNlHomVzHihjb6tQ4OnQnEZdBrQj4lg54VVrWX/Fy6QlDxnX/8pXvtIFqqVTDTC4boB3ISgflZr/3gkv1M1F27Hv6DgRdP/QgEO9Wa2L0brTYAvGhBxEuyah36o6eRrV0vyWvjc0dGh2Hv8Kv4RamFzJbH6veMUrJgE1A2LPxqGaj41fIpln8QVhhTR2DLhdQVeXe7GyQYmOLqYdW9aF7YFV39NVW3ge6KYkTh7j4nbDexGoWyp7eslmCqO2QD3ppJNKgEp9S08aGBlqERgsF8DaF/NvPbeCAQitqULmzbK01wSDToMV9q2LkIVwL5lkFz+ZPiiQYeOmnnWAelKWUUscALGnXv7ylzdeiZM1nEBYTsIc9qDqsI5AtbzL/nhqnKJcJxAoIdgPjpqyxDYjttO8v/kFe02zclkXv5Mcv+U+WHoZy8WEWb2REaina2NqTSYnaleLkqpVD9SXU6B6Q6Y8Rn3Zy17WFNTis8xoZfw5pimwgCiDa+8yZ0lZLMxq9k4C6L5WjDUkayzxIuGYRgPpk4BqXBHDl66b0dHJ0JacNACN+tIsUIuy/h6oL3nJS9YFVEMzulaS529a5VOmUXMn3biozN5QrFLpC8F6PVGCjAoCwsg6quDYJEtG6erUVKCycJ7xS5cB6u8vDP9lZ0rRhn+7mxe/+MXFQN2o9z1dVspons1FvD0zI1bArK1jNrJ/Kl30a3YnFy8Lt6JITusz4Hm6kkkBC4i57ZkD0L1e+a3f65Kp2mg88fpPk+6p9qJ80Yte1Bg2U1GItsJzDhyESpOhKkx3Mo8v8xm6y6tmWi0XSr3XWBLOlHTr0tf6N5Cbw7WPmthX9CIpMfkNwLk2WAaoQ+N0s/LcExdZv+oz1Wl/0v4HKB0NRWnP64knnlgK1HWzqgMiswxoWVcWExrjszCBq2F8UO2E90kAs14Hv9mcSaXakQGYRCaN7qw9D+2onP715JTRW7D2egBqgSWVS7AiUF/4whduJFCLEhLDjgrOcOisRiWhs/hCstjFC+9MY2KHFLolhiRIJAaTAZnkkjJj7hzmvOqScG/p/mbluBcuKlNV2nfKnlsJ1XwxKUX1ghe8YARUTBKgYkSNbuvH18xkNI1QxsSExkrgJAzKuCd9b9aSWr8RButceLeaUEokQYlsMXoPLA1ZF1TZahhh4EoOo5ZPbSuMSsO6O3/zBckN0Uqz/wou4cioz3/+85sS0LFCQAmrFpQ5Tf2a+zGtkMkyeuuHIx6w9QOZ4VwdpwsANr+ByBCHtd2GaifZ9LxU87tm3JNsqVYev7zz2P+8owXcgzBTyn793wfVsn3a3eyq1v7Ksvh4TDxnMet/3vOe1xgVJTdBWgaoUxOtgm4qCxCJLjRkxnyZi6kA1MwHziVyWOBIxjgZ5ygJ8Z7+9Bi7oJKIFT0TqCes/KffqVuNOqsW00+FXgXESK7/pp4kqIV2QdcteMIJJzRkePPoyi7J3Fkiok354A8RYcY9rRihBMHjA8nA5ENSY4eEbJSgOQlYF3bDeIRpHdLBkHVI7/2KWryW869uPKwvNOtiDBAdSsrNbqiHCz05ZtL4Tl2Ck1eO+e044clqi7pufpR21S1trJ93WOPzT+hltT72eQ/UElZbNkR7WpQlQCThcatTFpsbyUHShC16C/U0Kam6DO+tg+xGekmxg8oCm7Ws22cL8prcQrMOfILlAHoTWyHpet6+NNu+beU5vx2BV9XrM/y7cxSBevzxxzcTQcj8zhKznm5rrEcZGHzCYrlgOBpue59m+Fy0wGPDiGHMjZAtGXvFDqealAV4iRzwsv+Sat+frRz9W7XRlCKMOoQEYLBas2y33/YcPve5z23Wk9A4SUuRfnWWFWlU7xgxhHvAxUkyLN1buCyw2n0BQK1OK5xrgUapkvPOxquVAnAKUD+28hvHxfnRulDfF6iqhui3ENyBAE2z0KnVcccd15Toz0yINUOxxUCYCRv1/iTJY+OnjITNPKkYir0fXMBe6lhkzhEbfcp8VK1VQyZJ9D4LgZbo2tx3MuYBq425Yod1P7/yrGMjUBtzcF/lT44mOYoA9dhjj3WBaoXmnAbNhSGDTczwlmPFgs+r2RRFuvlY7bP2msXNLpq0F2C4KKQRRU87hFIGM3GtVQs6ytzkxtK2OWYsiVysYHPRylHHdKG/p0vNpk3lv0ZKjbutjjnmmBxQi8PtFPkwwdrSF0GN7COD3fDW7ZoJrbCLGS6ZtaUGnSpAR+8zcSEwYYJ1LTvNNetLALLs71VSys7tVx/HZStHPnsLxHQBJLKsLJO/snvZPKaH1XOe85xmWaAZNtRoufeFHCsrSWTkuaGPiwoW671wprDLBnyepX1rw6fOgt/pPRj2zebsyuldhpu/Xzni2bWqTFX9nKhrSRLxqEhLYAz7HaMeffTRWaB6CRQLJ+sJ4Tkrhg0GRN2aC8dOb8NmL3fX1Ya9l2Que/yefi2UbCaD4rH+047DfyMa/njfCF3nr7B5ClYUGTuPbX7PetazJgG1FKze+iUnhmXM2urxfhRWtrS0puEAjPoGSCSYr3d53U8ZThpUrGTTlAM5MBKrL5trGMRRDNQbVw77jzH0DyV9NVVq5VhWWATob4oSqqOOOqoIqM5JmOxdsiaUkjq2tz/Sn5k0qWAis6zuhv3NreX982EOgbgcCgm1cbeZIgYtYUDr3DjJqJsnlAA+Pu7YceiRnddveE9Mq/JkqrspSqiOPPLIpvAgs9WgKfqMlUanftY6j8FMVDIRISyxzUZe5K4kMIawbPS5c5Ou+Lh/xyFH4N17kkb+zOA+YeAumTriiCOWAqpXp7euQiwbeiFGf17OLC/UblldN+UHdHR7cUQpZcACLe9ZaHXmPM8Nr9a9wJzfu3vs2nHw4Vu2ZOxS4y6To/WbvjJ1+OGHN6VXv6Mv1/XDGFm8pytLwqEZSnHCYO1QWAWOKcxjMPV8Pe9ZIddo2iklA5covO+bA+r8gaf9WvG4fles9q7BYYcd1pSGNi8krydkFmS4o075wkLDUp+7DKNu1n4ZAHOSadnPNYa5u2Vd77ebb/v3v7aom9ZjmhSKRaqFitSYUtu3Dz300GbKSdZfhoTybKjHTBxeLwU43RJoGOAjGSFVoo7C+okiLJmxEYDFzF1n/UZJtehzC9hxVCQpDfFeIaRUM89v/be/urghmnWLycy9piq4fc8hhxzSTGW3KWAt9QBLpMSEfXjASbZHpg7+WK6S90freBfOFI3rOSdLOgVFeUIm6eVA/VH9K11qj3fuq/BOfpp14X0BcFx88MEHN17r3ZSDs/QjTFOuXyfsO+VkM6N/PWy4N+1j6gU6gSWDxbLLgNQipfm1zUHujNNGIkXXi+R70EEHNROqSEVgZePLGfOyeayM3lSrIXkKO3hG+fD+ekCF39uQN1Mcj7rkd8jZXKXf2/FcJ+Gi2+7/Nk+nQIXh/aNllo8VGfUZz3hGUwrCUlZF1jQqLHRaGiNZWtcxLXMh7m372cR91YYMXRdZza9sgaoNfzY8ujLAy4D61Kc+tcFxRZY3Skx7NvY/e8WX2j976kfbSKCUfodlj38Dv4OZKBEZkU24Em/56+Gpya17LAYNDpj759VTnvKUZqPB4J3MQMqnpSd+HZ9fEgLd8D+VUfbERbgRx1nCpMscZ/OVcGBY5/xo+lepDjzwwGZPnjCWEDBLaG//gffGz8/5nXvyeJu/JEDNhf5gvB+BesABBzRTD3CjAFvgHPzMj2VvOi+exNoMxlzP92w+Ew4YREHJhL05Rn3yk5/cLHNF76kTndlP8Y/jrb8nALzMNtb3sMqmy57jjfouo8LHOeHJ9PaSzJJiTgBo1+pJT3pSU3LAxBRPsnd6ZTmZPE54UZr4OBrU2zeCYN5Xh+q5Fx8LTfzS7UqAWOKZbvZFst6Ltzk7/HJ6hWWyf8dLrZ74xCc262W8zdjuZ7Xt3rTdz/P3bP40/DtXd4bC9wSoT3jCE5qNOCl7w/Y/S1Bs9oX383D+R0D9b+GXwhYSV2ryPPFm4HlsnH784x/f7EmwTNWkm/wDunbUEscyL3Qy2Drzid953XJgM89x8+aw/2LKEyP8W26AoWmr/fffv9kMkG3kidwbf5hfnC9/P81/bYFKM8FgV6CcR7Xffvs1m33Spuxzs36QzTrezToHS1h3e9U5aE4K+xUb/iUa9XGPe1yzXlAtc2L31Of84jN+Nr9Jc2J4HA3rJfeYIhKgeuxjH9ts1AHvyZOzns/brB/es/CW2G6+jnOy7DYb9ts1x4d/k0zRZyVWViKlXlf77rtvs1kgWu8J38jj2Ihj2RvOxUachz1xLpqjwmMS2NfLXAqL7apHP/rRzZ48QZsB4p/n492M49wbjrd5RthneCGzZW5Rr9G6WoXX8H71qEc9yv1kpyVv8pecGBaznmPl3L5wk4A66Tsu+/32JJiX+OySaU2jtNy6kcdRbd26tdnbmWFvZe1fnK89CNS6rptf/JA//4+97Xxt9NH8f5tgL0QfTzI1AAAAAElFTkSuQmCC)}.colourpicker-slider{background-position:20px 0}} \ No newline at end of file diff --git a/inst/htmlwidgets/lib/colourpicker/colourpicker.min.js b/inst/htmlwidgets/lib/colourpicker/colourpicker.min.js new file mode 100644 index 0000000000..ce5173a1f4 --- /dev/null +++ b/inst/htmlwidgets/lib/colourpicker/colourpicker.min.js @@ -0,0 +1,2 @@ +/* jQuery Colour picker: A tiny colour picker with useful extra features / v1.1 / Dean Attali and Cory LaViska / MIT license */ +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){function b(b,c){var d=a('
'),e=a.colourpicker.defaults;if(!b.data("colourpicker-initialized")){if(c=a.extend(!0,{},e,c),d.addClass("palette-"+c.palette),c.allowTransparent&&d.addClass("input-group"),b.addClass("colourpicker-input").prop("spellcheck",!1).data("colourpicker-initialized",!1).data("colourpicker-lastChange",!1).data("colourpicker-settings",c).prop("size",7).wrap(d),"square"==c.palette)b.after('
');else if("limited"==c.palette){var f='
';a.each(c.allowedCols.split(" "),function(a,b){0==a?f+='
':a%8==0&&(f+='
'),f+=''}),f+="
",b.after('
'+f+"
")}else console.log("colourpicker: invalid palette type ("+c.palette+")");c.allowTransparent?(b.parent().find(".colourpicker-panel").after('"),b.data("allow-transparent",!0)):b.data("allow-transparent",!1),"background"==c.showColour&&b.attr("readonly","readonly"),c.returnName?b.data("return-name",!0):b.data("return-name",!1),b.parent().find(".colourpicker-panel").on("selectstart",function(){return!1}).end(),h(b,!1),b.data("colourpicker-initialized",!0)}}function c(a){var b=a.parent();a.removeData("colourpicker-initialized").removeData("colourpicker-settings").removeProp("size").removeClass("colourpicker-input"),b.before(a).remove()}function d(a){var b=a.parent(),c=b.find(".colourpicker-panel"),d=a.data("colourpicker-settings");!a.data("colourpicker-initialized")||a.prop("disabled")||b.hasClass("colourpicker-focus")||(e(),b.addClass("colourpicker-focus"),c.stop(!0,!0).fadeIn(d.showSpeed,function(){d.show&&d.show.call(a.get(0))}))}function e(){a(".colourpicker-focus").each(function(){var b=a(this),c=b.find(".colourpicker-input"),d=b.find(".colourpicker-panel"),e=c.data("colourpicker-settings");d.fadeOut(e.hideSpeed,function(){e.hide&&e.hide.call(c.get(0)),b.removeClass("colourpicker-focus")})})}function f(a,b,c){var d=a.parents(".colourpicker").find(".colourpicker-input"),e=d.data("colourpicker-settings"),f=a.find("[class$=-picker]"),h=a.offset().left,i=a.offset().top,j=Math.round(b.pageX-h),k=Math.round(b.pageY-i),l=c?e.animationSpeed:0;b.originalEvent.changedTouches&&(j=b.originalEvent.changedTouches[0].pageX-h,k=b.originalEvent.changedTouches[0].pageY-i),j<0&&(j=0),k<0&&(k=0),j>a.width()&&(j=a.width()),k>a.height()&&(k=a.height()),a.is(".colourpicker-grid")?f.stop(!0).animate({top:k+"px",left:j+"px"},l,e.animationEasing,function(){g(d,a)}):f.stop(!0).animate({top:k+"px"},l,e.animationEasing,function(){g(d,a)})}function g(a,b){function c(a,b){var c,d;return a.length&&b?(c=a.offset().left,d=a.offset().top,{x:c-b.offset().left+a.outerWidth()/2,y:d-b.offset().top+a.outerHeight()/2}):null}var d,e,f,m=a.val(),n=a.parent(),p=a.data("colourpicker-settings"),q=n.find(".colourpicker-grid"),r=n.find(".colourpicker-slider"),t=q.find("[class$=-picker]"),u=r.find("[class$=-picker]"),v=c(t,q),w=c(u,r);switch(b.is(".colourpicker-grid, .colourpicker-slider")&&(d=l(360-parseInt(w.y*(360/r.height()),10),0,360),e=l(Math.floor(v.x*(100/q.width())),0,100),f=l(100-Math.floor(v.y*(100/q.height())),0,100),m=o({h:d,s:e,b:f}),q.css("backgroundColor",o({h:d,s:100,b:100})),a.val(m.toUpperCase())),b.is(".cp-list-col")&&(m=b.data("cp-col"),a.val(m)),p.showColour){case"text":a.css("color",""),a.css("background-color","");break;case"background":a.css("color","transparent"),a.css("background-color",m);break;default:a.css("color",s(m)?"#ddd":"#000"),a.css("background-color",m)}"limited"==p.palette&&(n.find(".cp-list-col").removeClass("selected-col"),n.find('.cp-list-col[data-cp-col="'+m+'"]').addClass("selected-col").addClass(s(m)?"dark":"light")),i(a,m,a.data("transparent"))}function h(a,b){var c,d,e,f,k=a.parent(),m=a.data("colourpicker-settings"),n=k.find(".colourpicker-grid"),q=k.find(".colourpicker-slider"),r=n.find("[class$=-picker]"),t=q.find("[class$=-picker]");switch(c=j(a),c||(c=u(a)),d=p(c),b||a.val(c),m.showColour){case"text":a.css("color",""),a.css("background-color","");break;case"background":a.css("color","transparent"),a.css("background-color",c);break;default:a.css("color",s(c)?"#ddd":"#000"),a.css("background-color",c)}"limited"==m.palette&&(k.find(".cp-list-col").removeClass("selected-col"),k.find('.cp-list-col[data-cp-col="'+c+'"]').addClass("selected-col").addClass(s(c)?"dark":"light")),e=l(Math.ceil(d.s/(100/n.width())),0,n.width()),f=l(n.height()-Math.ceil(d.b/(100/n.height())),0,n.height()),r.css({top:f+"px",left:e+"px"}),f=l(q.height()-d.h/(360/q.height()),0,q.height()),t.css("top",f+"px"),n.css("backgroundColor",o({h:d.h,s:100,b:100})),a.data("colourpicker-initialized")&&i(a,c,a.data("transparent")),a.data("transparent")?(k.find(".colourpicker-istransparent").prop("checked",!0),k.addClass("istransparent")):(k.find(".colourpicker-istransparent").prop("checked",!1),k.removeClass("istransparent")),a.trigger("change").trigger("input")}function i(a,b,c){var d=a.data("colourpicker-settings"),e=a.data("colourpicker-lastChange"),f=a.data("colourpicker-lastTransparent");e&&e===b&&f===c||(a.data("colourpicker-lastChange",b),a.data("colourpicker-lastTransparent",c),d.change&&(d.changeDelay?(clearTimeout(a.data("colourpicker-changeTimeout")),a.data("colourpicker-changeTimeout",setTimeout(function(){d.change.call(a.get(0),b)},d.changeDelay))):d.change.call(a.get(0),b)),a.trigger("change").trigger("input"))}function j(b){var c=b.val(),d=b.data("colourpicker-settings"),e=k(c).toUpperCase();return"limited"==d.palette&&a.inArray(e,d.allowedCols.split(" "))==-1&&(e=""),e}function k(a){return a=a.replace(/[^A-F0-9]/gi,""),3!==a.length&&6!==a.length?"":(3===a.length&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),"#"+a)}function l(a,b,c){return ac&&(a=c),a}function m(a){var b={},c=Math.round(a.h),d=Math.round(255*a.s/100),e=Math.round(255*a.b/100);if(0===d)b.r=b.g=b.b=e;else{var f=e,g=(255-d)*e/255,h=(f-g)*(c%60)/60;360===c&&(c=0),c<60?(b.r=f,b.b=g,b.g=g+h):c<120?(b.g=f,b.b=g,b.r=f-h):c<180?(b.g=f,b.r=g,b.b=g+h):c<240?(b.b=f,b.r=g,b.g=f-h):c<300?(b.b=f,b.g=g,b.r=g+h):c<360?(b.r=f,b.g=g,b.b=f-h):(b.r=0,b.g=0,b.b=0)}return{r:Math.round(b.r),g:Math.round(b.g),b:Math.round(b.b)}}function n(b){var c=[b.r.toString(16),b.g.toString(16),b.b.toString(16)];return a.each(c,function(a,b){1===b.length&&(c[a]="0"+b)}),"#"+c.join("")}function o(a){return n(m(a))}function p(a){var b=q(r(a));return 0===b.s&&(b.h=360),b}function q(a){var b={h:0,s:0,b:0},c=Math.min(a.r,a.g,a.b),d=Math.max(a.r,a.g,a.b),e=d-c;return b.b=d,b.s=0!==d?255*e/d:0,0!==b.s?a.r===d?b.h=(a.g-a.b)/e:a.g===d?b.h=2+(a.b-a.r)/e:b.h=4+(a.r-a.g)/e:b.h=-1,b.h*=60,b.h<0&&(b.h+=360),b.s*=100/255,b.b*=100/255,b}function r(a){return a=parseInt(a.indexOf("#")>-1?a.substring(1):a,16),{r:a>>16,g:(65280&a)>>8,b:255&a}}function s(a){return!(t(a)>.22)}function t(b){var c=r(b);c=a.map(c,function(a){return a/=255,a=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)});var d=.2126*c[0]+.7152*c[1]+.0722*c[2];return d}function u(a){if(a.data("colourpicker-lastChange"))return a.data("colourpicker-lastChange");if(a.parent().is(".palette-limited")){var b=a.parent().find(".cp-list-col").first();return b.data("cp-col")}return"#FFFFFF"}a.colourpicker={defaults:{animationSpeed:50,animationEasing:"swing",change:null,changeDelay:0,hide:null,hideSpeed:100,show:null,showSpeed:100,showColour:"both",allowTransparent:!1,transparentText:"Transparent",palette:"square",allowedCols:"#000000 #333333 #4D4D4D #666666 #7F7F7F #999999 #B3B3B3 #E5E5E5 #FFFFFF #27408B #000080 #0000FF #1E90FF #63B8FF #97FFFF #00FFFF #00868B #008B45 #458B00 #008B00 #00FF00 #7FFF00 #54FF9F #00FF7F #7FFFD4 #8B4500 #8B0000 #FF0000 #FF6A6A #FF7F00 #FFFF00 #FFF68F #F4A460 #551A8B #8B008B #8B0A50 #9400D3 #FF00FF #FF1493 #E066FF",returnName:!1,colsMap:{"#FFFFFF":"white","#F0F8FF":"aliceblue","#FAEBD7":"antiquewhite","#FFEFDB":"antiquewhite1","#EEDFCC":"antiquewhite2","#CDC0B0":"antiquewhite3","#8B8378":"antiquewhite4","#7FFFD4":"aquamarine","#76EEC6":"aquamarine2","#66CDAA":"aquamarine3","#458B74":"aquamarine4","#F0FFFF":"azure","#E0EEEE":"azure2","#C1CDCD":"azure3","#838B8B":"azure4","#F5F5DC":"beige","#FFE4C4":"bisque","#EED5B7":"bisque2","#CDB79E":"bisque3","#8B7D6B":"bisque4","#000000":"black","#FFEBCD":"blanchedalmond","#0000FF":"blue","#0000EE":"blue2","#0000CD":"blue3","#00008B":"blue4","#8A2BE2":"blueviolet","#A52A2A":"brown","#FF4040":"brown1","#EE3B3B":"brown2","#CD3333":"brown3","#8B2323":"brown4","#DEB887":"burlywood","#FFD39B":"burlywood1","#EEC591":"burlywood2","#CDAA7D":"burlywood3","#8B7355":"burlywood4","#5F9EA0":"cadetblue","#98F5FF":"cadetblue1","#8EE5EE":"cadetblue2","#7AC5CD":"cadetblue3","#53868B":"cadetblue4","#7FFF00":"chartreuse","#76EE00":"chartreuse2","#66CD00":"chartreuse3","#458B00":"chartreuse4","#D2691E":"chocolate","#FF7F24":"chocolate1","#EE7621":"chocolate2","#CD661D":"chocolate3","#8B4513":"chocolate4","#FF7F50":"coral","#FF7256":"coral1","#EE6A50":"coral2","#CD5B45":"coral3","#8B3E2F":"coral4","#6495ED":"cornflowerblue","#FFF8DC":"cornsilk","#EEE8CD":"cornsilk2","#CDC8B1":"cornsilk3","#8B8878":"cornsilk4","#00FFFF":"cyan","#00EEEE":"cyan2","#00CDCD":"cyan3","#008B8B":"cyan4","#B8860B":"darkgoldenrod","#FFB90F":"darkgoldenrod1","#EEAD0E":"darkgoldenrod2","#CD950C":"darkgoldenrod3","#8B6508":"darkgoldenrod4","#A9A9A9":"darkgray","#006400":"darkgreen","#BDB76B":"darkkhaki","#8B008B":"darkmagenta","#556B2F":"darkolivegreen","#CAFF70":"darkolivegreen1","#BCEE68":"darkolivegreen2","#A2CD5A":"darkolivegreen3","#6E8B3D":"darkolivegreen4","#FF8C00":"darkorange","#FF7F00":"darkorange1","#EE7600":"darkorange2","#CD6600":"darkorange3","#8B4500":"darkorange4","#9932CC":"darkorchid","#BF3EFF":"darkorchid1","#B23AEE":"darkorchid2","#9A32CD":"darkorchid3","#68228B":"darkorchid4","#8B0000":"darkred","#E9967A":"darksalmon","#8FBC8F":"darkseagreen","#C1FFC1":"darkseagreen1","#B4EEB4":"darkseagreen2","#9BCD9B":"darkseagreen3","#698B69":"darkseagreen4","#483D8B":"darkslateblue","#2F4F4F":"darkslategray","#97FFFF":"darkslategray1","#8DEEEE":"darkslategray2","#79CDCD":"darkslategray3","#528B8B":"darkslategray4","#00CED1":"darkturquoise","#9400D3":"darkviolet","#FF1493":"deeppink","#EE1289":"deeppink2","#CD1076":"deeppink3","#8B0A50":"deeppink4","#00BFFF":"deepskyblue","#00B2EE":"deepskyblue2","#009ACD":"deepskyblue3","#00688B":"deepskyblue4","#696969":"dimgray","#1E90FF":"dodgerblue","#1C86EE":"dodgerblue2","#1874CD":"dodgerblue3","#104E8B":"dodgerblue4","#B22222":"firebrick","#FF3030":"firebrick1","#EE2C2C":"firebrick2","#CD2626":"firebrick3","#8B1A1A":"firebrick4","#FFFAF0":"floralwhite","#228B22":"forestgreen","#DCDCDC":"gainsboro","#F8F8FF":"ghostwhite","#FFD700":"gold","#EEC900":"gold2","#CDAD00":"gold3","#8B7500":"gold4","#DAA520":"goldenrod","#FFC125":"goldenrod1","#EEB422":"goldenrod2","#CD9B1D":"goldenrod3","#8B6914":"goldenrod4","#BEBEBE":"gray","#030303":"gray1","#050505":"gray2","#080808":"gray3","#0A0A0A":"gray4","#0D0D0D":"gray5","#0F0F0F":"gray6","#121212":"gray7","#141414":"gray8","#171717":"gray9","#1A1A1A":"gray10","#1C1C1C":"gray11","#1F1F1F":"gray12","#212121":"gray13","#242424":"gray14","#262626":"gray15","#292929":"gray16","#2B2B2B":"gray17","#2E2E2E":"gray18","#303030":"gray19","#333333":"gray20","#363636":"gray21","#383838":"gray22","#3B3B3B":"gray23","#3D3D3D":"gray24","#404040":"gray25","#424242":"gray26","#454545":"gray27","#474747":"gray28","#4A4A4A":"gray29","#4D4D4D":"gray30","#4F4F4F":"gray31","#525252":"gray32","#545454":"gray33","#575757":"gray34","#595959":"gray35","#5C5C5C":"gray36","#5E5E5E":"gray37","#616161":"gray38","#636363":"gray39","#666666":"gray40","#6B6B6B":"gray42","#6E6E6E":"gray43","#707070":"gray44","#737373":"gray45","#757575":"gray46","#787878":"gray47","#7A7A7A":"gray48","#7D7D7D":"gray49","#7F7F7F":"gray50","#828282":"gray51","#858585":"gray52","#878787":"gray53","#8A8A8A":"gray54","#8C8C8C":"gray55","#8F8F8F":"gray56","#919191":"gray57","#949494":"gray58","#969696":"gray59","#999999":"gray60","#9C9C9C":"gray61","#9E9E9E":"gray62","#A1A1A1":"gray63","#A3A3A3":"gray64","#A6A6A6":"gray65","#A8A8A8":"gray66","#ABABAB":"gray67","#ADADAD":"gray68","#B0B0B0":"gray69","#B3B3B3":"gray70","#B5B5B5":"gray71","#B8B8B8":"gray72","#BABABA":"gray73","#BDBDBD":"gray74","#BFBFBF":"gray75","#C2C2C2":"gray76","#C4C4C4":"gray77","#C7C7C7":"gray78","#C9C9C9":"gray79","#CCCCCC":"gray80","#CFCFCF":"gray81","#D1D1D1":"gray82","#D4D4D4":"gray83","#D6D6D6":"gray84","#D9D9D9":"gray85","#DBDBDB":"gray86","#DEDEDE":"gray87","#E0E0E0":"gray88","#E3E3E3":"gray89","#E5E5E5":"gray90","#E8E8E8":"gray91","#EBEBEB":"gray92","#EDEDED":"gray93","#F0F0F0":"gray94","#F2F2F2":"gray95","#F5F5F5":"gray96","#F7F7F7":"gray97","#FAFAFA":"gray98","#FCFCFC":"gray99","#00FF00":"green","#00EE00":"green2","#00CD00":"green3","#008B00":"green4","#ADFF2F":"greenyellow","#F0FFF0":"honeydew","#E0EEE0":"honeydew2","#C1CDC1":"honeydew3","#838B83":"honeydew4","#FF69B4":"hotpink","#FF6EB4":"hotpink1","#EE6AA7":"hotpink2","#CD6090":"hotpink3","#8B3A62":"hotpink4","#CD5C5C":"indianred","#FF6A6A":"indianred1","#EE6363":"indianred2","#CD5555":"indianred3","#8B3A3A":"indianred4","#FFFFF0":"ivory","#EEEEE0":"ivory2","#CDCDC1":"ivory3","#8B8B83":"ivory4","#F0E68C":"khaki","#FFF68F":"khaki1","#EEE685":"khaki2","#CDC673":"khaki3","#8B864E":"khaki4","#E6E6FA":"lavender","#FFF0F5":"lavenderblush","#EEE0E5":"lavenderblush2","#CDC1C5":"lavenderblush3","#8B8386":"lavenderblush4","#7CFC00":"lawngreen","#FFFACD":"lemonchiffon","#EEE9BF":"lemonchiffon2","#CDC9A5":"lemonchiffon3","#8B8970":"lemonchiffon4","#ADD8E6":"lightblue","#BFEFFF":"lightblue1","#B2DFEE":"lightblue2","#9AC0CD":"lightblue3","#68838B":"lightblue4","#F08080":"lightcoral","#E0FFFF":"lightcyan","#D1EEEE":"lightcyan2","#B4CDCD":"lightcyan3","#7A8B8B":"lightcyan4","#EEDD82":"lightgoldenrod","#FFEC8B":"lightgoldenrod1","#EEDC82":"lightgoldenrod2","#CDBE70":"lightgoldenrod3","#8B814C":"lightgoldenrod4","#FAFAD2":"lightgoldenrodyellow","#D3D3D3":"lightgray","#90EE90":"lightgreen","#FFB6C1":"lightpink","#FFAEB9":"lightpink1","#EEA2AD":"lightpink2","#CD8C95":"lightpink3","#8B5F65":"lightpink4","#FFA07A":"lightsalmon","#EE9572":"lightsalmon2","#CD8162":"lightsalmon3","#8B5742":"lightsalmon4","#20B2AA":"lightseagreen","#87CEFA":"lightskyblue","#B0E2FF":"lightskyblue1","#A4D3EE":"lightskyblue2","#8DB6CD":"lightskyblue3","#607B8B":"lightskyblue4","#8470FF":"lightslateblue","#778899":"lightslategray","#B0C4DE":"lightsteelblue","#CAE1FF":"lightsteelblue1","#BCD2EE":"lightsteelblue2","#A2B5CD":"lightsteelblue3","#6E7B8B":"lightsteelblue4","#FFFFE0":"lightyellow","#EEEED1":"lightyellow2","#CDCDB4":"lightyellow3","#8B8B7A":"lightyellow4","#32CD32":"limegreen","#FAF0E6":"linen","#FF00FF":"magenta","#EE00EE":"magenta2","#CD00CD":"magenta3","#B03060":"maroon","#FF34B3":"maroon1","#EE30A7":"maroon2","#CD2990":"maroon3","#8B1C62":"maroon4","#BA55D3":"mediumorchid","#E066FF":"mediumorchid1","#D15FEE":"mediumorchid2","#B452CD":"mediumorchid3","#7A378B":"mediumorchid4","#9370DB":"mediumpurple","#AB82FF":"mediumpurple1","#9F79EE":"mediumpurple2","#8968CD":"mediumpurple3","#5D478B":"mediumpurple4","#3CB371":"mediumseagreen","#7B68EE":"mediumslateblue","#00FA9A":"mediumspringgreen","#48D1CC":"mediumturquoise","#C71585":"mediumvioletred","#191970":"midnightblue","#F5FFFA":"mintcream","#FFE4E1":"mistyrose","#EED5D2":"mistyrose2","#CDB7B5":"mistyrose3","#8B7D7B":"mistyrose4","#FFE4B5":"moccasin","#FFDEAD":"navajowhite","#EECFA1":"navajowhite2","#CDB38B":"navajowhite3","#8B795E":"navajowhite4","#000080":"navy","#FDF5E6":"oldlace","#6B8E23":"olivedrab","#C0FF3E":"olivedrab1","#B3EE3A":"olivedrab2","#9ACD32":"olivedrab3","#698B22":"olivedrab4","#FFA500":"orange","#EE9A00":"orange2","#CD8500":"orange3","#8B5A00":"orange4","#FF4500":"orangered","#EE4000":"orangered2","#CD3700":"orangered3","#8B2500":"orangered4","#DA70D6":"orchid","#FF83FA":"orchid1","#EE7AE9":"orchid2","#CD69C9":"orchid3","#8B4789":"orchid4","#EEE8AA":"palegoldenrod","#98FB98":"palegreen","#9AFF9A":"palegreen1","#7CCD7C":"palegreen3","#548B54":"palegreen4","#AFEEEE":"paleturquoise","#BBFFFF":"paleturquoise1","#AEEEEE":"paleturquoise2","#96CDCD":"paleturquoise3","#668B8B":"paleturquoise4","#DB7093":"palevioletred","#FF82AB":"palevioletred1","#EE799F":"palevioletred2","#CD6889":"palevioletred3","#8B475D":"palevioletred4","#FFEFD5":"papayawhip","#FFDAB9":"peachpuff","#EECBAD":"peachpuff2","#CDAF95":"peachpuff3","#8B7765":"peachpuff4","#CD853F":"peru","#FFC0CB":"pink","#FFB5C5":"pink1","#EEA9B8":"pink2","#CD919E":"pink3","#8B636C":"pink4","#DDA0DD":"plum","#FFBBFF":"plum1","#EEAEEE":"plum2","#CD96CD":"plum3","#8B668B":"plum4","#B0E0E6":"powderblue","#A020F0":"purple","#9B30FF":"purple1","#912CEE":"purple2","#7D26CD":"purple3","#551A8B":"purple4","#FF0000":"red","#EE0000":"red2","#CD0000":"red3","#BC8F8F":"rosybrown","#FFC1C1":"rosybrown1","#EEB4B4":"rosybrown2","#CD9B9B":"rosybrown3","#8B6969":"rosybrown4","#4169E1":"royalblue","#4876FF":"royalblue1","#436EEE":"royalblue2","#3A5FCD":"royalblue3","#27408B":"royalblue4","#FA8072":"salmon","#FF8C69":"salmon1","#EE8262":"salmon2","#CD7054":"salmon3","#8B4C39":"salmon4","#F4A460":"sandybrown","#2E8B57":"seagreen","#54FF9F":"seagreen1","#4EEE94":"seagreen2","#43CD80":"seagreen3","#FFF5EE":"seashell","#EEE5DE":"seashell2","#CDC5BF":"seashell3","#8B8682":"seashell4","#A0522D":"sienna","#FF8247":"sienna1","#EE7942":"sienna2","#CD6839":"sienna3","#8B4726":"sienna4","#87CEEB":"skyblue","#87CEFF":"skyblue1","#7EC0EE":"skyblue2","#6CA6CD":"skyblue3","#4A708B":"skyblue4","#6A5ACD":"slateblue","#836FFF":"slateblue1","#7A67EE":"slateblue2","#6959CD":"slateblue3","#473C8B":"slateblue4","#708090":"slategray","#C6E2FF":"slategray1","#B9D3EE":"slategray2","#9FB6CD":"slategray3","#6C7B8B":"slategray4","#FFFAFA":"snow","#EEE9E9":"snow2","#CDC9C9":"snow3","#8B8989":"snow4","#00FF7F":"springgreen","#00EE76":"springgreen2","#00CD66":"springgreen3","#008B45":"springgreen4","#4682B4":"steelblue","#63B8FF":"steelblue1","#5CACEE":"steelblue2","#4F94CD":"steelblue3","#36648B":"steelblue4","#D2B48C":"tan","#FFA54F":"tan1","#EE9A49":"tan2","#8B5A2B":"tan4","#D8BFD8":"thistle","#FFE1FF":"thistle1","#EED2EE":"thistle2","#CDB5CD":"thistle3","#8B7B8B":"thistle4","#FF6347":"tomato","#EE5C42":"tomato2","#CD4F39":"tomato3","#8B3626":"tomato4","#40E0D0":"turquoise","#00F5FF":"turquoise1","#00E5EE":"turquoise2","#00C5CD":"turquoise3","#00868B":"turquoise4","#EE82EE":"violet","#D02090":"violetred","#FF3E96":"violetred1","#EE3A8C":"violetred2","#CD3278":"violetred3","#8B2252":"violetred4","#F5DEB3":"wheat","#FFE7BA":"wheat1","#EED8AE":"wheat2","#CDBA96":"wheat3","#8B7E66":"wheat4","#FFFF00":"yellow","#EEEE00":"yellow2","#CDCD00":"yellow3","#8B8B00":"yellow4"}}},a.extend(a.fn,{colourpicker:function(f,g){switch(f){case"destroy":return a(this).each(function(){c(a(this))}),a(this);case"hide":return e(),a(this);case"settings":return void 0===g?a(this).data("colourpicker-settings"):(a(this).each(function(){var b=a(this).data("colourpicker-settings")||{};c(a(this)),a(this).colourpicker(a.extend(!0,b,g))}),a(this));case"show":return d(a(this).eq(0)),a(this);case"value":if(void 0===g){if(a(this).data("allow-transparent")&&a(this).data("transparent"))return"transparent";if(!j(a(this)))return a(this).data("colourpicker-lastChange");var i=j(a(this));return a(this).data("return-name")&&i in a(this).data("colourpicker-settings").colsMap&&(i=a(this).data("colourpicker-settings").colsMap[i]),i}return a(this).each(function(){"transparent"==g?a(this).data("allow-transparent")?a(this).data("transparent",!0):(a(this).data("transparent",!1),a(this).val(u(a(this)))):(a(this).data("transparent",!1),a(this).val(g)),h(a(this))}),a(this);default:return"create"!==f&&(g=f),a(this).each(function(){b(a(this),g)}),a(this)}}}),a(document).on("mousedown.colourpicker touchstart.colourpicker",function(b){a(b.target).parents().add(b.target).hasClass("colourpicker")||e()}).on("mousedown.colourpicker touchstart.colourpicker",".cp-list-col",function(b){var c=a(this);b.preventDefault();var d=c.parents(".colourpicker").find(".colourpicker-input");g(d,c)}).on("mousedown.colourpicker touchstart.colourpicker",".colourpicker-grid, .colourpicker-slider",function(b){var c=a(this);b.preventDefault(),a(document).data("colourpicker-target",c),f(c,b,!0)}).on("mousemove.colourpicker touchmove.colourpicker",function(b){var c=a(document).data("colourpicker-target");c&&f(c,b)}).on("mouseup.colourpicker touchend.colourpicker",function(){a(this).removeData("colourpicker-target")}).on("focus.colourpicker",".colourpicker-input",function(){var b=a(this);b.data("colourpicker-initialized")&&(b.data("transparent",!1),d(b),h(a(this)))}).on("blur.colourpicker",".colourpicker-input",function(){var b=a(this);b.data("colourpicker-settings");b.data("colourpicker-initialized")&&(b.val(j(b)),""===b.val()&&b.val(u(b)),b.val(b.val().toUpperCase()))}).on("keydown.colourpicker",".colourpicker-input",function(b){var c=a(this);if(c.data("colourpicker-initialized"))switch(b.keyCode){case 9:e();break;case 13:case 27:e(),c.blur()}}).on("keyup.colourpicker",".colourpicker-input",function(){var b=a(this);b.data("colourpicker-initialized")&&h(b,!0)}).on("paste.colourpicker",".colourpicker-input",function(){var b=a(this);b.data("colourpicker-initialized")&&setTimeout(function(){h(b,!0)},1)}).on("change.colourpicker-istransparent",".input-group-addon",function(b){var c=a(this).siblings(".colourpicker-input"),f=(c.parent(),a(this).find(".colourpicker-istransparent"));e(),c.data("transparent",f.is(":checked")),h(c)})}); diff --git a/inst/htmlwidgets/lib/mathjax/cdn.js b/inst/htmlwidgets/lib/mathjax/cdn.js new file mode 100644 index 0000000000..c0ed345192 --- /dev/null +++ b/inst/htmlwidgets/lib/mathjax/cdn.js @@ -0,0 +1,4 @@ +var script = document.createElement("script"); +script.type = "text/javascript"; +script.src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"; +document.getElementsByTagName("head")[0].appendChild(script); diff --git a/inst/htmlwidgets/lib/plotlyjs/LICENSE b/inst/htmlwidgets/lib/plotlyjs/LICENSE index ae3a855cb1..1196ce9631 100644 --- a/inst/htmlwidgets/lib/plotlyjs/LICENSE +++ b/inst/htmlwidgets/lib/plotlyjs/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Plotly, Inc +Copyright (c) 2021 Plotly, Inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/af.js b/inst/htmlwidgets/lib/plotlyjs/locales/af.js new file mode 100644 index 0000000000..4a1550f4cc --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/af.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"af",dictionary:{},format:{days:["Sondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrydag","Saterdag"],shortDays:["Son","Maan","Dins","Woens","Don","Vry","Sat"],months:["Januarie","Februarie","Maart","April","Mei","Junie","Julie","Augustus","September","Oktober","November","Desember"],shortMonths:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Des"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/am.js b/inst/htmlwidgets/lib/plotlyjs/locales/am.js new file mode 100644 index 0000000000..75213a0848 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/am.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"am",dictionary:{},format:{days:["\u1230\u1295\u12f4\u12ed","\u1218\u1295\u12f4\u12ed","\u1275\u12e9\u1235\u12f4\u12ed","\u12cc\u1295\u1235\u12f4\u12ed","\u1270\u122d\u1230\u12f4\u12ed","\u134d\u122b\u12ed\u12f4\u12ed","\u1233\u1270\u122d\u12f4\u12ed"],shortDays:["\u1230\u1295\u12f4","\u1218\u1295\u12f4","\u1275\u12e9\u1235","\u12cc\u1295\u1235","\u1270\u122d\u1230","\u134d\u122b\u12ed","\u1233\u1270\u122d"],months:["\u1303\u1295\u12cb\u122a","\u1348\u1265\u122d\u12cb\u122a","\u121b\u122d\u127d","\u12a0\u1355\u122a\u120d","\u121c\u12ed","\u1301\u1295","\u1301\u120b\u12ed","\u12a6\u1308\u1235\u1275","\u1234\u1355\u1274\u121d\u1260\u122d","\u12a6\u12ad\u1276\u1260\u122d","\u1296\u126c\u121d\u1260\u122d","\u12f2\u1234\u121d\u1260\u122d"],shortMonths:["\u1303\u1295\u12cb","\u1348\u1265\u122d","\u121b\u122d\u127d","\u12a0\u1355\u122a","\u121c\u12ed","\u1301\u1295","\u1301\u120b\u12ed","\u12a6\u1308\u1235","\u1234\u1355\u1274","\u12a6\u12ad\u1276","\u1296\u126c\u121d","\u12f2\u1234\u121d"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/ar-dz.js b/inst/htmlwidgets/lib/plotlyjs/locales/ar-dz.js new file mode 100644 index 0000000000..56b72c9686 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/ar-dz.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"ar-DZ",dictionary:{},format:{days:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0627\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a"],shortDays:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0627\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a"],months:["\u062c\u0627\u0646\u0641\u064a","\u0641\u064a\u0641\u0631\u064a","\u0645\u0627\u0631\u0633","\u0623\u0641\u0631\u064a\u0644","\u0645\u0627\u064a","\u062c\u0648\u0627\u0646","\u062c\u0648\u064a\u0644\u064a\u0629","\u0623\u0648\u062a","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"],shortMonths:["1","2","3","4","5","6","7","8","9","10","11","12"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/ar-eg.js b/inst/htmlwidgets/lib/plotlyjs/locales/ar-eg.js new file mode 100644 index 0000000000..c0944e25e9 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/ar-eg.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"ar-EG",dictionary:{},format:{days:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0627\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a"],shortDays:["\u0623\u062d\u062f","\u0627\u062b\u0646\u064a\u0646","\u062b\u0644\u0627\u062b\u0627\u0621","\u0623\u0631\u0628\u0639\u0627\u0621","\u062e\u0645\u064a\u0633","\u062c\u0645\u0639\u0629","\u0633\u0628\u062a"],months:["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0625\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0629","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"],shortMonths:["1","2","3","4","5","6","7","8","9","10","11","12"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/ar.js b/inst/htmlwidgets/lib/plotlyjs/locales/ar.js new file mode 100644 index 0000000000..975fe0ece3 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/ar.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"ar",dictionary:{},format:{days:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0627\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a"],shortDays:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0627\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a"],months:["\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u062b\u0627\u0646\u064a","\u0634\u0628\u0627\u0637","\u0622\u0630\u0627\u0631","\u0646\u064a\u0633\u0627\u0646","\u0622\u0630\u0627\u0631","\u062d\u0632\u064a\u0631\u0627\u0646","\u062a\u0645\u0648\u0632","\u0622\u0628","\u0623\u064a\u0644\u0648\u0644","\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u0623\u0648\u0644","\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u062b\u0627\u0646\u064a","\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u0623\u0648\u0644"],shortMonths:["1","2","3","4","5","6","7","8","9","10","11","12"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/az.js b/inst/htmlwidgets/lib/plotlyjs/locales/az.js new file mode 100644 index 0000000000..e918f965f5 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/az.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"az",dictionary:{},format:{days:["Bazar","Bazar ert\u0259si","\xc7\u0259r\u015f\u0259nb\u0259 ax\u015fam\u0131","\xc7\u0259r\u015f\u0259nb\u0259","C\xfcm\u0259 ax\u015fam\u0131","C\xfcm\u0259","\u015e\u0259nb\u0259"],shortDays:["B","Be","\xc7a","\xc7","Ca","C","\u015e"],months:["Yanvar","Fevral","Mart","Aprel","May","\u0130yun","\u0130yul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],shortMonths:["Yan","Fev","Mar","Apr","May","\u0130yun","\u0130yul","Avq","Sen","Okt","Noy","Dek"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/bg.js b/inst/htmlwidgets/lib/plotlyjs/locales/bg.js new file mode 100644 index 0000000000..48e9e78af3 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/bg.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"bg",dictionary:{},format:{days:["\u041d\u0435\u0434\u0435\u043b\u044f","\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u043d\u0438\u043a","\u0412\u0442\u043e\u0440\u043d\u0438\u043a","\u0421\u0440\u044f\u0434\u0430","\u0427\u0435\u0442\u0432\u044a\u0440\u0442\u044a\u043a","\u041f\u0435\u0442\u044a\u043a","\u0421\u044a\u0431\u043e\u0442\u0430"],shortDays:["\u041d\u0435\u0434","\u041f\u043e\u043d","\u0412\u0442\u043e","\u0421\u0440\u044f","\u0427\u0435\u0442","\u041f\u0435\u0442","\u0421\u044a\u0431"],months:["\u042f\u043d\u0443\u0430\u0440\u0438","\u0424\u0435\u0432\u0440\u0443\u0430\u0440\u0438","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0438\u043b","\u041c\u0430\u0439","\u042e\u043d\u0438","\u042e\u043b\u0438","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043f\u0442\u0435\u043c\u0432\u0440\u0438","\u041e\u043a\u0442\u043e\u043c\u0432\u0440\u0438","\u041d\u043e\u0435\u043c\u0432\u0440\u0438","\u0414\u0435\u043a\u0435\u043c\u0432\u0440\u0438"],shortMonths:["\u042f\u043d\u0443","\u0424\u0435\u0432","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0439","\u042e\u043d\u0438","\u042e\u043b\u0438","\u0410\u0432\u0433","\u0421\u0435\u043f","\u041e\u043a\u0442","\u041d\u043e\u0432","\u0414\u0435\u043a"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/bs.js b/inst/htmlwidgets/lib/plotlyjs/locales/bs.js new file mode 100644 index 0000000000..f55be92a55 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/bs.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"bs",dictionary:{},format:{days:["Nedelja","Ponedeljak","Utorak","Srijeda","\u010cetvrtak","Petak","Subota"],shortDays:["Ned","Pon","Uto","Sri","\u010cet","Pet","Sub"],months:["Januar","Februar","Mart","April","Maj","Juni","Juli","August","Septembar","Oktobar","Novembar","Decembar"],shortMonths:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/ca.js b/inst/htmlwidgets/lib/plotlyjs/locales/ca.js new file mode 100644 index 0000000000..9b3231c435 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/ca.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"ca",dictionary:{},format:{days:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"],shortDays:["Dug","Dln","Dmt","Dmc","Djs","Dvn","Dsb"],months:["Gener","Febrer","Mar\xe7","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],shortMonths:["Gen","Feb","Mar","Abr","Mai","Jun","Jul","Ago","Set","Oct","Nov","Des"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/cs.js b/inst/htmlwidgets/lib/plotlyjs/locales/cs.js new file mode 100644 index 0000000000..e9adaea1fc --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/cs.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"cs",dictionary:{Autoscale:"Auto rozsah","Box Select":"Obd\xe9ln\xedkov\xfd v\xfdb\u011br","Click to enter Colorscale title":"Klikn\u011bte pro zad\xe1n\xed n\xe1zvu barevn\xe9 \u0161k\xe1ly","Click to enter Component A title":"Klikn\u011bte pro zad\xe1n\xed n\xe1zvu komponenty A","Click to enter Component B title":"Klikn\u011bte pro zad\xe1n\xed n\xe1zvu komponenty B","Click to enter Component C title":"Klikn\u011bte pro zad\xe1n\xed n\xe1zvu komponenty C","Click to enter Plot title":"Klikn\u011bte pro zad\xe1n\xed n\xe1zvu grafu","Click to enter X axis title":"Klikn\u011bte pro zad\xe1n\xed n\xe1zvu osy X","Click to enter Y axis title":"Klikn\u011bte pro zad\xe1n\xed n\xe1zvu osy Y","Click to enter radial axis title":"Klikn\u011bte pro zad\xe1n\xed n\xe1zvu radi\xe1ln\xed osy","Compare data on hover":"Porovnat hodnoty p\u0159i najet\xed my\u0161\xed","Double-click on legend to isolate one trace":"Dvojklikem na legendu izolujete jedinou datovou sadu","Double-click to zoom back out":"Dvojklikem vr\xe1t\xedte zv\u011bt\u0161en\xed","Download plot as a png":"Ulo\u017eit jako PNG","Download plot":"Ulo\u017eit","Edit in Chart Studio":"Editovat v Chart Studio","IE only supports svg. Changing format to svg.":"IE podporuje pouze SVG form\xe1t. Zm\u011bn\u011bno na SVG.","Lasso Select":"Vyb\u011br lasem","Orbital rotation":"Rotace (orbit\xe1ln\xed)",Pan:"Posunovat","Produced with Plotly.js":"Vytvo\u0159eno pomoc\xed Plotly.js",Reset:"Obnovit nastaven\xed","Reset axes":"Obnovit nastaven\xed os","Reset camera to default":"Obnovit nastaven\xed kamery na v\xfdchoz\xed stav","Reset camera to last save":"Obnovit nastaven\xed kamery na posledn\xed ulo\u017een\xfd stav","Reset view":"Obnovit nastaven\xed pohledu","Reset views":"Obnovit nastaven\xed pohled\u016f","Show closest data on hover":"Zobrazit najbli\u017e\u0161\xed hodnotu p\u0159i najet\xed my\u0161\xed","Snapshot succeeded":"Sn\xedmek vytvo\u0159en","Sorry, there was a problem downloading your snapshot!":"Omlouv\xe1me se, ale do\u0161lo k chyb\u011b stahov\xe1n\xed sn\xedmku!","Taking snapshot - this may take a few seconds":"Vytv\xe1\u0159\xed se sn\xedmek - m\u016f\u017ee zabrat p\xe1r vte\u0159in",Zoom:"Zv\u011bt\u0161en\xed","Zoom in":"Zv\u011bt\u0161it","Zoom out":"Zmen\u0161it","close:":"zav\u0159\xedt:",trace:"datov\xe1 sada","lat:":"Lat.:","lon:":"Lon.:","q1:":"q1:","q3:":"q3:","source:":"zdroj:","target:":"c\xedl:","lower fence:":"doln\xed limit:","upper fence:":"horn\xed limit:","max:":"max.:","mean \xb1 \u03c3:":"pr\u016fm\u011br \xb1 \u03c3:","mean:":"pr\u016fm\u011br:","median:":"medi\xe1n:","min:":"min.:","new text":"nov\xfd text","Turntable rotation":"Rotace (oto\u010dn\xfd st\u016fl)","Toggle Spike Lines":"P\u0159epnout zobrazen\xed vod\xedc\xedch \u010dar","open:":"otev\u0159\xedt:","high:":"horn\xed:","low:":"doln\xed:","Toggle show closest data on hover":"P\u0159epnout zobrazov\xe1n\xed nejbli\u017e\u0161i hodnoty p\u0159i najet\xed my\u0161\xed","incoming flow count:":"po\u010det dat na vstupu:","outgoing flow count:":"po\u010det dat na v\xfdstupu:","kde:":"kde:"},format:{days:["ned\u011ble","pond\u011bl\xed","\xfater\xfd","st\u0159eda","\u010dtvrtek","p\xe1tek","sobota"],shortDays:["ne","po","\xfat","st","\u010dt","p\xe1","so"],months:["leden","\xfanor","b\u0159ezen","duben","kv\u011bten","\u010derven","\u010dervenec","srpen","z\xe1\u0159\xed","\u0159\xedjen","listopad","prosinec"],shortMonths:["led","\xfano","b\u0159e","dub","kv\u011b","\u010der","\u010dvc","srp","z\xe1\u0159","\u0159\xedj","lis","pro"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/cy.js b/inst/htmlwidgets/lib/plotlyjs/locales/cy.js new file mode 100644 index 0000000000..aa06e6af73 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/cy.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"cy",dictionary:{Autoscale:"Graddfa awtomatig","Box Select":"Dewiswch \xe2 blwch","Click to enter Colorscale title":"Cliciwch i nodi teitl Graddfa Liw","Click to enter Component A title":"Cliciwch i nodi teitl Cydran A","Click to enter Component B title":"Cliciwch i nodi teitl Cydran B","Click to enter Plot title":"Cliciwch i nodi teitl y Plot","Click to enter Component C title":"Cliciwch i nodi teitl Cydran C","Click to enter X axis title":"Cliciwch i nodi teitl echelin X","Click to enter Y axis title":"Cliciwch i nodi teitl echelin Y","Click to enter radial axis title":"Cliciwch i nodi teitl echelin reiddiol","Compare data on hover":"Cymharwch ddata wrth hofran","Double-click on legend to isolate one trace":"Dwbl-gliciwch ar yr allwedd i neilltuo un llinell","Double-click to zoom back out":"Dwbl-gliciwch i chwyddo'n \xf4l","Download plot":"Lawrlwythwch blot","Download plot as a png":"Lawrlwythwch y plot fel png","Edit in Chart Studio":"Golygu yn Chart Studio","IE only supports svg. Changing format to svg.":"Dim ond svg mae IE yn ei gefnogi. Newid fformat i svg.","Lasso Select":"Dewiswch \xe2 las\u0175","Orbital rotation":"Cylchdroi orbital",Pan:"Pan","Produced with Plotly.js":"Cynhyrchwyd gyda Plotly.js",Reset:"Ailosod","Reset axes":"Ailosod echelinau","Reset camera to default":"Ailosod camera i'r rhagosodiad","Reset camera to last save":"Ailosod camera i'r cadw diwethaf","Reset view":"Ailosodwch y golwg","Reset views":"Ailosod olygfeydd","Show closest data on hover":"Dangos y data agosaf wrth hofran","Snapshot succeeded":"Llwyddodd y Ciplun","Sorry, there was a problem downloading your snapshot!":"Mae'n ddrwg gennym, roedd problem wrth lawrlwytho eich ciplun!","Taking snapshot - this may take a few seconds":"Tynnu ciplun - gallai hyn gymryd ychydig o eiliadau","Toggle Spike Lines":"Toglo llinellau pigog","Toggle show closest data on hover":"Toglo dangos y data agosaf wrth hofran","Turntable rotation":"Cylchdroi trofwrdd",Zoom:"Chwyddo","Zoom in":"Closio","Zoom out":"Cilio","close:":"cau:","high:":"uchel:","incoming flow count:":"cyfrif llif sy'n dod i mewn:","kde:":"kde:","lat:":"lledred:","lon:":"hydred","low:":"isel:","lower fence:":"ffens isaf:","max:":"uchafbwynt:","mean \xb1 \u03c3:":"cymedr \xb1 \u03c3:","mean:":"cymedr:","median:":"canolrif:","min:":"isafbwynt:","new text":"testun newydd","open:":"agor:","outgoing flow count:":"cyfrif llif sy'n mynd allan:","q1:":"q1:","q3:":"q3:","source:":"ffynhonnell:","target:":"targed:",trace:"olin","upper fence:":"ffens uchaf:"},format:{days:["Dydd Sul","Dydd Llun","Dydd Mawrth","Dydd Mercher","Dydd Iau","Dydd Gwener","Dydd Sadwrn"],shortDays:["Sul","Llun","Maw","Mer","Iau","Gwen","Sad"],months:["Ionawr","Chwefror","Mawrth","Ebrill","Mai","Mehefin","Gorffennaf","Awst","Medi","Hydref","Tachwedd","Rhagfyr"],shortMonths:["Ion","Chw","Maw","Ebr","Mai","Meh","Gor","Awst","Medi","Hyd","Tach","Rhag"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/da.js b/inst/htmlwidgets/lib/plotlyjs/locales/da.js new file mode 100644 index 0000000000..5e42f088f4 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/da.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"da",dictionary:{},format:{days:["S\xf8ndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","L\xf8rdag"],shortDays:["S\xf8n","Man","Tir","Ons","Tor","Fre","L\xf8r"],months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],shortMonths:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],date:"%d-%m-%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/de-ch.js b/inst/htmlwidgets/lib/plotlyjs/locales/de-ch.js new file mode 100644 index 0000000000..f3bea5b8ad --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/de-ch.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"de-CH",dictionary:{},format:{days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shortDays:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","M\xe4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],shortMonths:["Jan","Feb","M\xe4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/de.js b/inst/htmlwidgets/lib/plotlyjs/locales/de.js new file mode 100644 index 0000000000..7f8ceabec3 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/de.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"de",dictionary:{Autoscale:"Automatische Skalierung","Box Select":"Rechteckauswahl","Click to enter Colorscale title":"Klicken, um den Farbskalatitel einzugeben","Click to enter Component A title":"Klicken, um den Titel der Komponente A einzugeben","Click to enter Component B title":"Klicken, um den Titel der Komponente B einzugeben","Click to enter Component C title":"Klicken, um den Titel der Komponente C einzugeben","Click to enter Plot title":"Klicken, um den Titel des Graphen einzugeben","Click to enter X axis title":"Klicken, um den Titel der X-Achse einzugeben","Click to enter Y axis title":"Klicken, um den Titel der Y-Achse einzugeben","Compare data on hover":"\xdcber die Daten fahren, um sie zu vergleichen","Double-click on legend to isolate one trace":"Daten isolieren durch Doppelklick in der Legende","Double-click to zoom back out":"Herauszoomen durch Doppelklick","Download plot as a png":"Graphen als PNG herunterladen","Download plot":"Graphen herunterladen","Edit in Chart Studio":"Im Chart Studio bearbeiten","IE only supports svg. Changing format to svg.":"IE unterst\xfctzt nur SVG-Dateien. Format wird zu SVG gewechselt.","Lasso Select":"Lassoauswahl","Orbital rotation":"Orbitalrotation",Pan:"Verschieben","Produced with Plotly.js":"Erstellt mit Plotly.js",Reset:"Zur\xfccksetzen","Reset axes":"Achsen zur\xfccksetzen","Reset camera to default":"Kamera auf Standard zur\xfccksetzen","Reset camera to last save":"Kamera auf letzte Speicherung zur\xfccksetzen","Reset view":"Ansicht zur\xfccksetzen","Reset views":"Ansichten zur\xfccksetzen","Show closest data on hover":"Zeige n\xe4heste Daten beim \xdcberfahren","Snapshot succeeded":"Snapshot erfolgreich","Sorry, there was a problem downloading your snapshot!":"Es gab ein Problem beim Herunterladen des Snapshots","Taking snapshot - this may take a few seconds":"Erstelle einen Snapshot - dies kann einige Sekunden dauern",Zoom:"Zoom","Zoom in":"Hineinzoomen","Zoom out":"Herauszoomen","close:":"Schluss:",trace:"Datenspur","lat:":"Lat.:","lon:":"Lon.:","q1:":"q1:","q3:":"q3:","source:":"Quelle:","target:":"Ziel:","lower fence:":"Untere Schranke:","upper fence:":"Obere Schranke:","max:":"Max.:","mean \xb1 \u03c3:":"Mittelwert \xb1 \u03c3:","mean:":"Mittelwert:","median:":"Median:","min:":"Min.:","Turntable rotation":"Drehscheibenorbit","Toggle Spike Lines":"Bezugslinien an-/abschalten","open:":"Er\xf6ffnung:","high:":"H\xf6chstkurs:","low:":"Tiefstkurs:","Toggle show closest data on hover":"Anzeige der n\xe4hesten Daten an-/abschalten","incoming flow count:":"Anzahl eingehender Verbindungen:","outgoing flow count:":"Anzahl ausgehender Verbindungen:","kde:":"Dichte:"},format:{days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shortDays:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","M\xe4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],shortMonths:["Jan","Feb","M\xe4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],date:"%d.%m.%Y",decimal:",",thousands:"."}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/el.js b/inst/htmlwidgets/lib/plotlyjs/locales/el.js new file mode 100644 index 0000000000..a365ec71b5 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/el.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"el",dictionary:{},format:{days:["\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae","\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1","\u03a4\u03c1\u03af\u03c4\u03b7","\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7","\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7","\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae","\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf"],shortDays:["\u039a\u03c5\u03c1","\u0394\u03b5\u03c5","\u03a4\u03c1\u03b9","\u03a4\u03b5\u03c4","\u03a0\u03b5\u03bc","\u03a0\u03b1\u03c1","\u03a3\u03b1\u03b2"],months:["\u0399\u03b1\u03bd\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2","\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2","\u039c\u03ac\u03c1\u03c4\u03b9\u03bf\u03c2","\u0391\u03c0\u03c1\u03af\u03bb\u03b9\u03bf\u03c2","\u039c\u03ac\u03b9\u03bf\u03c2","\u0399\u03bf\u03cd\u03bd\u03b9\u03bf\u03c2","\u0399\u03bf\u03cd\u03bb\u03b9\u03bf\u03c2","\u0391\u03cd\u03b3\u03bf\u03c5\u03c3\u03c4\u03bf\u03c2","\u03a3\u03b5\u03c0\u03c4\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2","\u039f\u03ba\u03c4\u03ce\u03b2\u03c1\u03b9\u03bf\u03c2","\u039d\u03bf\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2","\u0394\u03b5\u03ba\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2"],shortMonths:["\u0399\u03b1\u03bd","\u03a6\u03b5\u03b2","\u039c\u03b1\u03c1","\u0391\u03c0\u03c1","\u039c\u03b1\u03b9","\u0399\u03bf\u03c5\u03bd","\u0399\u03bf\u03c5\u03bb","\u0391\u03c5\u03b3","\u03a3\u03b5\u03c0","\u039f\u03ba\u03c4","\u039d\u03bf\u03b5","\u0394\u03b5\u03ba"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/eo.js b/inst/htmlwidgets/lib/plotlyjs/locales/eo.js new file mode 100644 index 0000000000..b4e9686d69 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/eo.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"eo",dictionary:{},format:{days:["Diman\u0109o","Lundo","Mardo","Merkredo","\u0134a\u016ddo","Vendredo","Sabato"],shortDays:["Dim","Lun","Mar","Mer","\u0134a\u016d","Ven","Sab"],months:["Januaro","Februaro","Marto","Aprilo","Majo","Junio","Julio","A\u016dgusto","Septembro","Oktobro","Novembro","Decembro"],shortMonths:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","A\u016dg","Sep","Okt","Nov","Dec"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/es-ar.js b/inst/htmlwidgets/lib/plotlyjs/locales/es-ar.js new file mode 100644 index 0000000000..839d034977 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/es-ar.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"es-AR",dictionary:{},format:{days:["Domingo","Lunes","Martes","Mi\xe9rcoles","Jueves","Viernes","S\xe1bado"],shortDays:["Dom","Lun","Mar","Mi\xe9","Juv","Vie","S\xe1b"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],shortMonths:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/es-pe.js b/inst/htmlwidgets/lib/plotlyjs/locales/es-pe.js new file mode 100644 index 0000000000..577470bf51 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/es-pe.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"es-PE",dictionary:{},format:{days:["Domingo","Lunes","Martes","Mi\xe9rcoles","Jueves","Viernes","S\xe1bado"],shortDays:["Dom","Lun","Mar","Mi\xe9","Jue","Vie","Sab"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],shortMonths:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],date:"%d/%m/%Y",decimal:".",thousands:",",currency:["S/",""]}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/es.js b/inst/htmlwidgets/lib/plotlyjs/locales/es.js new file mode 100644 index 0000000000..a0d0499cb5 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/es.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"es",dictionary:{Autoscale:"Autoescalar","Box Select":"Seleccionar Caja","Click to enter Colorscale title":"Introducir el t\xedtulo de la Escala de Color","Click to enter Component A title":"Introducir el t\xedtulo del Componente A","Click to enter Component B title":"Introducir el t\xedtulo del Componente B","Click to enter Component C title":"Introducir el t\xedtulo del Componente C","Click to enter Plot title":"Introducir el t\xedtulo de la Gr\xe1fica","Click to enter X axis title":"Introducir el t\xedtulo del eje X","Click to enter Y axis title":"Introducir el t\xedtulo del eje Y","Click to enter radial axis title":"Introducir el t\xedtulo del eje radial","Compare data on hover":"Comparar datos al pasar por encima","Double-click on legend to isolate one trace":"Haga doble-clic en la leyenda para aislar una traza","Double-click to zoom back out":"Haga doble-clic para restaurar la escala","Download plot as a png":"Descargar gr\xe1fica como png","Download plot":"Descargar gr\xe1fica","Edit in Chart Studio":"Editar en Chart Studio","IE only supports svg. Changing format to svg.":"IE solo soporta svg. Cambiando formato a svg.","Lasso Select":"Seleccionar con lazo","Orbital rotation":"Rotaci\xf3n esf\xe9rica",Pan:"Modo Panor\xe1mica","Produced with Plotly.js":"Hecho con Plotly.js",Reset:"Reiniciar","Reset axes":"Reiniciar ejes","Reset camera to default":"Restaurar c\xe1mara predeterminada","Reset camera to last save":"Restaurar anterior c\xe1mara","Reset view":"Restaurar vista","Reset views":"Restaurar vistas","Show closest data on hover":"Mostrar el dato m\xe1s cercano al pasar por encima","Snapshot succeeded":"La captura de la instant\xe1nea finaliz\xf3 correctamente","Sorry, there was a problem downloading your snapshot!":"\xa1La descarga de la instant\xe1nea fall\xf3!","Taking snapshot - this may take a few seconds":"Capturando una instant\xe1nea - podr\xeda tardar unos segundos","Toggle Spike Lines":"Mostrar/Ocultar Gu\xedas","Toggle show closest data on hover":"Activar/Desactivar mostrar el dato m\xe1s cercano al pasar por encima","Turntable rotation":"Rotaci\xf3n plana",Zoom:"Modo Ampliar/Reducir","Zoom in":"Ampliar","Zoom out":"Reducir","close:":"cierre:","high:":"alza:","incoming flow count:":"flujo de entrada:","kde:":"edp:","lat:":"lat:","lon:":"lon:","low:":"baja:","lower fence:":"l\xedmite inferior:","max:":"m\xe1x:","mean \xb1 \u03c3:":"media \xb1 \u03c3:","mean:":"media:","median:":"mediana:","min:":"m\xedn:","new text":"nuevo texto","open:":"apertura:","outgoing flow count:":"flujo de salida:","q1:":"q1:","q3:":"q3:","source:":"fuente:","target:":"destino:",trace:"traza","upper fence:":"l\xedmite superior:"},format:{days:["Domingo","Lunes","Martes","Mi\xe9rcoles","Jueves","Viernes","S\xe1bado"],shortDays:["Dom","Lun","Mar","Mi\xe9","Jue","Vie","S\xe1b"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],shortMonths:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],date:"%d/%m/%Y",decimal:",",thousands:" "}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/et.js b/inst/htmlwidgets/lib/plotlyjs/locales/et.js new file mode 100644 index 0000000000..f88d968540 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/et.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"et",dictionary:{},format:{days:["P\xfchap\xe4ev","Esmasp\xe4ev","Teisip\xe4ev","Kolmap\xe4ev","Neljap\xe4ev","Reede","Laup\xe4ev"],shortDays:["P\xfchap","Esmasp","Teisip","Kolmap","Neljap","Reede","Laup"],months:["Jaanuar","Veebruar","M\xe4rts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],shortMonths:["Jaan","Veebr","M\xe4rts","Apr","Mai","Juuni","Juuli","Aug","Sept","Okt","Nov","Dets"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/eu.js b/inst/htmlwidgets/lib/plotlyjs/locales/eu.js new file mode 100644 index 0000000000..b479b19693 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/eu.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"eu",dictionary:{},format:{days:["Igandea","Astelehena","Asteartea","Asteazkena","Osteguna","Ostirala","Larunbata"],shortDays:["Iga","Ast","Ast","Ast","Ost","Ost","Lar"],months:["Urtarrila","Otsaila","Martxoa","Apirila","Maiatza","Ekaina","Uztaila","Abuztua","Iraila","Urria","Azaroa","Abendua"],shortMonths:["Urt","Ots","Mar","Api","Mai","Eka","Uzt","Abu","Ira","Urr","Aza","Abe"],date:"%Y/%m/%d"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/fa.js b/inst/htmlwidgets/lib/plotlyjs/locales/fa.js new file mode 100644 index 0000000000..9619cbd097 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/fa.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"fa",dictionary:{},format:{days:["\u064a\u06a9\u0634\u0646\u0628\u0647","\u062f\u0648\u0634\u0646\u0628\u0647","\u0633\u0647\u200c\u0634\u0646\u0628\u0647","\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647","\u067e\u0646\u062c\u0634\u0646\u0628\u0647","\u062c\u0645\u0639\u0647","\u0634\u0646\u0628\u0647"],shortDays:["\u064a","\u062f","\u0633","\u0686","\u067e","\u062c","\u0634"],months:["\u0641\u0631\u0648\u0631\u062f\u064a\u0646","\u0627\u0631\u062f\u064a\u0628\u0647\u0634\u062a","\u062e\u0631\u062f\u0627\u062f","\u062a\u064a\u0631","\u0645\u0631\u062f\u0627\u062f","\u0634\u0647\u0631\u064a\u0648\u0631","\u0645\u0647\u0631","\u0622\u0628\u0627\u0646","\u0622\u0630\u0631","\u062f\u064a","\u0628\u0647\u0645\u0646","\u0627\u0633\u0641\u0646\u062f"],shortMonths:["1","2","3","4","5","6","7","8","9","10","11","12"],date:"%Y/%m/%d"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/fi.js b/inst/htmlwidgets/lib/plotlyjs/locales/fi.js new file mode 100644 index 0000000000..faaa1f50d1 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/fi.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"fi",dictionary:{Autoscale:"Autoskaalaa","Box Select":"Laatikkovalinta","Click to enter Colorscale title":"Klikkaa antaaksesi v\xe4riskaalan otsikko","Click to enter Component A title":"Klikkaa antaaksesi komponentin A otsikko","Click to enter Component B title":"Klikkaa antaaksesi komponentin B otsikko","Click to enter Component C title":"Klikkaa antaaksesi komponentin C otsikko","Click to enter Plot title":"Klikkaa antaaksesi kuvion otsikko","Click to enter X axis title":"Klikkaa antaaksesi x-akselin otsikko","Click to enter Y axis title":"Klikkaa antaaksesi y-akselin otsikko","Click to enter radial axis title":"Klikkaa antaaksesi radiaalisen akselin otsikko","Compare data on hover":"Vertaa dataa kursorilla","Double-click on legend to isolate one trace":"Kaksoisklikkaa selitett\xe4 erist\xe4\xe4ksesi yksi sarja","Double-click to zoom back out":"Kaksoisklikkaa zoomataksesi ulos","Download plot":"Lataa kuvio","Download plot as png":"Lataa kuvio png-muodossa","Edit in Chart Studio":"Muokkaa Chart Studiossa","IE only supports svg. Changing format to svg.":"Formaatiksi vaihdetaan IE:n tukema svg.","Lasso Select":"Lassovalinta","Orbital rotation":"Orbitaalikierto",Pan:"Panorointi","Produced with Plotly.js":"Tuotettu Plotly.jsll\xe4",Reset:"Palauta oletusasetukset","Reset axes":"Palauta akselien oletusasetukset","Reset camera to default":"Palauta kameran oletusasetukset","Reset camera to last save":"Palauta kameran viimeksi tallennetut asetukset","Reset view":"Palauta n\xe4kym\xe4n oletusasetukset","Reset views":"Palauta n\xe4kymien oletusasetukset","Show closest data on hover":"N\xe4yt\xe4 kursoria l\xe4hin data","Snapshot succeeded":"Tilannekuvan ottaminen onnistui","Sorry, there was a problem downloading your snapshot!":"Pahoittelut, tilannekuvan lataaminen ep\xe4onnistui!","Taking snapshot - this may take a few seconds":"Otetaan tilannekuvaa - odota hetki","Toggle Spike Lines":"N\xe4yt\xe4 huiput","Toggle show closest data on hover":"N\xe4yt\xe4 kursoria l\xe4hin data","Turntable rotation":"Tasokierto",Zoom:"Zoomaus","Zoom in":"Zoomaa sis\xe4\xe4n","Zoom out":"Zoomaa ulos","close:":"loppu:","high:":"korkein:","incoming flow count:":"saapuva virtaus:","kde:":"ydinestimointi:","lat:":"lat.:","lon:":"lon.:","low:":"matalin:","lower fence:":"alempi raja:","max:":"maks.:","mean \xb1 \u03c3:":"keskiarvo \xb1 \u03c3:","mean:":"keskiarvo:","median:":"mediaani:","min:":"min.:","new text":"uusi teksti","open:":"alku:","outgoing flow count:":"l\xe4htev\xe4 virtaus:","q1:":"q1:","q3:":"q3:","source:":"l\xe4hde:","target:":"kohde:",trace:"sarja","upper fence:":"ylempi raja:"},format:{days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],shortDays:["su","ma","ti","ke","to","pe","la"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kes\xe4kuu","hein\xe4kuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],shortMonths:["tammi","helmi","maalis","huhti","touko","kes\xe4","hein\xe4","elo","syys","loka","marras","joulu"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/fo.js b/inst/htmlwidgets/lib/plotlyjs/locales/fo.js new file mode 100644 index 0000000000..7cb96d928b --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/fo.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"fo",dictionary:{},format:{days:["Sunnudagur","M\xe1nadagur","T\xfdsdagur","Mikudagur","H\xf3sdagur","Fr\xedggjadagur","Leyardagur"],shortDays:["Sun","M\xe1n","T\xfds","Mik","H\xf3s","Fr\xed","Ley"],months:["Januar","Februar","Mars","Apr\xedl","Mei","Juni","Juli","August","September","Oktober","November","Desember"],shortMonths:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Des"],date:"%d-%m-%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/fr-ch.js b/inst/htmlwidgets/lib/plotlyjs/locales/fr-ch.js new file mode 100644 index 0000000000..5cf92269cd --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/fr-ch.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"fr-CH",dictionary:{},format:{days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],shortDays:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],months:["Janvier","F\xe9vrier","Mars","Avril","Mai","Juin","Juillet","Ao\xfbt","Septembre","Octobre","Novembre","D\xe9cembre"],shortMonths:["Jan","F\xe9v","Mar","Avr","Mai","Jun","Jul","Ao\xfb","Sep","Oct","Nov","D\xe9c"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/fr.js b/inst/htmlwidgets/lib/plotlyjs/locales/fr.js new file mode 100644 index 0000000000..cb3c203239 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/fr.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"fr",dictionary:{Autoscale:"\xc9chelle automatique","Box Select":"S\xe9lection rectangulaire","Click to enter Colorscale title":"Ajouter un titre \xe0 l'\xe9chelle de couleurs","Click to enter Component A title":"Ajouter un titre \xe0 la composante A","Click to enter Component B title":"Ajouter un titre \xe0 la composante B","Click to enter Component C title":"Ajouter un titre \xe0 la composante C","Click to enter Plot title":"Ajouter un titre au graphique","Click to enter X axis title":"Ajouter un titre \xe0 l'axe des x","Click to enter Y axis title":"Ajouter un titre \xe0 l'axe des y","Click to enter radial axis title":"Ajouter un titre \xe0 l'axe radial","Compare data on hover":"Comparaison entre donn\xe9es en survol","Double-click on legend to isolate one trace":"Double-cliquer sur la l\xe9gende pour isoler une s\xe9rie","Double-click to zoom back out":"Double-cliquer pour d\xe9zoomer","Download plot as a png":"T\xe9l\xe9charger le graphique en fichier PNG","Download plot":"T\xe9l\xe9charger le graphique","Edit in Chart Studio":"\xc9diter le graphique sur Chart Studio","IE only supports svg. Changing format to svg.":"IE ne permet que les conversions en SVG. Conversion en SVG en cours.","Lasso Select":"S\xe9lection lasso","Orbital rotation":"Rotation orbitale",Pan:"Translation","Produced with Plotly.js":"G\xe9n\xe9r\xe9 avec Plotly.js",Reset:"R\xe9initialiser","Reset axes":"R\xe9initialiser les axes","Reset camera to default":"R\xe9gler la cam\xe9ra \xe0 sa valeur d\xe9faut","Reset camera to last save":"R\xe9gler la cam\xe9ra \xe0 sa valeur sauvegard\xe9e","Reset view":"R\xe9initialiser","Reset views":"R\xe9initialiser","Show closest data on hover":"Donn\xe9es les plus proches en survol","Snapshot succeeded":"Conversion r\xe9ussie","Sorry, there was a problem downloading your snapshot!":"D\xe9sol\xe9, un probl\xe8me est survenu lors du t\xe9l\xe9chargement de votre graphique","Taking snapshot - this may take a few seconds":"Conversion en cours, ceci peut prendre quelques secondes",Zoom:"Zoom","Zoom in":"Zoom int\xe9rieur","Zoom out":"Zoom ext\xe9rieur","close:":"fermeture :",trace:"s\xe9rie","lat:":"lat. :","lon:":"lon. :","q1:":"q1 :","q3:":"q3 :","source:":"source :","target:":"embouchure :","lower fence:":"cl\xf4ture inf\xe9rieure :","upper fence:":"cl\xf4ture sup\xe9rieure :","max:":"max. :","mean \xb1 \u03c3:":"moyenne \xb1 \u03c3 :","mean:":"moyenne :","median:":"m\xe9diane :","min:":"min. :","new text":"nouveau texte","Turntable rotation":"Rotation planaire","Toggle Spike Lines":"Activer/d\xe9sactiver les pics","open:":"ouverture :","high:":"haut :","low:":"bas :","Toggle show closest data on hover":"Activer/d\xe9sactiver le survol","incoming flow count:":"flux entrant :","outgoing flow count:":"flux sortant :","kde:":"est. par noyau :"},format:{days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],shortDays:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],months:["Janvier","F\xe9vrier","Mars","Avril","Mai","Juin","Juillet","Ao\xfbt","Septembre","Octobre","Novembre","D\xe9cembre"],shortMonths:["Jan","F\xe9v","Mar","Avr","Mai","Jun","Jul","Ao\xfb","Sep","Oct","Nov","D\xe9c"],date:"%d/%m/%Y",decimal:",",thousands:" ",year:"%Y",month:"%b %Y",dayMonth:"%-d %b",dayMonthYear:"%-d %b %Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/gl.js b/inst/htmlwidgets/lib/plotlyjs/locales/gl.js new file mode 100644 index 0000000000..1debf3d013 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/gl.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"gl",dictionary:{},format:{days:["Domingo","Luns","Martes","M\xe9rcores","Xoves","Venres","S\xe1bado"],shortDays:["Dom","Lun","Mar","M\xe9r","Xov","Ven","S\xe1b"],months:["Xaneiro","Febreiro","Marzo","Abril","Maio","Xu\xf1o","Xullo","Agosto","Setembro","Outubro","Novembro","Decembro"],shortMonths:["Xan","Feb","Mar","Abr","Mai","Xu\xf1","Xul","Ago","Set","Out","Nov","Dec"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/gu.js b/inst/htmlwidgets/lib/plotlyjs/locales/gu.js new file mode 100644 index 0000000000..b4707b9a2f --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/gu.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"gu",dictionary:{},format:{days:["\u0ab0\u0ab5\u0abf\u0ab5\u0abe\u0ab0","\u0ab8\u0acb\u0aae\u0ab5\u0abe\u0ab0","\u0aae\u0a82\u0a97\u0ab3\u0ab5\u0abe\u0ab0","\u0aac\u0ac1\u0aa7\u0ab5\u0abe\u0ab0","\u0a97\u0ac1\u0ab0\u0ac1\u0ab5\u0abe\u0ab0","\u0ab6\u0ac1\u0a95\u0acd\u0ab0\u0ab5\u0abe\u0ab0","\u0ab6\u0aa8\u0abf\u0ab5\u0abe\u0ab0"],shortDays:["\u0ab0\u0ab5\u0abf","\u0ab8\u0acb\u0aae","\u0aae\u0a82\u0a97\u0ab3","\u0aac\u0ac1\u0aa7","\u0a97\u0ac1\u0ab0\u0ac1","\u0ab6\u0ac1\u0a95\u0acd\u0ab0","\u0ab6\u0aa8\u0abf"],months:["\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1\u0a86\u0ab0\u0ac0","\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1\u0a86\u0ab0\u0ac0","\u0aae\u0abe\u0ab0\u0acd\u0a9a","\u0a8f\u0aaa\u0acd\u0ab0\u0abf\u0ab2","\u0aae\u0ac7","\u0a9c\u0ac2\u0aa8","\u0a9c\u0ac1\u0ab2\u0abe\u0a88","\u0a91\u0a97\u0ab8\u0acd\u0a9f","\u0ab8\u0aaa\u0acd\u0a9f\u0ac7\u0aae\u0acd\u0aac\u0ab0","\u0a91\u0a95\u0acd\u0a9f\u0acb\u0aac\u0ab0","\u0aa8\u0ab5\u0ac7\u0aae\u0acd\u0aac\u0ab0","\u0aa1\u0abf\u0ab8\u0ac7\u0aae\u0acd\u0aac\u0ab0"],shortMonths:["\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1","\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1","\u0aae\u0abe\u0ab0\u0acd\u0a9a","\u0a8f\u0aaa\u0acd\u0ab0\u0abf\u0ab2","\u0aae\u0ac7","\u0a9c\u0ac2\u0aa8","\u0a9c\u0ac1\u0ab2\u0abe\u0a88","\u0a91\u0a97\u0ab8\u0acd\u0a9f","\u0ab8\u0aaa\u0acd\u0a9f\u0ac7","\u0a91\u0a95\u0acd\u0a9f\u0acb","\u0aa8\u0ab5\u0ac7","\u0aa1\u0abf\u0ab8\u0ac7"],date:"%d-%b-%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/he.js b/inst/htmlwidgets/lib/plotlyjs/locales/he.js new file mode 100644 index 0000000000..d5d08119c2 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/he.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"he",dictionary:{},format:{days:["\u05e8\u05d0\u05e9\u05d5\u05df","\u05e9\u05e0\u05d9","\u05e9\u05dc\u05d9\u05e9\u05d9","\u05e8\u05d1\u05d9\u05e2\u05d9","\u05d7\u05de\u05d9\u05e9\u05d9","\u05e9\u05d9\u05e9\u05d9","\u05e9\u05d1\u05ea"],shortDays:["\u05d0'","\u05d1'","\u05d2'","\u05d3'","\u05d4'","\u05d5'","\u05e9\u05d1\u05ea"],months:["\u05d9\u05e0\u05d5\u05d0\u05e8","\u05e4\u05d1\u05e8\u05d5\u05d0\u05e8","\u05de\u05e8\u05e5","\u05d0\u05e4\u05e8\u05d9\u05dc","\u05de\u05d0\u05d9","\u05d9\u05d5\u05e0\u05d9","\u05d9\u05d5\u05dc\u05d9","\u05d0\u05d5\u05d2\u05d5\u05e1\u05d8","\u05e1\u05e4\u05d8\u05de\u05d1\u05e8","\u05d0\u05d5\u05e7\u05d8\u05d5\u05d1\u05e8","\u05e0\u05d5\u05d1\u05de\u05d1\u05e8","\u05d3\u05e6\u05de\u05d1\u05e8"],shortMonths:["1","2","3","4","5","6","7","8","9","10","11","12"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/hi-in.js b/inst/htmlwidgets/lib/plotlyjs/locales/hi-in.js new file mode 100644 index 0000000000..ca970d6aec --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/hi-in.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"hi-IN",dictionary:{},format:{days:["\u0930\u0935\u093f\u0935\u093e\u0930","\u0938\u094b\u092e\u0935\u093e\u0930","\u092e\u0902\u0917\u0932\u0935\u093e\u0930","\u092c\u0941\u0927\u0935\u093e\u0930","\u0917\u0941\u0930\u0941\u0935\u093e\u0930","\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930","\u0936\u0928\u093f\u0935\u093e\u0930"],shortDays:["\u0930\u0935\u093f","\u0938\u094b\u092e","\u092e\u0902\u0917\u0932","\u092c\u0941\u0927","\u0917\u0941\u0930\u0941","\u0936\u0941\u0915\u094d\u0930","\u0936\u0928\u093f"],months:["\u091c\u0928\u0935\u0930\u0940"," \u092b\u0930\u0935\u0930\u0940","\u092e\u093e\u0930\u094d\u091a","\u0905\u092a\u094d\u0930\u0948\u0932","\u092e\u0908","\u091c\u0942\u0928","\u091c\u0941\u0932\u093e\u0908","\u0905\u0917\u0938\u094d\u0924","\u0938\u093f\u0924\u092e\u094d\u092c\u0930","\u0905\u0915\u094d\u091f\u0942\u092c\u0930","\u0928\u0935\u092e\u094d\u092c\u0930","\u0926\u093f\u0938\u092e\u094d\u092c\u0930"],shortMonths:["\u091c\u0928","\u092b\u0930","\u092e\u093e\u0930\u094d\u091a","\u0905\u092a\u094d\u0930\u0948","\u092e\u0908","\u091c\u0942\u0928","\u091c\u0941\u0932\u093e\u0908","\u0905\u0917","\u0938\u093f\u0924","\u0905\u0915\u094d\u091f\u0942","\u0928\u0935","\u0926\u093f\u0938"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/hr.js b/inst/htmlwidgets/lib/plotlyjs/locales/hr.js new file mode 100644 index 0000000000..f6c0edfa8f --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/hr.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"hr",dictionary:{Autoscale:"Automatsko skaliranje","Box Select":"Pravokutni odabir","Click to enter Colorscale title":"Kliknite za unos Colorscale naziva","Click to enter Component A title":"Kliknite za unos naziva Komponente A","Click to enter Component B title":"Kliknite za unos naziva Komponente B","Click to enter Component C title":"Kliknite za unos naziva Komponente C","Click to enter Plot title":"Kliknite za unos naslova grafikona","Click to enter X axis title":"Kliknite za unos naziva X osi","Click to enter Y axis title":"Kliknite za unos naziva Y osi","Click to enter radial axis title":"Kliknite za unos naziva radijalne osi","Compare data on hover":"Usporedi podatke pri prijelazu mi\u0161em","Double-click on legend to isolate one trace":"Dvaput kliknite kako biste izolirali jednu oznaku","Double-click to zoom back out":"Dvaput kliknite kako biste vratili originalnu razinu zumiranja","Download plot as a png":"Preuzmite grafi\u010dki prikaz kao .png","Download plot":"Preuzmite grafi\u010dki prikaz","Edit in Chart Studio":"Uredite pomo\u0107u funkcionalnosti Chart Studio","IE only supports svg. Changing format to svg.":"IE podr\u017eava samo svg. Format se mijenja u svg.","Lasso Select":"Laso odabir","Orbital rotation":"Rotacija oko osi",Pan:"Pomicanje","Produced with Plotly.js":"Napravljeno u paketu Plotly.js",Reset:"Resetirajte","Reset axes":"Resetirajte osi","Reset camera to default":"Resetirajte kameru na zadane vrijednosti","Reset camera to last save":"Resetirajte kameru na zadnje snimljene postavke","Reset view":"Resetirajte pogled","Reset views":"Resetirajte poglede","Show closest data on hover":"Prika\u017ei najbli\u017ee podatke pri zadr\u017eavanju mi\u0161em","Snapshot succeeded":"Preuzimanje slike uspje\u0161no","Sorry, there was a problem downloading your snapshot!":"Pojavila se gre\u0161ka prilikom preuzimanja slike!","Taking snapshot - this may take a few seconds":"Preuzimanje slike - ovo mo\u017ee potrajati nekoliko sekundi","Toggle Spike Lines":"Postavljanje pomo\u0107nih linija","Toggle show closest data on hover":"Postavljanje prikaza najbli\u017eih podataka pri zadr\u017eavanju mi\u0161em","Turntable rotation":"Turntable rotiranje",Zoom:"Zumiranje","Zoom in":"Pove\u0107aj zumiranje","Zoom out":"Smanji zumiranje","close:":"zatvori:","high:":"visoko:","incoming flow count:":"broj dolaze\u0107eg flowa:","kde:":"kde:","lat:":"lat:","lon:":"lon:","low:":"nisko:","lower fence:":"donja granica:","max:":"max:","mean:":"prosjek","median:":"medijan:","min:":"min:","new text":"novi tekst","open:":"otvori:","outgoing flow count:":"broj odlaze\u0107eg flow-a:","q1:":"q1:","q3:":"q3:","source:":"izvor:","target:":"cilj:",trace:"oznaka","upper fence:":"gornja granica:"},format:{days:["Nedjelja","Ponedjeljak","Utorak","Srijeda","\u010cetvrtak","Petak","Subota"],shortDays:["Ned","Pon","Uto","Sri","\u010cet","Pet","Sub"],months:["Sije\u010danj","Velja\u010da","O\u017eujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],shortMonths:["Sij","Velj","O\u017eu","Tra","Svi","Lip","Srp","Kol","Ruj","Lis","Stu","Pro"],date:"%d.%m.%Y.",decimal:",",thousands:""}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/hu.js b/inst/htmlwidgets/lib/plotlyjs/locales/hu.js new file mode 100644 index 0000000000..2e336f240b --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/hu.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"hu",dictionary:{},format:{days:["Vas\xe1rnap","H\xe9tf\xf6","Kedd","Szerda","Cs\xfct\xf6rt\xf6k","P\xe9ntek","Szombat"],shortDays:["Vas","H\xe9t","Ked","Sze","Cs\xfc","P\xe9n","Szo"],months:["Janu\xe1r","Febru\xe1r","M\xe1rcius","\xc1prilis","M\xe1jus","J\xfanius","J\xfalius","Augusztus","Szeptember","Okt\xf3ber","November","December"],shortMonths:["Jan","Feb","M\xe1r","\xc1pr","M\xe1j","J\xfan","J\xfal","Aug","Szep","Okt","Nov","Dec"],date:"%Y-%m-%d"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/hy.js b/inst/htmlwidgets/lib/plotlyjs/locales/hy.js new file mode 100644 index 0000000000..9f0e1ee25f --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/hy.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"hy",dictionary:{},format:{days:["\u056f\u056b\u0580\u0561\u056f\u056b","\u0565\u056f\u0578\u0582\u0577\u0561\u0562\u0569\u056b","\u0565\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056b","\u0579\u0578\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056b","\u0570\u056b\u0576\u0563\u0577\u0561\u0562\u0569\u056b","\u0578\u0582\u0580\u0562\u0561\u0569","\u0577\u0561\u0562\u0561\u0569"],shortDays:["\u056f\u056b\u0580","\u0565\u0580\u056f","\u0565\u0580\u0584","\u0579\u0580\u0584","\u0570\u0576\u0563","\u0578\u0582\u0580\u0562","\u0577\u0562\u0569"],months:["\u0540\u0578\u0582\u0576\u057e\u0561\u0580","\u0553\u0565\u057f\u0580\u057e\u0561\u0580","\u0544\u0561\u0580\u057f","\u0531\u057a\u0580\u056b\u056c","\u0544\u0561\u0575\u056b\u057d","\u0540\u0578\u0582\u0576\u056b\u057d","\u0540\u0578\u0582\u056c\u056b\u057d","\u0555\u0563\u0578\u057d\u057f\u0578\u057d","\u054d\u0565\u057a\u057f\u0565\u0574\u0562\u0565\u0580","\u0540\u0578\u056f\u057f\u0565\u0574\u0562\u0565\u0580","\u0546\u0578\u0575\u0565\u0574\u0562\u0565\u0580","\u0534\u0565\u056f\u057f\u0565\u0574\u0562\u0565\u0580"],shortMonths:["\u0540\u0578\u0582\u0576\u057e","\u0553\u0565\u057f\u0580","\u0544\u0561\u0580\u057f","\u0531\u057a\u0580","\u0544\u0561\u0575\u056b\u057d","\u0540\u0578\u0582\u0576\u056b\u057d","\u0540\u0578\u0582\u056c","\u0555\u0563\u057d","\u054d\u0565\u057a","\u0540\u0578\u056f","\u0546\u0578\u0575","\u0534\u0565\u056f"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/id.js b/inst/htmlwidgets/lib/plotlyjs/locales/id.js new file mode 100644 index 0000000000..20dd5bd86d --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/id.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"id",dictionary:{},format:{days:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],shortDays:["Min","Sen","Sel","Rab","kam","Jum","Sab"],months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","Nopember","Desember"],shortMonths:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agus","Sep","Okt","Nop","Des"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/is.js b/inst/htmlwidgets/lib/plotlyjs/locales/is.js new file mode 100644 index 0000000000..73a671f46a --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/is.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"is",dictionary:{},format:{days:["Sunnudagur","M\xe1nudagur","\xderi\xf0judagur","Mi\xf0vikudagur","Fimmtudagur","F\xf6studagur","Laugardagur"],shortDays:["Sun","M\xe1n","\xderi","Mi\xf0","Fim","F\xf6s","Lau"],months:["Jan\xfaar","Febr\xfaar","Mars","Apr\xedl","Ma\xed","J\xfan\xed","J\xfal\xed","\xc1g\xfast","September","Okt\xf3ber","N\xf3vember","Desember"],shortMonths:["Jan","Feb","Mar","Apr","Ma\xed","J\xfan","J\xfal","\xc1g\xfa","Sep","Okt","N\xf3v","Des"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/it.js b/inst/htmlwidgets/lib/plotlyjs/locales/it.js new file mode 100644 index 0000000000..098ab47274 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/it.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"it",dictionary:{Autoscale:"Scala automaticamente","Box Select":"Selezione box","Click to enter Colorscale title":"Clicca per inserire un titolo alla scala di colori","Click to enter Component A title":"Clicca per inserire un titolo al componente A","Click to enter Component B title":"Clicca per inserire un titolo al componente B","Click to enter Component C title":"Clicca per inserire un titolo al componente C","Click to enter Plot title":"Clicca per inserire un titolo al grafico","Click to enter X axis title":"Clicca per inserire un titolo all'asse X","Click to enter Y axis title":"Clicca per inserire un titolo all'asse Y","Click to enter radial axis title":"Clicca per inserire un titolo per l' asse radiale","Compare data on hover":"Paragona i dati al passaggio del mouse","Double-click on legend to isolate one trace":"Doppio click per isolare i dati di una traccia","Double-click to zoom back out":"Doppio click per tornare allo zoom iniziale","Download plot as a png":"Scarica il grafico come immagine png","Download plot":"Scarica il grafico","Edit in Chart Studio":"Modifica in Chart Studio","IE only supports svg. Changing format to svg.":"IE supporta solo svg. Modifica formato in svg.","Lasso Select":"Selezione lazo","Orbital rotation":"Rotazione orbitale",Pan:"Sposta","Produced with Plotly.js":"Creato con Plotly.js",Reset:"Reset","Reset axes":"Resetta gli assi","Reset camera to default":"Reimposta la camera ai valori predefiniti","Reset camera to last save":"Reimposta la camera all' ultimo salvataggio","Reset view":"Reimposta la vista","Reset views":"Reimposta le viste","Show closest data on hover":"Mostra i dati pi\xf9 vicini al passaggio del mouse","Snapshot succeeded":"Screenshot creato con successo","Sorry, there was a problem downloading your snapshot!":"Si \xe8 verificato un errore durante la creazione dello screenshot","Taking snapshot - this may take a few seconds":"Creazione screenshot - potrebbe richiedere qualche secondo",Zoom:"Zoom","Zoom in":"Ingrandisci","Zoom out":"Rimpicciolisci","close:":"chiudi:",trace:"traccia","lat:":"lat.:","lon:":"lon.:","q1:":"q1:","q3:":"q3:","source:":"sorgente:","target:":"target:","max:":"max.:","mean \xb1 \u03c3:":"media \xb1 \u03c3:","mean:":"media:","median:":"mediana:","min:":"min.:","new text:":"Nuovo testo:","upper fence:":"limite superiore:","lower fence:":"limite inferiore:","Turntable rotation":"Rotazione piattaforma","Toggle Spike Lines":"Abilita linee di identificazione","open:":"apri:","high:":"alto:","kde:":"kde:","low:":"basso:","incoming flow count:":"Flusso in entrata:","outgoing flow count:":"Flusso in uscita:","Toggle show closest data on hover":"Abilita mostra i dati pi\xf9 vicini al passaggio del mouse"},format:{days:["Domenica","Luned\xec","Marted\xec","Mercoled\xec","Gioved\xec","Venerd\xec","Sabato"],shortDays:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],shortMonths:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],date:"%d/%m/%Y",decimal:",",thousands:"."}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/ja.js b/inst/htmlwidgets/lib/plotlyjs/locales/ja.js new file mode 100644 index 0000000000..335a46b6b2 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/ja.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"ja",dictionary:{Autoscale:"\u81ea\u52d5\u30ba\u30fc\u30e0","Box Select":"\u77e9\u5f62\u9078\u629e","Click to enter Colorscale title":"\u8272\u30b9\u30b1\u30fc\u30eb\u30bf\u30a4\u30c8\u30eb\u3092\u5165\u529b\u3059\u308b\u306b\u306f\u30af\u30ea\u30c3\u30af","Click to enter Component A title":"\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8A\u306e\u30bf\u30a4\u30c8\u30eb\u5165\u529b\u3059\u308b\u306b\u306f\u30af\u30ea\u30c3\u30af","Click to enter Component B title":"\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8B\u306e\u30bf\u30a4\u30c8\u30eb\u5165\u529b\u3059\u308b\u306b\u306f\u30af\u30ea\u30c3\u30af","Click to enter Component C title":"\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8C\u306e\u30bf\u30a4\u30c8\u30eb\u5165\u529b\u3059\u308b\u306b\u306f\u30af\u30ea\u30c3\u30af","Click to enter Plot title":"\u30d7\u30ed\u30c3\u30c8\u30bf\u30a4\u30c8\u30eb\u3092\u5165\u529b\u3059\u308b\u306b\u306f\u30af\u30ea\u30c3\u30af","Click to enter X axis title":"X\u8ef8\u30bf\u30a4\u30c8\u30eb\u3092\u5165\u529b\u3059\u308b\u306b\u306f\u30af\u30ea\u30c3\u30af","Click to enter Y axis title":"Y\u8ef8\u30bf\u30a4\u30c8\u30eb\u3092\u5165\u529b\u3059\u308b\u306b\u306f\u30af\u30ea\u30c3\u30af","Compare data on hover":"\u30db\u30d0\u30fc\u4e2d\u306e\u30c7\u30fc\u30bf\u3092\u6bd4\u8f03","Double-click on legend to isolate one trace":"\u51e1\u4f8b\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u30661\u3064\u306e\u30c8\u30ec\u30fc\u30b9\u3092\u7121\u52b9\u5316\u3057\u307e\u3059","Double-click to zoom back out":"\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3067\u30ba\u30fc\u30e0\u3092\u623b\u3057\u307e\u3059","Download plot as a png":"PNG\u30d5\u30a1\u30a4\u30eb\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9","Download plot":"\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9","Edit in Chart Studio":"Chart Studio\u3067\u7de8\u96c6","IE only supports svg. Changing format to svg.":"IE\u306fSVG\u306e\u307f\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002SVG\u306b\u5909\u63db\u3057\u307e\u3059\u3002","Lasso Select":"\u6295\u3052\u7e04\u9078\u629e","Orbital rotation":"\u8ecc\u9053\u56de\u8ee2",Pan:"\u62e1\u5927","Produced with Plotly.js":"Plotly.js\u306b\u3088\u308a\u4f5c\u6210",Reset:"\u30ea\u30bb\u30c3\u30c8","Reset axes":"\u8ef8\u3092\u30ea\u30bb\u30c3\u30c8","Reset camera to default":"\u30ab\u30e1\u30e9\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u306b\u623b\u3059","Reset camera to last save":"\u30ab\u30e1\u30e9\u3092\u6700\u5f8c\u306e\u4fdd\u5b58\u72b6\u614b\u306b\u623b\u3059","Reset view":"\u30d3\u30e5\u30fc\u3092\u30ea\u30bb\u30c3\u30c8","Reset views":"\u30d3\u30e5\u30fc\u3092\u30ea\u30bb\u30c3\u30c8","Show closest data on hover":"\u30db\u30d0\u30fc\u6642\u306b\u4e00\u756a\u8fd1\u3044\u30c7\u30fc\u30bf\u3092\u8868\u793a","Snapshot succeeded":"\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306b\u6210\u529f","Sorry, there was a problem downloading your snapshot!":"\u3059\u307f\u307e\u305b\u3093\u3001\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u30a8\u30e9\u30fc\u3067\u3059!","Taking snapshot - this may take a few seconds":"\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u3092\u64ae\u5f71",Zoom:"\u30ba\u30fc\u30e0","Zoom in":"\u62e1\u5927","Zoom out":"\u7e2e\u5c0f","close:":"\u9589\u3058\u308b:",trace:"\u30c8\u30ec\u30fc\u30b9:","lat:":"\u7def\u5ea6:","lon:":"\u7d4c\u5ea6:","q1:":"\u7b2c\u4e00\u56db\u5206\u4f4d\u6570:","q3:":"\u7b2c\u4e09\u56db\u5206\u4f4d\u6570:","source:":"\u30bd\u30fc\u30b9:","target:":"\u30bf\u30fc\u30b2\u30c3\u30c8:","lower fence:":"\u30d5\u30a7\u30f3\u30b9\u4e0b\u9650:","upper fence:":"\u30d5\u30a7\u30f3\u30b9\u4e0a\u9650:","max:":"\u6700\u5927:","mean \xb1 \u03c3:":"\u5e73\u5747 \xb1 \u03c3:","mean:":"\u5e73\u5747:","median:":"\u4e2d\u592e\u5024:","min:":"\u6700\u5c0f:","Turntable rotation":"\u8ef8\u56de\u8ee2:","Toggle Spike Lines":"\u30b9\u30d1\u30a4\u30af\u30e9\u30a4\u30f3\u306e\u30aa\u30f3\u30aa\u30d5","open:":"\u958b\u304f:","high:":"\u9ad8:","low:":"\u4f4e:","Toggle show closest data on hover":"\u30db\u30d0\u30fc\u6642\u306b\u4e00\u756a\u8fd1\u3044\u30c7\u30fc\u30bf\u3092\u8868\u793a\u306e\u30aa\u30f3\u30aa\u30d5","incoming flow count:":"\u6d41\u5165\u30d5\u30ed\u30fc\u30ab\u30a6\u30f3\u30c8:","outgoing flow count:":"\u6d41\u51fa\u30d5\u30ed\u30fc\u30ab\u30a6\u30f3\u30c8:","kde:":"kde:","Click to enter radial axis title":"\u653e\u5c04\u8ef8\u30bf\u30a4\u30c8\u30eb\u3092\u5165\u529b\u3059\u308b\u306b\u306f\u30af\u30ea\u30c3\u30af","new text":"\u65b0\u898f\u30c6\u30ad\u30b9\u30c8"},format:{days:["\u65e5\u66dc\u65e5","\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5"],shortDays:["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],months:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],shortMonths:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],date:"%Y/%m/%d"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/ka.js b/inst/htmlwidgets/lib/plotlyjs/locales/ka.js new file mode 100644 index 0000000000..30d689998e --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/ka.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"ka",dictionary:{},format:{days:["\u10d9\u10d5\u10d8\u10e0\u10d0","\u10dd\u10e0\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8","\u10e1\u10d0\u10db\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8","\u10dd\u10d7\u10ee\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8","\u10ee\u10e3\u10d7\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8","\u10de\u10d0\u10e0\u10d0\u10e1\u10d9\u10d4\u10d5\u10d8","\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8"],shortDays:["\u10d9\u10d5","\u10dd\u10e0\u10e8","\u10e1\u10d0\u10db","\u10dd\u10d7\u10ee","\u10ee\u10e3\u10d7","\u10de\u10d0\u10e0","\u10e8\u10d0\u10d1"],months:["\u10d8\u10d0\u10dc\u10d5\u10d0\u10e0\u10d8","\u10d7\u10d4\u10d1\u10d4\u10e0\u10d5\u10d0\u10da\u10d8","\u10db\u10d0\u10e0\u10e2\u10d8","\u10d0\u10de\u10e0\u10d8\u10da\u10d8","\u10db\u10d0\u10d8\u10e1\u10d8","\u10d8\u10d5\u10dc\u10d8\u10e1\u10d8","\u10d8\u10d5\u10da\u10d8\u10e1\u10d8","\u10d0\u10d2\u10d5\u10d8\u10e1\u10e2\u10dd","\u10e1\u10d4\u10e5\u10e2\u10d4\u10db\u10d1\u10d4\u10e0\u10d8","\u10dd\u10e5\u10e2\u10dd\u10db\u10d1\u10d4\u10e0\u10d8","\u10dc\u10dd\u10d4\u10db\u10d1\u10d4\u10e0\u10d8","\u10d3\u10d4\u10d9\u10d4\u10db\u10d1\u10d4\u10e0\u10d8"],shortMonths:["\u10d8\u10d0\u10dc","\u10d7\u10d4\u10d1","\u10db\u10d0\u10e0","\u10d0\u10de\u10e0","\u10db\u10d0\u10d8\u10e1\u10d8","\u10d8\u10d5\u10dc","\u10d8\u10d5\u10da","\u10d0\u10d2\u10d5","\u10e1\u10d4\u10e5","\u10dd\u10e5\u10e2","\u10dc\u10dd\u10d4","\u10d3\u10d4\u10d9"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/km.js b/inst/htmlwidgets/lib/plotlyjs/locales/km.js new file mode 100644 index 0000000000..11c27b4a53 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/km.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"km",dictionary:{},format:{days:["\u1790\u17d2\u1784\u17c3\u200b\u17a2\u17b6\u1791\u17b7\u178f\u17d2\u1799","\u1790\u17d2\u1784\u17c3\u200b\u1785\u1793\u17d2\u1791","\u1790\u17d2\u1784\u17c3\u200b\u17a2\u1784\u17d2\u1782\u17b6\u179a","\u1790\u17d2\u1784\u17c3\u200b\u1796\u17bb\u1792","\u1790\u17d2\u1784\u17c3\u200b\u1796\u17d2\u179a\u17a0\u179f\u17d2\u1794\u178f\u17d2\u178f\u17b7\u17cd","\u1790\u17d2\u1784\u17c3\u200b\u179f\u17bb\u1780\u17d2\u179a","\u1790\u17d2\u1784\u17c3\u200b\u179f\u17c5\u179a\u17cd"],shortDays:["\u17a2\u17b6","\u1785\u1793\u17d2\u1791","\u17a2\u1784\u17d2\u1782","\u1796\u17bb\u1792","\u1796\u17d2\u179a\u17a0","\u179f\u17bb","\u179f\u17c5\u179a\u17cd"],months:["\u1781\u17c2\u200b\u1798\u1780\u179a\u17b6","\u1781\u17c2\u200b\u1780\u17bb\u1798\u17d2\u1797\u17c8","\u1781\u17c2\u200b\u1798\u17b7\u1793\u17b6","\u1781\u17c2\u200b\u1798\u17c1\u179f\u17b6","\u1781\u17c2\u200b\u17a7\u179f\u1797\u17b6","\u1781\u17c2\u200b\u1798\u17b7\u1790\u17bb\u1793\u17b6","\u1781\u17c2\u200b\u1780\u1780\u17d2\u1780\u178a\u17b6","\u1781\u17c2\u200b\u179f\u17b8\u17a0\u17b6","\u1781\u17c2\u200b\u1780\u1789\u17d2\u1789\u17b6","\u1781\u17c2\u200b\u178f\u17bb\u179b\u17b6","\u1781\u17c2\u200b\u179c\u17b7\u1785\u17d2\u1786\u17b7\u1780\u17b6","\u1781\u17c2\u200b\u1792\u17d2\u1793\u17bc"],shortMonths:["\u1798\u1780","\u1780\u17bb","\u1798\u17b7\u1793\u17b6","\u1798\u17c1","\u17a7\u179f","\u1798\u17b7\u1790\u17bb","\u1780\u1780\u17d2\u1780","\u179f\u17b8","\u1780\u1789\u17d2\u1789\u17b6","\u178f\u17bb\u179b\u17b6","\u179c\u17b7\u1785\u17d2\u1786\u17b7","\u1792\u17d2\u1793\u17bc"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/ko.js b/inst/htmlwidgets/lib/plotlyjs/locales/ko.js new file mode 100644 index 0000000000..f0003e96e1 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/ko.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"ko",dictionary:{Autoscale:"\uc790\ub3d9 \ud06c\uae30\uc9c0\uc815","Box Select":"\ubc15\uc2a4 \uc120\ud0dd","Click to enter Colorscale title":"Colorscale \uc81c\ubaa9\uc744 \uc9c0\uc815\ud558\ub824\uba74 \ud074\ub9ad\ud558\uc138\uc694","Click to enter Component A title":"A\ub370\uc774\ud130\uc758 \uc81c\ubaa9\uc744 \uc9c0\uc815\ud558\ub824\uba74 \ud074\ub9ad\ud558\uc138\uc694","Click to enter Component B title":"B\ub370\uc774\ud130\uc758 \uc81c\ubaa9\uc744 \uc9c0\uc815\ud558\ub824\uba74 \ud074\ub9ad\ud558\uc138\uc694","Click to enter Component C title":"C\ub370\uc774\ud130\uc758 \uc81c\ubaa9\uc744 \uc9c0\uc815\ud558\ub824\uba74 \ud074\ub9ad\ud558\uc138\uc694","Click to enter Plot title":"\ucc28\ud2b8 \uc81c\ubaa9\uc744 \uc9c0\uc815\ud558\ub824\uba74 \ud074\ub9ad\ud558\uc138\uc694","Click to enter X axis title":"X\ucd95 \uc81c\ubaa9\uc744 \uc9c0\uc815\ud558\ub824\uba74 \ud074\ub9ad\ud558\uc138\uc694","Click to enter Y axis title":"Y\ucd95 \uc81c\ubaa9\uc744 \uc9c0\uc815\ud558\ub824\uba74 \ud074\ub9ad\ud558\uc138\uc694","Click to enter radial axis title":"\uc6d0\ud615 \ucd95 \uc81c\ubaa9\uc744 \uc9c0\uc815\ud558\ub824\uba74 \ud074\ub9ad\ud558\uc138\uc694","Compare data on hover":"\ub9c8\uc6b0\uc2a4\ub97c \uc62c\ub9ac\uba74 \ub370\uc774\ud130\uc640 \ube44\uad50\ud569\ub2c8\ub2e4","Double-click on legend to isolate one trace":"\ubc94\ub840\ub97c \ub354\ube14 \ud074\ub9ad\ud558\uc5ec \ud558\ub098\uc758 \ud2b8\ub808\uc774\uc2a4\ub97c \ubd84\ub9ac\ud569\ub2c8\ub2e4","Double-click to zoom back out":"\ub354\ube14 \ud074\ub9ad\ud558\uc5ec \uc90c\uc744 \ud574\uc81c\ud569\ub2c8\ub2e4","Download plot as a png":".png \uc774\ubbf8\uc9c0 \ud30c\uc77c\ub85c \ucc28\ud2b8\ub97c \ub2e4\uc6b4\ub85c\ub4dc \ud569\ub2c8\ub2e4","Download plot":"\ucc28\ud2b8\ub97c \ub2e4\uc6b4\ub85c\ub4dc \ud569\ub2c8\ub2e4","Edit in Chart Studio":"Chart Studio\ub97c \uc218\uc815\ud569\ub2c8\ub2e4","IE only supports svg. Changing format to svg.":"IE\ub294 svg\ub9cc\uc744 \uc9c0\uc6d0\ud569\ub2c8\ub2e4. \ud3ec\ub9f7\uc744 svg\ub85c \ubcc0\uacbd\ud558\uc138\uc694","Lasso Select":"\uc62c\uac00\ubbf8 \uc120\ud0dd","Orbital rotation":"\uada4\ub3c4 \uc218\uc815",Pan:"\uc774\ub3d9","Produced with Plotly.js":"Plotly.js \uc81c\uacf5",Reset:"\ucd08\uae30\ud654","Reset axes":"\ucd95 \ucd08\uae30\ud654","Reset camera to default":"camera\ub97c \uae30\ubcf8\uac12\uc73c\ub85c \ucd08\uae30\ud654","Reset camera to last save":"camera\ub97c \ub9c8\uc9c0\ub9c9\uc73c\ub85c \uc800\uc7a5\ud55c \uac12\uc73c\ub85c \ucd08\uae30\ud654","Reset view":"view \ucd08\uae30\ud654","Reset views":"views \ucd08\uae30\ud654","Show closest data on hover":"\ub9c8\uc6b0\uc2a4\ub97c \uc62c\ub9ac\uba74 \uadfc\uc811\ud55c \ub370\uc774\ud130\ub97c \ubcf4\uc774\uae30","Snapshot succeeded":"Snapshot \uc131\uacf5","Sorry, there was a problem downloading your snapshot!":"\uc8c4\uc1a1\ud569\ub2c8\ub2e4, snapshot\uc744 \ub2e4\uc6b4\ub85c\ub4dc \uc911 \ubb38\uc81c\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4!","Taking snapshot - this may take a few seconds":"snapshot \ucc0d\uae30 - \uc218 \ucd08\uac00 \uac78\ub9b4 \uc218 \uc788\uc2b5\ub2c8\ub2e4","Toggle Spike Lines":"\uc2a4\uc704\uce58\ub85c Lines\uc744 \uace0\uc815\ud569\ub2c8\ub2e4","Toggle show closest data on hover":"\uc2a4\uc704\uce58\ub85c \ub9c8\uc6b0\uc2a4\ub97c \uc62c\ub838\uc744 \ub54c \uac00\uc7a5 \uac00\uae4c\uc6b4 \ub370\uc774\ud130\ub97c \ubcf4\uc5ec\uc90d\ub2c8\ub2e4","Turntable rotation":"Turntable \ud68c\uc804",Zoom:"\ud655\ub300(\uc90c)","Zoom in":"\ud655\ub300(\uc90c \uc778)","Zoom out":"\ucd95\uc18c(\uc90c \uc544\uc6c3)",close:"\ub2eb\uae30",high:"\ub192\uc74c",low:"\ub0ae\uc74c",max:"\ucd5c\ub313\uac12","mean \xb1 \u03c3":"\ud3c9\uade0 \xb1 \u03c3",mean:"\ud3c9\uade0",median:"\uc911\uac04 \uac12",min:"\ucd5c\uc19f\uac12","new text":"\uc0c8\ub85c\uc6b4 \ud14d\uc2a4\ud2b8",open:"\uc5f4\uae30",q1:"q1",q3:"q3",source:"\uc18c\uc2a4",target:"\ud0c0\uac9f"},format:{days:["\uc77c\uc694\uc77c","\uc6d4\uc694\uc77c","\ud654\uc694\uc77c","\uc218\uc694\uc77c","\ubaa9\uc694\uc77c","\uae08\uc694\uc77c","\ud1a0\uc694\uc77c"],shortDays:["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"],months:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"],shortMonths:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"],date:"%Y-%m-%d"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/lt.js b/inst/htmlwidgets/lib/plotlyjs/locales/lt.js new file mode 100644 index 0000000000..05a87224a0 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/lt.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"lt",dictionary:{},format:{days:["sekmadienis","pirmadienis","antradienis","tre\u010diadienis","ketvirtadienis","penktadienis","\u0161e\u0161tadienis"],shortDays:["sek","pir","ant","tre","ket","pen","\u0161e\u0161"],months:["Sausis","Vasaris","Kovas","Balandis","Gegu\u017e\u0117","Bir\u017eelis","Liepa","Rugpj\u016btis","Rugs\u0117jis","Spalis","Lapkritis","Gruodis"],shortMonths:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],date:"%Y-%m-%d"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/lv.js b/inst/htmlwidgets/lib/plotlyjs/locales/lv.js new file mode 100644 index 0000000000..d2094400b2 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/lv.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"lv",dictionary:{},format:{days:["sv\u0113tdiena","pirmdiena","otrdiena","tre\u0161diena","ceturtdiena","piektdiena","sestdiena"],shortDays:["svt","prm","otr","tre","ctr","pkt","sst"],months:["Janv\u0101ris","Febru\u0101ris","Marts","Apr\u012blis","Maijs","J\u016bnijs","J\u016blijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],shortMonths:["Jan","Feb","Mar","Apr","Mai","J\u016bn","J\u016bl","Aug","Sep","Okt","Nov","Dec"],date:"%d-%m-%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/me-me.js b/inst/htmlwidgets/lib/plotlyjs/locales/me-me.js new file mode 100644 index 0000000000..a52026e08d --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/me-me.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"me-ME",dictionary:{},format:{days:["Ne\u0111elja","Pone\u0111eljak","Utorak","Srijeda","\u010cetvrtak","Petak","Subota"],shortDays:["Ne\u0111","Pon","Uto","Sri","\u010cet","Pet","Sub"],months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],shortMonths:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/me.js b/inst/htmlwidgets/lib/plotlyjs/locales/me.js new file mode 100644 index 0000000000..d6db29e541 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/me.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"me",dictionary:{},format:{days:["\u041d\u0435\u0452\u0435\u0459\u0430","\u041f\u043e\u043d\u0435\u0452\u0435\u0459\u0430\u043a","\u0423\u0442\u043e\u0440\u0430\u043a","\u0421\u0440\u0438\u0458\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0440\u0442\u0430\u043a","\u041f\u0435\u0442\u0430\u043a","\u0421\u0443\u0431\u043e\u0442\u0430"],shortDays:["\u041d\u0435\u0452","\u041f\u043e\u043d","\u0423\u0442\u043e","\u0421\u0440\u0438","\u0427\u0435\u0442","\u041f\u0435\u0442","\u0421\u0443\u0431"],months:["\u0408\u0430\u043d\u0443\u0430\u0440","\u0424\u0435\u0431\u0440\u0443\u0430\u0440","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0438\u043b","\u041c\u0430\u0458","\u0408\u0443\u043d","\u0408\u0443\u043b","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043f\u0442\u0435\u043c\u0431\u0430\u0440","\u041e\u043a\u0442\u043e\u0431\u0430\u0440","\u041d\u043e\u0432\u0435\u043c\u0431\u0430\u0440","\u0414\u0435\u0446\u0435\u043c\u0431\u0430\u0440"],shortMonths:["\u0408\u0430\u043d","\u0424\u0435\u0431","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0458","\u0408\u0443\u043d","\u0408\u0443\u043b","\u0410\u0432\u0433","\u0421\u0435\u043f","\u041e\u043a\u0442","\u041d\u043e\u0432","\u0414\u0435\u0446"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/mk.js b/inst/htmlwidgets/lib/plotlyjs/locales/mk.js new file mode 100644 index 0000000000..7971b953c6 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/mk.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"mk",dictionary:{},format:{days:["\u041d\u0435\u0434\u0435\u043b\u0430","\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u043d\u0438\u043a","\u0412\u0442\u043e\u0440\u043d\u0438\u043a","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0440\u0442\u043e\u043a","\u041f\u0435\u0442\u043e\u043a","\u0421\u0430\u0431\u043e\u0442\u0430"],shortDays:["\u041d\u0435\u0434","\u041f\u043e\u043d","\u0412\u0442\u043e","\u0421\u0440\u0435","\u0427\u0435\u0442","\u041f\u0435\u0442","\u0421\u0430\u0431"],months:["\u0408\u0430\u043d\u0443\u0430\u0440\u0438","\u0424\u0435\u0432\u0440\u0443\u0430\u0440\u0438","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0438\u043b","\u041c\u0430\u0458","\u0408\u0443\u043d\u0438","\u0408\u0443\u043b\u0438","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043f\u0442\u0435\u043c\u0432\u0440\u0438","\u041e\u043a\u0442\u043e\u043c\u0432\u0440\u0438","\u041d\u043e\u0435\u043c\u0432\u0440\u0438","\u0414\u0435\u043a\u0435\u043c\u0432\u0440\u0438"],shortMonths:["\u0408\u0430\u043d","\u0424\u0435\u0432","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0458","\u0408\u0443\u043d","\u0408\u0443\u043b","\u0410\u0432\u0433","\u0421\u0435\u043f","\u041e\u043a\u0442","\u041d\u043e\u0432","\u0414\u0435\u043a"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/ml.js b/inst/htmlwidgets/lib/plotlyjs/locales/ml.js new file mode 100644 index 0000000000..f70f0c7eaa --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/ml.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"ml",dictionary:{},format:{days:["\u0d1e\u0d3e\u0d2f\u0d30\u0d4d\u200d","\u0d24\u0d3f\u0d19\u0d4d\u0d15\u0d33\u0d4d\u200d","\u0d1a\u0d4a\u0d35\u0d4d\u0d35","\u0d2c\u0d41\u0d27\u0d28\u0d4d\u200d","\u0d35\u0d4d\u0d2f\u0d3e\u0d34\u0d02","\u0d35\u0d46\u0d33\u0d4d\u0d33\u0d3f","\u0d36\u0d28\u0d3f"],shortDays:["\u0d1e\u0d3e\u0d2f","\u0d24\u0d3f\u0d19\u0d4d\u0d15","\u0d1a\u0d4a\u0d35\u0d4d\u0d35","\u0d2c\u0d41\u0d27","\u0d35\u0d4d\u0d2f\u0d3e\u0d34\u0d02","\u0d35\u0d46\u0d33\u0d4d\u0d33\u0d3f","\u0d36\u0d28\u0d3f"],months:["\u0d1c\u0d28\u0d41\u0d35\u0d30\u0d3f","\u0d2b\u0d46\u0d2c\u0d4d\u0d30\u0d41\u0d35\u0d30\u0d3f","\u0d2e\u0d3e\u0d30\u0d4d\u200d\u0d1a\u0d4d\u0d1a\u0d4d","\u0d0f\u0d2a\u0d4d\u0d30\u0d3f\u0d32\u0d4d\u200d","\u0d2e\u0d47\u0d2f\u0d4d","\u0d1c\u0d42\u0d23\u0d4d\u200d","\u0d1c\u0d42\u0d32\u0d48","\u0d06\u0d17\u0d38\u0d4d\u0d31\u0d4d\u0d31\u0d4d","\u0d38\u0d46\u0d2a\u0d4d\u0d31\u0d4d\u0d31\u0d02\u0d2c\u0d30\u0d4d\u200d","\u0d12\u0d15\u0d4d\u0d1f\u0d4b\u0d2c\u0d30\u0d4d\u200d","\u0d28\u0d35\u0d02\u0d2c\u0d30\u0d4d\u200d","\u0d21\u0d3f\u0d38\u0d02\u0d2c\u0d30\u0d4d\u200d"],shortMonths:["\u0d1c\u0d28\u0d41","\u0d2b\u0d46\u0d2c\u0d4d","\u0d2e\u0d3e\u0d30\u0d4d\u200d","\u0d0f\u0d2a\u0d4d\u0d30\u0d3f","\u0d2e\u0d47\u0d2f\u0d4d","\u0d1c\u0d42\u0d23\u0d4d\u200d","\u0d1c\u0d42\u0d32\u0d3e","\u0d06\u0d17","\u0d38\u0d46\u0d2a\u0d4d","\u0d12\u0d15\u0d4d\u0d1f\u0d4b","\u0d28\u0d35\u0d02","\u0d21\u0d3f\u0d38"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/ms.js b/inst/htmlwidgets/lib/plotlyjs/locales/ms.js new file mode 100644 index 0000000000..7d1b72e063 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/ms.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"ms",dictionary:{},format:{days:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"],shortDays:["Aha","Isn","Sel","Rab","Kha","Jum","Sab"],months:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],shortMonths:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/mt.js b/inst/htmlwidgets/lib/plotlyjs/locales/mt.js new file mode 100644 index 0000000000..e68db1ef52 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/mt.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"mt",dictionary:{},format:{days:["Il-\u0126add","It-Tnejn","It-Tlieta","L-Erbg\u0127a","Il-\u0126amis","Il-\u0120img\u0127a","Is-Sibt"],shortDays:["\u0126ad","Tne","Tli","Erb","\u0126am","\u0120im","Sib"],months:["Jannar","Frar","Marzu","April","Mejju","\u0120unju","Lulju","Awissu","Settembru","Ottubru","Novembru","Di\u010bembru"],shortMonths:["Jan","Fra","Mar","Apr","Mej","\u0120un","Lul","Awi","Set","Ott","Nov","Di\u010b"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/nl-be.js b/inst/htmlwidgets/lib/plotlyjs/locales/nl-be.js new file mode 100644 index 0000000000..a6ec7b612d --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/nl-be.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"nl-BE",dictionary:{},format:{days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],shortDays:["zon","maa","din","woe","don","vri","zat"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],shortMonths:["jan","feb","maa","apr","mei","jun","jul","aug","sep","okt","nov","dec"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/nl.js b/inst/htmlwidgets/lib/plotlyjs/locales/nl.js new file mode 100644 index 0000000000..dbb6f288e0 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/nl.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"nl",dictionary:{Autoscale:"Automatische schaal","Click to enter Colorscale title":"Klik om kleurenschaal titel in te vullen","Click to enter Component A title":"Klik om Component A titel in te vullen","Click to enter Component B title":"Klik om Component B titel in te vullen","Click to enter Component C title":"Klik om Component C titel in te vullen","Click to enter Plot title":"Klik om Plot titel in te vullen","Click to enter X axis title":"Klik om x-as titel in te vullen","Click to enter Y axis title":"Klik om y-as titel in te vullen","Click to enter radial axis title":"Klik om radiaal-as titel in te vullen","Double-click to zoom back out":"Zoom uit door te dubbel klikken","Download plot as a png":"Dowload de plot als een png-bestand","Download plot":"Download de plot","Draw circle":"Teken cirkel","Draw closed freeform":"Teken gesloten vorm","Draw line":"Teken lijn","Draw open freeform":"Teken open vorm","Draw rectangle":"Teken rechthoek","Edit in Chart Studio":"In Chart Studio wijzigen","Erase active shape":"Wis huidige vorm","IE only supports svg. Changing format to svg.":"IE ondersteunt alleen svg bestanden. Formaat gewijzigd naar svg.","Lasso Select":"Lasso selectie","Produced with Plotly.js":"Gemaakt met Plotly.js",Zoom:"Inzoomen","max:":"maximum:","mean \xb1 \u03c3:":"gemiddelde \xb1 \u03c3:","mean:":"gemiddelde:","min:":"minimum:","new text":"nieuwe tekst","open:":"openen:","high:":"hoog:","low:":"laag:","source:":"bron:","target:":"doel:"},format:{days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],shortDays:["zon","maa","din","woe","don","vri","zat"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],shortMonths:["jan","feb","maa","apr","mei","jun","jul","aug","sep","okt","nov","dec"],date:"%d-%m-%Y",decimal:",",thousands:".",year:"%Y",month:"%b %Y",dayMonth:"%-d %b",dayMonthYear:"%-d %b %Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/no.js b/inst/htmlwidgets/lib/plotlyjs/locales/no.js new file mode 100644 index 0000000000..af4ed9fdcd --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/no.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"no",dictionary:{Autoscale:"Autoskalere","Box Select":"Velg rektangel","Click to enter Colorscale title":"Klikk for \xe5 oppgi tittel p\xe5 fargeskala","Click to enter Component A title":"Klikk for \xe5 oppgi tittel p\xe5 komponent A","Click to enter Component B title":"Klikk for \xe5 oppgi tittel p\xe5 komponent B","Click to enter Component C title":"Klikk for \xe5 oppgi tittel p\xe5 komponent C","Click to enter Plot title":"Klikk for \xe5 oppgi tittel p\xe5 plot","Click to enter X axis title":"Klikk for \xe5 oppgi tittel p\xe5 x-akse","Click to enter Y axis title":"Klikk for \xe5 oppgi tittel p\xe5 y-akse","Click to enter radial axis title":"Klikk for \xe5 oppgi tittel p\xe5 radiell akse","Compare data on hover":"Sammenligne data n\xe5r musepekeren holdes \xe5ver","Double-click on legend to isolate one trace":"Dobbelklikk p\xe5 p\xe5 forklaringen for \xe5 vise bare en serie","Double-click to zoom back out":"Dobbelklikk for \xe5 zoome ut igjen","Download plot":"Last ned plot","Download plot as a png":"Last ned plot som png","Edit in Chart Studio":"Editer i Chart Studio","IE only supports svg. Changing format to svg.":"IE st\xf8tter bare svg. Bytt format til svg.","Lasso Select":"Velg lasso","Orbital rotation":"Orbital rotasjon",Pan:"Panne","Produced with Plotly":"Laget med Plotly",Reset:"Nullstille","Reset akses":"Nullstille akser","Reset camera to default":"Nullstille kamera til standard","Reset camera to last save":"Nullstille kamera til siste lagret","Reset view":"Nullstille visning","Reset views":"Nullstille visninger","Show closest data on hover":"Vis n\xe6rmeste verdi n\xe5r musepekeren holdes over","Snapshot succeeded":"Bilde Laget","Sorry, there was a problem downloading your snapshot!":"Beklager, noe gikk galt under nedlasting av bildet","Taking snapshot - this may take a few seconds":"Oppretter bilde - dette kan ta noen sekunder","Toggle Spike Lines":"Aktiver / deaktiver topplinjer","Toggle show closest data on hover":"Aktiver / deaktiver n\xe6rmeste verdi n\xe5r musepekeren holdes over","Turntable rotation":"Flat rotation",Zoom:"Zoom","Zoom in":"Zoom inn","Zoom out":"Zoom ut","close:":"steng:","concentration:":"konsentrasjon:","high:":"h\xf8y:","incoming flow count:":"innkommende str\xf8mningssammendrag:","kde:":"kde:","lat:":"lat:","lon:":"lon:","low:":"lav:","lower fence:":"lavere grense","max:":"maks:","mean \xb1 \u03c3:":"gjennomsnitt \xb1 \u03c3:","mean:":"gjennomsnitt:","median:":"median:","min:":"min:","new text":"ny text","open:":"\xe5pen:","outgoing flow count:":"utg\xe5ende str\xf8mningssammendrag:","q1:":"q1:","q3:":"q3:","source:":"kilde:","target:":"m\xe5l:",trace:"serie","upper fence:":"\xf8vre grense:"},format:{days:["S\xf8ndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","L\xf8rdag"],shortDays:["S\xf8n","Man","Tir","Ons","Tor","Fre","L\xf8r"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],shortMonths:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],date:"%d.%m.%Y",decimal:",",thousands:" "}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/pa.js b/inst/htmlwidgets/lib/plotlyjs/locales/pa.js new file mode 100644 index 0000000000..dd39a436e3 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/pa.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"pa",dictionary:{},format:{days:["\u0a10\u0a24\u0a35\u0a3e\u0a30","\u0a38\u0a4b\u0a2e\u0a35\u0a3e\u0a30","\u0a2e\u0a70\u0a17\u0a32\u0a35\u0a3e\u0a30","\u0a2c\u0a41\u0a71\u0a27\u0a35\u0a3e\u0a30","\u0a35\u0a40\u0a30\u0a35\u0a3e\u0a30","\u0a38\u0a3c\u0a41\u0a71\u0a15\u0a30\u0a35\u0a3e\u0a30","\u0a38\u0a3c\u0a28\u0a3f\u0a71\u0a1a\u0a30\u0a35\u0a3e\u0a30"],shortDays:["\u0a10\u0a24","\u0a38\u0a4b\u0a2e","\u0a2e\u0a70\u0a17\u0a32","\u0a2c\u0a41\u0a71\u0a27","\u0a35\u0a40\u0a30","\u0a38\u0a3c\u0a41\u0a71\u0a15\u0a30","\u0a38\u0a3c\u0a28\u0a3f\u0a71\u0a1a\u0a30"],months:["\u0a1c\u0a28\u0a35\u0a30\u0a40","\u0a2b\u0a3c\u0a30\u0a35\u0a30\u0a40","\u0a2e\u0a3e\u0a30\u0a1a","\u0a05\u0a2a\u0a4d\u0a30\u0a48\u0a32","\u0a2e\u0a08","\u0a1c\u0a42\u0a28","\u0a1c\u0a41\u0a32\u0a3e\u0a08","\u0a05\u0a17\u0a38\u0a24","\u0a38\u0a24\u0a70\u0a2c\u0a30","\u0a05\u0a15\u0a24\u0a42\u0a2c\u0a30","\u0a28\u0a35\u0a70\u0a2c\u0a30","\u0a26\u0a38\u0a70\u0a2c\u0a30"],shortMonths:["\u0a1c\u0a28","\u0a2b\u0a3c\u0a30","\u0a2e\u0a3e\u0a30","\u0a05\u0a2a\u0a4d\u0a30\u0a48","\u0a2e\u0a08","\u0a1c\u0a42\u0a28","\u0a1c\u0a41\u0a32\u0a3e","\u0a05\u0a17","\u0a38\u0a24\u0a70","\u0a05\u0a15","\u0a28\u0a35\u0a70","\u0a26\u0a38\u0a70"],date:"%d-%m-%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/pl.js b/inst/htmlwidgets/lib/plotlyjs/locales/pl.js new file mode 100644 index 0000000000..2a6cb561a8 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/pl.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"pl",dictionary:{},format:{days:["Niedziela","Poniedzia\u0142ek","Wtorek","\u015aroda","Czwartek","Pi\u0105tek","Sobota"],shortDays:["Nie","Pn","Wt","\u015ar","Czw","Pt","So"],months:["Stycze\u0144","Luty","Marzec","Kwiecie\u0144","Maj","Czerwiec","Lipiec","Sierpie\u0144","Wrzesie\u0144","Pa\u017adziernik","Listopad","Grudzie\u0144"],shortMonths:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],date:"%Y-%m-%d"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/pt-br.js b/inst/htmlwidgets/lib/plotlyjs/locales/pt-br.js new file mode 100644 index 0000000000..7a8f7b28ee --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/pt-br.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"pt-BR",dictionary:{Autoscale:"Escala autom\xe1tica","Box Select":"Sele\xe7\xe3o retangular","Click to enter Colorscale title":"Clique para editar o t\xedtulo da escala de cor","Click to enter Component A title":"Clique para editar o t\xedtulo do Componente A","Click to enter Component B title":"Clique para editar o t\xedtulo do Componente B","Click to enter Component C title":"Clique para editar o t\xedtulo do Componente C","Click to enter Plot title":"Clique para editar o t\xedtulo do Gr\xe1fico","Click to enter X axis title":"Clique para editar o t\xedtulo do eixo X","Click to enter Y axis title":"Clique para editar o t\xedtulo do eixo Y","Click to enter radial axis title":"Clique para editar o t\xedtulo do eixo radial","Compare data on hover":"Comparar dados ao pairar","Double-click on legend to isolate one trace":"Duplo clique na legenda para isolar uma s\xe9rie","Double-click to zoom back out":"Duplo clique para reverter zoom","Download plot as a png":"Fazer download do gr\xe1fico como imagem (png)","Download plot":"Fazer download do gr\xe1fico","Edit in Chart Studio":"Editar no Chart Studio","IE only supports svg. Changing format to svg.":"IE suporta apenas svg. Alterando formato para svg","Lasso Select":"Sele\xe7\xe3o de la\xe7o","Orbital rotation":"Rota\xe7\xe3o orbital",Pan:"Mover","Produced with Plotly.js":"Criado com o Plotly.js",Reset:"Restaurar","Reset axes":"Restaurar eixos","Reset camera to default":"Restaurar c\xe2mera para padr\xe3o","Reset camera to last save":"Restaurar c\xe2mera para \xfaltima salva","Reset view":"Restaurar vis\xe3o","Reset views":"Restaurar vis\xf5es","Show closest data on hover":"Exibir dado mais pr\xf3ximo ao pairar","Snapshot succeeded":"Captura instant\xe2nea completa","Sorry, there was a problem downloading your snapshot!":"Desculpe, houve um problema no download de sua captura instant\xe2nea!","Taking snapshot - this may take a few seconds":"Efetuando captura instant\xe2nea - isso pode levar alguns instantes","Toggle Spike Lines":"Habilitar/desabilitar triangula\xe7\xe3o de linhas","Toggle show closest data on hover":"Habilitar/desabilitar exibi\xe7\xe3o de dado mais pr\xf3ximo ao pairar","Turntable rotation":"Rota\xe7\xe3o de mesa",Zoom:"Zoom","Zoom in":"Ampliar zoom","Zoom out":"Reduzir zoom",close:"fechamento",high:"alta","incoming flow count":"contagem de fluxo de entrada",kde:"kde",lat:"latitude",lon:"longitude",low:"baixa","lower fence":"limite inferior",max:"m\xe1ximo","mean \xb1 \u03c3":"m\xe9dia \xb1 \u03c3",mean:"m\xe9dia",median:"mediana",min:"m\xednimo","new text":"novo texto",open:"abertura","outgoing flow count":"contagem de fluxo de sa\xedda",q1:"q1",q3:"q3",source:"origem",target:"destino",trace:"s\xe9rie","upper fence":"limite superior"},format:{days:["Domingo","Segunda-feira","Ter\xe7a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S\xe1bado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","S\xe1b"],months:["Janeiro","Fevereiro","Mar\xe7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/pt-pt.js b/inst/htmlwidgets/lib/plotlyjs/locales/pt-pt.js new file mode 100644 index 0000000000..be27931899 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/pt-pt.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"pt-PT",dictionary:{Autoscale:"Escala autom\xe1tica","Box Select":"Sele\xe7\xe3o retangular","Click to enter Colorscale title":"Clique para editar o t\xedtulo da escala de cor","Click to enter Component A title":"Clique para editar o t\xedtulo do Componente A","Click to enter Component B title":"Clique para editar o t\xedtulo do Componente B","Click to enter Component C title":"Clique para editar o t\xedtulo do Componente C","Click to enter Plot title":"Clique para editar o t\xedtulo do Gr\xe1fico","Click to enter X axis title":"Clique para editar o t\xedtulo do eixo X","Click to enter Y axis title":"Clique para editar o t\xedtulo do eixo Y","Click to enter radial axis title":"Clique para editar o t\xedtulo do eixo radial","Compare data on hover":"Comparar dados ao pairar","Double-click on legend to isolate one trace":"Duplo clique na legenda para isolar uma s\xe9rie","Double-click to zoom back out":"Duplo clique para reverter amplia\xe7\xe3o","Download plot as a png":"Baixar gr\xe1fico como imagem (png)","Download plot":"Baixar gr\xe1fico","Edit in Chart Studio":"Editar no Chart Studio","IE only supports svg. Changing format to svg.":"IE suporta apenas svg. Alterando formato para svg","Lasso Select":"Sele\xe7\xe3o de la\xe7o","Orbital rotation":"Rota\xe7\xe3o orbital",Pan:"Mover","Produced with Plotly.js":"Criado com Plotly.js",Reset:"Restaurar","Reset axes":"Restaurar eixos","Reset camera to default":"Restaurar c\xe2mera para padr\xe3o","Reset camera to last save":"Restaurar c\xe2mera para \xfaltima grava\xe7\xe3o","Reset view":"Restaurar vista","Reset views":"Restaurar vistas","Show closest data on hover":"Exibir dado mais pr\xf3ximo ao pairar","Snapshot succeeded":"Captura instant\xe2nea com sucesso","Sorry, there was a problem downloading your snapshot!":"Desculpe, houve um problema no download de sua captura instant\xe2nea!","Taking snapshot - this may take a few seconds":"Efetuando captura instant\xe2nea - isso pode demorar alguns segundos","Toggle Spike Lines":"Habilitar/desabilitar triangula\xe7\xe3o de linhas","Toggle show closest data on hover":"Habilitar/desabilitar exibi\xe7\xe3o de dado mais pr\xf3ximo ao pairar","Turntable rotation":"Rodar",Zoom:"Ampliar","Zoom in":"Aumentar Amplia\xe7\xe3o","Zoom out":"Reduzir Amplia\xe7\xe3o",close:"fechar",high:"alta","incoming flow count":"contagem de fluxo de entrada",kde:"kde",lat:"latitude",lon:"longitude",low:"baixa","lower fence":"limite inferior",max:"m\xe1ximo","mean \xb1 \u03c3":"m\xe9dia \xb1 \u03c3",mean:"m\xe9dia",median:"mediana",min:"m\xednimo","new text":"novo texto",open:"abrir","outgoing flow count":"contagem de fluxo de sa\xedda",q1:"q1",q3:"q3",source:"origem",target:"destino",trace:"s\xe9rie","upper fence":"limite superior"},format:{days:["domingo","segunda-feira","ter\xe7a-feira","quarta-feira","quinta-feira","sexta-feira","s\xe1bado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","S\xe1b"],months:["Janeiro","Fevereiro","Mar\xe7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/rm.js b/inst/htmlwidgets/lib/plotlyjs/locales/rm.js new file mode 100644 index 0000000000..61bc33d55f --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/rm.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"rm",dictionary:{},format:{days:["Dumengia","Glindesdi","Mardi","Mesemna","Gievgia","Venderdi","Sonda"],shortDays:["Dum","Gli","Mar","Mes","Gie","Ven","Som"],months:["Schaner","Favrer","Mars","Avrigl","Matg","Zercladur","Fanadur","Avust","Settember","October","November","December"],shortMonths:["Scha","Fev","Mar","Avr","Matg","Zer","Fan","Avu","Sett","Oct","Nov","Dec"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/ro.js b/inst/htmlwidgets/lib/plotlyjs/locales/ro.js new file mode 100644 index 0000000000..81c12023c6 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/ro.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"ro",dictionary:{},format:{days:["Duminic\u0103","Luni","Marti","Miercuri","Joi","Vineri","S\xe2mb\u0103t\u0103"],shortDays:["Dum","Lun","Mar","Mie","Joi","Vin","S\xe2m"],months:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"],shortMonths:["Ian","Feb","Mar","Apr","Mai","Iun","Iul","Aug","Sep","Oct","Noi","Dec"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/ru.js b/inst/htmlwidgets/lib/plotlyjs/locales/ru.js new file mode 100644 index 0000000000..c209653436 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/ru.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"ru",dictionary:{Autoscale:"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0448\u043a\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435","Box Select":"\u0412\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438","Click to enter Colorscale title":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0448\u043a\u0430\u043b\u044b","Click to enter Component A title":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 A","Click to enter Component B title":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 B","Click to enter Component C title":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 C","Click to enter Plot title":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430","Click to enter X axis title":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043e\u0441\u0438 X","Click to enter Y axis title":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043e\u0441\u0438 Y","Click to enter radial axis title":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044f\u0440\u043d\u043e\u0439 \u043e\u0441\u0438","Compare data on hover":"\u041f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435","Double-click on legend to isolate one trace":"\u0414\u0432\u0430\u0436\u0434\u044b \u0449\u0451\u043b\u043a\u043d\u0438\u0442\u0435 \u043f\u043e \u043b\u0435\u0433\u0435\u043d\u0434\u0435 \u0434\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445","Double-click to zoom back out":"\u0414\u043b\u044f \u0441\u0431\u0440\u043e\u0441\u0430 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430 \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u0432\u0430\u0436\u0434\u044b \u0449\u0451\u043b\u043a\u043d\u0438\u0442\u0435 \u043c\u044b\u0448\u044c\u044e","Download plot":"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a","Download plot as a png":"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 PNG","Edit in Chart Studio":"\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 Chart Studio","IE only supports svg. Changing format to svg.":"IE \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e svg. \u0424\u043e\u0440\u043c\u0430\u0442 \u0441\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 svg.","Lasso Select":"\u041b\u0430\u0441\u0441\u043e","Orbital rotation":"\u041e\u0440\u0431\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435",Pan:"\u0421\u0434\u0432\u0438\u0433","Produced with Plotly.js":"\u0421\u043e\u0437\u0434\u0430\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Plotly.js",Reset:"\u0421\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e","Reset axes":"\u0421\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043e\u0441\u0435\u0439 \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e","Reset camera to default":"\u0421\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u0430\u043c\u0435\u0440\u044b \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e","Reset camera to last save":"\u0421\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043a\u0430\u043c\u0435\u0440\u0443 \u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c\u0443 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e","Reset view":"\u0421\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e","Reset views":"\u0421\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e","Show closest data on hover":"\u041f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435","Snapshot succeeded":"\u0421\u043d\u0438\u043c\u043e\u043a \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d","Sorry, there was a problem downloading your snapshot!":"\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u0441\u043d\u0438\u043c\u043a\u0430","Taking snapshot - this may take a few seconds":"\u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0441\u043d\u0438\u043c\u043e\u043a - \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434","Toggle Spike Lines":"\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c/\u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043b\u0438\u043d\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u0439 \u0442\u043e\u0447\u0435\u043a","Toggle show closest data on hover":"\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c/\u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u043a\u0430\u0437 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438","Turntable rotation":"\u0412\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e\u043c \u0441\u0442\u043e\u043b\u0435",Zoom:"\u0417\u0443\u043c","Zoom in":"\u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c","Zoom out":"\u0423\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c","close:":"\u0417\u0430\u043a\u0440\u044b\u0442\u0438\u0435:","concentration:":"\u041a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u044f:","high:":"\u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c:","incoming flow count:":"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u0432\u044f\u0437\u0435\u0439:","kde:":"\u042f\u0434\u0435\u0440\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438:","lat:":"\u0428\u0438\u0440\u043e\u0442\u0430:","lon:":"\u0414\u043e\u043b\u0433\u043e\u0442\u0430:","low:":"\u041c\u0438\u043d\u0438\u043c\u0443\u043c:","lower fence:":"\u041d\u0438\u0436\u043d\u044f\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430:","max:":"\u041c\u0430\u043a\u0441.:","mean \xb1 \u03c3:":"\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \xb1 \u03c3:","mean:":"\u0421\u0440\u0435\u0434\u043d\u0435\u0435:","median:":"\u041c\u0435\u0434\u0438\u0430\u043d\u0430:","min:":"\u041c\u0438\u043d.:","new text":"\u041d\u043e\u0432\u044b\u0439 \u0442\u0435\u043a\u0441\u0442","open:":"\u041e\u0442\u043a\u0440\u044b\u0442\u0438\u0435:","outgoing flow count:":"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u0432\u044f\u0437\u0435\u0439:","q1:":"q1:","q3:":"q3:","source:":"\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a:","target:":"\u0426\u0435\u043b\u044c:",trace:"\u0420\u044f\u0434","upper fence:":"\u0412\u0435\u0440\u0445\u043d\u044f\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430:"},format:{days:["\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0432\u0442\u043e\u0440\u043d\u0438\u043a","\u0441\u0440\u0435\u0434\u0430","\u0447\u0435\u0442\u0432\u0435\u0440\u0433","\u043f\u044f\u0442\u043d\u0438\u0446\u0430","\u0441\u0443\u0431\u0431\u043e\u0442\u0430"],shortDays:["\u0432\u0441","\u043f\u043d","\u0432\u0442","\u0441\u0440","\u0447\u0442","\u043f\u0442","\u0441\u0431"],months:["\u042f\u043d\u0432\u0430\u0440\u044c","\u0424\u0435\u0432\u0440\u0430\u043b\u044c","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0435\u043b\u044c","\u041c\u0430\u0439","\u0418\u044e\u043d\u044c","\u0418\u044e\u043b\u044c","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043d\u0442\u044f\u0431\u0440\u044c","\u041e\u043a\u0442\u044f\u0431\u0440\u044c","\u041d\u043e\u044f\u0431\u0440\u044c","\u0414\u0435\u043a\u0430\u0431\u0440\u044c"],shortMonths:["\u042f\u043d\u0432.","\u0424\u0435\u0432\u0440.","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440.","\u041c\u0430\u0439","\u0418\u044e\u043d\u044c","\u0418\u044e\u043b\u044c","\u0410\u0432\u0433.","\u0421\u0435\u043d\u0442.","\u041e\u043a\u0442.","\u041d\u043e\u044f","\u0414\u0435\u043a."],date:"%d.%m.%Y",decimal:",",thousands:" "}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/si.js b/inst/htmlwidgets/lib/plotlyjs/locales/si.js new file mode 100644 index 0000000000..ef82b0d199 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/si.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"si",dictionary:{Autoscale:"\u0dc3\u0dca\u0dc0\u0dba\u0d82 \u0db4\u0dbb\u0dd2\u0db8\u0dcf\u0dab\u0db1\u0dba","Box Select":"\u0d9a\u0ddc\u0da7\u0dd4\u0dc0 \u0dc0\u0dbb\u0dab\u0dba","Click to enter Colorscale title":"\u0dc0\u0dbb\u0dca\u0dab\u0db4\u0dbb\u0dd2\u0db8\u0dcf\u0dab\u0db1 \u0dc3\u0dd2\u0dbb\u0dd0\u0dc3\u0dd2\u0dba \u0d87\u0dad\u0dd4\u0dbd\u0dca \u0d9a\u0dd2\u0dbb\u0dd3\u0db8\u0da7 \u0d94\u0db6\u0db1\u0dca\u0db1","Click to enter Component A title":"\u0dc3\u0d82\u0dbb\u0da0\u0d9a\u0dba\u0dda \u0d85 \u0dc3\u0dd2\u0dbb\u0dd0\u0dc3\u0dd2\u0dba \u0d87\u0dad\u0dd4\u0dbd\u0dca \u0d9a\u0dd2\u0dbb\u0dd3\u0db8\u0da7 \u0d94\u0db6\u0db1\u0dca\u0db1","Click to enter Component B title":"\u0dc3\u0d82\u0dbb\u0da0\u0d9a\u0dba\u0dda \u0d86 \u0dc3\u0dd2\u0dbb\u0dd0\u0dc3\u0dd2\u0dba \u0d87\u0dad\u0dd4\u0dbd\u0dca \u0d9a\u0dd2\u0dbb\u0dd3\u0db8\u0da7 \u0d94\u0db6\u0db1\u0dca\u0db1","Click to enter Component C title":"\u0dc3\u0d82\u0dbb\u0da0\u0d9a\u0dba\u0dda \u0d87 \u0dc3\u0dd2\u0dbb\u0dd0\u0dc3\u0dd2\u0dba \u0d87\u0dad\u0dd4\u0dbd\u0dca \u0d9a\u0dd2\u0dbb\u0dd3\u0db8\u0da7 \u0d94\u0db6\u0db1\u0dca\u0db1","Click to enter Plot title":"\u0d9a\u0ddc\u0da7\u0dd4\u0dc0\u0dd9\u0dc4\u0dd2 \u0dc3\u0dd2\u0dbb\u0dd0\u0dc3\u0dd2\u0dba \u0d87\u0dad\u0dd4\u0dbd\u0dca \u0d9a\u0dd2\u0dbb\u0dd3\u0db8\u0da7 \u0d94\u0db6\u0db1\u0dca\u0db1","Click to enter X axis title":"\u0dad\u0dd2\u0dbb\u0dc3\u0dca \u0d85\u0d9a\u0dca\u200d\u0dc2\u0dba\u0dda \u0dc3\u0dd2\u0dbb\u0dd0\u0dc3\u0dd2\u0dba \u0d87\u0dad\u0dd4\u0dbd\u0dca \u0d9a\u0dd2\u0dbb\u0dd3\u0db8\u0da7 \u0d94\u0db6\u0db1\u0dca\u0db1","Click to enter Y axis title":"\u0dc3\u0dd2\u0dbb\u0dc3\u0dca \u0d85\u0d9a\u0dca\u200d\u0dc2\u0dba\u0dda \u0dc3\u0dd2\u0dbb\u0dd0\u0dc3\u0dd2\u0dba \u0d87\u0dad\u0dd4\u0dbd\u0dca \u0d9a\u0dd2\u0dbb\u0dd3\u0db8\u0da7 \u0d94\u0db6\u0db1\u0dca\u0db1","Click to enter radial axis title":"\u0d85\u0dbb\u0dd3\u0dba \u0d85\u0d9a\u0dca\u200d\u0dc2\u0dba\u0dda \u0dc3\u0dd2\u0dbb\u0dd0\u0dc3\u0dd2\u0dba \u0d87\u0dad\u0dd4\u0dbd\u0dca \u0d9a\u0dd2\u0dbb\u0dd3\u0db8\u0da7 \u0d94\u0db6\u0db1\u0dca\u0db1","Compare data on hover":"\u0dc3\u0dd4\u0db1\u0d82\u0d9c\u0dd4 \u0d9a\u0dd2\u0dbb\u0dd3\u0db8\u0dda\u0daf\u0dd3 \u0daf\u0dad\u0dca\u0dad \u0dc3\u0dc3\u0db3\u0db1\u0dca\u0db1","Double-click on legend to isolate one trace":"Double-click on legend to isolate one trace","Double-click to zoom back out":"\u0d86\u0db4\u0dc3\u0dd4 \u0d9a\u0dd4\u0da9\u0dcf\u0dbd\u0db1\u0dba \u0d9a\u0dd2\u0dbb\u0dd3\u0db8\u0da7 \u0daf\u0dd9\u0dc0\u0dbb\u0d9a\u0dca \u0d94\u0db6\u0db1\u0dca\u0db1","Download plot":"\u0d9a\u0ddc\u0da7\u0dd4\u0dc0 \u0db6\u0dcf\u0d9c\u0db1\u0dca\u0db1","Download plot as a png":"\u0d9a\u0ddc\u0da7\u0dd4\u0dc0 \u0db4\u0dd3\u0d91\u0db1\u0dca\u0da2\u0dd3 \u0dbd\u0dd9\u0dc3 \u0db6\u0dcf\u0d9c\u0db1\u0dca\u0db1","Draw circle":"\u0d9a\u0dc0\u0dba\u0d9a\u0dca \u0d85\u0db3\u0dd2\u0db1\u0dca\u0db1","Draw closed freeform":"\u0dc3\u0d82\u0dc0\u0dd8\u0dad \u0dbd\u0dd9\u0dc3 \u0db1\u0dd2\u0daf\u0dc4\u0dc3\u0dda \u0d85\u0db3\u0dd2\u0db1\u0dca\u0db1","Draw line":"\u0dbb\u0dda\u0d9b\u0dcf\u0dc0\u0d9a\u0dca \u0d85\u0db3\u0dd2\u0db1\u0dca\u0db1","Draw open freeform":"\u0dc0\u0dd2\u0dc0\u0dd8\u0dad \u0dbd\u0dd9\u0dc3 \u0db1\u0dd2\u0daf\u0dc4\u0dc3\u0dda \u0d85\u0db3\u0dd2\u0db1\u0dca\u0db1","Draw rectangle":"\u0dc3\u0dd8\u0da2\u0dd4\u0d9a\u0ddd\u0dab\u0dba\u0d9a\u0dca \u0d85\u0db3\u0dd2\u0db1\u0dca\u0db1","Edit in Chart Studio":"\u0db4\u0dca\u200d\u0dbb\u0dc3\u0dca\u0dad\u0dcf\u0dbb \u0da0\u0dd2\u0dad\u0dca\u200d\u0dbb\u0dcf\u0d9c\u0dcf\u0dbb\u0dba\u0dd9\u0dc4\u0dd2 \u0dc3\u0d82\u0dc3\u0dca\u0d9a\u0dbb\u0dab\u0dba","Erase active shape":"\u0dc3\u0d9a\u0dca\u200d\u0dbb\u0dd2\u0dba \u0dc4\u0dd0\u0da9\u0dba \u0db8\u0d9a\u0db1\u0dca\u0db1","IE only supports svg. Changing format to svg.":"\u0d89.\u0d91. \u0d91\u0dc3\u0dca\u0dc0\u0dd3\u0da2\u0dd3 \u0dc3\u0db3\u0dc4\u0dcf \u0db4\u0db8\u0dab\u0d9a\u0dca \u0dc3\u0dc4\u0dcf\u0dba \u0daf\u0d9a\u0dca\u0dc0\u0dba\u0dd2. \u0d86\u0d9a\u0dd8\u0dad\u0dd2\u0dba \u0d91\u0dba\u0da7 \u0dc0\u0dd9\u0db1\u0dc3\u0dca \u0dc0\u0dd9\u0db8\u0dd2\u0db1\u0dca","Lasso Select":"\u0db8\u0dcf\u0dba\u0dd2\u0db8 \u0dc0\u0dbb\u0dab\u0dba","Orbital rotation":"\u0d9a\u0dcf\u0d9a\u0dca\u200d\u0dc2\u0dd2\u0d9a \u0d9a\u0dbb\u0d9a\u0dd0\u0dc0\u0dd3\u0db8",Pan:"\u0da0\u0dbd\u0d9a\u0dba","Produced with Plotly":"\u0db4\u0dca\u0dbd\u0ddc\u0da7\u0dca\u0dbd\u0dd2 \u0dc3\u0db8\u0d9f \u0d8b\u0db4\u0daf\u0dc0\u0db1 \u0dbd\u0daf\u0dd2",Reset:"\u0dba\u0dc5\u0dd2 \u0dc3\u0d9a\u0dc3\u0db1\u0dca\u0db1","Reset axes":"\u0d85\u0d9a\u0dca\u200d\u0dc2 \u0dba\u0dc5\u0dd2 \u0dc3\u0d9a\u0dc3\u0db1\u0dca\u0db1","Reset camera to default":"Reset camera to default","Reset camera to last save":"Reset camera to last save","Reset view":"\u0daf\u0dd0\u0d9a\u0dca\u0db8 \u0dba\u0dc5\u0dd2 \u0dc3\u0d9a\u0dc3\u0db1\u0dca\u0db1","Reset views":"\u0daf\u0dd0\u0d9a\u0dca\u0db8\u0dca \u0dba\u0dc5\u0dd2 \u0dc3\u0d9a\u0dc3\u0db1\u0dca\u0db1","Show closest data on hover":"\u0dc3\u0dd4\u0db1\u0d82\u0d9c\u0dd4 \u0d9a\u0dd2\u0dbb\u0dd3\u0db8\u0dda\u0daf\u0dd3 \u0d86\u0dc3\u0db1\u0dca\u0db1\u0db8 \u0daf\u0dad\u0dca\u0dad \u0db4\u0dd9\u0db1\u0dca\u0dc0\u0db1\u0dca\u0db1","Snapshot succeeded":"\u0da1\u0dcf\u0dba\u0dcf\u0dbb\u0dd6\u0db4\u0dba \u0dc3\u0dcf\u0dbb\u0dca\u0dae\u0d9a\u0dba\u0dd2","Sorry, there was a problem downloading your snapshot!":"\u0dc3\u0db8\u0dcf\u0dc0\u0db1\u0dca\u0db1, \u0d94\u0db6\u0d9c\u0dda \u0da1\u0dcf\u0dba\u0dcf\u0dbb\u0dd6\u0db4\u0dba \u0db6\u0dcf\u0d9c\u0dd0\u0db1\u0dd3\u0db8\u0dda \u0d9c\u0dd0\u0da7\u0dbd\u0dd4\u0dc0\u0d9a\u0dca \u0d87\u0dad!","Taking snapshot - this may take a few seconds":"\u0da1\u0dcf\u0dba\u0dcf\u0dbb\u0dd6\u0db4\u0dba \u0d9c\u0dd0\u0db1\u0dd9\u0db8\u0dd2\u0db1\u0dca - \u0db8\u0dd9\u0dba\u0da7 \u0dad\u0dad\u0dca. \u0d9a\u0dd2\u0dc4\u0dd2\u0db4\u0dba\u0d9a\u0dca \u0d9c\u0dad\u0dc0\u0dd2\u0dba \u0dc4\u0dd0\u0d9a\u0dd2\u0dba","Toggle Spike Lines":"Toggle Spike Lines","Toggle show closest data on hover":"Toggle show closest data on hover","Turntable rotation":"\u0db6\u0db8\u0dbb \u0d9a\u0dbb\u0d9a\u0dd0\u0dc0\u0dd3\u0db8",Zoom:"\u0dc0\u0dd2\u0dc1\u0dcf\u0dbd \u0d9a\u0dbb\u0db1\u0dca\u0db1","Zoom in":"\u0dc0\u0dd2\u0dc1\u0dcf\u0dbd\u0db1\u0dba","Zoom out":"\u0d9a\u0dd4\u0da9\u0dcf\u0dbd\u0db1\u0dba","close:":"\u0dc0\u0dc3\u0db1\u0dca\u0db1:","concentration:":"\u0dc3\u0d82\u0d9a\u0dda\u0db1\u0dca\u0daf\u0dca\u200d\u0dbb\u0dab\u0dba:","high:":"high:","incoming flow count:":"\u0d87\u0dad\u0dd4\u0dc5\u0da7\u0d91\u0db1 \u0db4\u0dca\u200d\u0dbb\u0dc0\u0dcf\u0dc4\u0dba \u0d9c\u0dab\u0db1\u0dba:","kde:":"kde:","lat:":"lat:","lon:":"lon:","low:":"low:","lower fence:":"lower fence:","max:":"\u0d8b\u0db4\u0dbb\u0dd2\u0db8:","mean \xb1 \u03c3:":"\u0db8\u0db0\u0dca\u200d\u0dba\u0db1\u0dca\u200d\u0dba \xb1 \u03c3:","mean:":"\u0db8\u0db0\u0dca\u200d\u0dba\u0db1\u0dca\u200d\u0dba:","median:":"\u0db8\u0db0\u0dca\u200d\u0dba\u0dc3\u0dae\u0dba:","min:":"\u0d85\u0dc0\u0db8:","new text":"\u0db1\u0dc0 \u0db4\u0dcf\u0da8\u0dba","open:":"\u0dc0\u0dd2\u0dc0\u0dd8\u0dad:","outgoing flow count:":"\u0db4\u0dd2\u0da7\u0dad\u0da7\u0dba\u0db1 \u0db4\u0dca\u200d\u0dbb\u0dc0\u0dcf\u0dc4\u0dba \u0d9c\u0dab\u0db1\u0dba:","q1:":"q1:","q3:":"q3:","source:":"\u0db8\u0dd6\u0dbd\u0dcf\u0dc1\u0dca\u200d\u0dbb\u0dba:","target:":"\u0d89\u0dbd\u0d9a\u0dca\u0d9a\u0dba:",trace:"trace","upper fence:":"upper fence:"},format:{days:["\u0d89\u0dbb\u0dd2\u0daf\u0dcf","\u0dc3\u0db3\u0dd4\u0daf\u0dcf","\u0d85\u0d9f\u0dc4\u0dbb\u0dd4\u0dc0\u0dcf\u0daf\u0dcf","\u0db6\u0daf\u0dcf\u0daf\u0dcf","\u0db6\u0dca\u200d\u0dbb\u0dc4\u0dc3\u0dca\u0db4\u0dad\u0dd2\u0db1\u0dca\u0daf\u0dcf","\u0dc3\u0dd2\u0d9a\u0dd4\u0dbb\u0dcf\u0daf\u0dcf","\u0dc3\u0dd9\u0db1\u0dc3\u0dd4\u0dbb\u0dcf\u0daf\u0dcf"],shortDays:["\u0d89\u0dbb\u0dd2\u0daf\u0dcf","\u0dc3\u0db3\u0dd4\u0daf\u0dcf","\u0d85\u0d9f\u0dc4","\u0db6\u0daf\u0dcf\u0daf\u0dcf","\u0db6\u0dca\u200d\u0dbb\u0dc4\u0dc3\u0dca","\u0dc3\u0dd2\u0d9a\u0dd4","\u0dc3\u0dd9\u0db1"],months:["\u0daf\u0dd4\u0dbb\u0dd4\u0dad\u0dd4","\u0db1\u0dc0\u0db8\u0dca","\u0db8\u0dd0\u0daf\u0dd2\u0db1\u0dca","\u0db6\u0d9a\u0dca","\u0dc0\u0dd9\u0dc3\u0d9a\u0dca","\u0db4\u0ddc\u0dc3\u0ddc\u0db1\u0dca","\u0d87\u0dc3\u0dc5","\u0db1\u0dd2\u0d9a\u0dd2\u0dab\u0dd2","\u0db6\u0dd2\u0db1\u0dbb","\u0dc0\u0db4\u0dca","\u0d89\u0dbd\u0dca","\u0d8b\u0db3\u0dd4\u0dc0\u0db4\u0dca"],shortMonths:["\u0daf\u0dd4\u0dbb\u0dd4\u0dad\u0dd4","\u0db1\u0dc0\u0db8\u0dca","\u0db8\u0dd0\u0daf\u0dd2\u0db1\u0dca","\u0db6\u0d9a\u0dca","\u0dc0\u0dd9\u0dc3\u0d9a\u0dca","\u0db4\u0ddc\u0dc3\u0ddc\u0db1\u0dca","\u0d87\u0dc3\u0dc5","\u0db1\u0dd2\u0d9a\u0dd2\u0dab\u0dd2","\u0db6\u0dd2\u0db1\u0dbb","\u0dc0\u0db4\u0dca","\u0d89\u0dbd\u0dca","\u0d8b\u0db3\u0dd4"],date:"%d-%m-%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/sk.js b/inst/htmlwidgets/lib/plotlyjs/locales/sk.js new file mode 100644 index 0000000000..9aacb2089b --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/sk.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"sk",dictionary:{Autoscale:"Auto rozsah","Box Select":"Obd\u013a\u017enikov\xfd v\xfdber","Click to enter Colorscale title":"Kliknite pre zadanie n\xe1zvu farebnej \u0161k\xe1ly","Click to enter Component A title":"Kliknite pre zadanie n\xe1zvu komponentu A","Click to enter Component B title":"Kliknite pre zadanie n\xe1zvu komponentu B","Click to enter Component C title":"Kliknite pre zadanie n\xe1zvu komponentu C","Click to enter Plot title":"Kliknite pre zadanie n\xe1zvu grafu","Click to enter X axis title":"Kliknite pre zadanie n\xe1zvu osi X","Click to enter Y axis title":"Kliknite pre zadanie n\xe1zvu osi Y","Click to enter radial axis title":"Kliknite pre zadanie n\xe1zvu radi\xe1lnej osi","Compare data on hover":"Porovna\u0165 hodnoty pri prejden\xed my\u0161ou","Double-click on legend to isolate one trace":"Dvojklikom na legendu izolujete jednu d\xe1tov\xfa sadu","Double-click to zoom back out":"Dvojklikom vr\xe1tite zv\xe4\u010d\u0161enie","Download plot as a png":"Ulo\u017ei\u0165 ako PNG","Download plot":"Ulo\u017ei\u0165","Edit in Chart Studio":"Editova\u0165 v Chart Studio","IE only supports svg. Changing format to svg.":"IE podporuje iba SVG form\xe1t. Zmenen\xe9 na SVG.","Lasso Select":"V\xfdber lasom","Orbital rotation":"Rot\xe1cia (orbit\xe1lna)",Pan:"Pos\xfavanie","Produced with Plotly.js":"Vytvoren\xe9 pomocou Plotly.js",Reset:"Obnovi\u0165 nastavenie","Reset axes":"Obnovi\u0165 nastavenie os\xed","Reset camera to default":"Obnovi\u0165 nastavenie kamery do predvolen\xe9ho stavu","Reset camera to last save":"Obnovi\u0165 nastavenie kamery do posledn\xe9ho ulo\u017een\xe9ho stavu","Reset view":"Obnovi\u0165 nastavenie poh\u013eadu","Reset views":"Obnovi\u0165 nastavenie poh\u013eadov","Show closest data on hover":"Zobrazi\u0165 najbli\u017e\u0161iu hodnotu p\u0159i prejden\xed my\u0161ou","Snapshot succeeded":"Obr\xe1zok vytvoren\xfd","Sorry, there was a problem downloading your snapshot!":"Ospravedl\u0148ujeme sa, do\u0161lo k chybe pri s\u0165ahovan\xed obr\xe1zka!","Taking snapshot - this may take a few seconds":"Sn\xedmanie - m\xf4\u017ee trva\u0165 nieko\u013eko sek\xfand",Zoom:"Zv\xe4\u010d\u0161enie","Zoom in":"Zv\xe4\u010d\u0161i\u0165","Zoom out":"Zmen\u0161i\u0165","close:":"zavrie\u0165:",trace:"d\xe1tov\xe1 sada","lat:":"Lat.:","lon:":"Lon.:","q1:":"q1:","q3:":"q3:","source:":"zdroj:","target:":"cie\u013e:","lower fence:":"spodn\xe1 hranica:","upper fence:":"vrchn\xe1 hranica:","max:":"max.:","mean \xb1 \u03c3:":"priemer \xb1 \u03c3:","mean:":"priemer:","median:":"medi\xe1n:","min:":"min.:","new text":"nov\xfd text","Turntable rotation":"Rot\xe1cia (oto\u010dn\xfd stol\xedk)","Toggle Spike Lines":"Prepn\xfa\u0165 zobrazenie vodiacich \u010diar","open:":"otvori\u0165:","high:":"horn\xe1:","low:":"doln\xe1:","Toggle show closest data on hover":"Prepn\xfa\u0165 zobrazovanie najbli\u017e\u0161ej hodnoty pri prejden\xed my\u0161ou","incoming flow count:":"po\u010det \xfadajov na vstupe:","outgoing flow count:":"po\u010det \xfadajov na v\xfdstupe:","kde:":"kde:"},format:{days:["Nede\u013ea","Pondelok","Utorok","Streda","\u0160tvrtok","Piatok","Sobota"],shortDays:["Ned","Pon","Uto","Str","\u0160tv","Pia","Sob"],months:["Janu\xe1r","Febru\xe1r","Marec","Apr\xedl","M\xe1j","J\xfan","J\xfal","August","September","Okt\xf3ber","November","December"],shortMonths:["Jan","Feb","Mar","Apr","M\xe1j","J\xfan","J\xfal","Aug","Sep","Okt","Nov","Dec"],date:"%d.%m.%Y",decimal:",",thousands:" "}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/sl.js b/inst/htmlwidgets/lib/plotlyjs/locales/sl.js new file mode 100644 index 0000000000..36972d9dc1 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/sl.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"sl",dictionary:{},format:{days:["Nedelja","Ponedeljek","Torek","Sreda","\u010cetrtek","Petek","Sobota"],shortDays:["Ned","Pon","Tor","Sre","\u010cet","Pet","Sob"],months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],shortMonths:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/sq.js b/inst/htmlwidgets/lib/plotlyjs/locales/sq.js new file mode 100644 index 0000000000..65751069c9 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/sq.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"sq",dictionary:{},format:{days:["E Diel","E H\xebn\xeb","E Mart\xeb","E M\xebrkur\xeb","E Enjte","E Premte","E Shtune"],shortDays:["Di","H\xeb","Ma","M\xeb","En","Pr","Sh"],months:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","N\xebntor","Dhjetor"],shortMonths:["Jan","Shk","Mar","Pri","Maj","Qer","Kor","Gus","Sht","Tet","N\xebn","Dhj"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/sr-sr.js b/inst/htmlwidgets/lib/plotlyjs/locales/sr-sr.js new file mode 100644 index 0000000000..297102f0da --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/sr-sr.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"sr-SR",dictionary:{},format:{days:["Nedelja","Ponedeljak","Utorak","Sreda","\u010cetvrtak","Petak","Subota"],shortDays:["Ned","Pon","Uto","Sre","\u010cet","Pet","Sub"],months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],shortMonths:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/sr.js b/inst/htmlwidgets/lib/plotlyjs/locales/sr.js new file mode 100644 index 0000000000..7dc0b699c5 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/sr.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"sr",dictionary:{},format:{days:["\u041d\u0435\u0434\u0435\u0459\u0430","\u041f\u043e\u043d\u0435\u0434\u0435\u0459\u0430\u043a","\u0423\u0442\u043e\u0440\u0430\u043a","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0440\u0442\u0430\u043a","\u041f\u0435\u0442\u0430\u043a","\u0421\u0443\u0431\u043e\u0442\u0430"],shortDays:["\u041d\u0435\u0434","\u041f\u043e\u043d","\u0423\u0442\u043e","\u0421\u0440\u0435","\u0427\u0435\u0442","\u041f\u0435\u0442","\u0421\u0443\u0431"],months:["\u0408\u0430\u043d\u0443\u0430\u0440","\u0424\u0435\u0431\u0440\u0443\u0430\u0440","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0438\u043b","\u041c\u0430\u0458","\u0408\u0443\u043d","\u0408\u0443\u043b","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043f\u0442\u0435\u043c\u0431\u0430\u0440","\u041e\u043a\u0442\u043e\u0431\u0430\u0440","\u041d\u043e\u0432\u0435\u043c\u0431\u0430\u0440","\u0414\u0435\u0446\u0435\u043c\u0431\u0430\u0440"],shortMonths:["\u0408\u0430\u043d","\u0424\u0435\u0431","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0458","\u0408\u0443\u043d","\u0408\u0443\u043b","\u0410\u0432\u0433","\u0421\u0435\u043f","\u041e\u043a\u0442","\u041d\u043e\u0432","\u0414\u0435\u0446"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/sv.js b/inst/htmlwidgets/lib/plotlyjs/locales/sv.js new file mode 100644 index 0000000000..b6e2324fc0 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/sv.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"sv",dictionary:{Autoscale:"Autoskala","Box Select":"V\xe4lj rektangel","Click to enter Colorscale title":"Klicka f\xf6r att ange titel p\xe5 f\xe4rgskala","Click to enter Component A title":"Klicka f\xf6r att ange titel p\xe5 komponent A","Click to enter Component B title":"Klicka f\xf6r att ange titel p\xe5 komponent B","Click to enter Component C title":"Klicka f\xf6r att ange titel p\xe5 komponent C","Click to enter Plot title":"Klicka f\xf6r att ange titel p\xe5 diagram","Click to enter X axis title":"Klicka f\xf6r att ange titel p\xe5 x-axel","Click to enter Y axis title":"Klicka f\xf6r att ange titel p\xe5 y-axel","Click to enter radial axis title":"Klicka f\xf6r att ange titel p\xe5 radiell axel","Compare data on hover":"J\xe4mf\xf6r data n\xe4r muspekaren h\xe5lls \xf6ver","Double-click on legend to isolate one trace":"Dubbelklicka p\xe5 f\xf6rklaringen f\xf6r att visa endast en serie","Double-click to zoom back out":"Dubbelklicka f\xf6r att zooma ut igen","Download plot":"Ladda ner diagram","Download plot as a png":"Ladda ner diagram som png","Edit in Chart Studio":"Editera i Chart Studio","IE only supports svg. Changing format to svg.":"IE st\xf6der enbart svg. Byter format till svg.","Lasso Select":"V\xe4lj lasso","Orbital rotation":"Orbital rotation",Pan:"Panorera","Produced with Plotly.js":"Skapad med Plotly.js",Reset:"\xc5terst\xe4ll","Reset axes":"\xc5terst\xe4ll axlar","Reset camera to default":"\xc5terst\xe4ll kamera till standard","Reset camera to last save":"\xc5terst\xe4ll kamera till senast sparad","Reset view":"\xc5terst\xe4ll vy","Reset views":"\xc5terst\xe4ll vyer","Show closest data on hover":"Visa n\xe4rmaste v\xe4rde n\xe4r muspekaren h\xe5lls \xf6ver","Snapshot succeeded":"Bild skapad","Sorry, there was a problem downloading your snapshot!":"Tyv\xe4rr gick n\xe5got fel vid nedladdning av bild","Taking snapshot - this may take a few seconds":"Skapar bild - detta kan ta n\xe5gra sekunder","Toggle Spike Lines":"Aktivera/Inaktivera topplinjer","Toggle show closest data on hover":"Aktivera/Inaktivera visa n\xe4rmaste v\xe4rde n\xe4r muspekaren h\xe5lls \xf6ver","Turntable rotation":"Platt rotation",Zoom:"Zooma","Zoom in":"Zooma in","Zoom out":"Zooma ut","close:":"st\xe4ngning:","concentration:":"koncentration:","high:":"h\xf6g:","incoming flow count:":"inkommande fl\xf6de summering:","kde:":"kde:","lat:":"lat:","lon:":"lon:","low:":"l\xe5g:","lower fence:":"undre gr\xe4ns:","max:":"max:","mean \xb1 \u03c3:":"medel \xb1 \u03c3:","mean:":"medel:","median:":"median:","min:":"min:","new text":"ny text","open:":"\xf6ppning:","outgoing flow count:":"utg\xe5ende fl\xf6de summering:","q1:":"q1:","q3:":"q3:","source:":"k\xe4lla:","target:":"m\xe5l:",trace:"serie","upper fence:":"\xf6vre gr\xe4ns:"},format:{days:["S\xf6ndag","M\xe5ndag","Tisdag","Onsdag","Torsdag","Fredag","L\xf6rdag"],shortDays:["S\xf6n","M\xe5n","Tis","Ons","Tor","Fre","L\xf6r"],months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],shortMonths:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],date:"%Y-%m-%d"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/sw.js b/inst/htmlwidgets/lib/plotlyjs/locales/sw.js new file mode 100644 index 0000000000..e60a4474de --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/sw.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"sw",dictionary:{Autoscale:"Kigezo - otomatiki","Box Select":"Teua kisanduku","Click to enter Colorscale title":"Bonyeza kuandika kichwa cha Colorscale","Click to enter Component A title":"Bonyeza kuandika kichwa cha sehemu A","Click to enter Component B title":"Bonyeza kuandika kichwa cha sehemu B","Click to enter Component C title":"Bonyeza kuandika kichwa cha sehemu C","Click to enter Plot title":"Bonyeza kuandika kichwa cha Plot","Click to enter X axis title":"Bonyeza kuandika kichwa cha mhimili wa X","Click to enter Y axis title":"Bonyeza kuandika kichwa cha mhimili wa Y","Click to enter radial axis title":"Bonyeza kuandika kichwa cha mhimili wa radial","Compare data on hover":"Linganisha data kwa kuelea kielekezi","Double-click on legend to isolate one trace":"Bonyeza mara mbili juu ya hadithi ili kutenganisha moja kwa moja","Double-click to zoom back out":"Bonyeza mara mbili ili kuvuta nje","Download plot as a png":"Pakua mpango kama png","Download plot":"Pakua mpango","Edit in Chart Studio":"Hariri katika Chart studio","IE only supports svg. Changing format to svg.":"IE inatumia tu svg. Tunabadilisha muundo kuwa svg.","Lasso Select":"Kuteua lasso","Orbital rotation":"Mzunguko wa mazao",Pan:"Tandaza","Produced with Plotly.js":"Ilitengenezwa na Plotly.js",Reset:"Weka upya","Reset axes":"Weka upya axes","Reset camera to default":"Rudisha kamera kwenye uhifadhi wa default","Reset camera to last save":"Rudisha kamera kwenye uhifadhi wa mwisho","Reset view":"Weka upya mtazamo","Reset views":"Weka upya maoni","Show closest data on hover":"Onyesha data iliyo karibu zaidi kielekezi kinapoelea","Snapshot succeeded":"Snapshot ilifanikiwa","Sorry, there was a problem downloading your snapshot!":"Samahani, kulikuwa na shida kupakua picha yako!","Taking snapshot - this may take a few seconds":"Kuchukua snapshot - hii inaweza kuchukua sekunde chache","Toggle Spike Lines":"Badilisha Mistari ya Spike","Toggle show closest data on hover":"Badilisha mabadiliko ya karibu zaidi kwenye hover","Turntable rotation":"Zunguka kwa mhimili wa Z",Zoom:"Vuta","Zoom in":"Vuta nje","Zoom out":"Vuta ndani","close:":"funga:","high:":"juu:","incoming flow count:":"hesabu ya mtiririko unaokuja:","kde:":"kde:","lat:":"lat:","lon:":"lon:","low:":"chini:","lower fence:":"fensi ya chini:","max:":"upeo:","mean \xb1 \u03c3:":"maana \xb1 \u03c3:","mean:":"maana:","median:":"wastani:","min:":"kidogo:","new text":"nakala mpya","open:":"fungua:","outgoing flow count:":"hesabu ya mtiririko unaotoka:","q1:":"q1:","q3:":"q3:","source:":"chanzo:","target:":"lengo:",trace:"fuatilia","upper fence:":"Fensi ya juu:"},format:{days:["Jumapili","Jumatatu","Jumanne","Jumatano","Alhamisi","Ijumaa","Jumamosi"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["Januari","Februari","Machi","Aprili","Mei","Juni","Julai","Agosti","Septemba","Oktoba","Novemba","Desemba"],shortMonths:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ago","Sep","Okt","Nov","Des"],date:"%d/%m/%Y",decimal:".",thousands:","}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/ta.js b/inst/htmlwidgets/lib/plotlyjs/locales/ta.js new file mode 100644 index 0000000000..e16573377d --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/ta.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"ta",dictionary:{},format:{days:["\u0b9e\u0bbe\u0baf\u0bbf\u0bb1\u0bcd\u0bb1\u0bc1\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8","\u0ba4\u0bbf\u0b99\u0bcd\u0b95\u0b9f\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8","\u0b9a\u0bc6\u0bb5\u0bcd\u0bb5\u0bbe\u0baf\u0bcd\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8","\u0baa\u0bc1\u0ba4\u0ba9\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8","\u0bb5\u0bbf\u0baf\u0bbe\u0bb4\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8","\u0bb5\u0bc6\u0bb3\u0bcd\u0bb3\u0bbf\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8","\u0b9a\u0ba9\u0bbf\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8"],shortDays:["\u0b9e\u0bbe\u0baf\u0bbf\u0bb1\u0bc1","\u0ba4\u0bbf\u0b99\u0bcd\u0b95\u0bb3\u0bcd","\u0b9a\u0bc6\u0bb5\u0bcd\u0bb5\u0bbe\u0baf\u0bcd","\u0baa\u0bc1\u0ba4\u0ba9\u0bcd","\u0bb5\u0bbf\u0baf\u0bbe\u0bb4\u0ba9\u0bcd","\u0bb5\u0bc6\u0bb3\u0bcd\u0bb3\u0bbf","\u0b9a\u0ba9\u0bbf"],months:["\u0ba4\u0bc8","\u0bae\u0bbe\u0b9a\u0bbf","\u0baa\u0b99\u0bcd\u0b95\u0bc1\u0ba9\u0bbf","\u0b9a\u0bbf\u0ba4\u0bcd\u0ba4\u0bbf\u0bb0\u0bc8","\u0bb5\u0bc8\u0b95\u0bbe\u0b9a\u0bbf","\u0b86\u0ba9\u0bbf","\u0b86\u0b9f\u0bbf","\u0b86\u0bb5\u0ba3\u0bbf","\u0baa\u0bc1\u0bb0\u0b9f\u0bcd\u0b9f\u0bbe\u0b9a\u0bbf","\u0b90\u0baa\u0bcd\u0baa\u0b9a\u0bbf","\u0b95\u0bbe\u0bb0\u0bcd\u0ba4\u0bcd\u0ba4\u0bbf\u0b95\u0bc8","\u0bae\u0bbe\u0bb0\u0bcd\u0b95\u0bb4\u0bbf"],shortMonths:["\u0ba4\u0bc8","\u0bae\u0bbe\u0b9a\u0bbf","\u0baa\u0b99\u0bcd","\u0b9a\u0bbf\u0ba4\u0bcd","\u0bb5\u0bc8\u0b95\u0bbe","\u0b86\u0ba9\u0bbf","\u0b86\u0b9f\u0bbf","\u0b86\u0bb5","\u0baa\u0bc1\u0bb0","\u0b90\u0baa\u0bcd","\u0b95\u0bbe\u0bb0\u0bcd","\u0bae\u0bbe\u0bb0\u0bcd"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/th.js b/inst/htmlwidgets/lib/plotlyjs/locales/th.js new file mode 100644 index 0000000000..363a891f18 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/th.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"th",dictionary:{},format:{days:["\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c","\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c","\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23","\u0e1e\u0e38\u0e18","\u0e1e\u0e24\u0e2b\u0e31\u0e2a\u0e1a\u0e14\u0e35","\u0e28\u0e38\u0e01\u0e23\u0e4c","\u0e40\u0e2a\u0e32\u0e23\u0e4c"],shortDays:["\u0e2d\u0e32.","\u0e08.","\u0e2d.","\u0e1e.","\u0e1e\u0e24.","\u0e28.","\u0e2a."],months:["\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21","\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c","\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21","\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19","\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21","\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19","\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21","\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21","\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19","\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21","\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19","\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21"],shortMonths:["\u0e21.\u0e04.","\u0e01.\u0e1e.","\u0e21\u0e35.\u0e04.","\u0e40\u0e21.\u0e22.","\u0e1e.\u0e04.","\u0e21\u0e34.\u0e22.","\u0e01.\u0e04.","\u0e2a.\u0e04.","\u0e01.\u0e22.","\u0e15.\u0e04.","\u0e1e.\u0e22.","\u0e18.\u0e04."],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/tr.js b/inst/htmlwidgets/lib/plotlyjs/locales/tr.js new file mode 100644 index 0000000000..6a370f4691 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/tr.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"tr",dictionary:{},format:{days:["Pazar","Pazartesi","Sal\u0131","\xc7ar\u015famba","Per\u015fembe","Cuma","Cumartesi"],shortDays:["Pz","Pt","Sa","\xc7a","Pe","Cu","Ct"],months:["Ocak","\u015eubat","Mart","Nisan","May\u0131s","Haziran","Temmuz","A\u011fustos","Eyl\xfcl","Ekim","Kas\u0131m","Aral\u0131k"],shortMonths:["Oca","\u015eub","Mar","Nis","May","Haz","Tem","A\u011fu","Eyl","Eki","Kas","Ara"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/tt.js b/inst/htmlwidgets/lib/plotlyjs/locales/tt.js new file mode 100644 index 0000000000..df7b0801b8 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/tt.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"tt",dictionary:{},format:{days:["\u044f\u043a\u0448\u04d9\u043c\u0431\u0435","\u0434\u04af\u0448\u04d9\u043c\u0431\u0435","\u0441\u0438\u0448\u04d9\u043c\u0431\u0435","\u0447\u04d9\u0440\u0448\u04d9\u043c\u0431\u0435","\u043f\u04d9\u043d\u0497\u0435\u0448\u04d9\u043c\u0431\u0435","\u0497\u043e\u043c\u0433\u0430","\u0448\u0438\u043c\u0431\u04d9"],shortDays:["\u044f\u043a\u0448","\u0434\u04af\u0448","\u0441\u0438\u0448","\u0447\u04d9\u0440","\u043f\u04d9\u043d","\u0497\u043e\u043c","\u0448\u0438\u043c"],months:["\u0413\u044b\u043d\u0432\u0430\u0440","\u0424\u0435\u0432\u0440\u0430\u043b\u044c","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0435\u043b\u044c","\u041c\u0430\u0439","\u0418\u044e\u043d\u044c","\u0418\u044e\u043b\u044c","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043d\u0442\u044f\u0431\u0440\u044c","\u041e\u043a\u0442\u044f\u0431\u0440\u044c","\u041d\u043e\u044f\u0431\u0440\u044c","\u0414\u0435\u043a\u0430\u0431\u0440\u044c"],shortMonths:["\u0413\u044b\u0439\u043d","\u0424\u0435\u0432","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0439","\u0418\u044e\u043d","\u0418\u044e\u043b","\u0410\u0432\u0433","\u0421\u0435\u043d","\u041e\u043a\u0442","\u041d\u043e\u044f","\u0414\u0435\u043a"],date:"%d.%m.%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/uk.js b/inst/htmlwidgets/lib/plotlyjs/locales/uk.js new file mode 100644 index 0000000000..15460c76cc --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/uk.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"uk",dictionary:{Autoscale:"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u0435 \u0448\u043a\u0430\u043b\u044e\u0432\u0430\u043d\u043d\u044f","Box Select":"\u0412\u0438\u0434\u0456\u043b\u0435\u043d\u043d\u044f \u043f\u0440\u044f\u043c\u043e\u043a\u0443\u0442\u043d\u043e\u0457 \u043e\u0431\u043b\u0430\u0441\u0442\u0456","Click to enter Colorscale title":"\u041d\u0430\u0442\u0438\u0441\u043d\u0456\u0442\u044c \u0434\u043b\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044f \u043d\u0430\u0437\u0432\u0438 \u0448\u043a\u0430\u043b\u0438 \u043a\u043e\u043b\u044c\u043e\u0440\u0443","Click to enter Component A title":"\u041d\u0430\u0442\u0438\u0441\u043d\u0456\u0442\u044c \u0434\u043b\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044f \u043d\u0430\u0437\u0432\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 A","Click to enter Component B title":"\u041d\u0430\u0442\u0438\u0441\u043d\u0456\u0442\u044c \u0434\u043b\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044f \u043d\u0430\u0437\u0432\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 B","Click to enter Component C title":"\u041d\u0430\u0442\u0438\u0441\u043d\u0456\u0442\u044c \u0434\u043b\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044f \u043d\u0430\u0437\u0432\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 C","Click to enter Plot title":"\u041d\u0430\u0442\u0438\u0441\u043d\u0456\u0442\u044c \u0434\u043b\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044f \u043d\u0430\u0437\u0432\u0438 \u0433\u0440\u0430\u0444\u0456\u043a\u0430","Click to enter X axis title":"\u041d\u0430\u0442\u0438\u0441\u043d\u0456\u0442\u044c \u0434\u043b\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044f \u043d\u0430\u0437\u0432\u0438 \u043e\u0441\u0456 X","Click to enter Y axis title":"\u041d\u0430\u0442\u0438\u0441\u043d\u0456\u0442\u044c \u0434\u043b\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044f \u043d\u0430\u0437\u0432\u0438 \u043e\u0441\u0456 Y","Click to enter radial axis title":"\u041d\u0430\u0442\u0438\u0441\u043d\u0456\u0442\u044c \u0434\u043b\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044f \u043d\u0430\u0437\u0432\u0438 \u043f\u043e\u043b\u044f\u0440\u043d\u043e\u0457 \u043e\u0441\u0456","Compare data on hover":"\u041f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u0456 \u043f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0432\u0441\u0456 \u0434\u0430\u043d\u0456","Double-click on legend to isolate one trace":"\u0414\u0432\u0456\u0447\u0456 \u043a\u043b\u0430\u0446\u043d\u0456\u0442\u044c \u043f\u043e \u043b\u0435\u0433\u0435\u043d\u0434\u0456 \u0434\u043b\u044f \u0432\u0438\u0434\u0456\u043b\u0435\u043d\u043d\u044f \u043e\u043a\u0440\u0435\u043c\u0438\u0445 \u0434\u0430\u043d\u0438\u0445","Double-click to zoom back out":"\u0414\u043b\u044f \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0437\u0430 \u0437\u0430\u043c\u043e\u0432\u0447\u0443\u0432\u0430\u043d\u043d\u044f\u043c \u0434\u0432\u0456\u0447\u0456 \u043a\u043b\u0430\u0446\u043d\u0456\u0442\u044c \u043c\u0438\u0448\u0435\u044e","Download plot":"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u0433\u0440\u0430\u0444\u0456\u043a","Download plot as a png":"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u0443 \u0444\u043e\u0440\u043c\u0430\u0442\u0456 PNG","Edit in Chart Studio":"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0443 Chart Studio","IE only supports svg. Changing format to svg.":"IE \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454 \u043b\u0438\u0448\u0435 svg. \u0424\u043e\u0440\u043c\u0430\u0442 \u0437\u043c\u0456\u043d\u044e\u0454\u0442\u044c\u0441\u044f \u043d\u0430 svg.","Lasso Select":"\u041b\u0430\u0441\u043e","Orbital rotation":"\u0420\u0443\u0445 \u043f\u043e \u043e\u0440\u0431\u0456\u0442\u0456",Pan:"\u0417\u0441\u0443\u0432","Produced with Plotly.js":"\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043e \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e Plotly.js",Reset:"\u0412\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0437\u0430 \u0437\u0430\u043c\u043e\u0432\u0447\u0443\u0432\u0430\u043d\u043d\u044f\u043c","Reset axes":"\u0412\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438 \u043e\u0441\u044f\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0437\u0430 \u0437\u0430\u043c\u043e\u0432\u0447\u0443\u0432\u0430\u043d\u043d\u044f\u043c","Reset camera to default":"\u0412\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438 \u043a\u0430\u043c\u0435\u0440\u0456 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0437\u0430 \u0437\u0430\u043c\u043e\u0432\u0447\u0443\u0432\u0430\u043d\u043d\u044f\u043c","Reset camera to last save":"\u041f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u0438 \u043a\u0430\u043c\u0435\u0440\u0443 \u0432 \u043e\u0441\u0442\u0430\u043d\u043d\u0456\u0439 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u0438\u0439 \u0441\u0442\u0430\u043d","Reset view":"\u0412\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438 \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0437\u0430 \u0437\u0430\u043c\u043e\u0432\u0447\u0443\u0432\u0430\u043d\u043d\u044f\u043c","Reset views":"\u0412\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438 \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0437\u0430 \u0437\u0430\u043c\u043e\u0432\u0447\u0443\u0432\u0430\u043d\u043d\u044f\u043c","Show closest data on hover":"\u041f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u0456 \u043f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043d\u0430\u0439\u0431\u043b\u0438\u0436\u0447\u0456 \u0434\u0430\u043d\u0456","Snapshot succeeded":"\u0417\u043d\u0456\u043c\u043e\u043a \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0439","Sorry, there was a problem downloading your snapshot!":"\u041d\u0430 \u0436\u0430\u043b\u044c, \u0432\u0438\u043d\u0438\u043a\u043b\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u0438 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u043d\u0456 \u0437\u043d\u0456\u043c\u043a\u0443","Taking snapshot - this may take a few seconds":"\u0421\u0442\u0432\u043e\u0440\u044e\u0454\u0442\u044c\u0441\u044f \u0437\u043d\u0456\u043c\u043e\u043a - \u0446\u0435 \u043c\u043e\u0436\u0435 \u0437\u0430\u0439\u043d\u044f\u0442\u0438 \u043a\u0456\u043b\u044c\u043a\u0430 \u0441\u0435\u043a\u0443\u043d\u0434","Toggle Spike Lines":"\u0423\u0432\u0456\u043c\u043a\u043d\u0443\u0442\u0438/\u0432\u0438\u043c\u043a\u043d\u0443\u0442\u0438 \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u043b\u0456\u043d\u0456\u0439 \u043f\u0440\u043e\u0435\u043a\u0446\u0456\u0439 \u0442\u043e\u0447\u043e\u043a","Toggle show closest data on hover":"\u0423\u0432\u0456\u043c\u043a\u043d\u0443\u0442\u0438/\u0432\u0438\u043c\u043a\u043d\u0443\u0442\u0438 \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u043d\u0430\u0439\u0431\u043b\u0438\u0436\u0447\u0438\u0445 \u0434\u0430\u043d\u0438\u0445 \u043f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u0456","Turntable rotation":"\u041e\u0431\u0435\u0440\u0442\u0430\u043d\u043d\u044f \u043d\u0430 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e\u043c\u0443 \u0441\u0442\u043e\u043b\u0456",Zoom:"\u0417\u0443\u043c","Zoom in":"\u0417\u0431\u0456\u043b\u044c\u0448\u0438\u0442\u0438","Zoom out":"\u0417\u043c\u0435\u043d\u0448\u0438\u0442\u0438","close:":"\u0417\u0430\u043a\u0440\u0438\u0442\u0442\u044f:","concentration:":"\u041a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0456\u044f:","high:":"\u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c:","incoming flow count:":"\u041a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0432\u0445\u0456\u0434\u043d\u0438\u0445 \u0437\u0432'\u044f\u0437\u043a\u0456\u0432:","kde:":"\u042f\u0434\u0440\u043e\u0432\u0430 \u043e\u0446\u0456\u043d\u043a\u0430 \u0433\u0443\u0441\u0442\u0438\u043d\u0438 \u0440\u043e\u0437\u043f\u043e\u0434\u0456\u043b\u0443:","lat:":"\u0428\u0438\u0440\u043e\u0442\u0430:","lon:":"\u0414\u043e\u0432\u0433\u043e\u0442\u0430:","low:":"\u041c\u0456\u043d\u0456\u043c\u0443\u043c:","lower fence:":"\u041d\u0438\u0436\u043d\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u044f:","max:":"\u041c\u0430\u043a\u0441.:","mean \xb1 \u03c3:":"\u0421\u0435\u0440\u0435\u0434\u043d\u0454 \xb1 \u03c3:","mean:":"\u0421\u0435\u0440\u0435\u0434\u043d\u0454:","median:":"\u041c\u0435\u0434\u0456\u0430\u043d\u0430:","min:":"\u041c\u0456\u043d.:","new text":"\u041d\u043e\u0432\u0438\u0439 \u0442\u0435\u043a\u0441\u0442","open:":"\u0412\u0456\u0434\u043a\u0440\u0438\u0442\u0442\u044f:","outgoing flow count:":"\u041a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0432\u0438\u0445\u0456\u0434\u043d\u0438\u0445 \u0437\u0432'\u044f\u0437\u043a\u0456\u0432:","q1:":"q1:","q3:":"q3:","source:":"\u0414\u0436\u0435\u0440\u0435\u043b\u043e:","target:":"\u0426\u0456\u043b\u044c:",trace:"\u0420\u044f\u0434","upper fence:":"\u0412\u0435\u0440\u0445\u043d\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u044f:"},format:{days:["\u043d\u0435\u0434\u0456\u043b\u044f","\u043f\u043e\u043d\u0435\u0434\u0456\u043b\u043e\u043a","\u0432\u0456\u0432\u0442\u043e\u0440\u043e\u043a","\u0441\u0435\u0440\u0435\u0434\u0430","\u0447\u0435\u0442\u0432\u0435\u0440","\u043f'\u044f\u0442\u043d\u0438\u0446\u044f","\u0441\u0443\u0431\u043e\u0442\u0430"],shortDays:["\u043d\u0434","\u043f\u043d","\u0432\u0442","\u0441\u0440","\u0447\u0442","\u043f\u0442","\u0441\u0431"],months:["\u0421\u0456\u0447\u0435\u043d\u044c","\u041b\u044e\u0442\u0438\u0439","\u0411\u0435\u0440\u0435\u0437\u0435\u043d\u044c","\u041a\u0432\u0456\u0442\u0435\u043d\u044c","\u0422\u0440\u0430\u0432\u0435\u043d\u044c","\u0427\u0435\u0440\u0432\u0435\u043d\u044c","\u041b\u0438\u043f\u0435\u043d\u044c","\u0421\u0435\u0440\u043f\u0435\u043d\u044c","\u0412\u0435\u0440\u0435\u0441\u0435\u043d\u044c","\u0416\u043e\u0432\u0442\u0435\u043d\u044c","\u041b\u0438\u0441\u0442\u043e\u043f\u0430\u0434","\u0413\u0440\u0443\u0434\u0435\u043d\u044c"],shortMonths:["\u0421\u0456\u0447.","\u041b\u044e\u0442.","\u0411\u0435\u0440\u0435\u0437.","\u041a\u0432\u0456\u0442.","\u0422\u0440\u0430\u0432.","\u0427\u0435\u0440\u0432.","\u041b\u0438\u043f.","\u0421\u0435\u0440\u043f.","\u0412\u0435\u0440\u0435\u0441.","\u0416\u043e\u0432\u0442.","\u041b\u0438\u0441\u0442\u043e\u043f.","\u0413\u0440\u0443\u0434."],date:"%d.%m.%Y",decimal:",",thousands:" "}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/ur.js b/inst/htmlwidgets/lib/plotlyjs/locales/ur.js new file mode 100644 index 0000000000..536b69f9de --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/ur.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"ur",dictionary:{},format:{days:["\u0627\u062a\u0648\u0627\u0631","\u067e\u064a\u0631","\u0645\u0646\u06af\u0644","\u0628\u062f\u06be","\u062c\u0645\u0639\u0631\u0627\u062a","\u062c\u0645\u0639\u06c1","\u06c1\u0641\u062a\u06c1"],shortDays:["\u0627\u062a\u0648\u0627\u0631","\u067e\u064a\u0631","\u0645\u0646\u06af\u0644","\u0628\u062f\u06be","\u062c\u0645\u0639\u0631\u0627\u062a","\u062c\u0645\u0639\u06c1","\u06c1\u0641\u062a\u06c1"],months:["\u062c\u0646\u0648\u0631\u06cc","\u0641\u0631\u0648\u0631\u06cc","\u0645\u0627\u0631\u0686","\u0627\u067e\u0631\u06cc\u0644","\u0645\u0626\u06cc","\u062c\u0648\u0646","\u062c\u0648\u0644\u0627\u0626\u06cc","\u0627\u06af\u0633\u062a","\u0633\u062a\u0645\u0628\u0631","\u0627\u06a9\u062a\u0648\u0628\u0631","\u0646\u0648\u0645\u0628\u0631","\u062f\u0633\u0645\u0628\u0631"],shortMonths:["1","2","3","4","5","6","7","8","9","10","11","12"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/vi.js b/inst/htmlwidgets/lib/plotlyjs/locales/vi.js new file mode 100644 index 0000000000..8b0d722ade --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/vi.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"vi",dictionary:{},format:{days:["Ch\u1ee7 Nh\u1eadt","Th\u1ee9 Hai","Th\u1ee9 Ba","Th\u1ee9 T\u01b0","Th\u1ee9 N\u0103m","Th\u1ee9 S\xe1u","Th\u1ee9 B\u1ea3y"],shortDays:["CN","T2","T3","T4","T5","T6","T7"],months:["Th\xe1ng M\u1ed9t","Th\xe1ng Hai","Th\xe1ng Ba","Th\xe1ng T\u01b0","Th\xe1ng N\u0103m","Th\xe1ng S\xe1u","Th\xe1ng B\u1ea3y","Th\xe1ng T\xe1m","Th\xe1ng Ch\xedn","Th\xe1ng M\u01b0\u1eddi","Th\xe1ng M\u01b0\u1eddi M\u1ed9t","Th\xe1ng M\u01b0\u1eddi Hai"],shortMonths:["Th\xe1ng 1","Th\xe1ng 2","Th\xe1ng 3","Th\xe1ng 4","Th\xe1ng 5","Th\xe1ng 6","Th\xe1ng 7","Th\xe1ng 8","Th\xe1ng 9","Th\xe1ng 10","Th\xe1ng 11","Th\xe1ng 12"],date:"%d/%m/%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/zh-cn.js b/inst/htmlwidgets/lib/plotlyjs/locales/zh-cn.js new file mode 100644 index 0000000000..a967f54e48 --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/zh-cn.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"zh-CN",dictionary:{Autoscale:"\u81ea\u52a8\u7f29\u653e","Box Select":"\u77e9\u5f62\u6846\u9009","Click to enter Colorscale title":"\u70b9\u51fb\u8f93\u5165\u8272\u9636\u7684\u6807\u9898","Click to enter Component A title":"\u70b9\u51fb\u8f93\u5165\u7ec4\u4ef6A\u7684\u6807\u9898","Click to enter Component B title":"\u70b9\u51fb\u8f93\u5165\u7ec4\u4ef6B\u7684\u6807\u9898","Click to enter Component C title":"\u70b9\u51fb\u8f93\u5165\u7ec4\u4ef6C\u7684\u6807\u9898","Click to enter Plot title":"\u70b9\u51fb\u8f93\u5165\u56fe\u8868\u7684\u6807\u9898","Click to enter X axis title":"\u70b9\u51fb\u8f93\u5165X\u8f74\u7684\u6807\u9898","Click to enter Y axis title":"\u70b9\u51fb\u8f93\u5165Y\u8f74\u7684\u6807\u9898","Compare data on hover":"\u60ac\u505c\u65f6\u6bd4\u8f83\u6570\u636e","Double-click on legend to isolate one trace":"\u53cc\u51fb\u56fe\u4f8b\u6765\u7a81\u663e\u5bf9\u5e94\u8f68\u8ff9","Double-click to zoom back out":"\u53cc\u51fb\u8fd4\u56de\u7f29\u5c0f\u663e\u793a","Download plot as a png":"\u4e0b\u8f7d\u56fe\u8868\u4e3aPNG\u683c\u5f0f","Download plot":"\u4e0b\u8f7d\u56fe\u8868","Edit in Chart Studio":"\u5728Chart Studio\u4e2d\u7f16\u8f91","IE only supports svg. Changing format to svg.":"IE\u53ea\u652f\u6301SVG\u3002\u8f6c\u6362\u683c\u5f0f\u4e3aSVG\u3002","Lasso Select":"\u5957\u7d22\u9009\u62e9","Orbital rotation":"\u8f68\u9053\u65cb\u8f6c",Pan:"\u5e73\u79fb","Produced with Plotly.js":"\u7531Plotly.js\u751f\u6210",Reset:"\u91cd\u7f6e","Reset axes":"\u91cd\u7f6e\u8f74","Reset camera to default":"\u91cd\u7f6e\u955c\u5934\u89c6\u89d2\u4e3a\u9ed8\u8ba4\u72b6\u6001","Reset camera to last save":"\u91cd\u7f6e\u955c\u5934\u89c6\u89d2\u4e3a\u4e0a\u6b21\u4fdd\u5b58\u72b6\u6001","Reset view":"\u91cd\u7f6e\u89c6\u56fe","Reset views":"\u91cd\u7f6e\u89c6\u56fe","Show closest data on hover":"\u60ac\u505c\u65f6\u663e\u793a\u6700\u8fd1\u7684\u6570\u636e","Snapshot succeeded":"\u751f\u6210\u5feb\u7167\u6210\u529f","Sorry, there was a problem downloading your snapshot!":"\u62b1\u6b49\uff0c\u4e0b\u8f7d\u5feb\u7167\u51fa\u73b0\u95ee\u9898\uff01","Taking snapshot - this may take a few seconds":"\u6b63\u5728\u751f\u6210\u5feb\u7167 - \u53ef\u80fd\u9700\u8981\u51e0\u79d2\u949f",Zoom:"\u7f29\u653e","Zoom in":"\u653e\u5927","Zoom out":"\u7f29\u5c0f","close:":"\u5173\u95ed:",trace:"\u8e2a\u8ff9:","lat:":"\u7eac\u5ea6:","lon:":"\u7ecf\u5ea6:","q1:":"\u7b2c\u4e00\u56db\u5206\u4f4d\u6570:","q3:":"\u7b2c\u4e09\u56db\u5206\u4f4d\u6570:","source:":"\u6e90:","target:":"\u76ee\u6807:","lower fence:":"\u5185\u4fa7\u680f(lower fence):","upper fence:":"\u5916\u4fa7\u680f(upper fence):","max:":"\u6700\u5927\u503c:","mean \xb1 \u03c3:":"\u5e73\u5747\u6570 \xb1 \u6807\u51c6\u5dee\u03c3:","mean:":"\u5e73\u5747\u6570:","median:":"\u4e2d\u4f4d\u6570:","min:":"\u6700\u5c0f\u503c:","Turntable rotation":"\u65cb\u8f6c\u8f6c\u76d8:","Toggle Spike Lines":"\u5207\u6362\u663e\u793a\u6570\u636e\u70b9\u8f85\u52a9\u7ebf(Spike Lines)","open:":"\u6253\u5f00:","high:":"\u9ad8:","low:":"\u4f4e:","Toggle show closest data on hover":"\u5207\u6362\u60ac\u505c\u65f6\u663e\u793a\u6700\u8fd1\u7684\u6570\u636e\u70b9","incoming flow count:":"\u6d41\u5165\u6570\u91cf:","outgoing flow count:":"\u6d41\u51fa\u6570\u91cf:","kde:":"kde:","Click to enter radial axis title":"\u70b9\u51fb\u8f93\u5165\u5f84\u5411\u8f74\u6807\u9898","new text":"\u65b0\u5efa\u6587\u672c"},format:{days:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],shortDays:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d"],months:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],shortMonths:["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"],date:"%Y-%m-%d"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/zh-hk.js b/inst/htmlwidgets/lib/plotlyjs/locales/zh-hk.js new file mode 100644 index 0000000000..aa5f0bd65b --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/zh-hk.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"zh-HK",dictionary:{},format:{days:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],shortDays:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d"],months:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],shortMonths:["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"],date:"%d-%m-%Y"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/locales/zh-tw.js b/inst/htmlwidgets/lib/plotlyjs/locales/zh-tw.js new file mode 100644 index 0000000000..cb80b15b3e --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/locales/zh-tw.js @@ -0,0 +1 @@ +var locale={moduleType:"locale",name:"zh-TW",dictionary:{Autoscale:"\u81ea\u52d5\u7e2e\u653e","Box Select":"\u77e9\u5f62\u9078\u64c7","Click to enter Colorscale title":"\u9ede\u64ca\u4ee5\u8f38\u5165\u8272\u968e\u6a19\u984c","Click to enter Component A title":"\u9ede\u64ca\u4ee5\u8f38\u5165\u5143\u4ef6 A \u6a19\u984c","Click to enter Component B title":"\u9ede\u64ca\u4ee5\u8f38\u5165\u5143\u4ef6 B \u6a19\u984c","Click to enter Component C title":"\u9ede\u64ca\u4ee5\u8f38\u5165\u5143\u4ef6 C \u6a19\u984c","Click to enter Plot title":"\u9ede\u64ca\u4ee5\u8f38\u5165\u7e6a\u5716\u6a19\u984c","Click to enter X axis title":"\u9ede\u64ca\u4ee5\u8f38\u5165 X \u8ef8\u6a19\u984c","Click to enter Y axis title":"\u9ede\u64ca\u4ee5\u8f38\u5165 Y \u8ef8\u6a19\u984c","Click to enter radial axis title":"\u9ede\u64ca\u4ee5\u8f38\u5165\u8f3b\u5c04\u8ef8\u6a19\u984c","Compare data on hover":"\u6e38\u6a19\u505c\u7559\u6642\u6bd4\u8f03\u8cc7\u6599","Double-click on legend to isolate one trace":"\u96d9\u64ca\u5716\u4f8b\u4ee5\u9694\u96e2\u55ae\u4e00\u8ecc\u8de1","Double-click to zoom back out":"\u96d9\u64ca\u56de\u5fa9\u7e2e\u653e","Download plot as a png":"\u4e0b\u8f09\u5716\u8868\u70ba PNG \u5716\u6a94","Download plot":"\u4e0b\u8f09\u5716\u8868","Draw circle":"\u7e6a\u88fd\u5713\u5708","Draw closed freeform":"\u7e6a\u88fd\u5c01\u9589\u7684\u4efb\u610f\u5716\u5f62","Draw line":"\u7e6a\u88fd\u7dda\u689d","Draw open freeform":"\u7e6a\u88fd\u958b\u653e\u7684\u4efb\u610f\u5716\u5f62","Draw rectangle":"\u7e6a\u88fd\u77e9\u5f62","Edit in Chart Studio":"\u65bc Chart Studio \u7de8\u8f2f","Erase active shape":"\u6e05\u9664\u4f5c\u7528\u4e2d\u7684\u5f62\u72c0","IE only supports svg. Changing format to svg.":"IE \u50c5\u652f\u63f4 SVG\uff0c\u5c07\u8b8a\u66f4\u683c\u5f0f\u70ba SVG\u3002","Lasso Select":"\u5957\u7d22\u9078\u64c7","Orbital rotation":"\u8ecc\u9053\u65cb\u8f49",Pan:"\u5e73\u79fb","Produced with Plotly.js":"\u4f7f\u7528 Plotly.js \u88fd\u4f5c",Reset:"\u91cd\u7f6e","Reset axes":"\u91cd\u7f6e\u8ef8","Reset camera to default":"\u91cd\u7f6e\u76f8\u6a5f\u81f3\u9810\u8a2d\u4f4d\u7f6e","Reset camera to last save":"\u91cd\u7f6e\u76f8\u6a5f\u81f3\u4e0a\u6b21\u5132\u5b58\u7684\u4f4d\u7f6e","Reset view":"\u91cd\u7f6e\u8996\u5716","Reset views":"\u91cd\u7f6e\u8996\u5716","Show closest data on hover":"\u6e38\u6a19\u505c\u7559\u6642\u986f\u793a\u6700\u63a5\u8fd1\u7684\u8cc7\u6599","Snapshot succeeded":"\u5feb\u7167\u6210\u529f","Sorry, there was a problem downloading your snapshot!":"\u62b1\u6b49\uff0c\u4e0b\u8f09\u5feb\u7167\u6642\u767c\u751f\u932f\u8aa4!","Taking snapshot - this may take a few seconds":"\u7522\u751f\u5feb\u7167\u4e2d - \u53ef\u80fd\u9700\u8981\u4e00\u9ede\u6642\u9593",Zoom:"\u7e2e\u653e","Zoom in":"\u653e\u5927","Zoom out":"\u7e2e\u5c0f","close:":"\u95dc\u9589:",concentration:"\u96c6\u4e2d",trace:"\u8ecc\u8de1:","lat:":"\u7def\u5ea6:","lon:":"\u7d93\u5ea6:","q1:":"\u7b2c\u4e00\u56db\u5206\u4f4d\u6578:","q3:":"\u7b2c\u4e09\u56db\u5206\u4f4d\u6578:","source:":"\u4f86\u6e90:","target:":"\u76ee\u6a19:","lower fence:":"\u4e0b\u570d\u7c6c\u503c:","upper fence:":"\u4e0a\u570d\u7c6c\u503c:","max:":"\u6700\u5927\u503c:","mean \xb1 \u03c3:":"\u5e73\u5747 \xb1 \u03c3:","mean:":"\u5e73\u5747\u503c:","median:":"\u4e2d\u4f4d\u6578:","min:":"\u6700\u5c0f\u503c:","Turntable rotation":"\u8f49\u76e4\u65cb\u8f49:","Toggle Spike Lines":"\u5207\u63db\u5c16\u5cf0\u7dda","open:":"\u958b\u555f:","high:":"\u9ad8:","low:":"\u4f4e:","Toggle show closest data on hover":"\u5207\u63db\u6ed1\u9f20\u61f8\u505c\u986f\u793a\u6700\u63a5\u8fd1\u7684\u8cc7\u6599","incoming flow count:":"\u50b3\u5165\u6d41\u91cf\u8a08\u6578:","outgoing flow count:":"\u50b3\u51fa\u6d41\u91cf\u8a08\u6578:","kde:":"kde:","new text":"\u65b0\u6587\u672c"},format:{days:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],shortDays:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],months:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],shortMonths:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],date:"%Y-%m-%d"}};"undefined"==typeof Plotly?(window.PlotlyLocales=window.PlotlyLocales||[],window.PlotlyLocales.push(locale)):Plotly.register(locale); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/plotlyjs/plotly-htmlwidgets.css b/inst/htmlwidgets/lib/plotlyjs/plotly-htmlwidgets.css new file mode 100644 index 0000000000..f35906d52c --- /dev/null +++ b/inst/htmlwidgets/lib/plotlyjs/plotly-htmlwidgets.css @@ -0,0 +1,9 @@ +/* +just here so that plotly works +correctly with ioslides. +see https://github.com/ropensci/plotly/issues/463 +*/ + +slide:not(.current) .plotly.html-widget{ + display: none; +} diff --git a/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js b/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js index 89d1192a20..9f88c0fdea 100644 --- a/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js +++ b/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js @@ -1,44 +1,8 @@ /** -* plotly.js v1.4.1 -* Copyright 2012-2016, Plotly, Inc. +* plotly.js v2.25.2 +* Copyright 2012-2025, Plotly, Inc. * All rights reserved. * Licensed under the MIT license */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return i(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;or)){var i=this._components;if(r===e.length-1)for(var l=16*r,u=0;16>u;++u)n[u]=i[l++];else{for(var c=e[r+1]-e[r],l=16*r,f=this.prevMatrix,h=!0,u=0;16>u;++u)f[u]=i[l++];for(var d=this.nextMatrix,u=0;16>u;++u)d[u]=i[l++],h=h&&f[u]===d[u];if(1e-6>c||h)for(var u=0;16>u;++u)n[u]=f[u];else o(n,f,d,(t-e[r])/c)}var g=this.computedUp;g[0]=n[1],g[1]=n[5],g[2]=n[6],p(g,g);var m=this.computedInverse;s(m,n);var v=this.computedEye,y=m[15];v[0]=m[12]/y,v[1]=m[13]/y,v[2]=m[14]/y;for(var b=this.computedCenter,x=Math.exp(this.computedRadius[0]),u=0;3>u;++u)b[u]=v[u]-n[2+4*u]*x}},g.idle=function(t){if(!(tn;++n)e.push(e[r++]);this._time.push(t)}},g.flush=function(t){var e=a.gt(this._time,t)-2;0>e||(this._time.slice(0,e),this._components.slice(0,16*e))},g.lastT=function(){return this._time[this._time.length-1]},g.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||d,n=n||this.computedUp,this.setMatrix(t,f(this.computedMatrix,e,r,n));for(var i=0,a=0;3>a;++a)i+=Math.pow(r[a]-e[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},g.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&u(i,i,e),r&&l(i,i,r),n&&c(i,i,n),this.setMatrix(t,s(this.computedMatrix,i))};var m=[0,0,0];g.pan=function(t,e,r,n){m[0]=-(e||0),m[1]=-(r||0),m[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;h(i,i,m),this.setMatrix(t,s(i,i))},g.translate=function(t,e,r,n){m[0]=e||0,m[1]=r||0,m[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;h(i,i,m),this.setMatrix(t,i)},g.setMatrix=function(t,e){if(!(tr;++r)this._components.push(e[r])}},g.setDistance=function(t,e){this.computedRadius[0]=e},g.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},g.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},{"binary-search-bounds":4,"gl-mat4/invert":214,"gl-mat4/lookAt":215,"gl-mat4/rotateX":219,"gl-mat4/rotateY":220,"gl-mat4/rotateZ":221,"gl-mat4/scale":222,"gl-mat4/translate":223,"gl-vec3/normalize":9,"mat4-interpolate":10}],4:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){var a=new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],5:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}e.exports=n},{}],6:[function(t,e,r){function n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.exports=n},{}],7:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}e.exports=n},{}],8:[function(t,e,r){function n(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}e.exports=n},{}],9:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],10:[function(t,e,r){function n(t,e,r,n){if(0===c(e)||0===c(r))return!1;var i=u(e,h.translate,h.scale,h.skew,h.perspective,h.quaternion),a=u(r,p.translate,p.scale,p.skew,p.perspective,p.quaternion);return i&&a?(s(d.translate,h.translate,p.translate,n),s(d.skew,h.skew,p.skew,n),s(d.scale,h.scale,p.scale,n),s(d.perspective,h.perspective,p.perspective,n),f(d.quaternion,h.quaternion,p.quaternion,n),l(t,d.translate,d.scale,d.skew,d.perspective,d.quaternion),!0):!1}function i(){return{translate:a(),scale:a(1),skew:a(),perspective:o(),quaternion:o()}}function a(t){return[t||0,t||0,t||0]}function o(){return[0,0,0,1]}var s=t("gl-vec3/lerp"),l=t("mat4-recompose"),u=t("mat4-decompose"),c=t("gl-mat4/determinant"),f=t("quat-slerp"),h=i(),p=i(),d=i();e.exports=n},{"gl-mat4/determinant":210,"gl-vec3/lerp":8,"mat4-decompose":11,"mat4-recompose":13,"quat-slerp":14}],11:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}function i(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function a(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}var o=t("./normalize"),s=t("gl-mat4/create"),l=t("gl-mat4/clone"),u=t("gl-mat4/determinant"),c=t("gl-mat4/invert"),f=t("gl-mat4/transpose"),h={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},p=s(),d=s(),g=[0,0,0,0],m=[[0,0,0],[0,0,0],[0,0,0]],v=[0,0,0];e.exports=function(t,e,r,s,y,b){if(e||(e=[0,0,0]),r||(r=[0,0,0]),s||(s=[0,0,0]),y||(y=[0,0,0,1]),b||(b=[0,0,0,1]),!o(p,t))return!1;if(l(d,p),d[3]=0,d[7]=0,d[11]=0,d[15]=1,Math.abs(u(d)<1e-8))return!1;var x=p[3],_=p[7],w=p[11],A=p[12],k=p[13],M=p[14],E=p[15];if(0!==x||0!==_||0!==w){g[0]=x,g[1]=_,g[2]=w,g[3]=E;var T=c(d,d);if(!T)return!1;f(d,d),n(y,g,d)}else y[0]=y[1]=y[2]=0,y[3]=1;if(e[0]=A,e[1]=k,e[2]=M,i(m,p),r[0]=h.length(m[0]),h.normalize(m[0],m[0]),s[0]=h.dot(m[0],m[1]),a(m[1],m[1],m[0],1,-s[0]),r[1]=h.length(m[1]),h.normalize(m[1],m[1]),s[0]/=r[1],s[1]=h.dot(m[0],m[2]),a(m[2],m[2],m[0],1,-s[1]),s[2]=h.dot(m[1],m[2]),a(m[2],m[2],m[1],1,-s[2]),r[2]=h.length(m[2]),h.normalize(m[2],m[2]),s[1]/=r[2],s[2]/=r[2],h.cross(v,m[1],m[2]),h.dot(m[0],v)<0)for(var L=0;3>L;L++)r[L]*=-1,m[L][0]*=-1,m[L][1]*=-1,m[L][2]*=-1;return b[0]=.5*Math.sqrt(Math.max(1+m[0][0]-m[1][1]-m[2][2],0)),b[1]=.5*Math.sqrt(Math.max(1-m[0][0]+m[1][1]-m[2][2],0)),b[2]=.5*Math.sqrt(Math.max(1-m[0][0]-m[1][1]+m[2][2],0)),b[3]=.5*Math.sqrt(Math.max(1+m[0][0]+m[1][1]+m[2][2],0)),m[2][1]>m[1][2]&&(b[0]=-b[0]),m[0][2]>m[2][0]&&(b[1]=-b[1]),m[1][0]>m[0][1]&&(b[2]=-b[2]),!0}},{"./normalize":12,"gl-mat4/clone":208,"gl-mat4/create":209,"gl-mat4/determinant":210,"gl-mat4/invert":214,"gl-mat4/transpose":224,"gl-vec3/cross":5,"gl-vec3/dot":6,"gl-vec3/length":7,"gl-vec3/normalize":9}],12:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;16>i;i++)t[i]=e[i]*n;return!0}},{}],13:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":209,"gl-mat4/fromRotationTranslation":212,"gl-mat4/identity":213,"gl-mat4/multiply":216,"gl-mat4/scale":222,"gl-mat4/translate":223}],14:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":15}],15:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],f=e[2],h=e[3],p=r[0],d=r[1],g=r[2],m=r[3];return a=u*p+c*d+f*g+h*m,0>a&&(a=-a,p=-p,d=-d,g=-g,m=-m),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*p,t[1]=s*c+l*d,t[2]=s*f+l*g,t[3]=s*h+l*m,t}e.exports=n},{}],16:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(f>0){var f=Math.sqrt(c+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,u),f=Math.sqrt(2*h-c+1);e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}e.exports=n},{}],17:[function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;nr;++r)e[r]=0;return e}function o(t,e,r){switch(arguments.length){case 0:return new i([0],[0],0);case 1:if("number"==typeof t){var n=a(t);return new i(n,n,0)}return new i(t,a(t.length),0);case 2:if("number"==typeof e){var n=a(t.length);return new i(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new i(t,e,r)}}e.exports=o;var s=t("cubic-hermite"),l=t("binary-search-bounds"),u=i.prototype;u.flush=function(t){var e=l.gt(this._time,t)-1;0>=e||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},u.curve=function(t){var e=this._time,r=e.length,i=l.le(e,t),a=this._scratch[0],o=this._state,u=this._velocity,c=this.dimension,f=this.bounds;if(0>i)for(var h=c-1,p=0;c>p;++p,--h)a[p]=o[h];else if(i>=r-1)for(var h=o.length-1,d=t-e[r-1],p=0;c>p;++p,--h)a[p]=o[h]+d*u[h];else{for(var h=c*(i+1)-1,g=e[i],m=e[i+1],v=m-g||1,y=this._scratch[1],b=this._scratch[2],x=this._scratch[3],_=this._scratch[4],w=!0,p=0;c>p;++p,--h)y[p]=o[h],x[p]=u[h]*v,b[p]=o[h+c],_[p]=u[h+c]*v,w=w&&y[p]===b[p]&&x[p]===_[p]&&0===x[p];if(w)for(var p=0;c>p;++p)a[p]=y[p];else s(y,x,b,_,(t-g)/v,a)}for(var A=f[0],k=f[1],p=0;c>p;++p)a[p]=n(A[p],k[p],a[p]);return a},u.dcurve=function(t){var e=this._time,r=e.length,n=l.le(e,t),i=this._scratch[0],a=this._state,o=this._velocity,u=this.dimension;if(n>=r-1)for(var c=a.length-1,f=(t-e[r-1],0);u>f;++f,--c)i[f]=o[c];else{for(var c=u*(n+1)-1,h=e[n],p=e[n+1],d=p-h||1,g=this._scratch[1],m=this._scratch[2],v=this._scratch[3],y=this._scratch[4],b=!0,f=0;u>f;++f,--c)g[f]=a[c],v[f]=o[c]*d,m[f]=a[c+u],y[f]=o[c+u]*d,b=b&&g[f]===m[f]&&v[f]===y[f]&&0===v[f];if(b)for(var f=0;u>f;++f)i[f]=0;else{s.derivative(g,v,m,y,(t-h)/d,i);for(var f=0;u>f;++f)i[f]/=d}}return i},u.lastT=function(){var t=this._time;return t[t.length-1]},u.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},u.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(e>t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1];this._time.push(e,t);for(var c=0;2>c;++c)for(var f=0;r>f;++f)i.push(i[o++]),a.push(0);this._time.push(t);for(var f=r;f>0;--f)i.push(n(l[f-1],u[f-1],arguments[f])),a.push(0)}},u.push=function(t){var e=this.lastT(),r=this.dimension;if(!(e>t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=t-e,l=this.bounds,u=l[0],c=l[1],f=s>1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var p=n(u[h-1],c[h-1],arguments[h]);i.push(p),a.push((p-i[o++])*f)}}},u.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},u.move=function(t){var e=this.lastT(),r=this.dimension;if(!(e>=t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,f=c>1e-6?1/c:0;this._time.push(t);for(var h=r;h>0;--h){var p=arguments[h];i.push(n(l[h-1],u[h-1],i[o++]+p)),a.push(p*f)}}},u.idle=function(t){var e=this.lastT();if(!(e>t)){var r=this.dimension,i=this._state,a=this._velocity,o=i.length-r,s=this.bounds,l=s[0],u=s[1],c=t-e;this._time.push(t);for(var f=r-1;f>=0;--f)i.push(n(l[f],u[f],i[o]+c*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":18,"cubic-hermite":19}],18:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],19:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}function i(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var p=t.length-1;p>=0;--p)a[p]=u*t[p]+c*e[p]+f*r[p]+h*n[p];return a}return u*t+c*e+f*r+h*n}e.exports=i,e.exports.derivative=n},{}],20:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=l([r]),this.center=l(e),this.rotation=l(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),r=[].slice.call(r,0,4),a(r,r);var i=new o(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),f=t("gl-mat4/invert"),h=t("./lib/quatFromFrame"),p=o.prototype;p.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},p.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;c(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;3>l;++l){for(var u=0,f=0;3>f;++f)u+=r[l+4*f]*i[f];r[12+l]=-u}},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;16>n;++n)e[n]=r[n];return e}return r},p.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},p.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},p.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],f=a[4],h=a[8],p=c*o+f*s+h*l;c-=o*p,f-=s*p,h-=l*p;var d=n(c,f,h);c/=d,f/=d,h/=d;var g=a[2],m=a[6],v=a[10],y=g*o+m*s+v*l,b=g*c+m*f+v*h;g-=y*o+b*c,m-=y*s+b*f,v-=y*l+b*h;var x=n(g,m,v);g/=x,m/=x,v/=x;var _=c*e+o*r,w=f*e+s*r,A=h*e+l*r;this.center.move(t,_,w,A);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+i),this.radius.set(t,Math.log(k))},p.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],u=o[8],c=o[1],f=o[5],h=o[9],p=o[2],d=o[6],g=o[10],m=e*s+r*c,v=e*l+r*f,y=e*u+r*h,b=-(d*y-g*v),x=-(g*m-p*y),_=-(p*v-d*m),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),A=i(b,x,_,w);A>1e-6?(b/=A,x/=A,_/=A,w/=A):(b=x=_=0,w=1);var k=this.computedRotation,M=k[0],E=k[1],T=k[2],L=k[3],S=M*w+L*b+E*_-T*x,C=E*w+L*x+T*b-M*_,P=T*w+L*_+M*x-E*b,z=L*w-M*b-E*x-T*_;if(a){b=p,x=d,_=g;var R=Math.sin(a)/n(b,x,_);b*=R,x*=R,_*=R,w=Math.cos(e),S=S*w+z*b+C*_-P*x,C=C*w+z*x+P*b-S*_,P=P*w+z*_+S*x-C*b,z=z*w-S*b-C*x-P*_}var j=i(S,C,P,z);j>1e-6?(S/=j,C/=j,P/=j,z/=j):(S=C=P=0,z=1),this.rotation.set(t,S,C,P,z)},p.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;u(i,e,r,n);var o=this.computedRotation;h(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,l=0;3>l;++l)s+=Math.pow(r[l]-e[l],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e){var r=this.computedRotation;h(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;f(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var u=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*u,s-n[6]*u,l-n[10]*u),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-(1/0),e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},p.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":16,"filtered-vector":17,"gl-mat4/fromQuat":211,"gl-mat4/invert":214,"gl-mat4/lookAt":215}],21:[function(t,e,r){arguments[4][17][0].apply(r,arguments)},{"binary-search-bounds":22,"cubic-hermite":23,dup:17}],22:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],23:[function(t,e,r){arguments[4][19][0].apply(r,arguments)},{dup:19}],24:[function(t,e,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],25:[function(t,e,r){arguments[4][6][0].apply(r,arguments)},{dup:6}],26:[function(t,e,r){arguments[4][9][0].apply(r,arguments)},{dup:9}],27:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t){return Math.min(1,Math.max(-1,t))}function a(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;3>s;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(var s=0;3>s;++s)i[s]-=o/a*t[s];return h(i,i),i}function o(t,e,r,n,i,a,o,s){this.center=l(r),this.up=l(n),this.right=l(i),this.radius=l([a]),this.angle=l([o,s]),this.angle.bounds=[[-(1/0),-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;16>u;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,u=t.phi||0; -if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),h(r,r),i=[].slice.call(i,0,3),h(i,i),"eye"in t){var c=t.eye,d=[c[0]-e[0],c[1]-e[1],c[2]-e[2]];f(i,d,r),n(i[0],i[1],i[2])<1e-6?i=a(r):h(i,i),s=n(d[0],d[1],d[2]);var g=p(r,d)/s,m=p(i,d)/s;u=Math.acos(g),l=Math.acos(m)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,u)}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),f=t("gl-vec3/cross"),h=t("gl-vec3/normalize"),p=t("gl-vec3/dot"),d=o.prototype;d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-(1/0),e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,i=0,a=0,o=0;3>o;++o)a+=e[o]*r[o],i+=e[o]*e[o];for(var s=Math.sqrt(i),l=0,o=0;3>o;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;for(var u=Math.sqrt(l),o=0;3>o;++o)r[o]/=u;var c=this.computedToward;f(c,e,r),h(c,c);for(var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],g=this.computedAngle[1],m=Math.cos(d),v=Math.sin(d),y=Math.cos(g),b=Math.sin(g),x=this.computedCenter,_=m*y,w=v*y,A=b,k=-m*b,M=-v*b,E=y,T=this.computedEye,L=this.computedMatrix,o=0;3>o;++o){var S=_*r[o]+w*c[o]+A*e[o];L[4*o+1]=k*r[o]+M*c[o]+E*e[o],L[4*o+2]=S,L[4*o+3]=0}var C=L[1],P=L[5],z=L[9],R=L[2],j=L[6],I=L[10],O=P*I-z*j,N=z*R-C*I,F=C*j-P*R,D=n(O,N,F);O/=D,N/=D,F/=D,L[0]=O,L[4]=N,L[8]=F;for(var o=0;3>o;++o)T[o]=x[o]+L[2+4*o]*p;for(var o=0;3>o;++o){for(var l=0,B=0;3>B;++B)l+=L[o+4*B]*T[B];L[12+o]=-l}L[15]=1},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;16>n;++n)e[n]=r[n];return e}return r};var g=[0,0,0];d.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;g[0]=i[2],g[1]=i[6],g[2]=i[10];for(var a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;3>l;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,g);for(var l=0;3>l;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],f=a[4],h=a[8],p=c*o+f*s+h*l;c-=o*p,f-=s*p,h-=l*p;var d=n(c,f,h);c/=d,f/=d,h/=d;var g=c*e+o*r,m=f*e+s*r,v=h*e+l*r;this.center.move(t,g,m,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),this.radius.set(t,Math.log(y))},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e,r,a){var o=1;"number"==typeof r&&(o=0|r),(0>o||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var l=e[o],c=e[o+4],f=e[o+8];if(a){var h=Math.abs(l),p=Math.abs(c),d=Math.abs(f),g=Math.max(h,p,d);h===g?(l=0>l?-1:1,c=f=0):d===g?(f=0>f?-1:1,l=c=0):(c=0>c?-1:1,l=f=0)}else{var m=n(l,c,f);l/=m,c/=m,f/=m}var v=e[s],y=e[s+4],b=e[s+8],x=v*l+y*c+b*f;v-=l*x,y-=c*x,b-=f*x;var _=n(v,y,b);v/=_,y/=_,b/=_;var w=c*b-f*y,A=f*v-l*b,k=l*y-c*v,M=n(w,A,k);w/=M,A/=M,k/=M,this.center.jump(t,G,H,Y),this.radius.idle(t),this.up.jump(t,l,c,f),this.right.jump(t,v,y,b);var E,T;if(2===o){var L=e[1],S=e[5],C=e[9],P=L*v+S*y+C*b,z=L*w+S*A+C*k;E=0>O?-Math.PI/2:Math.PI/2,T=Math.atan2(z,P)}else{var R=e[2],j=e[6],I=e[10],O=R*l+j*c+I*f,N=R*v+j*y+I*b,F=R*w+j*A+I*k;E=Math.asin(i(O)),T=Math.atan2(F,N)}this.angle.jump(t,T,E),this.recalcMatrix(t);var D=e[2],B=e[6],U=e[10],V=this.computedMatrix;u(V,e);var q=V[15],G=V[12]/q,H=V[13]/q,Y=V[14]/q,X=Math.exp(this.computedRadius[0]);this.center.jump(t,G-D*X,H-B*X,Y-U*X)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},d.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.lookAt=function(t,e,r,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter,a=a||this.computedUp;var o=a[0],s=a[1],l=a[2],u=n(o,s,l);if(!(1e-6>u)){o/=u,s/=u,l/=u;var c=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],p=n(c,f,h);if(!(1e-6>p)){c/=p,f/=p,h/=p;var d=this.computedRight,g=d[0],m=d[1],v=d[2],y=o*g+s*m+l*v;g-=y*o,m-=y*s,v-=y*l;var b=n(g,m,v);if(!(.01>b&&(g=s*h-l*f,m=l*c-o*h,v=o*f-s*c,b=n(g,m,v),1e-6>b))){g/=b,m/=b,v/=b,this.up.set(t,o,s,l),this.right.set(t,g,m,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var x=s*v-l*m,_=l*g-o*v,w=o*m-s*g,A=n(x,_,w);x/=A,_/=A,w/=A;var k=o*c+s*f+l*h,M=g*c+m*f+v*h,E=x*c+_*f+w*h,T=Math.asin(i(k)),L=Math.atan2(E,M),S=this.angle._state,C=S[S.length-1],P=S[S.length-2];C%=2*Math.PI;var z=Math.abs(C+2*Math.PI-L),R=Math.abs(C-L),j=Math.abs(C-2*Math.PI-L);R>z&&(C+=2*Math.PI),R>j&&(C-=2*Math.PI),this.angle.jump(this.angle.lastT(),C,P),this.angle.set(t,L,T)}}}}},{"filtered-vector":21,"gl-mat4/invert":214,"gl-mat4/rotate":218,"gl-vec3/cross":24,"gl-vec3/dot":25,"gl-vec3/normalize":26}],28:[function(t,e,r){"use strict";function n(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}function i(t){t=t||{};var e=t.eye||[0,0,1],r=t.center||[0,0,0],i=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=a(),f=o(),h=s();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,i),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,i),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,i),new n({turntable:c,orbit:f,matrix:h},u)}e.exports=i;var a=t("turntable-camera-controller"),o=t("orbit-camera-controller"),s=t("matrix-camera-controller"),l=n.prototype,u=[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]];u.forEach(function(t){for(var e=t[0],r=[],n=0;ne)){var r=this._active,n=this._controllerList[e],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,this._mode=t,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},l.getMode=function(){return this._mode}},{"matrix-camera-controller":3,"orbit-camera-controller":20,"turntable-camera-controller":27}],29:[function(t,e,r){function n(t,e){return a(i(t,e))}e.exports=n;var i=t("alpha-complex"),a=t("simplicial-complex-boundary")},{"alpha-complex":30,"simplicial-complex-boundary":41}],30:[function(t,e,r){"use strict";function n(t,e){return i(e).filter(function(r){for(var n=new Array(r.length),i=0;ii;++i)r+=t[i]*e[i];return r}function i(t){var e=t.length;if(0===e)return[];var r=(t[0].length,o([t.length+1,t.length+1],1)),i=o([t.length+1],1);r[e][e]=0;for(var a=0;e>a;++a){for(var l=0;a>=l;++l)r[l][a]=r[a][l]=2*n(t[a],t[l]);i[a]=n(t[a],t[a])}for(var u=s(r,i),c=0,f=u[e+1],a=0;aa;++a){for(var f=u[a],p=0,l=0;ls;++s)r[s]+=t[a][s]*n[a];return r}var o=t("dup"),s=t("robust-linear-solve");a.barycenetric=i,e.exports=a},{dup:33,"robust-linear-solve":34}],33:[function(t,e,r){"use strict";function n(t,e,r){var i=0|t[r];if(0>=i)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;i>a;++a)o[a]=e;else for(a=0;i>a;++a)o[a]=n(t,e,r+1);return o}function i(t,e){var r,n;for(r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function a(t,e){switch("undefined"==typeof e&&(e=0),typeof t){case"number":if(t>0)return i(0|t,e);break;case"object":if("number"==typeof t.length)return n(t,e,0)}return[]}e.exports=a},{}],34:[function(t,e,r){"use strict";function n(t){for(var e="robustLinearSolve"+t+"d",r=["function ",e,"(A,b){return ["],n=0;t>n;++n){r.push("det([");for(var i=0;t>i;++i){i>0&&r.push(","),r.push("[");for(var a=0;t>a;++a)a>0&&r.push(","),a===n?r.push("+b[",i,"]"):r.push("+A[",i,"][",a,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var o=new Function("det",r.join(""));return o(6>t?s[t]:s)}function i(){return[0]}function a(t,e){return[[e[0]],[t[0][0]]]}function o(){for(;u.lengthi;++i)t.push("s"+i),r.push("case ",i,":return s",i,"(A,b);");r.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),t.push("CACHE","g",r.join(""));var a=Function.apply(void 0,t);e.exports=a.apply(void 0,u.concat([u,n]));for(var i=0;l>i;++i)e.exports[i]=u[i]}var s=t("robust-determinant"),l=6,u=[i,a];o()},{"robust-determinant":40}],35:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i];r=a+o;var s=r-a,l=o-s;l&&(t[--n]=r,r=l)}for(var u=0,i=n;e>i;++i){var a=t[i],o=r;r=a+o;var s=r-a,l=o-s;l&&(t[u++]=l)}return t[u++]=r,t.length=u,t}e.exports=n},{}],36:[function(t,e,r){"use strict";function n(t,e,r){var n=t+e,i=n-t,a=n-i,o=e-i,s=t-a;return r?(r[0]=s+o,r[1]=n,r):[s+o,n]}e.exports=n},{}],37:[function(t,e,r){"use strict";function n(t,e){var r=t.length;if(1===r){var n=i(t[0],e);return n[0]?n:[n[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],u=0;i(t[0],e,s),s[0]&&(o[u++]=s[0]);for(var c=1;r>c;++c){i(t[c],e,l);var f=s[1];a(f,l[0],s),s[0]&&(o[u++]=s[0]);var h=l[1],p=s[1],d=h+p,g=d-h,m=p-g;s[1]=d,m&&(o[u++]=m)}return s[1]&&(o[u++]=s[1]),0===u&&(o[u++]=0),o.length=u,o}var i=t("two-product"),a=t("two-sum");e.exports=n},{"two-product":39,"two-sum":36}],38:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],e[0]);var a,o,s=r+i,l=new Array(s),u=0,c=0,f=0,h=Math.abs,p=t[c],d=h(p),g=e[f],m=h(g);m>d?(o=p,c+=1,r>c&&(p=t[c],d=h(p))):(o=g,f+=1,i>f&&(g=e[f],m=h(g))),r>c&&m>d||f>=i?(a=p,c+=1,r>c&&(p=t[c],d=h(p))):(a=g,f+=1,i>f&&(g=e[f],m=h(g)));for(var v,y,b,x,_,w=a+o,A=w-a,k=o-A,M=k,E=w;r>c&&i>f;)m>d?(a=p,c+=1,r>c&&(p=t[c],d=h(p))):(a=g,f+=1,i>f&&(g=e[f],m=h(g))),o=M,w=a+o,A=w-a,k=o-A,k&&(l[u++]=k),v=E+w,y=v-E,b=v-y,x=w-y,_=E-b,M=_+x,E=v;for(;r>c;)a=p,o=M,w=a+o,A=w-a,k=o-A,k&&(l[u++]=k),v=E+w,y=v-E,b=v-y,x=w-y,_=E-b,M=_+x,E=v,c+=1,r>c&&(p=t[c]);for(;i>f;)a=g,o=M,w=a+o,A=w-a,k=o-A,k&&(l[u++]=k),v=E+w,y=v-E,b=v-y,x=w-y,_=E-b,M=_+x,E=v,f+=1,i>f&&(g=e[f]);return M&&(l[u++]=M),E&&(l[u++]=E),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],39:[function(t,e,r){"use strict";function n(t,e,r){var n=t*e,a=i*t,o=a-t,s=a-o,l=t-s,u=i*e,c=u-e,f=u-c,h=e-f,p=n-s*f,d=p-l*f,g=d-s*h,m=l*h-g;return r?(r[0]=m,r[1]=n,r):[m,n]}e.exports=n;var i=+(Math.pow(2,27)+1)},{}],40:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;nr;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=["m[",r,"][",n,"]"].join("")}return e}function a(t){return 1&t?"-":""}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;rn;++n)t.push("det"+n),r.push("case ",n,":return det",n,"(m);");r.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),t.push("CACHE","gen",r.join(""));var i=Function.apply(void 0,t);e.exports=i.apply(void 0,g.concat([g,l]));for(var n=0;nn;++n)r+=t[n].length;for(var i=new Array(r),a=0,n=0;e>n;++n)for(var o=t[n],s=o.length,l=0;s>l;++l)for(var u=i[a++]=new Array(s-1),c=1;s>c;++c)u[c-1]=o[(l+c)%s];return i}e.exports=n},{}],43:[function(t,e,r){"use strict";function n(t){for(var e=1,r=1;rn;++n)if(t[r]x;++x)if(i=y[x]-b[x])return i;return 0}}e.exports=i;var a=Math.min},{}],45:[function(t,e,r){"use strict";function n(t,e){return i(t,e)||a(t)-a(e)}var i=t("compare-cell"),a=t("cell-orientation");e.exports=n},{"cell-orientation":43,"compare-cell":44}],46:[function(t,e,r){"use strict";function n(t){t.sort(a);for(var e=t.length,r=0,n=0;e>n;++n){var s=t[n],l=o(s);if(0!==l){if(r>0){var u=t[r-1];if(0===i(s,u)&&o(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}var i=t("compare-cell"),a=t("compare-oriented-cell"),o=t("cell-orientation");e.exports=n},{"cell-orientation":43,"compare-cell":44,"compare-oriented-cell":45}],47:[function(t,e,r){"use strict";var n=function(){function t(t){return!Array.isArray(t)&&null!==t&&"object"==typeof t}function e(t,e,r){for(var n=(e-t)/(r-1),i=[],a=0;r>a;a++)i.push(t+a*n);return i}function r(){for(var t=[].slice.call(arguments),e=t.map(function(t){return t.length}),r=Math.min.apply(null,e),n=[],i=0;r>i;i++){n[i]=[];for(var a=0;aa;a++)i.push([t[a],e[a],r[a]]);return i}function i(t){function e(t){for(var n=0;n>16&255,r[1]=n>>8&255,r[2]=255&n):f.test(t)&&(n=t.match(h),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3])),!e)for(var i=0;3>i;++i)r[i]=r[i]/255;return r}function u(t,e){var r,n;if("string"!=typeof t)return t;if(r=[],"#"===t[0]?(t=t.substr(1),3===t.length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):f.test(t)&&(n=t.match(h),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3]),n[4]?r[3]=parseFloat(n[4]):r[3]=1),!e)for(var i=0;3>i;++i)r[i]=r[i]/255;return r}var c={},f=/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(,.*)?\)$/,h=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,?\s*(.*)?\)$/;return c.isPlainObject=t,c.linspace=e,c.zip3=n,c.sum=i,c.zip=r,c.isEqual=s,c.copy2D=a,c.copy1D=o,c.str2RgbArray=l,c.str2RgbaArray=u,c};e.exports=n()},{}],48:[function(t,e,r){(function(e){"use strict";function n(){function t(){}try{var e=new Uint8Array(1);return e.foo=function(){return 42},e.constructor=t,42===e.foo()&&e.constructor===t&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(r){return!1}}function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t){return this instanceof a?(a.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof t?o(this,t):"string"==typeof t?s(this,t,arguments.length>1?arguments[1]:"utf8"):l(this,t)):arguments.length>1?new a(t,arguments[1]):new a(t)}function o(t,e){if(t=g(t,0>e?0:0|m(e)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;e>r;r++)t[r]=0;return t}function s(t,e,r){("string"!=typeof r||""===r)&&(r="utf8");var n=0|y(e,r);return t=g(t,n),t.write(e,r),t}function l(t,e){if(a.isBuffer(e))return u(t,e);if(Q(e))return c(t,e);if(null==e)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(e.buffer instanceof ArrayBuffer)return f(t,e);if(e instanceof ArrayBuffer)return h(t,e)}return e.length?p(t,e):d(t,e)}function u(t,e){var r=0|m(e.length);return t=g(t,r),e.copy(t,0,0,r),t}function c(t,e){var r=0|m(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function f(t,e){var r=0|m(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function h(t,e){return a.TYPED_ARRAY_SUPPORT?(e.byteLength,t=a._augment(new Uint8Array(e))):t=f(t,new Uint8Array(e)),t}function p(t,e){var r=0|m(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function d(t,e){var r,n=0;"Buffer"===e.type&&Q(e.data)&&(r=e.data,n=0|m(r.length)),t=g(t,n);for(var i=0;n>i;i+=1)t[i]=255&r[i];return t}function g(t,e){a.TYPED_ARRAY_SUPPORT?(t=a._augment(new Uint8Array(e)),t.__proto__=a.prototype):(t.length=e,t._isBuffer=!0);var r=0!==e&&e<=a.poolSize>>>1;return r&&(t.parent=K),t}function m(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function v(t,e){if(!(this instanceof v))return new v(t,e);var r=new a(t,e);return delete r.parent,r}function y(t,e){"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return q(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,r){var n=!1;if(e=0|e,r=void 0===r||r===1/0?this.length:0|r,t||(t="utf8"),0>e&&(e=0),r>this.length&&(r=this.length),e>=r)return"";for(;;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return S(this,e,r);case"binary":return C(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function x(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new Error("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;n>o;o++){var s=parseInt(e.substr(2*o,2),16);if(isNaN(s))throw new Error("Invalid hex string");t[r+o]=s}return o}function _(t,e,r,n){return X(q(e,t.length-r),t,r,n)}function w(t,e,r,n){return X(G(e),t,r,n)}function A(t,e,r,n){return w(t,e,r,n)}function k(t,e,r,n){return X(Y(e),t,r,n)}function M(t,e,r,n){return X(H(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?W.fromByteArray(t):W.fromByteArray(t.slice(e,r))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;r>i;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(r>=i+s){var l,u,c,f;switch(s){case 1:128>a&&(o=a);break;case 2:l=t[i+1],128===(192&l)&&(f=(31&a)<<6|63&l,f>127&&(o=f));break;case 3:l=t[i+1],u=t[i+2],128===(192&l)&&128===(192&u)&&(f=(15&a)<<12|(63&l)<<6|63&u,f>2047&&(55296>f||f>57343)&&(o=f));break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128===(192&l)&&128===(192&u)&&128===(192&c)&&(f=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c,f>65535&&1114112>f&&(o=f))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return L(n)}function L(t){var e=t.length;if($>=e)return String.fromCharCode.apply(String,t);for(var r="",n=0;e>n;)r+=String.fromCharCode.apply(String,t.slice(n,n+=$));return r}function S(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(127&t[i]);return n}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(t[i]);return n}function P(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var i="",a=e;r>a;a++)i+=V(t[a]);return i}function z(t,e,r){for(var n=t.slice(e,r),i="",a=0;at)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>i||o>e)throw new RangeError("value is out of bounds");if(r+n>t.length)throw new RangeError("index out of range")}function I(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-r,2);a>i;i++)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function O(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-r,4);a>i;i++)t[r+i]=e>>>8*(n?i:3-i)&255}function N(t,e,r,n,i,a){if(e>i||a>e)throw new RangeError("value is out of bounds");if(r+n>t.length)throw new RangeError("index out of range");if(0>r)throw new RangeError("index out of range")}function F(t,e,r,n,i){return i||N(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return i||N(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,r,n,52,8),r+8}function B(t){if(t=U(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function U(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function V(t){return 16>t?"0"+t.toString(16):t.toString(16)}function q(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;n>o;o++){if(r=t.charCodeAt(o),r>55295&&57344>r){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(56320>r){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,128>r){if((e-=1)<0)break;a.push(r)}else if(2048>r){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(65536>r){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function G(t){for(var e=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function Y(t){return W.toByteArray(B(t))}function X(t,e,r,n){for(var i=0;n>i&&!(i+r>=e.length||i>=t.length);i++)e[i+r]=t[i];return i}var W=t("base64-js"),Z=t("ieee754"),Q=t("isarray");r.Buffer=a,r.SlowBuffer=v,r.INSPECT_MAX_BYTES=50,a.poolSize=8192;var K={};a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:n(),a.TYPED_ARRAY_SUPPORT?(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array):(a.prototype.length=void 0,a.prototype.parent=void 0),a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);o>i&&t[i]===e[i];)++i;return i!==o&&(r=t[i],n=e[i]),n>r?-1:r>n?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!Q(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new a(0);var r;if(void 0===e)for(e=0,r=0;r0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},a.prototype.compare=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:a.compare(this,t)},a.prototype.indexOf=function(t,e){function r(t,e,r){for(var n=-1,i=0;r+i2147483647?e=2147483647:-2147483648>e&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(0>e&&(e=Math.max(this.length+e,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,e);if(a.isBuffer(t))return r(this,t,e);if("number"==typeof t)return a.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):r(this,[t],e);throw new TypeError("val must be string, number or Buffer")},a.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},a.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0);else{var i=n;n=e,e=0|r,r=i}var a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(0>r||0>e)||e>this.length)throw new RangeError("attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"binary":return A(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),t>e&&(e=t);var n;if(a.TYPED_ARRAY_SUPPORT)n=a._augment(this.subarray(t,e));else{var i=e-t;n=new a(i,void 0);for(var o=0;i>o;o++)n[o]=this[o+t]}return n.length&&(n.parent=this.parent||this),n},a.prototype.readUIntLE=function(t,e,r){t=0|t,e=0|e,r||R(t,e,this.length);for(var n=this[t],i=1,a=0;++a0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||R(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||R(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},a.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),Z.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),Z.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),Z.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),Z.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||j(this,t,e,r,Math.pow(2,8*r),0);var i=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+i]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e=0|e,r||j(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=0|e,r||j(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=0|e,r||j(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=0|e,r||j(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):O(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=0|e,r||j(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1); -j(this,t,e,r,i-1,-i)}var a=0,o=1,s=0>t?1:0;for(this[e]=255&t;++a>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0>t?1:0;for(this[e+a]=255&t;--a>=0&&(o*=256);)this[e+a]=(t/o>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e=0|e,r||j(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e=0|e,r||j(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e=0|e,r||j(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e=0|e,r||j(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):O(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e=0|e,r||j(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&r>n&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-er&&n>e)for(i=o-1;i>=0;i--)t[i+e]=this[i+r];else if(1e3>o||!a.TYPED_ARRAY_SUPPORT)for(i=0;o>i;i++)t[i+e]=this[i+r];else t._set(this.subarray(r,r+o),e);return o},a.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),e>r)throw new RangeError("end < start");if(r!==e&&0!==this.length){if(0>e||e>=this.length)throw new RangeError("start out of bounds");if(0>r||r>this.length)throw new RangeError("end out of bounds");var n;if("number"==typeof t)for(n=e;r>n;n++)this[n]=t;else{var i=q(t.toString()),a=i.length;for(n=e;r>n;n++)this[n]=i[n%a]}return this}},a.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(a.TYPED_ARRAY_SUPPORT)return new a(this).buffer;for(var t=new Uint8Array(this.length),e=0,r=t.length;r>e;e+=1)t[e]=this[e];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var J=a.prototype;a._augment=function(t){return t.constructor=a,t._isBuffer=!0,t._set=t.set,t.get=J.get,t.set=J.set,t.write=J.write,t.toString=J.toString,t.toLocaleString=J.toString,t.toJSON=J.toJSON,t.equals=J.equals,t.compare=J.compare,t.indexOf=J.indexOf,t.copy=J.copy,t.slice=J.slice,t.readUIntLE=J.readUIntLE,t.readUIntBE=J.readUIntBE,t.readUInt8=J.readUInt8,t.readUInt16LE=J.readUInt16LE,t.readUInt16BE=J.readUInt16BE,t.readUInt32LE=J.readUInt32LE,t.readUInt32BE=J.readUInt32BE,t.readIntLE=J.readIntLE,t.readIntBE=J.readIntBE,t.readInt8=J.readInt8,t.readInt16LE=J.readInt16LE,t.readInt16BE=J.readInt16BE,t.readInt32LE=J.readInt32LE,t.readInt32BE=J.readInt32BE,t.readFloatLE=J.readFloatLE,t.readFloatBE=J.readFloatBE,t.readDoubleLE=J.readDoubleLE,t.readDoubleBE=J.readDoubleBE,t.writeUInt8=J.writeUInt8,t.writeUIntLE=J.writeUIntLE,t.writeUIntBE=J.writeUIntBE,t.writeUInt16LE=J.writeUInt16LE,t.writeUInt16BE=J.writeUInt16BE,t.writeUInt32LE=J.writeUInt32LE,t.writeUInt32BE=J.writeUInt32BE,t.writeIntLE=J.writeIntLE,t.writeIntBE=J.writeIntBE,t.writeInt8=J.writeInt8,t.writeInt16LE=J.writeInt16LE,t.writeInt16BE=J.writeInt16BE,t.writeInt32LE=J.writeInt32LE,t.writeInt32BE=J.writeInt32BE,t.writeFloatLE=J.writeFloatLE,t.writeFloatBE=J.writeFloatBE,t.writeDoubleLE=J.writeDoubleLE,t.writeDoubleBE=J.writeDoubleBE,t.fill=J.fill,t.inspect=J.inspect,t.toArrayBuffer=J.toArrayBuffer,t};var tt=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":49,ieee754:50,isarray:51}],49:[function(t,e,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===o||e===f?62:e===s||e===h?63:l>e?-1:l+10>e?e-l+26+26:c+26>e?e-c:u+26>e?e-u+26:void 0}function r(t){function r(t){u[f++]=t}var n,i,o,s,l,u;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=t.length;l="="===t.charAt(c-2)?2:"="===t.charAt(c-1)?1:0,u=new a(3*t.length/4-l),o=l>0?t.length-4:t.length;var f=0;for(n=0,i=0;o>n;n+=4,i+=3)s=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&s)>>16),r((65280&s)>>8),r(255&s);return 2===l?(s=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&s)):1===l&&(s=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(s>>8&255),r(255&s)),u}function i(t){function e(t){return n.charAt(t)}function r(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,a,o,s=t.length%3,l="";for(i=0,o=t.length-s;o>i;i+=3)a=(t[i]<<16)+(t[i+1]<<8)+t[i+2],l+=r(a);switch(s){case 1:a=t[t.length-1],l+=e(a>>2),l+=e(a<<4&63),l+="==";break;case 2:a=(t[t.length-2]<<8)+t[t.length-1],l+=e(a>>10),l+=e(a>>4&63),l+=e(a<<2&63),l+="="}return l}var a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="+".charCodeAt(0),s="/".charCodeAt(0),l="0".charCodeAt(0),u="a".charCodeAt(0),c="A".charCodeAt(0),f="-".charCodeAt(0),h="_".charCodeAt(0);t.toByteArray=r,t.fromByteArray=i}("undefined"==typeof r?this.base64js={}:r)},{}],50:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,c=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:(p?-1:1)*(1/0);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),e+=o+f>=1?h/l:h*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,u-=8);t[r+p-d]|=128*g}},{}],51:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],52:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function a(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!a(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,a,l,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[t],s(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),r.apply(this,a)}else if(o(r))for(a=Array.prototype.slice.call(arguments,1),u=r.slice(),n=u.length,l=0;n>l;l++)u[l].apply(this,a);return!0},n.prototype.addListener=function(t,e){var r;if(!i(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(r=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,a,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],a=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(0>n)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],53:[function(t,e,r){function n(){c=!1,s.length?u=s.concat(u):f=-1,u.length&&i()}function i(){if(!c){var t=setTimeout(n);c=!0;for(var e=u.length;e;){for(s=u,u=[];++f1)for(var r=1;rt[r][0]&&(r=n);return r>e?[[e],[r]]:e>r?[[r],[e]]:[[e]]}e.exports=n},{}],56:[function(t,e,r){"use strict";function n(t){var e=i(t),r=e.length;if(2>=r)return[];for(var n=new Array(r),a=e[r-1],o=0;r>o;++o){var s=e[o];n[o]=[a,s],a=s}return n}e.exports=n;var i=t("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":63}],57:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),i=0;ii;++i)e.indexOf(i)<0&&(n[a++]=t[i]);return n}function i(t,e){for(var r=t.length,n=e.length,i=0;r>i;++i)for(var a=t[i],o=0;os)a[o]=e[s];else{s-=n;for(var l=0;n>l;++l)s>=e[l]&&(s+=1);a[o]=s}}return t}function a(t,e){try{return o(t,!0)}catch(r){var a=s(t);if(a.length<=e)return[];var l=n(t,a),u=o(l,!0);return i(u,a)}}e.exports=a;var o=t("incremental-convex-hull"),s=t("affine-hull")},{"affine-hull":58,"incremental-convex-hull":59}],58:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(e+1),n=0;n=i;++i){for(var o=new Array(e),s=0;e>s;++s)o[s]=Math.pow(i+1-n,s);r[i]=o}var l=a.apply(void 0,r);if(l)return!0}return!1}function i(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,i=[t[0]],a=[0],o=1;e>o;++o)if(i.push(t[o]),n(i,r)){if(a.push(o),a.length===r+1)return a}else i.pop();return a}e.exports=i;var a=t("robust-orientation")},{"robust-orientation":996}],59:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return c(t.vertices,e.vertices)}function o(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;t>=r;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=u[t+1];return i||(i=u),n(i)}function s(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;t>=n;++n)this.tuple[n]=this.vertices[n];var i=f[t];i||(i=f[t]=o(t)),this.orient=i}function l(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(i>=r)throw new Error("Must input at least d+1 points");var a=t.slice(0,i+1),o=u.apply(void 0,a);if(0===o)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;i>=c;++c)l[c]=c;0>o&&(l[0]=1,l[1]=0);for(var f=new n(l,new Array(i+1),!1),h=f.adjacent,p=new Array(i+2),c=0;i>=c;++c){for(var d=l.slice(),g=0;i>=g;++g)g===c&&(d[g]=-1);var m=d[0];d[0]=d[1],d[1]=m;var v=new n(d,new Array(i+1),!0);h[c]=v,p[c]=v}p[i+1]=f;for(var c=0;i>=c;++c)for(var d=h[c].vertices,y=h[c].adjacent,g=0;i>=g;++g){var b=d[g];if(0>b)y[g]=f;else for(var x=0;i>=x;++x)h[x].vertices.indexOf(b)<0&&(y[g]=h[x])}for(var _=new s(i,a,p),w=!!e,c=i+1;r>c;++c)_.insert(t[c],w);return _.boundary()}e.exports=l;var u=t("robust-orientation"),c=t("simplicial-complex").compareCells;n.prototype.flip=function(){var t=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=t;var e=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=e};var f=[],h=s.prototype;h.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){t=o.pop();for(var s=(t.vertices,t.adjacent),l=0;r>=l;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,f=0;r>=f;++f){var h=c[f];0>h?i[f]=e:i[f]=a[h]}var p=this.orient();if(p>0)return u;u.lastVisited=-n,0===p&&o.push(u)}}}return null},h.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;n>=c;++c)a[c]=i[l[c]];s.lastVisited=r;for(var c=0;n>=c;++c){var f=u[c];if(!(f.lastVisited>=r)){var h=a[c];a[c]=t;var p=this.orient();if(a[c]=h,0>p){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},h.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var h=[];f.length>0;){var e=f.pop(),p=e.vertices,d=e.adjacent,g=p.indexOf(r);if(!(0>g))for(var m=0;o>=m;++m)if(m!==g){var v=d[m];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var b=0,x=0;o>=x;++x)y[x]<0?(b=x,l[x]=t):l[x]=s[y[x]];var _=this.orient();if(_>0){y[b]=r,v.boundary=!1,u.push(v),f.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var w=v.adjacent,A=p.slice(),k=d.slice(),M=new n(A,k,!0);c.push(M);var E=w.indexOf(e);if(!(0>E)){w[E]=M,k[g]=v,A[m]=-1,k[m]=e,d[m]=M,M.flip();for(var x=0;o>=x;++x){var T=A[x];if(!(0>T||T===r)){for(var L=new Array(o-1),S=0,C=0;o>=C;++C){var P=A[C];0>P||C===x||(L[S++]=P)}h.push(new i(L,M,x))}}}}}}h.sort(a);for(var m=0;m+1j||0>I||(z.cell.adjacent[z.index]=R.cell,R.cell.adjacent[R.index]=z.cell)}},h.insert=function(t,e){var r=this.vertices;r.push(t);var n=this.walk(t,e);if(n){for(var i=this.dimension,a=this.tuple,o=0;i>=o;++o){var s=n.vertices[o];0>s?a[o]=t:a[o]=r[s]}var l=this.orient(a);0>l||(0!==l||(n=this.handleBoundaryDegeneracy(n,t)))&&this.addPeaks(t,n)}},h.boundary=function(){for(var t=this.dimension,e=[],r=this.simplices,n=r.length,i=0;n>i;++i){var a=r[i];if(a.boundary){for(var o=new Array(t),s=a.vertices,l=0,u=0,c=0;t>=c;++c)s[c]>=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":996,"simplicial-complex":62}],60:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}var i=32;r.INT_BITS=i,r.INT_MAX=2147483647,r.INT_MIN=-1<0)-(0>t)},r.abs=function(t){var e=t>>i-1;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(e>t)},r.max=function(t,e){return t^(t^e)&-(e>t)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,e|=r,e|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,t=(858993459&t)+(t>>>2&858993459),16843009*(t+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,t&=15,27030>>>t&1};var a=new Array(256);!function(t){for(var e=0;256>e;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|a[t>>>16&255]<<8|a[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),t=65535&(t|t>>>16),t<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),t=1023&(t|t>>>16),t<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],61:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;t>e;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n;var i=n.prototype;Object.defineProperty(i,"length",{get:function(){return this.roots.length}}),i.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},i.find=function(t){for(var e=t,r=this.roots;r[t]!==t;)t=r[t];for(;r[e]!==t;){var n=r[e];r[e]=t,e=n}return t},i.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];s>o?a[r]=n:o>s?a[n]=r:(a[n]=r,++i[r])}}},{}],62:[function(t,e,r){"use strict";"use restrict";function n(t){for(var e=0,r=Math.max,n=0,i=t.length;i>n;++n)e=r(e,t[n].length);return e-1}function i(t){for(var e=-1,r=Math.max,n=0,i=t.length;i>n;++n)for(var a=t[n],o=0,s=a.length;s>o;++o)e=r(e,a[o]);return e+1}function a(t){for(var e=new Array(t.length),r=0,n=t.length;n>r;++r)e[r]=t[r].slice(0);return e}function o(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:var a=t[0]+t[1]-e[0]-e[1];return a?a:i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=i(t[0],t[1]),u=i(e[0],e[1]),a=i(l,t[2])-i(u,e[2]);return a?a:i(l+t[2],o)-i(u+e[2],s);default:var c=t.slice(0);c.sort();var f=e.slice(0);f.sort();for(var h=0;r>h;++h)if(n=c[h]-f[h])return n;return 0}}function s(t,e){return o(t[0],e[0])}function l(t,e){if(e){for(var r=t.length,n=new Array(r),i=0;r>i;++i)n[i]=[t[i],e[i]];n.sort(s);for(var i=0;r>i;++i)t[i]=n[i][0],e[i]=n[i][1];return t}return t.sort(o),t}function u(t){if(0===t.length)return[];for(var e=1,r=t.length,n=1;r>n;++n){var i=t[n];if(o(i,t[n-1])){if(n===e){e++;continue}t[e++]=i}}return t.length=e,t}function c(t,e){for(var r=0,n=t.length-1,i=-1;n>=r;){var a=r+n>>1,s=o(t[a],e);0>=s?(0===s&&(i=a),r=a+1):s>0&&(n=a-1)}return i}function f(t,e){for(var r=new Array(t.length),n=0,i=r.length;i>n;++n)r[n]=[];for(var a=[],n=0,s=e.length;s>n;++n)for(var l=e[n],u=l.length,f=1,h=1<f;++f){a.length=b.popCount(f);for(var p=0,d=0;u>d;++d)f&1<g))for(;;)if(r[g++].push(n),g>=t.length||0!==o(t[g],a))break}return r}function h(t,e){if(!e)return f(u(d(t,0)),t,0);for(var r=new Array(e),n=0;e>n;++n)r[n]=[];for(var n=0,i=t.length;i>n;++n)for(var a=t[n],o=0,s=a.length;s>o;++o)r[a[o]].push(n);return r}function p(t){for(var e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],a=0|i.length,o=1,s=1<o;++o){for(var u=[],c=0;a>c;++c)o>>>c&1&&u.push(i[c]);e.push(u)}return l(e)}function d(t,e){if(0>e)return[];for(var r=[],n=(1<r;++r)for(var i=t[r],a=0,o=i.length;o>a;++a){for(var s=new Array(i.length-1),u=0,c=0;o>u;++u)u!==a&&(s[c++]=i[u]);e.push(s)}return l(e)}function m(t,e){for(var r=new x(e),n=0;ne){for(var r=new Array(e),n=0;e>n;++n)r[n]=n;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:r}for(var a=new Array(e),n=0;e>n;++n)a[n]=n;a.sort(function(e,r){var n=t[e][0]-t[r][0];return n?n:t[e][1]-t[r][1]});for(var o=[a[0],a[1]],s=[a[0],a[1]],n=2;e>n;++n){for(var l=a[n],u=t[l],c=o.length;c>1&&i(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&i(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),f=0,n=0,h=o.length;h>n;++n)r[f++]=o[n];for(var p=s.length-2;p>0;--p)r[f++]=s[p];return r}e.exports=n;var i=t("robust-orientation")[3]},{"robust-orientation":996}],64:[function(e,r,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return e>t?-1:t>e?1:t>=e?0:NaN}function a(t){return null===t?NaN:+t}function o(t){return!isNaN(t)}function s(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);i>n;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);i>n;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}function l(t){return t.length}function u(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function f(){this._=Object.create(null)}function h(t){return(t+="")===vo||t[0]===yo?yo+t:t}function p(t){return(t+="")[0]===yo?t.slice(1):t}function d(t){return h(t)in this._}function g(t){return(t=h(t))in this._&&delete this._[t]}function m(){var t=[];for(var e in this._)t.push(p(e));return t}function v(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function b(){this._=Object.create(null)}function x(t){return t}function _(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=bo.length;n>r;++r){var i=bo[r]+e;if(i in t)return i}}function A(){}function k(){}function M(t){function e(){for(var e,n=r,i=-1,a=n.length;++ir;r++)for(var i,a=t[r],o=0,s=a.length;s>o;o++)(i=a[o])&&e(i,o,r);return t}function Y(t){return _o(t,To),t}function X(t){var e,r;return function(n,i,a){var o,s=t[a].update,l=s.length;for(a!=r&&(r=a,e=0),i>=e&&(e=i+1);!(o=s[e])&&++e0&&(t=t.slice(0,s));var u=Lo.get(t);return u&&(t=u,l=Q),s?e?i:n:e?A:a}function Z(t,e){return function(r){var n=no.event;no.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{no.event=n}}}function Q(t,e){var r=Z(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}function K(t){var r=".dragsuppress-"+ ++Co,i="click"+r,a=no.select(n(t)).on("touchmove"+r,E).on("dragstart"+r,E).on("selectstart"+r,E);if(null==So&&(So="onselectstart"in t?!1:w(t.style,"userSelect")),So){var o=e(t).style,s=o[So];o[So]="none"}return function(t){if(a.on(r,null),So&&(o[So]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){E(),e()},!0),setTimeout(e,0)}}}function $(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Po){var a=n(t);if(a.scrollX||a.scrollY){r=no.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Po=!(o.f||o.e),r.remove()}}return Po?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function J(){return no.event.changedTouches[0].identifier}function tt(t){return t>0?1:0>t?-1:0}function et(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function rt(t){return t>1?0:-1>t?jo:Math.acos(t)}function nt(t){return t>1?No:-1>t?-No:Math.asin(t)}function it(t){return((t=Math.exp(t))-1/t)/2}function at(t){return((t=Math.exp(t))+1/t)/2}function ot(t){return((t=Math.exp(2*t))-1)/(t+1)}function st(t){return(t=Math.sin(t/2))*t}function lt(){}function ut(t,e,r){return this instanceof ut?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof ut?new ut(t.h,t.s,t.l):At(""+t,kt,ut):new ut(t,e,r)}function ct(t,e,r){function n(t){return t>360?t-=360:0>t&&(t+=360),60>t?a+(o-a)*t/60:180>t?o:240>t?a+(o-a)*(240-t)/60:a}function i(t){return Math.round(255*n(t))}var a,o;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,r=0>r?0:r>1?1:r,o=.5>=r?r*(1+e):r+e-r*e,a=2*r-o,new bt(i(t+120),i(t),i(t-120))}function ft(t,e,r){return this instanceof ft?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof ft?new ft(t.h,t.c,t.l):t instanceof pt?gt(t.l,t.a,t.b):gt((t=Mt((t=no.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ft(t,e,r)}function ht(t,e,r){ -return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new pt(r,Math.cos(t*=Fo)*e,Math.sin(t)*e)}function pt(t,e,r){return this instanceof pt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof pt?new pt(t.l,t.a,t.b):t instanceof ft?ht(t.h,t.c,t.l):Mt((t=bt(t)).r,t.g,t.b):new pt(t,e,r)}function dt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=mt(i)*Zo,n=mt(n)*Qo,a=mt(a)*Ko,new bt(yt(3.2404542*i-1.5371385*n-.4985314*a),yt(-.969266*i+1.8760108*n+.041556*a),yt(.0556434*i-.2040259*n+1.0572252*a))}function gt(t,e,r){return t>0?new ft(Math.atan2(r,e)*Do,Math.sqrt(e*e+r*r),t):new ft(NaN,NaN,t)}function mt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function vt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function bt(t,e,r){return this instanceof bt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof bt?new bt(t.r,t.g,t.b):At(""+t,bt,ct):new bt(t,e,r)}function xt(t){return new bt(t>>16,t>>8&255,255&t)}function _t(t){return xt(t)+""}function wt(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function At(t,e,r){t=t.toLowerCase();var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(Tt(i[0]),Tt(i[1]),Tt(i[2]))}return(a=ts.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o=o>>4|o,s=240&a,s=s>>4|s,l=15&a,l=l<<4|l):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function kt(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=.5>l?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(r>e?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,i=l>0&&1>l?0:n),new ut(n,i,l)}function Mt(t,e,r){t=Et(t),e=Et(e),r=Et(r);var n=vt((.4124564*t+.3575761*e+.1804375*r)/Zo),i=vt((.2126729*t+.7151522*e+.072175*r)/Qo),a=vt((.0193339*t+.119192*e+.9503041*r)/Ko);return pt(116*i-16,500*(n-i),200*(i-a))}function Et(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Tt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Lt(t){return"function"==typeof t?t:function(){return t}}function St(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Ct(e,r,t,n)}}function Ct(t,e,r,n){function i(){var t,e=l.status;if(!e&&zt(l)||e>=200&&300>e||304===e){try{t=r.call(a,l)}catch(n){return void o.error.call(a,n)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=no.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,u=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=no.event;no.event=t;try{o.progress.call(a,l)}finally{no.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(u=t,a):u},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(ao(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=u&&(l.responseType=u),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},no.rebind(a,o,"on"),null==n?a:a.get(Pt(n))}function Pt(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function zt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Rt(){var t=jt(),e=It()-t;e>24?(isFinite(e)&&(clearTimeout(is),is=setTimeout(Rt,e)),ns=0):(ns=1,os(Rt))}function jt(){var t=Date.now();for(as=es;as;)t>=as.t&&(as.f=as.c(t-as.t)),as=as.n;return t}function It(){for(var t,e=es,r=1/0;e;)e.f?e=t?t.n=e.n:es=e.n:(e.t8?function(t){return t/r}:function(t){return t*r},symbol:t}}function Ft(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:x;return function(t){var r=ls.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",u=r[5],c=+r[6],f=r[7],h=r[8],p=r[9],d=1,g="",m="",v=!1,y=!0;switch(h&&(h=+h.substring(1)),(u||"0"===n&&"="===o)&&(u=n="0",o="="),p){case"n":f=!0,p="g";break;case"%":d=100,m="%",p="f";break;case"p":d=100,m="%",p="r";break;case"b":case"o":case"x":case"X":"#"===l&&(g="0"+p.toLowerCase());case"c":y=!1;case"d":v=!0,h=0;break;case"s":d=-1,p="r"}"$"===l&&(g=i[0],m=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):("e"==p||"f"==p)&&(h=Math.max(0,Math.min(20,h)))),p=us.get(p)||Dt;var b=u&&f;return function(t){var r=m;if(v&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===s?"":s;if(0>d){var l=no.formatPrefix(t,h);t=l.scale(t),r=l.symbol+m}else t*=d;t=p(t,h);var x,_,w=t.lastIndexOf(".");if(0>w){var A=y?t.lastIndexOf("e"):-1;0>A?(x=t,_=""):(x=t.substring(0,A),_=t.substring(A))}else x=t.substring(0,w),_=e+t.substring(w+1);!u&&f&&(x=a(x,1/0));var k=g.length+x.length+_.length+(b?0:i.length),M=c>k?new Array(k=c-k+1).join(n):"";return b&&(x=a(M+x,M.length?c-_.length:1/0)),i+=g,t=x+_,("<"===o?i+t+M:">"===o?M+i+t:"^"===o?M.substring(0,k>>=1)+i+t+M.substring(k):i+(b?t:M+t))+r}}}function Dt(t){return t+""}function Bt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ut(t,e,r){function n(e){var r=t(e),n=a(r,1);return n-e>e-r?r:n}function i(r){return e(r=t(new fs(r-1)),1),r}function a(t,r){return e(t=new fs(+t),r),t}function o(t,n,a){var o=i(t),s=[];if(a>1)for(;n>o;)r(o)%a||s.push(new Date(+o)),e(o,1);else for(;n>o;)s.push(new Date(+o)),e(o,1);return s}function s(t,e,r){try{fs=Bt;var n=new Bt;return n._=t,o(n,e,r)}finally{fs=Date}}t.floor=t,t.round=n,t.ceil=i,t.offset=a,t.range=o;var l=t.utc=Vt(t);return l.floor=l,l.round=Vt(n),l.ceil=Vt(i),l.offset=Vt(a),l.range=s,t}function Vt(t){return function(e,r){try{fs=Bt;var n=new Bt;return n._=e,t(n,r)._}finally{fs=Date}}}function qt(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++ss;){if(n>=u)return-1;if(i=e.charCodeAt(s++),37===i){if(o=e.charAt(s++),a=S[o in ps?e.charAt(s++):o],!a||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}function n(t,e,r){w.lastIndex=0;var n=w.exec(e.slice(r));return n?(t.w=A.get(n[0].toLowerCase()),r+n[0].length):-1}function i(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.w=_.get(n[0].toLowerCase()),r+n[0].length):-1}function a(t,e,r){E.lastIndex=0;var n=E.exec(e.slice(r));return n?(t.m=T.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){k.lastIndex=0;var n=k.exec(e.slice(r));return n?(t.m=M.get(n[0].toLowerCase()),r+n[0].length):-1}function s(t,e,n){return r(t,L.c.toString(),e,n)}function l(t,e,n){return r(t,L.x.toString(),e,n)}function u(t,e,n){return r(t,L.X.toString(),e,n)}function c(t,e,r){var n=b.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)}var f=t.dateTime,h=t.date,p=t.time,d=t.periods,g=t.days,m=t.shortDays,v=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{fs=Bt;var e=new fs;return e._=t,n(e)}finally{fs=Date}}var n=e(t);return r.parse=function(t){try{fs=Bt;var e=n.parse(t);return e&&e._}finally{fs=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ue;var b=no.map(),x=Ht(g),_=Yt(g),w=Ht(m),A=Yt(m),k=Ht(v),M=Yt(v),E=Ht(y),T=Yt(y);d.forEach(function(t,e){b.set(t.toLowerCase(),e)});var L={a:function(t){return m[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return v[t.getMonth()]},c:e(f),d:function(t,e){return Gt(t.getDate(),e,2)},e:function(t,e){return Gt(t.getDate(),e,2)},H:function(t,e){return Gt(t.getHours(),e,2)},I:function(t,e){return Gt(t.getHours()%12||12,e,2)},j:function(t,e){return Gt(1+cs.dayOfYear(t),e,3)},L:function(t,e){return Gt(t.getMilliseconds(),e,3)},m:function(t,e){return Gt(t.getMonth()+1,e,2)},M:function(t,e){return Gt(t.getMinutes(),e,2)},p:function(t){return d[+(t.getHours()>=12)]},S:function(t,e){return Gt(t.getSeconds(),e,2)},U:function(t,e){return Gt(cs.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Gt(cs.mondayOfYear(t),e,2)},x:e(h),X:e(p),y:function(t,e){return Gt(t.getFullYear()%100,e,2)},Y:function(t,e){return Gt(t.getFullYear()%1e4,e,4)},Z:se,"%":function(){return"%"}},S={a:n,A:i,b:a,B:o,c:s,d:ee,e:ee,H:ne,I:ne,j:re,L:oe,m:te,M:ie,p:c,S:ae,U:Wt,w:Xt,W:Zt,x:l,X:u,y:Kt,Y:Qt,Z:$t,"%":le};return e}function Gt(t,e,r){var n=0>t?"-":"",i=(n?-t:t)+"",a=i.length;return n+(r>a?new Array(r-a+1).join(e)+i:i)}function Ht(t){return new RegExp("^(?:"+t.map(no.requote).join("|")+")","i")}function Yt(t){for(var e=new f,r=-1,n=t.length;++r68?1900:2e3)}function te(t,e,r){ds.lastIndex=0;var n=ds.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function ee(t,e,r){ds.lastIndex=0;var n=ds.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function re(t,e,r){ds.lastIndex=0;var n=ds.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ne(t,e,r){ds.lastIndex=0;var n=ds.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function ie(t,e,r){ds.lastIndex=0;var n=ds.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function ae(t,e,r){ds.lastIndex=0;var n=ds.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function oe(t,e,r){ds.lastIndex=0;var n=ds.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function se(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=mo(e)/60|0,i=mo(e)%60;return r+Gt(n,"0",2)+Gt(i,"0",2)}function le(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ue(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*r,l=Math.cos(e),u=Math.sin(e),c=a*u,f=i*l+c*Math.cos(s),h=c*o*Math.sin(s);_s.add(Math.atan2(h,f)),n=t,i=l,a=u}var e,r,n,i,a;ws.point=function(o,s){ws.point=t,n=(e=o)*Fo,i=Math.cos(s=(r=s)*Fo/2+jo/4),a=Math.sin(s)},ws.lineEnd=function(){t(e,r)}}function me(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function ve(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ye(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function be(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function xe(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function _e(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function we(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function Ae(t,e){return mo(t[0]-e[0])s;++s)i.point((r=t[s])[0],r[1]);return void i.lineEnd()}var l=new Re(r,t,null,!0),u=new Re(r,null,l,!1);l.o=u,a.push(l),o.push(u),l=new Re(n,t,null,!1),u=new Re(n,null,l,!0),l.o=u,a.push(l),o.push(u)}}),o.sort(e),ze(a),ze(o),a.length){for(var s=0,l=r,u=o.length;u>s;++s)o[s].e=l=!l;for(var c,f,h=a[0];;){for(var p=h,d=!0;p.v;)if((p=p.n)===h)return;c=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(var s=0,u=c.length;u>s;++s)i.point((f=c[s])[0],f[1]);else n(p.x,p.n.x,1,i);p=p.n}else{if(d){c=p.p.z;for(var s=c.length-1;s>=0;--s)i.point((f=c[s])[0],f[1])}else n(p.x,p.p.x,-1,i);p=p.p}p=p.o,c=p.z,d=!d}while(!p.v);i.lineEnd()}}}function ze(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o1&&2&e&&r.push(r.pop().concat(r.shift())),p.push(r.filter(Ie))}var p,d,g,m=e(a),v=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c,y.lineStart=f,y.lineEnd=h,p=[],d=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=u,p=no.merge(p);var t=Ue(v,d);p.length?(_||(a.polygonStart(),_=!0),Pe(p,Ne,t,r,a)):t&&(_||(a.polygonStart(),_=!0),a.lineStart(),r(null,null,1,a),a.lineEnd()),_&&(a.polygonEnd(),_=!1),p=d=null},sphere:function(){a.polygonStart(),a.lineStart(),r(null,null,1,a),a.lineEnd(),a.polygonEnd()}},b=Oe(),x=e(b),_=!1;return y}}function Ie(t){return t.length>1}function Oe(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:A,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Ne(t,e){return((t=t.x)[0]<0?t[1]-No-zo:No-t[1])-((e=e.x)[0]<0?e[1]-No-zo:No-e[1])}function Fe(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?jo:-jo,l=mo(a-r);mo(l-jo)0?No:-No),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=jo&&(mo(r-i)zo?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}function Be(t,e,r,n){var i;if(null==t)i=r*No,n.point(-jo,i),n.point(0,i),n.point(jo,i),n.point(jo,0),n.point(jo,-i),n.point(0,-i),n.point(-jo,-i),n.point(-jo,0),n.point(-jo,i);else if(mo(t[0]-e[0])>zo){var a=t[0]s;++s){var u=e[s],c=u.length;if(c)for(var f=u[0],h=f[0],p=f[1]/2+jo/4,d=Math.sin(p),g=Math.cos(p),m=1;;){m===c&&(m=0),t=u[m];var v=t[0],y=t[1]/2+jo/4,b=Math.sin(y),x=Math.cos(y),_=v-h,w=_>=0?1:-1,A=w*_,k=A>jo,M=d*b;if(_s.add(Math.atan2(M*w*Math.sin(A),g*x+M*Math.cos(A))),a+=k?_+w*Io:_,k^h>=r^v>=r){var E=ye(me(f),me(t));_e(E);var T=ye(i,E);_e(T);var L=(k^_>=0?-1:1)*nt(T[2]);(n>L||n===L&&(E[0]||E[1]))&&(o+=k^_>=0?1:-1)}if(!m++)break;h=v,d=b,g=x,f=t}}return(-zo>a||zo>a&&0>_s)^1&o}function Ve(t){function e(t,e){return Math.cos(t)*Math.cos(e)>a}function r(t){var r,a,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(f,h){var p,d=[f,h],g=e(f,h),m=o?g?0:i(f,h):g?i(f+(0>f?jo:-jo),h):0;if(!r&&(u=l=g)&&t.lineStart(),g!==l&&(p=n(r,d),(Ae(r,p)||Ae(d,p))&&(d[0]+=zo,d[1]+=zo,g=e(d[0],d[1]))),g!==l)c=0,g?(t.lineStart(),p=n(d,r),t.point(p[0],p[1])):(p=n(r,d),t.point(p[0],p[1]),t.lineEnd()),r=p;else if(s&&r&&o^g){var v;m&a||!(v=n(d,r,!0))||(c=0,o?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||r&&Ae(r,d)||t.point(d[0],d[1]),r=d,l=g,a=m},lineEnd:function(){l&&t.lineEnd(),r=null},clean:function(){return c|(u&&l)<<1}}}function n(t,e,r){var n=me(t),i=me(e),o=[1,0,0],s=ye(n,i),l=ve(s,s),u=s[0],c=l-u*u;if(!c)return!r&&t;var f=a*l/c,h=-a*u/c,p=ye(o,s),d=xe(o,f),g=xe(s,h);be(d,g);var m=p,v=ve(d,m),y=ve(m,m),b=v*v-y*(ve(d,d)-1);if(!(0>b)){var x=Math.sqrt(b),_=xe(m,(-v-x)/y);if(be(_,d),_=we(_),!r)return _;var w,A=t[0],k=e[0],M=t[1],E=e[1];A>k&&(w=A,A=k,k=w);var T=k-A,L=mo(T-jo)T;if(!L&&M>E&&(w=M,M=E,E=w),S?L?M+E>0^_[1]<(mo(_[0]-A)jo^(A<=_[0]&&_[0]<=k)){var C=xe(m,(-v+x)/y);return be(C,d),[_,we(C)]}}}function i(e,r){var n=o?t:jo-t,i=0;return-n>e?i|=1:e>n&&(i|=2),-n>r?i|=4:r>n&&(i|=8),i}var a=Math.cos(t),o=a>0,s=mo(a)>zo,l=gr(t,6*Fo);return je(e,r,l,o?[0,-t]:[-jo,t-jo])}function qe(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,u=o.y,c=s.x,f=s.y,h=0,p=1,d=c-l,g=f-u;if(a=t-l,d||!(a>0)){if(a/=d,0>d){if(h>a)return;p>a&&(p=a)}else if(d>0){if(a>p)return;a>h&&(h=a)}if(a=r-l,d||!(0>a)){if(a/=d,0>d){if(a>p)return;a>h&&(h=a)}else if(d>0){if(h>a)return;p>a&&(p=a)}if(a=e-u,g||!(a>0)){if(a/=g,0>g){if(h>a)return;p>a&&(p=a)}else if(g>0){if(a>p)return;a>h&&(h=a)}if(a=n-u,g||!(0>a)){if(a/=g,0>g){if(a>p)return;a>h&&(h=a)}else if(g>0){if(h>a)return;p>a&&(p=a)}return h>0&&(i.a={x:l+h*d,y:u+h*g}),1>p&&(i.b={x:l+p*d,y:u+p*g}),i}}}}}}function Ge(t,e,r,n){function i(n,i){return mo(n[0]-t)0?0:3:mo(n[0]-r)0?2:1:mo(n[1]-e)0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,r=m.length,n=t[1],i=0;r>i;++i)for(var a,o=1,s=m[i],l=s.length,u=s[0];l>o;++o)a=s[o],u[1]<=n?a[1]>n&&et(u,a,t)>0&&++e:a[1]<=n&&et(u,a,t)<0&&--e,u=a;return 0!==e}function u(a,s,l,u){var c=0,f=0;if(null==a||(c=i(a,l))!==(f=i(s,l))||o(a,s)<0^l>0){do u.point(0===c||3===c?t:r,c>1?n:e);while((c=(c+l+4)%4)!==f)}else u.point(s[0],s[1])}function c(i,a){return i>=t&&r>=i&&a>=e&&n>=a}function f(t,e){c(t,e)&&s.point(t,e)}function h(){S.point=d,m&&m.push(v=[]),k=!0,A=!1,_=w=NaN}function p(){g&&(d(y,b),x&&A&&T.rejoin(),g.push(T.buffer())),S.point=f,A&&s.lineEnd()}function d(t,e){t=Math.max(-Os,Math.min(Os,t)),e=Math.max(-Os,Math.min(Os,e));var r=c(t,e);if(m&&v.push([t,e]),k)y=t,b=e,x=r,k=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&A)s.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};L(n)?(A||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),M=!1):r&&(s.lineStart(),s.point(t,e),M=!1)}_=t,w=e,A=r}var g,m,v,y,b,x,_,w,A,k,M,E=s,T=Oe(),L=qe(t,e,r,n),S={point:f,lineStart:h,lineEnd:p,polygonStart:function(){s=T,g=[],m=[],M=!0},polygonEnd:function(){s=E,g=no.merge(g);var e=l([t,n]),r=M&&e,i=g.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),u(null,null,1,s),s.lineEnd()),i&&Pe(g,a,e,u,s),s.polygonEnd()),g=m=v=null}};return S}}function He(t){var e=0,r=jo/3,n=sr(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*jo/180,r=t[1]*jo/180):[e/jo*180,r/jo*180]},i}function Ye(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,nt((a-(t*t+r*r)*i*i)/(2*i))]},r}function Xe(){function t(t,e){Fs+=i*t-n*e,n=t,i=e}var e,r,n,i;qs.point=function(a,o){qs.point=t,e=n=a,r=i=o},qs.lineEnd=function(){t(e,r)}}function We(t,e){Ds>t&&(Ds=t),t>Us&&(Us=t),Bs>e&&(Bs=e),e>Vs&&(Vs=e)}function Ze(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=r}function r(t,e){o.push("L",t,",",e)}function n(){s.point=t}function i(){o.push("Z")}var a=Qe(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Qe(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}function Qe(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ke(t,e){Ms+=t,Es+=e,++Ts}function $e(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);Ls+=o*(e+t)/2,Ss+=o*(r+n)/2,Cs+=o,Ke(e=t,r=n)}var e,r;Hs.point=function(n,i){Hs.point=t,Ke(e=n,r=i)}}function Je(){Hs.point=Ke}function tr(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);Ls+=o*(n+t)/2,Ss+=o*(i+e)/2,Cs+=o,o=i*t-n*e,Ps+=o*(n+t),zs+=o*(i+e),Rs+=3*o,Ke(n=t,i=e)}var e,r,n,i;Hs.point=function(a,o){Hs.point=t,Ke(e=n=a,r=i=o)},Hs.lineEnd=function(){t(e,r)}}function er(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,Io)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:A};return s}function rr(t){function e(t){return(s?n:r)(t)}function r(e){return ar(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})}function n(e){function r(r,n){r=t(r,n),e.point(r[0],r[1])}function n(){b=NaN,k.point=a,e.lineStart()}function a(r,n){var a=me([r,n]),o=t(r,n);i(b,x,y,_,w,A,b=o[0],x=o[1],y=r,_=a[0],w=a[1],A=a[2],s,e),e.point(b,x)}function o(){k.point=r,e.lineEnd()}function l(){n(),k.point=u,k.lineEnd=c}function u(t,e){a(f=t,h=e),p=b,d=x,g=_,m=w,v=A,k.point=a}function c(){i(b,x,y,_,w,A,p,d,f,g,m,v,s,e),k.lineEnd=o,o()}var f,h,p,d,g,m,v,y,b,x,_,w,A,k={point:r,lineStart:n,lineEnd:o,polygonStart:function(){e.polygonStart(),k.lineStart=l},polygonEnd:function(){e.polygonEnd(),k.lineStart=n}};return k}function i(e,r,n,s,l,u,c,f,h,p,d,g,m,v){var y=c-e,b=f-r,x=y*y+b*b;if(x>4*a&&m--){var _=s+p,w=l+d,A=u+g,k=Math.sqrt(_*_+w*w+A*A),M=Math.asin(A/=k),E=mo(mo(A)-1)a||mo((y*C+b*P)/x-.5)>.3||o>s*p+l*d+u*g)&&(i(e,r,n,s,l,u,L,S,E,_/=k,w/=k,A,m,v),v.point(L,S),i(L,S,E,_,w,A,c,f,h,p,d,g,m,v))}}var a=.5,o=Math.cos(30*Fo),s=16;return e.precision=function(t){return arguments.length?(s=(a=t*t)>0&&16,e):Math.sqrt(a)},e}function nr(t){var e=rr(function(e,r){return t([e*Do,r*Do])});return function(t){return lr(e(t))}}function ir(t){this.stream=t}function ar(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function or(t){return sr(function(){return t})()}function sr(t){function e(t){return t=s(t[0]*Fo,t[1]*Fo),[t[0]*h+l,u-t[1]*h]}function r(t){return t=s.invert((t[0]-l)/h,(u-t[1])/h),t&&[t[0]*Do,t[1]*Do]}function n(){s=Se(o=fr(v,y,b),a);var t=a(g,m);return l=p-t[0]*h,u=d+t[1]*h,i()}function i(){return c&&(c.valid=!1,c=null),e}var a,o,s,l,u,c,f=rr(function(t,e){return t=a(t,e),[t[0]*h+l,u-t[1]*h]}),h=150,p=480,d=250,g=0,m=0,v=0,y=0,b=0,_=Is,w=x,A=null,k=null;return e.stream=function(t){return c&&(c.valid=!1),c=lr(_(o,f(w(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(_=null==t?(A=t,Is):Ve((A=+t)*Fo),i()):A},e.clipExtent=function(t){return arguments.length?(k=t,w=t?Ge(t[0][0],t[0][1],t[1][0],t[1][1]):x,i()):k},e.scale=function(t){return arguments.length?(h=+t,n()):h},e.translate=function(t){return arguments.length?(p=+t[0],d=+t[1],n()):[p,d]},e.center=function(t){return arguments.length?(g=t[0]%360*Fo,m=t[1]%360*Fo,n()):[g*Do,m*Do]},e.rotate=function(t){return arguments.length?(v=t[0]%360*Fo,y=t[1]%360*Fo,b=t.length>2?t[2]%360*Fo:0,n()):[v*Do,y*Do,b*Do]},no.rebind(e,f,"precision"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&r,n()}}function lr(t){return ar(t,function(e,r){t.point(e*Fo,r*Fo)})}function ur(t,e){return[t,e]}function cr(t,e){return[t>jo?t-Io:-jo>t?t+Io:t,e]}function fr(t,e,r){return t?e||r?Se(pr(t),dr(e,r)):pr(t):e||r?dr(e,r):cr}function hr(t){return function(e,r){return e+=t,[e>jo?e-Io:-jo>e?e+Io:e,r]}}function pr(t){var e=hr(t);return e.invert=hr(-t),e}function dr(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*n+s*i;return[Math.atan2(l*a-c*o,s*n-u*i),nt(c*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*a-l*o;return[Math.atan2(l*a+u*o,s*n+c*i),nt(c*n-s*i)]},r}function gr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=mr(r,i),a=mr(r,a),(o>0?a>i:i>a)&&(i+=o*Io)):(i=t+o*Io,a=t-.5*l);for(var u,c=i;o>0?c>a:a>c;c-=l)s.point((u=we([r,-n*Math.cos(c),-n*Math.sin(c)]))[0],u[1])}}function mr(t,e){var r=me(e);r[0]-=t,_e(r);var n=rt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-zo)%(2*Math.PI)}function vr(t,e,r){var n=no.range(t,e-zo,r).concat(e);return function(t){return n.map(function(e){return[t,e]})}}function yr(t,e,r){var n=no.range(t,e-zo,r).concat(e);return function(t){return n.map(function(e){return[e,t]})}}function br(t){return t.source}function xr(t){return t.target}function _r(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),u=i*Math.sin(t),c=o*Math.cos(r),f=o*Math.sin(r),h=2*Math.asin(Math.sqrt(st(n-e)+i*o*st(r-t))),p=1/Math.sin(h),d=h?function(t){var e=Math.sin(t*=h)*p,r=Math.sin(h-t)*p,n=r*l+e*c,i=r*u+e*f,o=r*a+e*s;return[Math.atan2(i,n)*Do,Math.atan2(o,Math.sqrt(n*n+i*i))*Do]}:function(){return[t*Do,e*Do]};return d.distance=h,d}function wr(){function t(t,i){var a=Math.sin(i*=Fo),o=Math.cos(i),s=mo((t*=Fo)-e),l=Math.cos(s);Ys+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;Xs.point=function(i,a){e=i*Fo,r=Math.sin(a*=Fo),n=Math.cos(a),Xs.point=t},Xs.lineEnd=function(){Xs.point=Xs.lineEnd=A}}function Ar(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}function kr(t,e){function r(t,e){o>0?-No+zo>e&&(e=-No+zo):e>No-zo&&(e=No-zo);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(jo/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=tt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-No]},r):Er}function Mr(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return mo(i)i;i++){for(;n>1&&et(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function zr(t,e){return t[0]-e[0]||t[1]-e[1]}function Rr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function jr(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],u=r[1],c=e[1]-l,f=n[1]-u,h=(s*(l-u)-f*(i-a))/(f*o-s*c);return[i+h*o,l+h*c]}function Ir(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function Or(){nn(this),this.edge=this.site=this.circle=null}function Nr(t){var e=al.pop()||new Or;return e.site=t,e}function Fr(t){Wr(t),rl.remove(t),al.push(t),nn(t)}function Dr(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];Fr(t);for(var l=a;l.circle&&mo(r-l.circle.x)c;++c)u=s[c],l=s[c-1],tn(u.edge,l.site,u.site,i);l=s[0],u=s[f-1],u.edge=$r(l.site,u.site,null,i),Xr(l),Xr(u)}function Br(t){for(var e,r,n,i,a=t.x,o=t.y,s=rl._;s;)if(n=Ur(s,o)-a,n>zo)s=s.L;else{if(i=a-Vr(s,o),!(i>zo)){n>-zo?(e=s.P,r=s):i>-zo?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Nr(t);if(rl.insert(e,l),e||r){if(e===r)return Wr(e),r=Nr(e.site),rl.insert(l,r),l.edge=r.edge=$r(e.site,l.site),Xr(e),void Xr(r);if(!r)return void(l.edge=$r(e.site,l.site));Wr(e),Wr(r);var u=e.site,c=u.x,f=u.y,h=t.x-c,p=t.y-f,d=r.site,g=d.x-c,m=d.y-f,v=2*(h*m-p*g),y=h*h+p*p,b=g*g+m*m,x={x:(m*y-p*b)/v+c,y:(h*b-g*y)/v+f};tn(r.edge,u,d,x),l.edge=$r(u,t,null,x),r.edge=$r(t,d,null,x),Xr(e),Xr(r)}}function Ur(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-(1/0);r=o.site;var s=r.x,l=r.y,u=l-e; -if(!u)return s;var c=s-n,f=1/a-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+i-a/2)))/f+n:(n+s)/2}function Vr(t,e){var r=t.N;if(r)return Ur(r,e);var n=t.site;return n.y===e?n.x:1/0}function qr(t){this.site=t,this.edges=[]}function Gr(t){for(var e,r,n,i,a,o,s,l,u,c,f=t[0][0],h=t[1][0],p=t[0][1],d=t[1][1],g=el,m=g.length;m--;)if(a=g[m],a&&a.prepare())for(s=a.edges,l=s.length,o=0;l>o;)c=s[o].end(),n=c.x,i=c.y,u=s[++o%l].start(),e=u.x,r=u.y,(mo(n-e)>zo||mo(i-r)>zo)&&(s.splice(o,0,new en(Jr(a.site,c,mo(n-f)zo?{x:f,y:mo(e-f)zo?{x:mo(r-d)zo?{x:h,y:mo(e-h)zo?{x:mo(r-p)=-Ro)){var p=l*l+u*u,d=c*c+f*f,g=(f*p-u*d)/h,m=(l*d-c*p)/h,f=m+s,v=ol.pop()||new Yr;v.arc=t,v.site=i,v.x=g+o,v.y=f+Math.sqrt(g*g+m*m),v.cy=f,t.circle=v;for(var y=null,b=il._;b;)if(v.ym||m>=s)return;if(h>d){if(a){if(a.y>=u)return}else a={x:m,y:l};r={x:m,y:u}}else{if(a){if(a.yn||n>1)if(h>d){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.yp){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.xa||f>o||n>h||i>p)){if(d=t.point){var d,g=e-t.x,m=r-t.y,v=g*g+m*m;if(l>v){var y=Math.sqrt(l=v);n=e-y,i=r-y,a=e+y,o=r+y,s=d}}for(var b=t.nodes,x=.5*(c+h),_=.5*(f+p),w=e>=x,A=r>=_,k=A<<1|w,M=k+4;M>k;++k)if(t=b[3&k])switch(3&k){case 0:u(t,c,f,x,_);break;case 1:u(t,x,f,h,_);break;case 2:u(t,c,_,x,p);break;case 3:u(t,x,_,h,p)}}}(t,n,i,a,o),s}function mn(t,e){t=no.rgb(t),e=no.rgb(e);var r=t.r,n=t.g,i=t.b,a=e.r-r,o=e.g-n,s=e.b-i;return function(t){return"#"+wt(Math.round(r+a*t))+wt(Math.round(n+o*t))+wt(Math.round(i+s*t))}}function vn(t,e){var r,n={},i={};for(r in t)r in e?n[r]=xn(t[r],e[r]):i[r]=t[r];for(r in e)r in t||(i[r]=e[r]);return function(t){for(r in n)i[r]=n[r](t);return i}}function yn(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function bn(t,e){var r,n,i,a=ll.lastIndex=ul.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=ll.exec(t))&&(n=ul.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:yn(r,n)})),a=ul.lastIndex;return an;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}function xn(t,e){for(var r,n=no.interpolators.length;--n>=0&&!(r=no.interpolators[n](t,e)););return r}function _n(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;s>r;++r)n.push(xn(t[r],e[r]));for(;a>r;++r)i[r]=t[r];for(;o>r;++r)i[r]=e[r];return function(t){for(r=0;s>r;++r)i[r]=n[r](t);return i}}function wn(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function An(t){return function(e){return 1-t(1-e)}}function kn(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function Mn(t){return t*t}function En(t){return t*t*t}function Tn(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(.5>t?r:3*(t-e)+r-.75)}function Ln(t){return function(e){return Math.pow(e,t)}}function Sn(t){return 1-Math.cos(t*No)}function Cn(t){return Math.pow(2,10*(t-1))}function Pn(t){return 1-Math.sqrt(1-t*t)}function zn(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Io*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Io/e)}}function Rn(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function jn(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function In(t,e){t=no.hcl(t),e=no.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:-180>a&&(a+=360),function(t){return ht(r+a*t,n+o*t,i+s*t)+""}}function On(t,e){t=no.hsl(t),e=no.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:-180>a&&(a+=360),function(t){return ct(r+a*t,n+o*t,i+s*t)+""}}function Nn(t,e){t=no.lab(t),e=no.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return dt(r+a*t,n+o*t,i+s*t)+""}}function Fn(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Dn(t){var e=[t.a,t.b],r=[t.c,t.d],n=Un(e),i=Bn(e,r),a=Un(Vn(r,e,-i))||0;e[0]*r[1]180?c+=360:c-u>180&&(u+=360),i.push({i:n.push(n.pop()+"rotate(",null,")")-2,x:yn(u,c)})):c&&n.push(n.pop()+"rotate("+c+")"),f!=h?i.push({i:n.push(n.pop()+"skewX(",null,")")-2,x:yn(f,h)}):h&&n.push(n.pop()+"skewX("+h+")"),p[0]!=d[0]||p[1]!=d[1]?(r=n.push(n.pop()+"scale(",null,",",null,")"),i.push({i:r-4,x:yn(p[0],d[0])},{i:r-2,x:yn(p[1],d[1])})):(1!=d[0]||1!=d[1])&&n.push(n.pop()+"scale("+d+")"),r=i.length,function(t){for(var e,a=-1;++a=0;)r.push(i[n])}function ri(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++or;++r)(e=t[r][1])>i&&(n=r,i=e);return n}function pi(t){return t.reduce(di,0)}function di(t,e){return t+e[1]}function gi(t,e){return mi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function mi(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function vi(t){return[no.min(t),no.max(t)]}function yi(t,e){return t.value-e.value}function bi(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function xi(t,e){t._pack_next=e,e._pack_prev=t}function _i(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function wi(t){function e(t){c=Math.min(t.x-t.r,c),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),p=Math.max(t.y+t.r,p)}if((r=t.children)&&(u=r.length)){var r,n,i,a,o,s,l,u,c=1/0,f=-(1/0),h=1/0,p=-(1/0);if(r.forEach(Ai),n=r[0],n.x=-n.r,n.y=0,e(n),u>1&&(i=r[1],i.x=i.r,i.y=0,e(i),u>2))for(a=r[2],Ei(n,i,a),e(a),bi(n,a),n._pack_prev=a,bi(a,i),i=n._pack_next,o=3;u>o;o++){Ei(n,i,a=r[o]);var d=0,g=1,m=1;for(s=i._pack_next;s!==i;s=s._pack_next,g++)if(_i(s,a)){d=1;break}if(1==d)for(l=n._pack_prev;l!==s._pack_prev&&!_i(l,a);l=l._pack_prev,m++);d?(m>g||g==m&&i.ro;o++)a=r[o],a.x-=v,a.y-=y,b=Math.max(b,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=b,r.forEach(ki)}}function Ai(t){t._pack_next=t._pack_prev=t}function ki(t){delete t._pack_next,delete t._pack_prev}function Mi(t,e,r,n){var i=t.children;if(t.x=e+=n*t.x,t.y=r+=n*t.y,t.r*=n,i)for(var a=-1,o=i.length;++a=0;)e=i[a],e.z+=r,e.m+=r,r+=e.s+(n+=e.c)}function zi(t,e,r){return t.a.parent===e.parent?t.a:r}function Ri(t){return 1+no.max(t,function(t){return t.y})}function ji(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ii(t){var e=t.children;return e&&e.length?Ii(e[0]):t}function Oi(t){var e,r=t.children;return r&&(e=r.length)?Oi(r[e-1]):t}function Ni(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Fi(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return 0>i&&(r+=i/2,i=0),0>a&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function Di(t){var e=t[0],r=t[t.length-1];return r>e?[e,r]:[r,e]}function Bi(t){return t.rangeExtent?t.rangeExtent():Di(t.range())}function Ui(t,e,r,n){var i=r(t[0],t[1]),a=n(e[0],e[1]);return function(t){return a(i(t))}}function Vi(t,e){var r,n=0,i=t.length-1,a=t[n],o=t[i];return a>o&&(r=n,n=i,i=r,r=a,a=o,o=r),t[n]=e.floor(a),t[i]=e.ceil(o),t}function qi(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:xl}function Gi(t,e,r,n){var i=[],a=[],o=0,s=Math.min(t.length,e.length)-1;for(t[s]2?Gi:Ui,l=n?Hn:Gn;return o=i(t,e,l,r),s=i(e,t,l,xn),a}function a(t){return o(t)}var o,s;return a.invert=function(t){return s(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Fn)},a.clamp=function(t){return arguments.length?(n=t,i()):n},a.interpolate=function(t){return arguments.length?(r=t,i()):r},a.ticks=function(e){return Zi(t,e)},a.tickFormat=function(e,r){return Qi(t,e,r)},a.nice=function(e){return Xi(t,e),i()},a.copy=function(){return Hi(t,e,r,n)},i()}function Yi(t,e){return no.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Xi(t,e){return Vi(t,qi(Wi(t,e)[2]))}function Wi(t,e){null==e&&(e=10);var r=Di(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return.15>=a?i*=10:.35>=a?i*=5:.75>=a&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function Zi(t,e){return no.range.apply(no,Wi(t,e))}function Qi(t,e,r){var n=Wi(t,e);if(r){var i=ls.exec(r);if(i.shift(),"s"===i[8]){var a=no.formatPrefix(Math.max(mo(n[0]),mo(n[1])));return i[7]||(i[7]="."+Ki(a.scale(n[2]))),i[8]="f",r=no.format(i.join("")),function(t){return r(a.scale(t))+a.symbol}}i[7]||(i[7]="."+$i(i[8],n)),r=i.join("")}else r=",."+Ki(n[2])+"f";return no.format(r)}function Ki(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function $i(t,e){var r=Ki(e[2]);return t in _l?Math.abs(r-Ki(Math.max(mo(e[0]),mo(e[1]))))+ +("e"!==t):r-2*("%"===t)}function Ji(t,e,r,n){function i(t){return(r?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Vi(n.map(i),r?Math:Al);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Di(n),o=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(c-u)){if(r){for(;c>u;u++)for(var h=1;f>h;h++)o.push(a(u)*h);o.push(a(u))}else for(o.push(a(u));u++0;h--)o.push(a(u)*h);for(u=0;o[u]l;c--);o=o.slice(u,c)}return o},o.tickFormat=function(t,e){if(!arguments.length)return wl;arguments.length<2?e=wl:"function"!=typeof e&&(e=no.format(e));var n,s=Math.max(.1,t/o.ticks().length),l=r?(n=1e-12,Math.ceil):(n=-1e-12,Math.floor);return function(t){return t/a(l(i(t)+n))<=s?e(t):""}},o.copy=function(){return Ji(t.copy(),e,r,n)},Yi(o,t)}function ta(t,e,r){function n(e){return t(i(e))}var i=ea(e),a=ea(1/e);return n.invert=function(e){return a(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(i)),n):r},n.ticks=function(t){return Zi(r,t)},n.tickFormat=function(t,e){return Qi(r,t,e)},n.nice=function(t){return n.domain(Xi(r,t))},n.exponent=function(o){return arguments.length?(i=ea(e=o),a=ea(1/e),t.domain(r.map(i)),n):e},n.copy=function(){return ta(t.copy(),e,r)},Yi(n,t)}function ea(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ra(t,e){function r(r){return a[((i.get(r)||("range"===e.t?i.set(r,t.push(r)):NaN))-1)%a.length]}function n(e,r){return no.range(t.length).map(function(t){return e+r*t})}var i,a,o;return r.domain=function(n){if(!arguments.length)return t;t=[],i=new f;for(var a,o=-1,s=n.length;++or?[NaN,NaN]:[r>0?s[r-1]:t[0],re?NaN:e/a+t,[e,e+1/a]},n.copy=function(){return ia(t,e,r)},i()}function aa(t,e){function r(r){return r>=r?e[no.bisect(t,r)]:void 0}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(t){return arguments.length?(e=t,r):e},r.invertExtent=function(r){return r=e.indexOf(r),[t[r-1],t[r]]},r.copy=function(){return aa(t,e)},r}function oa(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=r.map(e),e):t},e.ticks=function(e){return Zi(t,e)},e.tickFormat=function(e,r){return Qi(t,e,r)},e.copy=function(){return oa(t)},e}function sa(){return 0}function la(t){return t.innerRadius}function ua(t){return t.outerRadius}function ca(t){return t.startAngle}function fa(t){return t.endAngle}function ha(t){return t&&t.padAngle}function pa(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function da(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,f=t[1]+u,h=e[0]+l,p=e[1]+u,d=(c+h)/2,g=(f+p)/2,m=h-c,v=p-f,y=m*m+v*v,b=r-n,x=c*p-h*f,_=(0>v?-1:1)*Math.sqrt(b*b*y-x*x),w=(x*v-m*_)/y,A=(-x*m-v*_)/y,k=(x*v+m*_)/y,M=(-x*m+v*_)/y,E=w-d,T=A-g,L=k-d,S=M-g;return E*E+T*T>L*L+S*S&&(w=k,A=M),[[w-l,A-u],[w*r/b,A*r/b]]}function ga(t){function e(e){function o(){u.push("M",a(t(c),s))}for(var l,u=[],c=[],f=-1,h=e.length,p=Lt(r),d=Lt(n);++f1&&i.push("H",n[0]),i.join("")}function ba(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;u9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}function Ia(t){return t.length<3?ma(t):t[0]+ka(t,ja(t))}function Oa(t){for(var e,r,n,i=-1,a=t.length;++in)return c();var i=a[a.active];i&&(--a.count,delete a[a.active],i.event&&i.event.interrupt.call(t,t.__data__,i.index)),a.active=n,o.event&&o.event.start.call(t,t.__data__,e),o.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&g.push(n)}),h=o.ease,f=o.duration,no.timer(function(){return d.c=u(r||1)?Ce:u,1},0,s)}function u(r){if(a.active!==n)return 1;for(var i=r/f,s=h(i),l=g.length;l>0;)g[--l].call(t,s);return i>=1?(o.event&&o.event.end.call(t,t.__data__,e),c()):void 0}function c(){return--a.count?delete a[n]:delete t[r],1}var f,h,p=o.delay,d=as,g=[];return d.t=p+s,i>=p?l(i-p):void(d.c=l)},0,s)}}function Qa(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function Ka(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function $a(t){return t.toISOString()}function Ja(t,e,r){function n(e){return t(e)}function i(t,r){var n=t[1]-t[0],i=n/r,a=no.bisect(Wl,i);return a==Wl.length?[e.year,Wi(t.map(function(t){return t/31536e6}),r)[2]]:a?e[i/Wl[a-1]1?{floor:function(e){for(;r(e=t.floor(e));)e=to(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=to(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Di(n.domain()),a=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],to(+r[1]+1),1>e?1:e)},n.tickFormat=function(){return r},n.copy=function(){return Ja(t.copy(),e,r)},Yi(n,t)}function to(t){return new Date(t)}function eo(t){return JSON.parse(t.responseText)}function ro(t){var e=oo.createRange();return e.selectNode(oo.body),e.createContextualFragment(t.responseText)}var no={version:"3.5.6"},io=[].slice,ao=function(t){return io.call(t)},oo=this.document;if(oo)try{ao(oo.documentElement.childNodes)[0].nodeType}catch(so){ao=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),oo)try{oo.createElement("DIV").style.setProperty("opacity",0,"")}catch(lo){var uo=this.Element.prototype,co=uo.setAttribute,fo=uo.setAttributeNS,ho=this.CSSStyleDeclaration.prototype,po=ho.setProperty;uo.setAttribute=function(t,e){co.call(this,t,e+"")},uo.setAttributeNS=function(t,e,r){fo.call(this,t,e,r+"")},ho.setProperty=function(t,e,r){po.call(this,t,e+"",r)}}no.ascending=i,no.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:NaN},no.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},no.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},no.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),n>i&&(i=n))}else{for(;++a=n){r=i=n;break}for(;++an&&(r=n),n>i&&(i=n))}return[r,i]},no.sum=function(t,e){var r,n=0,i=t.length,a=-1;if(1===arguments.length)for(;++a1?l/(c-1):void 0},no.deviation=function(){var t=no.variance.apply(this,arguments);return t?Math.sqrt(t):t};var go=s(i);no.bisectLeft=go.left,no.bisect=no.bisectRight=go.right,no.bisector=function(t){return s(1===t.length?function(e,r){return i(t(e),r)}:t)},no.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,2>a&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},no.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},no.pairs=function(t){for(var e,r=0,n=t.length-1,i=t[0],a=new Array(0>n?0:n);n>r;)a[r]=[e=i,i=t[++r]];return a},no.zip=function(){if(!(n=arguments.length))return[];for(var t=-1,e=no.min(arguments,l),r=new Array(e);++t=0;)for(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r};var mo=Math.abs;no.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r===1/0)throw new Error("infinite range");var n,i=[],a=u(mo(r)),o=-1; -if(t*=a,e*=a,r*=a,0>r)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,c,h,p=-1,d=o.length,g=a[s++],m=new f;++p=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t(no.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},no.set=function(t){var e=new b;if(t)for(var r=0,n=t.length;n>r;++r)e.add(t[r]);return e},c(b,{has:d,add:function(t){return this._[h(t+="")]=!0,t},remove:g,values:m,size:v,empty:y,forEach:function(t){for(var e in this._)t.call(this,p(e))}}),no.behavior={},no.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},no.event=null,no.requote=function(t){return t.replace(xo,"\\$&")};var xo=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,_o={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},wo=function(t,e){return e.querySelector(t)},Ao=function(t,e){return e.querySelectorAll(t)},ko=function(t,e){var r=t.matches||t[w(t,"matchesSelector")];return(ko=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(wo=function(t,e){return Sizzle(t,e)[0]||null},Ao=Sizzle,ko=Sizzle.matchesSelector),no.selection=function(){return no.select(oo.documentElement)};var Mo=no.selection.prototype=[];Mo.select=function(t){var e,r,n,i,a=[];t=C(t);for(var o=-1,s=this.length;++o=0&&(r=t.slice(0,e),t=t.slice(e+1)),Eo.hasOwnProperty(r)?{space:Eo[r],local:t}:t}},Mo.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return t=no.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(z(e,t[e]));return this}return this.each(z(t,e))},Mo.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=I(t)).length,i=-1;if(e=r.classList){for(;++ii){if("string"!=typeof t){2>i&&(e="");for(r in t)this.each(F(r,t[r],e));return this}if(2>i){var a=this.node();return n(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(F(t,e,r))},Mo.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(D(e,t[e]));return this}return this.each(D(t,e))},Mo.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Mo.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Mo.append=function(t){return t=B(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Mo.insert=function(t,e){return t=B(t),e=C(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Mo.remove=function(){return this.each(U)},Mo.data=function(t,e){function r(t,r){var n,i,a,o=t.length,c=r.length,h=Math.min(o,c),p=new Array(c),d=new Array(c),g=new Array(o);if(e){var m,v=new f,y=new Array(o);for(n=-1;++nn;++n)d[n]=V(r[n]);for(;o>n;++n)g[n]=t[n]}d.update=p,d.parentNode=p.parentNode=g.parentNode=t.parentNode,s.push(d),l.push(p),u.push(g)}var n,i,a=-1,o=this.length;if(!arguments.length){for(t=new Array(o=(n=this[0]).length);++aa;a++){i.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;l>s;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return S(i)},Mo.order=function(){for(var t=-1,e=this.length;++t=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},Mo.sort=function(t){t=G.apply(this,arguments);for(var e=-1,r=this.length;++et;t++)for(var r=this[t],n=0,i=r.length;i>n;n++){var a=r[n];if(a)return a}return null},Mo.size=function(){var t=0;return H(this,function(){++t}),t};var To=[];no.selection.enter=Y,no.selection.enter.prototype=To,To.append=Mo.append,To.empty=Mo.empty,To.node=Mo.node,To.call=Mo.call,To.size=Mo.size,To.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++sn){if("string"!=typeof t){2>n&&(e=!1);for(r in t)this.each(W(r,t[r],e));return this}if(2>n)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(W(t,e,r))};var Lo=no.map({mouseenter:"mouseover",mouseleave:"mouseout"});oo&&Lo.forEach(function(t){"on"+t in oo&&Lo.remove(t)});var So,Co=0;no.mouse=function(t){return $(t,T())};var Po=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;no.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=T().changedTouches),e)for(var n,i=0,a=e.length;a>i;++i)if((n=e[i]).identifier===r)return $(t,n)},no.behavior.drag=function(){function t(){this.on("mousedown.drag",a).on("touchstart.drag",o)}function e(t,e,n,a,o){return function(){function s(){var t,r,n=e(h,g);n&&(t=n[0]-b[0],r=n[1]-b[1],d|=t|r,b=n,p({type:"drag",x:n[0]+u[0],y:n[1]+u[1],dx:t,dy:r}))}function l(){e(h,g)&&(v.on(a+m,null).on(o+m,null),y(d&&no.event.target===f),p({type:"dragend"}))}var u,c=this,f=no.event.target,h=c.parentNode,p=r.of(c,arguments),d=0,g=t(),m=".drag"+(null==g?"":"-"+g),v=no.select(n(f)).on(a+m,s).on(o+m,l),y=K(f),b=e(h,g);i?(u=i.apply(c,arguments),u=[u.x-b[0],u.y-b[1]]):u=[0,0],p({type:"dragstart"})}}var r=L(t,"drag","dragstart","dragend"),i=null,a=e(A,no.mouse,n,"mousemove","mouseup"),o=e(J,no.touch,x,"touchmove","touchend");return t.origin=function(e){return arguments.length?(i=e,t):i},no.rebind(t,r,"on")},no.touches=function(t,e){return arguments.length<2&&(e=T().touches),e?ao(e).map(function(e){var r=$(t,e);return r.identifier=e.identifier,r}):[]};var zo=1e-6,Ro=zo*zo,jo=Math.PI,Io=2*jo,Oo=Io-zo,No=jo/2,Fo=jo/180,Do=180/jo,Bo=Math.SQRT2,Uo=2,Vo=4;no.interpolateZoom=function(t,e){function r(t){var e=t*y;if(v){var r=at(g),o=a/(Uo*h)*(r*ot(Bo*e+g)-it(g));return[n+o*u,i+o*c,a*r/at(Bo*e+g)]}return[n+t*u,i+t*c,a*Math.exp(Bo*e)]}var n=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2],u=o-n,c=s-i,f=u*u+c*c,h=Math.sqrt(f),p=(l*l-a*a+Vo*f)/(2*a*Uo*h),d=(l*l-a*a-Vo*f)/(2*l*Uo*h),g=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(d*d+1)-d),v=m-g,y=(v||Math.log(l/a))/Bo;return r.duration=1e3*y,r},no.behavior.zoom=function(){function t(t){t.on(P,f).on(Go+".zoom",p).on("dblclick.zoom",d).on(j,h)}function e(t){return[(t[0]-k.x)/k.k,(t[1]-k.y)/k.k]}function r(t){return[t[0]*k.k+k.x,t[1]*k.k+k.y]}function i(t){k.k=Math.max(T[0],Math.min(T[1],t))}function a(t,e){e=r(e),k.x+=t[0]-e[0],k.y+=t[1]-e[1]}function o(e,r,n,o){e.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,o)),a(m=r,n),e=no.select(e),S>0&&(e=e.transition().duration(S)),e.call(t.event)}function s(){_&&_.domain(x.range().map(function(t){return(t-k.x)/k.k}).map(x.invert)),A&&A.domain(w.range().map(function(t){return(t-k.y)/k.k}).map(w.invert))}function l(t){C++||t({type:"zoomstart"})}function u(t){s(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--C||(t({type:"zoomend"}),m=null)}function f(){function t(){f=1,a(no.mouse(i),p),u(s)}function r(){h.on(z,null).on(R,null),d(f&&no.event.target===o),c(s)}var i=this,o=no.event.target,s=I.of(i,arguments),f=0,h=no.select(n(i)).on(z,t).on(R,r),p=e(no.mouse(i)),d=K(i);Fl.call(i),l(s)}function h(){function t(){var t=no.touches(d);return p=k.k,t.forEach(function(t){t.identifier in m&&(m[t.identifier]=e(t))}),t}function r(){var e=no.event.target;no.select(e).on(x,n).on(_,s),w.push(e);for(var r=no.event.changedTouches,i=0,a=r.length;a>i;++i)m[r[i].identifier]=null;var l=t(),u=Date.now();if(1===l.length){if(500>u-b){var c=l[0];o(d,c,m[c.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),E()}b=u}else if(l.length>1){var c=l[0],f=l[1],h=c[0]-f[0],p=c[1]-f[1];v=h*h+p*p}}function n(){var t,e,r,n,o=no.touches(d);Fl.call(d);for(var s=0,l=o.length;l>s;++s,n=null)if(r=o[s],n=m[r.identifier]){if(e)break;t=r,e=n}if(n){var c=(c=r[0]-t[0])*c+(c=r[1]-t[1])*c,f=v&&Math.sqrt(c/v);t=[(t[0]+r[0])/2,(t[1]+r[1])/2],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],i(f*p)}b=null,a(t,e),u(g)}function s(){if(no.event.touches.length){for(var e=no.event.changedTouches,r=0,n=e.length;n>r;++r)delete m[e[r].identifier];for(var i in m)return void t()}no.selectAll(w).on(y,null),A.on(P,f).on(j,h),M(),c(g)}var p,d=this,g=I.of(d,arguments),m={},v=0,y=".zoom-"+no.event.changedTouches[0].identifier,x="touchmove"+y,_="touchend"+y,w=[],A=no.select(d),M=K(d);r(),l(g),A.on(P,null).on(j,r)}function p(){var t=I.of(this,arguments);y?clearTimeout(y):(Fl.call(this),g=e(m=v||no.mouse(this)),l(t)),y=setTimeout(function(){y=null,c(t)},50),E(),i(Math.pow(2,.002*qo())*k.k),a(m,g),u(t)}function d(){var t=no.mouse(this),r=Math.log(k.k)/Math.LN2;o(this,t,e(t),no.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var g,m,v,y,b,x,_,w,A,k={x:0,y:0,k:1},M=[960,500],T=Ho,S=250,C=0,P="mousedown.zoom",z="mousemove.zoom",R="mouseup.zoom",j="touchstart.zoom",I=L(t,"zoomstart","zoom","zoomend");return Go||(Go="onwheel"in oo?(qo=function(){return-no.event.deltaY*(no.event.deltaMode?120:1)},"wheel"):"onmousewheel"in oo?(qo=function(){return no.event.wheelDelta},"mousewheel"):(qo=function(){return-no.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=I.of(this,arguments),e=k;Ol?no.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(t)}).tween("zoom:zoom",function(){var r=M[0],n=M[1],i=m?m[0]:r/2,a=m?m[1]:n/2,o=no.interpolateZoom([(i-k.x)/k.k,(a-k.y)/k.k,r/k.k],[(i-e.x)/e.k,(a-e.y)/e.k,r/e.k]);return function(e){var n=o(e),s=r/n[2];this.__chart__=k={x:i-n[0]*s,y:a-n[1]*s,k:s},u(t)}}).each("interrupt.zoom",function(){c(t)}).each("end.zoom",function(){c(t)}):(this.__chart__=k,l(t),u(t),c(t))})},t.translate=function(e){return arguments.length?(k={x:+e[0],y:+e[1],k:k.k},s(),t):[k.x,k.y]},t.scale=function(e){return arguments.length?(k={x:k.x,y:k.y,k:+e},s(),t):k.k},t.scaleExtent=function(e){return arguments.length?(T=null==e?Ho:[+e[0],+e[1]],t):T},t.center=function(e){return arguments.length?(v=e&&[+e[0],+e[1]],t):v},t.size=function(e){return arguments.length?(M=e&&[+e[0],+e[1]],t):M},t.duration=function(e){return arguments.length?(S=+e,t):S},t.x=function(e){return arguments.length?(_=e,x=e.copy(),k={x:0,y:0,k:1},t):_},t.y=function(e){return arguments.length?(A=e,w=e.copy(),k={x:0,y:0,k:1},t):A},no.rebind(t,I,"on")};var qo,Go,Ho=[0,1/0];no.color=lt,lt.prototype.toString=function(){return this.rgb()+""},no.hsl=ut;var Yo=ut.prototype=new lt;Yo.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,this.l/t)},Yo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,t*this.l)},Yo.rgb=function(){return ct(this.h,this.s,this.l)},no.hcl=ft;var Xo=ft.prototype=new lt;Xo.brighter=function(t){return new ft(this.h,this.c,Math.min(100,this.l+Wo*(arguments.length?t:1)))},Xo.darker=function(t){return new ft(this.h,this.c,Math.max(0,this.l-Wo*(arguments.length?t:1)))},Xo.rgb=function(){return ht(this.h,this.c,this.l).rgb()},no.lab=pt;var Wo=18,Zo=.95047,Qo=1,Ko=1.08883,$o=pt.prototype=new lt;$o.brighter=function(t){return new pt(Math.min(100,this.l+Wo*(arguments.length?t:1)),this.a,this.b)},$o.darker=function(t){return new pt(Math.max(0,this.l-Wo*(arguments.length?t:1)),this.a,this.b)},$o.rgb=function(){return dt(this.l,this.a,this.b)},no.rgb=bt;var Jo=bt.prototype=new lt;Jo.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&i>e&&(e=i),r&&i>r&&(r=i),n&&i>n&&(n=i),new bt(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new bt(i,i,i)},Jo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new bt(t*this.r,t*this.g,t*this.b)},Jo.hsl=function(){return kt(this.r,this.g,this.b)},Jo.toString=function(){return"#"+wt(this.r)+wt(this.g)+wt(this.b)};var ts=no.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ts.forEach(function(t,e){ts.set(t,xt(e))}),no.functor=Lt,no.xhr=St(x),no.dsv=function(t,e){function r(t,r,a){arguments.length<3&&(a=r,r=null);var o=Ct(t,e,null==r?n:i(r),a);return o.row=function(t){return arguments.length?o.response(null==(r=t)?n:i(t)):r},o}function n(t){return r.parse(t.responseText)}function i(t){return function(e){return r.parse(e.responseText,t)}}function a(e){return e.map(o).join(t)}function o(t){return s.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var s=new RegExp('["'+t+"\n]"),l=t.charCodeAt(0);return r.parse=function(t,e){var n;return r.parseRows(t,function(t,r){if(n)return n(t,r-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");n=e?function(t,r){return e(i(t),r)}:i})},r.parseRows=function(t,e){function r(){if(c>=u)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++c;){var n=t.charCodeAt(c++),s=1;if(10===n)i=!0;else if(13===n)i=!0,10===t.charCodeAt(c)&&(++c,++s);else if(n!==l)continue;return t.slice(e,c-s)}return t.slice(e)}for(var n,i,a={},o={},s=[],u=t.length,c=0,f=0;(n=r())!==o;){for(var h=[];n!==a&&n!==o;)h.push(n),n=r();e&&null==(h=e(h,f++))||s.push(h)}return s},r.format=function(e){if(Array.isArray(e[0]))return r.formatRows(e);var n=new b,i=[];return e.forEach(function(t){for(var e in t)n.has(e)||i.push(n.add(e))}),[i.map(o).join(t)].concat(e.map(function(e){return i.map(function(t){return o(e[t])}).join(t)})).join("\n")},r.formatRows=function(t){return t.map(a).join("\n")},r},no.csv=no.dsv(",","text/csv"),no.tsv=no.dsv(" ","text/tab-separated-values");var es,rs,ns,is,as,os=this[w(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};no.timer=function(t,e,r){var n=arguments.length;2>n&&(e=0),3>n&&(r=Date.now());var i=r+e,a={c:t,t:i,f:!1,n:null};rs?rs.n=a:es=a,rs=a,ns||(is=clearTimeout(is),ns=1,os(Rt))},no.timer.flush=function(){jt(),It()},no.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var ss=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Nt);no.formatPrefix=function(t,e){var r=0;return t&&(0>t&&(t*=-1),e&&(t=no.round(t,Ot(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),ss[8+r/3]};var ls=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,us=no.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=no.round(t,Ot(t,e))).toFixed(Math.max(0,Math.min(20,Ot(t*(1+1e-15),e))))}}),cs=no.time={},fs=Date;Bt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){hs.setUTCDate.apply(this._,arguments)},setDay:function(){hs.setUTCDay.apply(this._,arguments)},setFullYear:function(){hs.setUTCFullYear.apply(this._,arguments)},setHours:function(){hs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){hs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){hs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){hs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){hs.setUTCSeconds.apply(this._,arguments)},setTime:function(){hs.setTime.apply(this._,arguments)}};var hs=Date.prototype;cs.year=Ut(function(t){return t=cs.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),cs.years=cs.year.range,cs.years.utc=cs.year.utc.range,cs.day=Ut(function(t){var e=new fs(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),cs.days=cs.day.range,cs.days.utc=cs.day.utc.range,cs.dayOfYear=function(t){var e=cs.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=cs[t]=Ut(function(t){return(t=cs.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=cs.year(t).getDay();return Math.floor((cs.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});cs[t+"s"]=r.range,cs[t+"s"].utc=r.utc.range,cs[t+"OfYear"]=function(t){var r=cs.year(t).getDay();return Math.floor((cs.dayOfYear(t)+(r+e)%7)/7)}}),cs.week=cs.sunday,cs.weeks=cs.sunday.range,cs.weeks.utc=cs.sunday.utc.range,cs.weekOfYear=cs.sundayOfYear;var ps={"-":"",_:" ",0:"0"},ds=/^\s*\d+/,gs=/^%/;no.locale=function(t){return{numberFormat:Ft(t),timeFormat:qt(t)}};var ms=no.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});no.format=ms.numberFormat,no.geo={},ce.prototype={s:0,t:0,add:function(t){fe(t,this.t,vs),fe(vs.s,this.s,this),this.s?this.t+=vs.t:this.s=vs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var vs=new ce;no.geo.stream=function(t,e){t&&ys.hasOwnProperty(t.type)?ys[t.type](t,e):he(t,e)};var ys={Feature:function(t,e){he(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++nt?4*jo+t:t,ws.lineStart=ws.lineEnd=ws.point=A}};no.geo.bounds=function(){function t(t,e){b.push(x=[c=t,h=t]),f>e&&(f=e),e>p&&(p=e)}function e(e,r){var n=me([e*Fo,r*Fo]);if(v){var i=ye(v,n),a=[i[1],-i[0],0],o=ye(a,i);_e(o),o=we(o);var l=e-d,u=l>0?1:-1,g=o[0]*Do*u,m=mo(l)>180;if(m^(g>u*d&&u*e>g)){var y=o[1]*Do;y>p&&(p=y)}else if(g=(g+360)%360-180,m^(g>u*d&&u*e>g)){var y=-o[1]*Do;f>y&&(f=y)}else f>r&&(f=r),r>p&&(p=r);m?d>e?s(c,e)>s(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e):h>=c?(c>e&&(c=e),e>h&&(h=e)):e>d?s(c,e)>s(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e)}else t(e,r);v=n,d=e}function r(){_.point=e}function n(){x[0]=c,x[1]=h,_.point=t,v=null}function i(t,r){if(v){var n=t-d;y+=mo(n)>180?n+(n>0?360:-360):n}else g=t,m=r;ws.point(t,r),e(t,r)}function a(){ws.lineStart()}function o(){i(g,m),ws.lineEnd(),mo(y)>zo&&(c=-(h=180)),x[0]=c,x[1]=h,v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function u(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t_s?(c=-(h=180),f=-(p=90)):y>zo?p=90:-zo>y&&(f=-90),x[0]=c,x[1]=h}};return function(t){p=h=-(c=f=1/0),b=[],no.geo.stream(t,_);var e=b.length;if(e){b.sort(l);for(var r,n=1,i=b[0],a=[i];e>n;++n)r=b[n],u(r[0],i)||u(r[1],i)?(s(i[0],r[1])>s(i[0],i[1])&&(i[1]=r[1]),s(r[0],i[1])>s(i[0],i[1])&&(i[0]=r[0])):a.push(i=r);for(var o,r,d=-(1/0),e=a.length-1,n=0,i=a[e];e>=n;i=r,++n)r=a[n],(o=s(i[1],r[0]))>d&&(d=o,c=r[0],h=i[1])}return b=x=null,c===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,f],[h,p]]}}(),no.geo.centroid=function(t){As=ks=Ms=Es=Ts=Ls=Ss=Cs=Ps=zs=Rs=0,no.geo.stream(t,js);var e=Ps,r=zs,n=Rs,i=e*e+r*r+n*n;return Ro>i&&(e=Ls,r=Ss,n=Cs,zo>ks&&(e=Ms,r=Es,n=Ts),i=e*e+r*r+n*n,Ro>i)?[NaN,NaN]:[Math.atan2(r,e)*Do,nt(n/Math.sqrt(i))*Do]};var As,ks,Ms,Es,Ts,Ls,Ss,Cs,Ps,zs,Rs,js={sphere:A,point:ke,lineStart:Ee,lineEnd:Te,polygonStart:function(){js.lineStart=Le},polygonEnd:function(){js.lineStart=Ee}},Is=je(Ce,Fe,Be,[-jo,-jo/2]),Os=1e9;no.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),i=a(t),i.valid=!0,i},extent:function(s){return arguments.length?(a=Ge(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(no.geo.conicEqualArea=function(){return He(Ye)}).raw=Ye,no.geo.albers=function(){return no.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},no.geo.albersUsa=function(){function t(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}var e,r,n,i,a=no.geo.albers(),o=no.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=no.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};return t.invert=function(t){var e=a.scale(),r=a.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&.234>i&&n>=-.425&&-.214>n?o:i>=.166&&.234>i&&n>=-.214&&-.115>n?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var u=a.scale(),c=+e[0],f=+e[1];return r=a.translate(e).clipExtent([[c-.455*u,f-.238*u],[c+.455*u,f+.238*u]]).stream(l).point,n=o.translate([c-.307*u,f+.201*u]).clipExtent([[c-.425*u+zo,f+.12*u+zo],[c-.214*u-zo,f+.234*u-zo]]).stream(l).point,i=s.translate([c-.205*u,f+.212*u]).clipExtent([[c-.214*u+zo,f+.166*u+zo],[c-.115*u-zo,f+.234*u-zo]]).stream(l).point,t},t.scale(1070)};var Ns,Fs,Ds,Bs,Us,Vs,qs={point:A,lineStart:A,lineEnd:A,polygonStart:function(){Fs=0,qs.lineStart=Xe},polygonEnd:function(){qs.lineStart=qs.lineEnd=qs.point=A,Ns+=mo(Fs/2)}},Gs={point:We,lineStart:A,lineEnd:A,polygonStart:A,polygonEnd:A},Hs={point:Ke,lineStart:$e,lineEnd:Je,polygonStart:function(){Hs.lineStart=tr},polygonEnd:function(){Hs.point=Ke,Hs.lineStart=$e,Hs.lineEnd=Je}};no.geo.path=function(){function t(t){return t&&("function"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),no.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Ns=0,no.geo.stream(t,i(qs)),Ns},t.centroid=function(t){return Ms=Es=Ts=Ls=Ss=Cs=Ps=zs=Rs=0,no.geo.stream(t,i(Hs)),Rs?[Ps/Rs,zs/Rs]:Cs?[Ls/Cs,Ss/Cs]:Ts?[Ms/Ts,Es/Ts]:[NaN,NaN]},t.bounds=function(t){return Us=Vs=-(Ds=Bs=1/0),no.geo.stream(t,i(Gs)),[[Ds,Bs],[Us,Vs]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||nr(t):x,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new Ze:new er(t),"function"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection(no.geo.albersUsa()).context(null)},no.geo.transform=function(t){return{stream:function(e){var r=new ir(e);for(var n in t)r[n]=t[n];return r}}},ir.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},no.geo.projection=or,no.geo.projectionMutator=sr,(no.geo.equirectangular=function(){return or(ur)}).raw=ur.invert=ur,no.geo.rotation=function(t){function e(e){return e=t(e[0]*Fo,e[1]*Fo),e[0]*=Do,e[1]*=Do,e}return t=fr(t[0]%360*Fo,t[1]*Fo,t.length>2?t[2]*Fo:0),e.invert=function(e){return e=t.invert(e[0]*Fo,e[1]*Fo),e[0]*=Do,e[1]*=Do,e},e},cr.invert=ur,no.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=fr(-t[0]*Fo,-t[1]*Fo,0).invert,i=[]; -return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=Do,t[1]*=Do}}),{type:"Polygon",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=gr((e=+n)*Fo,i*Fo),t):e},t.precision=function(n){return arguments.length?(r=gr(e*Fo,(i=+n)*Fo),t):i},t.angle(90)},no.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Fo,i=t[1]*Fo,a=e[1]*Fo,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),u=Math.cos(i),c=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=u*c-l*f*s)*r),l*c+u*f*s)},no.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return no.range(Math.ceil(a/m)*m,i,m).map(h).concat(no.range(Math.ceil(u/v)*v,l,v).map(p)).concat(no.range(Math.ceil(n/d)*d,r,d).filter(function(t){return mo(t%m)>zo}).map(c)).concat(no.range(Math.ceil(s/g)*g,o,g).filter(function(t){return mo(t%v)>zo}).map(f))}var r,n,i,a,o,s,l,u,c,f,h,p,d=10,g=d,m=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(p(l).slice(1),h(i).reverse().slice(1),p(u).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],u=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),u>l&&(e=u,u=l,l=e),t.precision(y)):[[a,u],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(m=+e[0],v=+e[1],t):[m,v]},t.minorStep=function(e){return arguments.length?(d=+e[0],g=+e[1],t):[d,g]},t.precision=function(e){return arguments.length?(y=+e,c=vr(s,o,90),f=yr(n,r,y),h=vr(u,l,90),p=yr(a,i,y),t):y},t.majorExtent([[-180,-90+zo],[180,90-zo]]).minorExtent([[-180,-80-zo],[180,80+zo]])},no.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=br,i=xr;return t.distance=function(){return no.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},no.geo.interpolate=function(t,e){return _r(t[0]*Fo,t[1]*Fo,e[0]*Fo,e[1]*Fo)},no.geo.length=function(t){return Ys=0,no.geo.stream(t,Xs),Ys};var Ys,Xs={sphere:A,point:A,lineStart:wr,lineEnd:A,polygonStart:A,polygonEnd:A},Ws=Ar(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(no.geo.azimuthalEqualArea=function(){return or(Ws)}).raw=Ws;var Zs=Ar(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},x);(no.geo.azimuthalEquidistant=function(){return or(Zs)}).raw=Zs,(no.geo.conicConformal=function(){return He(kr)}).raw=kr,(no.geo.conicEquidistant=function(){return He(Mr)}).raw=Mr;var Qs=Ar(function(t){return 1/t},Math.atan);(no.geo.gnomonic=function(){return or(Qs)}).raw=Qs,Er.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-No]},(no.geo.mercator=function(){return Tr(Er)}).raw=Er;var Ks=Ar(function(){return 1},Math.asin);(no.geo.orthographic=function(){return or(Ks)}).raw=Ks;var $s=Ar(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(no.geo.stereographic=function(){return or($s)}).raw=$s,Lr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-No]},(no.geo.transverseMercator=function(){var t=Tr(Lr),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=Lr,no.geom={},no.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=Lt(r),a=Lt(n),o=t.length,s=[],l=[];for(e=0;o>e;e++)s.push([+i.call(this,t[e],e),+a.call(this,t[e],e),e]);for(s.sort(zr),e=0;o>e;e++)l.push([s[e][0],-s[e][1]]);var u=Pr(s),c=Pr(l),f=c[0]===u[0],h=c[c.length-1]===u[u.length-1],p=[];for(e=u.length-1;e>=0;--e)p.push(t[s[u[e]][2]]);for(e=+f;e=n&&u.x<=a&&u.y>=i&&u.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[];c.point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/zo)*zo,y:Math.round(o(t,e)/zo)*zo,i:e}})}var n=Sr,i=Cr,a=n,o=i,s=sl;return t?e(t):(e.links=function(t){return ln(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return ln(r(t)).cells.forEach(function(r,n){for(var i,a,o=r.site,s=r.edges.sort(Hr),l=-1,u=s.length,c=s[u-1].edge,f=c.l===o?c.r:c.l;++l=u,h=n>=c,p=h<<1|f;t.leaf=!1,t=t.nodes[p]||(t.nodes[p]=pn()),f?i=u:s=u,h?o=c:l=c,a(t,e,r,n,i,o,s,l)}var c,f,h,p,d,g,m,v,y,b=Lt(s),x=Lt(l);if(null!=e)g=e,m=r,v=n,y=i;else if(v=y=-(g=m=1/0),f=[],h=[],d=t.length,o)for(p=0;d>p;++p)c=t[p],c.xv&&(v=c.x),c.y>y&&(y=c.y),f.push(c.x),h.push(c.y);else for(p=0;d>p;++p){var _=+b(c=t[p],p),w=+x(c,p);g>_&&(g=_),m>w&&(m=w),_>v&&(v=_),w>y&&(y=w),f.push(_),h.push(w)}var A=v-g,k=y-m;A>k?y=m+A:v=g+k;var M=pn();if(M.add=function(t){a(M,t,+b(t,++p),+x(t,p),g,m,v,y)},M.visit=function(t){dn(t,M,g,m,v,y)},M.find=function(t){return gn(M,t[0],t[1],g,m,v,y)},p=-1,null==e){for(;++p=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=fl.get(r)||cl,n=hl.get(n)||x,wn(n(r.apply(null,io.call(arguments,1))))},no.interpolateHcl=In,no.interpolateHsl=On,no.interpolateLab=Nn,no.interpolateRound=Fn,no.transform=function(t){var e=oo.createElementNS(no.ns.prefix.svg,"g");return(no.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Dn(r?r.matrix:pl)})(t)},Dn.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var pl={a:1,b:0,c:0,d:1,e:0,f:0};no.interpolateTransform=qn,no.layout={},no.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++rs*s/m){if(d>l){var u=e.charge/l;t.px-=a*u,t.py-=o*u}return!0}if(e.point&&l&&d>l){var u=e.pointCharge/l;t.px-=a*u,t.py-=o*u}}return!e.charge}}function e(t){t.px=no.event.x,t.py=no.event.y,s.resume()}var r,n,i,a,o,s={},l=no.dispatch("start","tick","end"),u=[1,1],c=.9,f=dl,h=gl,p=-30,d=ml,g=.1,m=.64,v=[],y=[];return s.tick=function(){if((n*=.99)<.005)return l.end({type:"end",alpha:n=0}),!0;var e,r,s,f,h,d,m,b,x,_=v.length,w=y.length;for(r=0;w>r;++r)s=y[r],f=s.source,h=s.target,b=h.x-f.x,x=h.y-f.y,(d=b*b+x*x)&&(d=n*a[r]*((d=Math.sqrt(d))-i[r])/d,b*=d,x*=d,h.x-=b*(m=f.weight/(h.weight+f.weight)),h.y-=x*m,f.x+=b*(m=1-m),f.y+=x*m);if((m=n*g)&&(b=u[0]/2,x=u[1]/2,r=-1,m))for(;++r<_;)s=v[r],s.x+=(b-s.x)*m,s.y+=(x-s.y)*m;if(p)for(Jn(e=no.geom.quadtree(v),n,o),r=-1;++r<_;)(s=v[r]).fixed||e.visit(t(s));for(r=-1;++r<_;)s=v[r],s.fixed?(s.x=s.px,s.y=s.py):(s.x-=(s.px-(s.px=s.x))*c,s.y-=(s.py-(s.py=s.y))*c);l.tick({type:"tick",alpha:n})},s.nodes=function(t){return arguments.length?(v=t,s):v},s.links=function(t){return arguments.length?(y=t,s):y},s.size=function(t){return arguments.length?(u=t,s):u},s.linkDistance=function(t){return arguments.length?(f="function"==typeof t?t:+t,s):f},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.friction=function(t){return arguments.length?(c=+t,s):c},s.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,s):p},s.chargeDistance=function(t){return arguments.length?(d=t*t,s):Math.sqrt(d)},s.gravity=function(t){return arguments.length?(g=+t,s):g},s.theta=function(t){return arguments.length?(m=t*t,s):Math.sqrt(m)},s.alpha=function(t){return arguments.length?(t=+t,n?n=t>0?t:0:t>0&&(l.start({type:"start",alpha:n=t}),no.timer(s.tick)),s):n},s.start=function(){function t(t,n){if(!r){for(r=new Array(l),s=0;l>s;++s)r[s]=[];for(s=0;c>s;++s){var i=y[s];r[i.source.index].push(i.target),r[i.target.index].push(i.source)}}for(var a,o=r[e],s=-1,u=o.length;++se;++e)(n=v[e]).index=e,n.weight=0;for(e=0;c>e;++e)n=y[e],"number"==typeof n.source&&(n.source=v[n.source]),"number"==typeof n.target&&(n.target=v[n.target]),++n.source.weight,++n.target.weight;for(e=0;l>e;++e)n=v[e],isNaN(n.x)&&(n.x=t("x",d)),isNaN(n.y)&&(n.y=t("y",g)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(i=[],"function"==typeof f)for(e=0;c>e;++e)i[e]=+f.call(this,y[e],e);else for(e=0;c>e;++e)i[e]=f;if(a=[],"function"==typeof h)for(e=0;c>e;++e)a[e]=+h.call(this,y[e],e);else for(e=0;c>e;++e)a[e]=h;if(o=[],"function"==typeof p)for(e=0;l>e;++e)o[e]=+p.call(this,v[e],e);else for(e=0;l>e;++e)o[e]=p;return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){return r||(r=no.behavior.drag().origin(x).on("dragstart.force",Zn).on("drag.force",e).on("dragend.force",Qn)),arguments.length?void this.on("mouseover.force",Kn).on("mouseout.force",$n).call(r):r},no.rebind(s,l,"on")};var dl=20,gl=1,ml=1/0;no.layout.hierarchy=function(){function t(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(u=r.call(t,a,a.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;n&&(a.value=0),a.children=u}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return ri(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=ai,r=ni,n=ii;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(ei(e,function(t){t.children&&(t.value=0)}),ri(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},no.layout.partition=function(){function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++uf?-1:1),d=(f-l*p)/no.sum(u),g=no.range(l),m=[];return null!=r&&g.sort(r===vl?function(t,e){return u[e]-u[t]}:function(t,e){return r(o[t],o[e])}),g.forEach(function(t){m[t]={data:o[t],value:s=u[t],startAngle:c,endAngle:c+=s*d+p,padAngle:h}}),m}var e=Number,r=vl,n=0,i=Io,a=0;return t.value=function(r){return arguments.length?(e=r,t):e},t.sort=function(e){return arguments.length?(r=e,t):r},t.startAngle=function(e){return arguments.length?(n=e,t):n},t.endAngle=function(e){return arguments.length?(i=e,t):i},t.padAngle=function(e){return arguments.length?(a=e,t):a},t};var vl={};no.layout.stack=function(){function t(s,l){if(!(h=s.length))return s;var u=s.map(function(r,n){return e.call(t,r,n)}),c=u.map(function(e){return e.map(function(e,r){return[a.call(t,e,r),o.call(t,e,r)]})}),f=r.call(t,c,l);u=no.permute(u,f),c=no.permute(c,f);var h,p,d,g,m=n.call(t,c,l),v=u[0].length;for(d=0;v>d;++d)for(i.call(t,u[0][d],g=m[d],c[0][d][1]),p=1;h>p;++p)i.call(t,u[p][d],g+=c[p-1][d][1],c[p][d][1]);return s}var e=x,r=ci,n=fi,i=ui,a=si,o=li;return t.values=function(r){return arguments.length?(e=r,t):e},t.order=function(e){return arguments.length?(r="function"==typeof e?e:yl.get(e)||ci,t):r},t.offset=function(e){return arguments.length?(n="function"==typeof e?e:bl.get(e)||fi,t):n},t.x=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(o=e,t):o},t.out=function(e){return arguments.length?(i=e,t):i},t};var yl=no.map({"inside-out":function(t){var e,r,n=t.length,i=t.map(hi),a=t.map(pi),o=no.range(n).sort(function(t,e){return i[t]-i[e]}),s=0,l=0,u=[],c=[];for(e=0;n>e;++e)r=o[e],l>s?(s+=a[r],u.push(r)):(l+=a[r],c.push(r));return c.reverse().concat(u)},reverse:function(t){return no.range(t.length).reverse()},"default":ci}),bl=no.map({silhouette:function(t){var e,r,n,i=t.length,a=t[0].length,o=[],s=0,l=[];for(r=0;a>r;++r){for(e=0,n=0;i>e;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;a>r;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,i,a,o,s,l,u,c=t.length,f=t[0],h=f.length,p=[];for(p[0]=l=u=0,r=1;h>r;++r){for(e=0,i=0;c>e;++e)i+=t[e][r][1];for(e=0,a=0,s=f[r][0]-f[r-1][0];c>e;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);e>n;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;a+=o*t[e][r][1]}p[r]=l-=i?a/i*s:0,u>l&&(u=l)}for(r=0;h>r;++r)p[r]-=u;return p},expand:function(t){var e,r,n,i=t.length,a=t[0].length,o=1/i,s=[];for(r=0;a>r;++r){for(e=0,n=0;i>e;e++)n+=t[e][r][1];if(n)for(e=0;i>e;e++)t[e][r][1]/=n;else for(e=0;i>e;e++)t[e][r][1]=o}for(r=0;a>r;++r)s[r]=0;return s},zero:fi});no.layout.histogram=function(){function t(t,a){for(var o,s,l=[],u=t.map(r,this),c=n.call(this,u,a),f=i.call(this,c,u,a),a=-1,h=u.length,p=f.length-1,d=e?1:1/h;++a0)for(a=-1;++a=c[0]&&s<=c[1]&&(o=l[no.bisect(f,s,1,p)-1],o.y+=d,o.push(t[a]));return l}var e=!0,r=Number,n=vi,i=gi;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=Lt(e),t):n},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return mi(t,e)}:Lt(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},no.layout.pack=function(){function t(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,ri(s,function(t){t.r=+c(t.value)}),ri(s,wi),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;ri(s,function(t){t.r+=f}),ri(s,wi),ri(s,function(t){t.r-=f})}return Mi(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}var e,r=no.layout.hierarchy().sort(yi),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},ti(t,r)},no.layout.tree=function(){function t(t,i){var c=o.call(this,t,i),f=c[0],h=e(f);if(ri(h,r),h.parent.m=-h.z,ei(h,n),u)ei(f,a);else{var p=f,d=f,g=f;ei(f,function(t){t.xd.x&&(d=t),t.depth>g.depth&&(g=t)});var m=s(p,d)/2-p.x,v=l[0]/(d.x+s(d,p)/2+m),y=l[1]/(g.depth||1);ei(f,function(t){t.x=(t.x+m)*v,t.y=t.depth*y})}return c}function e(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;s>o;++o)n.push((a[o]=i={_:a[o],parent:e,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}function r(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.length){Pi(t);var a=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+s(t._,n._),t.m=t.z-a):t.z=a}else n&&(t.z=n.z+s(t._,n._));t.parent.A=i(t,n,t.parent.A||r[0])}function n(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,r){if(e){for(var n,i=t,a=t,o=e,l=i.parent.children[0],u=i.m,c=a.m,f=o.m,h=l.m;o=Si(o),i=Li(i),o&&i;)l=Li(l),a=Si(a),a.a=t,n=o.z+f-i.z-u+s(o._,i._),n>0&&(Ci(zi(o,t,r),t,n),u+=n,c+=n),f+=o.m,u+=i.m,h+=l.m,c+=a.m;o&&!Si(a)&&(a.t=o,a.m+=f-c),i&&!Li(l)&&(l.t=i,l.m+=u-h,r=t)}return r}function a(t){t.x*=l[0],t.y=t.depth*l[1]}var o=no.layout.hierarchy().sort(null).value(null),s=Ti,l=[1,1],u=null;return t.separation=function(e){return arguments.length?(s=e,t):s},t.size=function(e){return arguments.length?(u=null==(l=e)?a:null,t):u?null:l},t.nodeSize=function(e){return arguments.length?(u=null==(l=e)?null:a,t):u?l:null},ti(t,o)},no.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],u=0;ri(l,function(t){var e=t.children;e&&e.length?(t.x=ji(e),t.y=Ri(e)):(t.x=o?u+=r(t,o):0,t.y=0,o=t)});var c=Ii(l),f=Oi(l),h=c.x-r(c,f)/2,p=f.x+r(f,c)/2;return ri(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-h)/(p-h)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=no.layout.hierarchy().sort(null).value(null),r=Ti,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},ti(t,e)},no.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++ie?0:e),r.area=isNaN(n)||0>=n?0:n}function e(r){var a=r.children;if(a&&a.length){var o,s,l,u=f(r),c=[],h=a.slice(),d=1/0,g="slice"===p?u.dx:"dice"===p?u.dy:"slice-dice"===p?1&r.depth?u.dy:u.dx:Math.min(u.dx,u.dy);for(t(h,u.dx*u.dy/r.value),c.area=0;(l=h.length)>0;)c.push(o=h[l-1]),c.area+=o.area,"squarify"!==p||(s=n(c,g))<=d?(h.pop(),d=s):(c.area-=c.pop().area,i(c,g,u,!1),g=Math.min(u.dx,u.dy),c.length=c.area=0,d=1/0);c.length&&(i(c,g,u,!0),c.length=c.area=0),a.forEach(e)}}function r(e){var n=e.children;if(n&&n.length){var a,o=f(e),s=n.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(i(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);n.forEach(r)}}function n(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++or&&(a=r),r>i&&(i=r));return n*=n,e*=e,n?Math.max(e*i*d/n,n/(e*a*d)):1/0}function i(t,e,r,n){var i,a=-1,o=t.length,s=r.x,u=r.y,c=e?l(t.area/e):0;if(e==r.dx){for((n||c>r.dy)&&(c=r.dy);++ar.dx)&&(c=r.dx);++ar&&(e=1),1>r&&(t=0),function(){var r,n,i;do r=2*Math.random()-1,n=2*Math.random()-1,i=r*r+n*n;while(!i||i>1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=no.random.normal.apply(no,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=no.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;t>r;r++)e+=Math.random();return e}}},no.scale={};var xl={floor:x,ceil:x};no.scale.linear=function(){return Hi([0,1],[0,1],xn,!1)};var _l={s:1,g:1,p:1,r:1,e:1};no.scale.log=function(){return Ji(no.scale.linear().domain([0,1]),10,!0,[1,10])};var wl=no.format(".0e"),Al={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};no.scale.pow=function(){return ta(no.scale.linear(),1,[0,1])},no.scale.sqrt=function(){return no.scale.pow().exponent(.5)},no.scale.ordinal=function(){return ra([],{t:"range",a:[[]]})},no.scale.category10=function(){return no.scale.ordinal().range(kl)},no.scale.category20=function(){return no.scale.ordinal().range(Ml)},no.scale.category20b=function(){return no.scale.ordinal().range(El)},no.scale.category20c=function(){return no.scale.ordinal().range(Tl)};var kl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),Ml=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),El=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),Tl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_t);no.scale.quantile=function(){return na([],[])},no.scale.quantize=function(){return ia(0,1,[0,1])},no.scale.threshold=function(){return aa([.5],[0,1])},no.scale.identity=function(){return oa([0,1])},no.svg={},no.svg.arc=function(){function t(){var t=Math.max(0,+r.apply(this,arguments)),u=Math.max(0,+n.apply(this,arguments)),c=o.apply(this,arguments)-No,f=s.apply(this,arguments)-No,h=Math.abs(f-c),p=c>f?0:1;if(t>u&&(d=u,u=t,t=d),h>=Oo)return e(u,p)+(t?e(t,1-p):"")+"Z";var d,g,m,v,y,b,x,_,w,A,k,M,E=0,T=0,L=[];if((v=(+l.apply(this,arguments)||0)/2)&&(m=a===Ll?Math.sqrt(t*t+u*u):+a.apply(this,arguments),p||(T*=-1),u&&(T=nt(m/u*Math.sin(v))),t&&(E=nt(m/t*Math.sin(v)))),u){y=u*Math.cos(c+T),b=u*Math.sin(c+T),x=u*Math.cos(f-T),_=u*Math.sin(f-T);var S=Math.abs(f-c-2*T)<=jo?0:1;if(T&&pa(y,b,x,_)===p^S){var C=(c+f)/2;y=u*Math.cos(C),b=u*Math.sin(C),x=_=null}}else y=b=0;if(t){w=t*Math.cos(f-E),A=t*Math.sin(f-E),k=t*Math.cos(c+E),M=t*Math.sin(c+E);var P=Math.abs(c-f+2*E)<=jo?0:1;if(E&&pa(w,A,k,M)===1-p^P){var z=(c+f)/2;w=t*Math.cos(z),A=t*Math.sin(z),k=M=null}}else w=A=0;if((d=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){g=u>t^p?0:1;var R=null==k?[w,A]:null==x?[y,b]:jr([y,b],[k,M],[x,_],[w,A]),j=y-R[0],I=b-R[1],O=x-R[0],N=_-R[1],F=1/Math.sin(Math.acos((j*O+I*N)/(Math.sqrt(j*j+I*I)*Math.sqrt(O*O+N*N)))/2),D=Math.sqrt(R[0]*R[0]+R[1]*R[1]);if(null!=x){var B=Math.min(d,(u-D)/(F+1)),U=da(null==k?[w,A]:[k,M],[y,b],u,B,p),V=da([x,_],[w,A],u,B,p);d===B?L.push("M",U[0],"A",B,",",B," 0 0,",g," ",U[1],"A",u,",",u," 0 ",1-p^pa(U[1][0],U[1][1],V[1][0],V[1][1]),",",p," ",V[1],"A",B,",",B," 0 0,",g," ",V[0]):L.push("M",U[0],"A",B,",",B," 0 1,",g," ",V[0])}else L.push("M",y,",",b);if(null!=k){var q=Math.min(d,(t-D)/(F-1)),G=da([y,b],[k,M],t,-q,p),H=da([w,A],null==x?[y,b]:[x,_],t,-q,p);d===q?L.push("L",H[0],"A",q,",",q," 0 0,",g," ",H[1],"A",t,",",t," 0 ",p^pa(H[1][0],H[1][1],G[1][0],G[1][1]),",",1-p," ",G[1],"A",q,",",q," 0 0,",g," ",G[0]):L.push("L",H[0],"A",q,",",q," 0 0,",g," ",G[0])}else L.push("L",w,",",A)}else L.push("M",y,",",b),null!=x&&L.push("A",u,",",u," 0 ",S,",",p," ",x,",",_),L.push("L",w,",",A),null!=k&&L.push("A",t,",",t," 0 ",P,",",1-p," ",k,",",M);return L.push("Z"),L.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var r=la,n=ua,i=sa,a=Ll,o=ca,s=fa,l=ha;return t.innerRadius=function(e){return arguments.length?(r=Lt(e),t):r},t.outerRadius=function(e){return arguments.length?(n=Lt(e),t):n},t.cornerRadius=function(e){return arguments.length?(i=Lt(e),t):i},t.padRadius=function(e){return arguments.length?(a=e==Ll?Ll:Lt(e),t):a},t.startAngle=function(e){return arguments.length?(o=Lt(e),t):o},t.endAngle=function(e){return arguments.length?(s=Lt(e),t):s},t.padAngle=function(e){return arguments.length?(l=Lt(e),t):l},t.centroid=function(){var t=(+r.apply(this,arguments)+ +n.apply(this,arguments))/2,e=(+o.apply(this,arguments)+ +s.apply(this,arguments))/2-No;return[Math.cos(e)*t,Math.sin(e)*t]},t};var Ll="auto";no.svg.line=function(){return ga(x)};var Sl=no.map({linear:ma,"linear-closed":va,step:ya,"step-before":ba,"step-after":xa,basis:Ea,"basis-open":Ta,"basis-closed":La,bundle:Sa,cardinal:Aa,"cardinal-open":_a,"cardinal-closed":wa,monotone:Ia});Sl.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Cl=[0,2/3,1/3,0],Pl=[0,1/3,2/3,0],zl=[0,1/6,2/3,1/6];no.svg.line.radial=function(){var t=ga(Oa);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},ba.reverse=xa,xa.reverse=ba,no.svg.area=function(){return Na(x)},no.svg.area.radial=function(){var t=Na(Oa);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},no.svg.chord=function(){function t(t,s){var l=e(this,a,t,s),u=e(this,o,t,s);return"M"+l.p0+n(l.r,l.p1,l.a1-l.a0)+(r(l,u)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,u.r,u.p0)+n(u.r,u.p1,u.a1-u.a0)+i(u.r,u.p1,l.r,l.p0))+"Z"}function e(t,e,r,n){var i=e.call(t,r,n),a=s.call(t,i,n),o=l.call(t,i,n)-No,c=u.call(t,i,n)-No;return{r:a,a0:o,a1:c,p0:[a*Math.cos(o),a*Math.sin(o)],p1:[a*Math.cos(c),a*Math.sin(c)]}}function r(t,e){return t.a0==e.a0&&t.a1==e.a1}function n(t,e,r){return"A"+t+","+t+" 0 "+ +(r>jo)+",1 "+e}function i(t,e,r,n){return"Q 0,0 "+n}var a=br,o=xr,s=Fa,l=ca,u=fa;return t.radius=function(e){return arguments.length?(s=Lt(e),t):s},t.source=function(e){return arguments.length?(a=Lt(e),t):a},t.target=function(e){return arguments.length?(o=Lt(e),t):o},t.startAngle=function(e){return arguments.length?(l=Lt(e),t):l},t.endAngle=function(e){return arguments.length?(u=Lt(e),t):u},t},no.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return l=l.map(n),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=br,r=xr,n=Da;return t.source=function(r){ -return arguments.length?(e=Lt(r),t):e},t.target=function(e){return arguments.length?(r=Lt(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},no.svg.diagonal.radial=function(){var t=no.svg.diagonal(),e=Da,r=t.projection;return t.projection=function(t){return arguments.length?r(Ba(e=t)):e},t},no.svg.symbol=function(){function t(t,n){return(Rl.get(e.call(this,t,n))||qa)(r.call(this,t,n))}var e=Va,r=Ua;return t.type=function(r){return arguments.length?(e=Lt(r),t):e},t.size=function(e){return arguments.length?(r=Lt(e),t):r},t};var Rl=no.map({circle:qa,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Il)),r=e*Il;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/jl),r=e*jl/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/jl),r=e*jl/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});no.svg.symbolTypes=Rl.keys();var jl=Math.sqrt(3),Il=Math.tan(30*Fo);Mo.transition=function(t){for(var e,r,n=Ol||++Bl,i=Wa(t),a=[],o=Nl||{time:Date.now(),ease:Tn,delay:0,duration:250},s=-1,l=this.length;++sa;a++){i.push(e=[]);for(var r=this[a],s=0,l=r.length;l>s;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return Ha(i,this.namespace,this.id)},Dl.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):H(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},Dl.attr=function(t,e){function r(){this.removeAttribute(s)}function n(){this.removeAttributeNS(s.space,s.local)}function i(t){return null==t?r:(t+="",function(){var e,r=this.getAttribute(s);return r!==t&&(e=o(r,t),function(t){this.setAttribute(s,e(t))})})}function a(t){return null==t?n:(t+="",function(){var e,r=this.getAttributeNS(s.space,s.local);return r!==t&&(e=o(r,t),function(t){this.setAttributeNS(s.space,s.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var o="transform"==t?qn:xn,s=no.ns.qualify(t);return Ya(this,"attr."+t,e,s.local?a:i)},Dl.attrTween=function(t,e){function r(t,r){var n=e.call(this,t,r,this.getAttribute(i));return n&&function(t){this.setAttribute(i,n(t))}}function n(t,r){var n=e.call(this,t,r,this.getAttributeNS(i.space,i.local));return n&&function(t){this.setAttributeNS(i.space,i.local,n(t))}}var i=no.ns.qualify(t);return this.tween("attr."+t,i.local?n:r)},Dl.style=function(t,e,r){function i(){this.style.removeProperty(t)}function a(e){return null==e?i:(e+="",function(){var i,a=n(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(i=xn(a,e),function(e){this.style.setProperty(t,i(e),r)})})}var o=arguments.length;if(3>o){if("string"!=typeof t){2>o&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Ya(this,"style."+t,e,a)},Dl.styleTween=function(t,e,r){function i(i,a){var o=e.call(this,i,a,n(this).getComputedStyle(this,null).getPropertyValue(t));return o&&function(e){this.style.setProperty(t,o(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,i)},Dl.text=function(t){return Ya(this,"text",t,Xa)},Dl.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Dl.ease=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].ease:("function"!=typeof t&&(t=no.ease.apply(no,arguments)),H(this,function(n){n[r][e].ease=t}))},Dl.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:H(this,"function"==typeof t?function(n,i,a){n[r][e].delay=+t.call(n,n.__data__,i,a)}:(t=+t,function(n){n[r][e].delay=t}))},Dl.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:H(this,"function"==typeof t?function(n,i,a){n[r][e].duration=Math.max(1,t.call(n,n.__data__,i,a))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},Dl.each=function(t,e){var r=this.id,n=this.namespace;if(arguments.length<2){var i=Nl,a=Ol;try{Ol=r,H(this,function(e,i,a){Nl=e[n][r],t.call(e,e.__data__,i,a)})}finally{Nl=i,Ol=a}}else H(this,function(i){var a=i[n][r];(a.event||(a.event=no.dispatch("start","end","interrupt"))).on(t,e)});return this},Dl.transition=function(){for(var t,e,r,n,i=this.id,a=++Bl,o=this.namespace,s=[],l=0,u=this.length;u>l;l++){s.push(t=[]);for(var e=this[l],c=0,f=e.length;f>c;c++)(r=e[c])&&(n=r[o][i],Za(r,c,o,a,{time:n.time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration})),t.push(r)}return Ha(s,o,a)},no.svg.axis=function(){function t(t){t.each(function(){var t,u=no.select(this),c=this.__chart__||r,f=this.__chart__=r.copy(),h=null==l?f.ticks?f.ticks.apply(f,s):f.domain():l,p=null==e?f.tickFormat?f.tickFormat.apply(f,s):x:e,d=u.selectAll(".tick").data(h,f),g=d.enter().insert("g",".domain").attr("class","tick").style("opacity",zo),m=no.transition(d.exit()).style("opacity",zo).remove(),v=no.transition(d.order()).style("opacity",1),y=Math.max(i,0)+o,b=Bi(f),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),no.transition(_));g.append("line"),g.append("text");var A,k,M,E,T=g.select("line"),L=v.select("line"),S=d.select("text").text(p),C=g.select("text"),P=v.select("text"),z="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(t=Qa,A="x",M="y",k="x2",E="y2",S.attr("dy",0>z?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+z*a+"V0H"+b[1]+"V"+z*a)):(t=Ka,A="y",M="x",k="y2",E="x2",S.attr("dy",".32em").style("text-anchor",0>z?"end":"start"),w.attr("d","M"+z*a+","+b[0]+"H0V"+b[1]+"H"+z*a)),T.attr(E,z*i),C.attr(M,z*y),L.attr(k,0).attr(E,z*i),P.attr(A,0).attr(M,z*y),f.rangeBand){var R=f,j=R.rangeBand()/2;c=f=function(t){return R(t)+j}}else c.rangeBand?c=f:m.call(t,f,c);g.call(t,c,f),v.call(t,f,f)})}var e,r=no.scale.linear(),n=Ul,i=6,a=6,o=3,s=[10],l=null;return t.scale=function(e){return arguments.length?(r=e,t):r},t.orient=function(e){return arguments.length?(n=e in Vl?e+"":Ul,t):n},t.ticks=function(){return arguments.length?(s=arguments,t):s},t.tickValues=function(e){return arguments.length?(l=e,t):l},t.tickFormat=function(r){return arguments.length?(e=r,t):e},t.tickSize=function(e){var r=arguments.length;return r?(i=+e,a=+arguments[r-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(a=+e,t):a},t.tickPadding=function(e){return arguments.length?(o=+e,t):o},t.tickSubdivide=function(){return arguments.length&&t},t};var Ul="bottom",Vl={top:1,right:1,bottom:1,left:1};no.svg.brush=function(){function t(n){n.each(function(){var n=no.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",a).on("touchstart.brush",a),o=n.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=n.selectAll(".resize").data(g,x);s.exit().remove(),s.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return ql[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),s.style("display",t.empty()?"none":null);var l,f=no.transition(n),h=no.transition(o);u&&(l=Bi(u),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(f)),c&&(l=Bi(c),h.attr("y",l[0]).attr("height",l[1]-l[0]),i(f)),e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+h[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",f[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function a(){function a(){32==no.event.keyCode&&(S||(b=null,P[0]-=f[1],P[1]-=h[1],S=2),E())}function g(){32==no.event.keyCode&&2==S&&(P[0]+=f[1],P[1]+=h[1],S=0,E())}function m(){var t=no.mouse(_),n=!1;x&&(t[0]+=x[0],t[1]+=x[1]),S||(no.event.altKey?(b||(b=[(f[0]+f[1])/2,(h[0]+h[1])/2]),P[0]=f[+(t[0]c?(i=n,n=c):i=c),g[0]!=n||g[1]!=i?(r?s=null:o=null,g[0]=n,g[1]=i,!0):void 0}function y(){m(),k.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),no.select("body").style("cursor",null),z.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),C(),A({type:"brushend"})}var b,x,_=this,w=no.select(no.event.target),A=l.of(_,arguments),k=no.select(_),M=w.datum(),T=!/^(n|s)$/.test(M)&&u,L=!/^(e|w)$/.test(M)&&c,S=w.classed("extent"),C=K(_),P=no.mouse(_),z=no.select(n(_)).on("keydown.brush",a).on("keyup.brush",g);if(no.event.changedTouches?z.on("touchmove.brush",m).on("touchend.brush",y):z.on("mousemove.brush",m).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),S)P[0]=f[0]-P[0],P[1]=h[0]-P[1];else if(M){var R=+/w$/.test(M),j=+/^n/.test(M);x=[f[1-R]-P[0],h[1-j]-P[1]],P[0]=f[R],P[1]=h[j]}else no.event.altKey&&(b=P.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),no.select("body").style("cursor",w.style("cursor")),A({type:"brushstart"}),m()}var o,s,l=L(t,"brushstart","brush","brushend"),u=null,c=null,f=[0,0],h=[0,0],p=!0,d=!0,g=Gl[0];return t.event=function(t){t.each(function(){var t=l.of(this,arguments),e={x:f,y:h,i:o,j:s},r=this.__chart__||e;this.__chart__=e,Ol?no.select(this).transition().each("start.brush",function(){o=r.i,s=r.j,f=r.x,h=r.y,t({type:"brushstart"})}).tween("brush:brush",function(){var r=_n(f,e.x),n=_n(h,e.y);return o=s=null,function(i){f=e.x=r(i),h=e.y=n(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=e.i,s=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(u=e,g=Gl[!u<<1|!c],t):u},t.y=function(e){return arguments.length?(c=e,g=Gl[!u<<1|!c],t):c},t.clamp=function(e){return arguments.length?(u&&c?(p=!!e[0],d=!!e[1]):u?p=!!e:c&&(d=!!e),t):u&&c?[p,d]:u?p:c?d:null},t.extent=function(e){var r,n,i,a,l;return arguments.length?(u&&(r=e[0],n=e[1],c&&(r=r[0],n=n[0]),o=[r,n],u.invert&&(r=u(r),n=u(n)),r>n&&(l=r,r=n,n=l),(r!=f[0]||n!=f[1])&&(f=[r,n])),c&&(i=e[0],a=e[1],u&&(i=i[1],a=a[1]),s=[i,a],c.invert&&(i=c(i),a=c(a)),i>a&&(l=i,i=a,a=l),(i!=h[0]||a!=h[1])&&(h=[i,a])),t):(u&&(o?(r=o[0],n=o[1]):(r=f[0],n=f[1],u.invert&&(r=u.invert(r),n=u.invert(n)),r>n&&(l=r,r=n,n=l))),c&&(s?(i=s[0],a=s[1]):(i=h[0],a=h[1],c.invert&&(i=c.invert(i),a=c.invert(a)),i>a&&(l=i,i=a,a=l))),u&&c?[[r,i],[n,a]]:u?[r,n]:c&&[i,a])},t.clear=function(){return t.empty()||(f=[0,0],h=[0,0],o=s=null),t},t.empty=function(){return!!u&&f[0]==f[1]||!!c&&h[0]==h[1]},no.rebind(t,l,"on")};var ql={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Gl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Hl=cs.format=ms.timeFormat,Yl=Hl.utc,Xl=Yl("%Y-%m-%dT%H:%M:%S.%LZ");Hl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?$a:Xl,$a.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},$a.toString=Xl.toString,cs.second=Ut(function(t){return new fs(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),cs.seconds=cs.second.range,cs.seconds.utc=cs.second.utc.range,cs.minute=Ut(function(t){return new fs(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),cs.minutes=cs.minute.range,cs.minutes.utc=cs.minute.utc.range,cs.hour=Ut(function(t){var e=t.getTimezoneOffset()/60;return new fs(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),cs.hours=cs.hour.range,cs.hours.utc=cs.hour.utc.range,cs.month=Ut(function(t){return t=cs.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),cs.months=cs.month.range,cs.months.utc=cs.month.utc.range;var Wl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Zl=[[cs.second,1],[cs.second,5],[cs.second,15],[cs.second,30],[cs.minute,1],[cs.minute,5],[cs.minute,15],[cs.minute,30],[cs.hour,1],[cs.hour,3],[cs.hour,6],[cs.hour,12],[cs.day,1],[cs.day,2],[cs.week,1],[cs.month,1],[cs.month,3],[cs.year,1]],Ql=Hl.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Ce]]),Kl={range:function(t,e,r){return no.range(Math.ceil(t/r)*r,+e,r).map(to)},floor:x,ceil:x};Zl.year=cs.year,cs.scale=function(){return Ja(no.scale.linear(),Zl,Ql)};var $l=Zl.map(function(t){return[t[0].utc,t[1]]}),Jl=Yl.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Ce]]);$l.year=cs.year.utc,cs.scale.utc=function(){return Ja(no.scale.linear(),$l,Jl)},no.text=St(function(t){return t.responseText}),no.json=function(t,e){return Ct(t,"application/json",eo,e)},no.html=function(t,e){return Ct(t,"text/html",ro,e)},no.xml=St(function(t){return t.responseXML}),"function"==typeof t&&t.amd?t(no):"object"==typeof r&&r.exports&&(r.exports=no),this.d3=no}()},{}],65:[function(t,e,r){arguments[4][59][0].apply(r,arguments)},{dup:59,"robust-orientation":996,"simplicial-complex":68}],66:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],67:[function(t,e,r){arguments[4][61][0].apply(r,arguments)},{dup:61}],68:[function(t,e,r){arguments[4][62][0].apply(r,arguments)},{"bit-twiddle":66,dup:62,"union-find":67}],69:[function(t,e,r){"use strict";function n(t,e){for(var r=1,n=t.length,i=t[0],a=t[0],o=1;n>o;++o)if(a=i,i=t[o],e(i,a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}function i(t){for(var e=1,r=t.length,n=t[0],i=t[0],a=1;r>a;++a,i=n)if(i=n,n=t[a],n!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}function a(t,e,r){return 0===t.length?t:e?(r||t.sort(e),n(t,e)):(r||t.sort(),i(t))}e.exports=a},{}],70:[function(t,e,r){"use strict";function n(t,e){this.point=t,this.index=e}function i(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;i>a;++a){var o=n[a]-r[a];if(o)return o}return 0}function a(t,e,r){if(1===t)return r?[[-1,0]]:[];var n=e.map(function(t,e){return[t[0],e]});n.sort(function(t,e){return t[0]-e[0]});for(var i=new Array(t-1),a=1;t>a;++a){var o=n[a-1],s=n[a];i[a-1]=[o[1],s[1]]}return r&&i.push([-1,i[0][1]],[i[t-1][1],-1]),i}function o(t,e){var r=t.length;if(0===r)return[];var o=t[0].length;if(1>o)return[];if(1===o)return a(r,t,e);for(var u=new Array(r),c=1,f=0;r>f;++f){for(var h=t[f],p=new Array(o+1),d=0,g=0;o>g;++g){var m=h[g];p[g]=m,d+=m*m}p[o]=d,u[f]=new n(p,f),c=Math.max(d,c)}l(u,i),r=u.length;for(var v=new Array(r+o+1),y=new Array(r+o+1),b=(o+1)*(o+1)*c,x=new Array(o+1),f=0;o>=f;++f)x[f]=0;x[o]=b,v[0]=x.slice(),y[0]=-1;for(var f=0;o>=f;++f){var p=x.slice();p[f]=1,v[f+1]=p,y[f+1]=-1}for(var f=0;r>f;++f){var _=u[f];v[f+o+1]=_.point,y[f+o+1]=_.index}var w=s(v,!1);if(w=e?w.filter(function(t){for(var e=0,r=0;o>=r;++r){var n=y[t[r]];if(0>n&&++e>=2)return!1;t[r]=n}return!0}):w.filter(function(t){for(var e=0;o>=e;++e){var r=y[t[e]];if(0>r)return!1;t[e]=r}return!0}),1&o)for(var f=0;ft;t+=2){var e=rt[t],r=rt[t+1];e(r),rt[t]=void 0,rt[t+1]=void 0}Z=0}function m(){try{var t=e,r=t("vertx");return H=r.runOnLoop||r.runOnContext,f()}catch(n){return d()}}function v(){}function y(){return new TypeError("You cannot resolve a promise with itself")}function b(){return new TypeError("A promises callback cannot return that same promise.")}function x(t){try{return t.then}catch(e){return ot.error=e,ot}}function _(t,e,r,n){try{t.call(e,r,n)}catch(i){return i}}function w(t,e,r){Q(function(t){var n=!1,i=_(r,e,function(r){n||(n=!0,e!==r?M(t,r):T(t,r))},function(e){n||(n=!0,L(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&i&&(n=!0,L(t,i))},t)}function A(t,e){e._state===it?T(t,e._result):e._state===at?L(t,e._result):S(e,void 0,function(e){M(t,e)},function(e){L(t,e)})}function k(t,e){if(e.constructor===t.constructor)A(t,e);else{var r=x(e);r===ot?L(t,ot.error):void 0===r?T(t,e):o(r)?w(t,e,r):T(t,e)}}function M(t,e){t===e?L(t,y()):a(e)?k(t,e):T(t,e)}function E(t){t._onerror&&t._onerror(t._result),C(t)}function T(t,e){t._state===nt&&(t._result=e,t._state=it,0!==t._subscribers.length&&Q(C,t))}function L(t,e){t._state===nt&&(t._state=at,t._result=e,Q(E,t))}function S(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+it]=r,i[a+at]=n,0===a&&t._state&&Q(C,t)}function C(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n,i,a=t._result,o=0;oo;o++)S(n.resolve(t[o]),void 0,e,r);return i}function F(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(v);return M(r,t),r}function D(t){var e=this,r=new e(v);return L(r,t),r}function B(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function U(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function V(t){this._id=pt++,this._state=void 0,this._result=void 0,this._subscribers=[],v!==t&&(o(t)||B(),this instanceof V||U(),j(this,t))}function q(){var t;if("undefined"!=typeof i)t=i;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=t.Promise;(!r||"[object Promise]"!==Object.prototype.toString.call(r.resolve())||r.cast)&&(t.Promise=dt)}var G;G=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var H,Y,X,W=G,Z=0,Q=({}.toString,function(t,e){rt[Z]=t,rt[Z+1]=e,Z+=2,2===Z&&(Y?Y(g):X())}),K="undefined"!=typeof window?window:void 0,$=K||{},J=$.MutationObserver||$.WebKitMutationObserver,tt="undefined"!=typeof n&&"[object process]"==={}.toString.call(n),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3);X=tt?c():J?h():et?p():void 0===K&&"function"==typeof e?m():d();var nt=void 0,it=1,at=2,ot=new P,st=new P;I.prototype._validateInput=function(t){return W(t)},I.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},I.prototype._init=function(){this._result=new Array(this.length)};var lt=I;I.prototype._enumerate=function(){for(var t=this,e=t.length,r=t.promise,n=t._input,i=0;r._state===nt&&e>i;i++)t._eachEntry(n[i],i)},I.prototype._eachEntry=function(t,e){var r=this,n=r._instanceConstructor;s(t)?t.constructor===n&&t._state!==nt?(t._onerror=null,r._settledAt(t._state,e,t._result)):r._willSettleAt(n.resolve(t),e):(r._remaining--,r._result[e]=t)},I.prototype._settledAt=function(t,e,r){var n=this,i=n.promise;i._state===nt&&(n._remaining--,t===at?L(i,r):n._result[e]=r),0===n._remaining&&T(i,n._result)},I.prototype._willSettleAt=function(t,e){var r=this;S(t,void 0,function(t){r._settledAt(it,e,t)},function(t){r._settledAt(at,e,t)})};var ut=O,ct=N,ft=F,ht=D,pt=0,dt=V;V.all=ut,V.race=ct,V.resolve=ft,V.reject=ht,V._setScheduler=l,V._setAsap=u,V._asap=Q,V.prototype={constructor:V,then:function(t,e){var r=this,n=r._state;if(n===it&&!t||n===at&&!e)return this;var i=new this.constructor(v),a=r._result;if(n){var o=arguments[n-1];Q(function(){R(n,i,o,a)})}else S(r,i,t,e);return i},"catch":function(t){return this.then(null,t)}};var gt=q,mt={Promise:dt,polyfill:gt};"function"==typeof t&&t.amd?t(function(){return mt}):"undefined"!=typeof r&&r.exports?r.exports=mt:"undefined"!=typeof this&&(this.ES6Promise=mt),gt()}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:53}],72:[function(t,e,r){"use strict";function n(t){for(var e,r=t.length,n=0;r>n;n++)if(e=t.charCodeAt(n),(9>e||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(8192>e||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(t=+t,0===t&&n(r))return!1}else if("number"!==e)return!1;return 1>t-t}},{}],73:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.shader=e,this.buffer=r,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.numPoints=0,this.color=[0,0,0,1]}function i(t,e){var r=a(t.gl,l.vertex,l.fragment),i=o(t.gl),s=new n(t,r,i);return s.update(e),t.addObject(s),s}var a=t("gl-shader"),o=t("gl-buffer"),s=t("typedarray-pool"),l=t("./lib/shaders");e.exports=i;var u=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]],c=n.prototype;c.draw=function(){var t=[1,0,0,0,1,0,0,0,1],e=[1,1];return function(){var r=this.plot,n=this.shader,i=this.buffer,a=this.bounds,o=this.numPoints,s=(this.color,r.gl),l=r.dataBox,c=r.viewBox,f=r.pixelRatio,h=a[2]-a[0],p=a[3]-a[1],d=l[2]-l[0],g=l[3]-l[1];t[0]=2*h/d,t[4]=2*p/g,t[6]=2*(a[0]-l[0])/d-1,t[7]=2*(a[1]-l[1])/g-1;var m=c[2]-c[0],v=c[3]-c[1];e[0]=2*f/m,e[1]=2*f/v,i.bind(),n.bind(),n.uniforms.viewTransform=t,n.uniforms.pixelScale=e,n.uniforms.color=this.color,n.attributes.position.pointer(s.FLOAT,!1,16,0),n.attributes.pixelOffset.pointer(s.FLOAT,!1,16,8),s.drawArrays(s.TRIANGLES,0,o*u.length)}}(),c.drawPick=function(t){return t},c.pick=function(t,e){return null},c.update=function(t){t=t||{};var e=t.positions||[],r=t.errors||[],n=1;"lineWidth"in t&&(n=+t.lineWidth);var i=5;"capSize"in t&&(i=+t.capSize),this.color=(t.color||[0,0,0,1]).slice();for(var a=this.bounds=[1/0,1/0,-(1/0),-(1/0)],o=this.numPoints=e.length>>1,l=0;o>l;++l){var c=e[2*l],f=e[2*l+1];a[0]=Math.min(c,a[0]),a[1]=Math.min(f,a[1]),a[2]=Math.max(c,a[2]),a[3]=Math.max(f,a[3])}a[2]===a[0]&&(a[2]+=1),a[3]===a[1]&&(a[3]+=1);for(var h=1/(a[2]-a[0]),p=1/(a[3]-a[1]),d=a[0],g=a[1],m=s.mallocFloat32(o*u.length*4),v=0,l=0;o>l;++l)for(var c=e[2*l],f=e[2*l+1],y=r[4*l],b=r[4*l+1],x=r[4*l+2],_=r[4*l+3],w=0;wk?k*=y:k>0&&(k*=b),0>M?M*=x:M>0&&(M*=_),m[v++]=h*(c-d+k),m[v++]=p*(f-g+M),m[v++]=n*A[2]+(i+n)*A[4],m[v++]=n*A[3]+(i+n)*A[5]}this.buffer.update(m),s.free(m)},c.dispose=function(){this.plot.removeObject(this),this.shader.dispose(),this.buffer.dispose()}},{"./lib/shaders":74,"gl-buffer":75,"gl-shader":76,"typedarray-pool":102}],74:[function(t,e,r){e.exports={vertex:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 position;\nattribute vec2 pixelOffset;\n\nuniform mat3 viewTransform;\nuniform vec2 pixelScale;\n\nvoid main() {\n vec3 scrPosition = viewTransform * vec3(position, 1);\n gl_Position = vec4(\n scrPosition.xy + scrPosition.z * pixelScale * pixelOffset,\n 0,\n scrPosition.z);\n}\n",fragment:"#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"}},{}],75:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=i}function i(t,e,r,n,i,a){var o=i.length*i.BYTES_PER_ELEMENT;if(0>a)return t.bufferData(e,i,n),o;if(o+a>r)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function a(t,e){for(var r=l.malloc(t.length,e),n=t.length,i=0;n>i;++i)r[i]=t[i];return r}function o(t,e){for(var r=1,n=e.length-1;n>=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}function s(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var a=t.createBuffer(),o=new n(t,r,a,0,i);return o.update(e),o}var l=t("typedarray-pool"),u=t("ndarray-ops"),c=t("ndarray"),f=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"],h=n.prototype;h.bind=function(){this.gl.bindBuffer(this.type,this.handle)},h.unbind=function(){this.gl.bindBuffer(this.type,null)},h.dispose=function(){this.gl.deleteBuffer(this.handle)},h.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&"undefined"!=typeof t.shape){var r=t.dtype;if(f.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var n=gl.getExtension("OES_element_index_uint");r=n&&"uint16"!==r?"uint32":"uint16"}if(r===t.dtype&&o(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=l.malloc(t.size,r),h=c(s,t.shape);u.assign(h,t),0>e?this.length=i(this.gl,this.type,this.length,this.usage,s,e):this.length=i(this.gl,this.type,this.length,this.usage,s.subarray(0,t.size),e),l.free(s)}}else if(Array.isArray(t)){var p;p=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),0>e?this.length=i(this.gl,this.type,this.length,this.usage,p,e):this.length=i(this.gl,this.type,this.length,this.usage,p.subarray(0,t.length),e),l.free(p)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");t=0|t,0>=t&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=s},{ndarray:987,"ndarray-ops":982,"typedarray-pool":102}],76:[function(t,e,r){"use strict";function n(t){this.gl=t,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}function i(t,e){return t.name=0){for(var k=0|A.type.charAt(A.type.length-1),M=new Array(k),E=0;k>E;++E)M[E]=_.length,x.push(A.name+"["+E+"]"),"number"==typeof A.location?_.push(A.location+E):Array.isArray(A.location)&&A.location.length===k&&"number"==typeof A.location[E]?_.push(0|A.location[E]):_.push(-1); -b.push({name:A.name,type:A.type,locations:M})}else b.push({name:A.name,type:A.type,locations:[_.length]}),x.push(A.name),"number"==typeof A.location?_.push(0|A.location):_.push(-1)}for(var T=0,w=0;w<_.length;++w)if(_[w]<0){for(;_.indexOf(T)>=0;)T+=1;_[w]=T}var L=new Array(r.length);a(),p._relink=a,p.types={uniforms:l(r),attributes:l(n)},p.attributes=s(d,p,b,_),Object.defineProperty(p,"uniforms",o(d,p,r,L))},e.exports=a},{"./lib/GLError":77,"./lib/create-attributes":78,"./lib/create-uniforms":79,"./lib/reflect":80,"./lib/runtime-reflect":81,"./lib/shader-cache":82}],77:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,e.exports=n},{}],78:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],u=[],c=0;a>c;++c)l.push("x"+c),u.push("x"+c);l.push("if(x0.length===void 0){return gl.vertexAttrib"+a+"f(v,"+u.join()+")}else{return gl.vertexAttrib"+a+"fv(v,x0)}");var f=Function.apply(null,l),h=new n(t,e,r,i,a,f);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(i[r]),f(t,i[r],e),e},get:function(){return h},enumerable:!0})}function a(t,e,r,n,a,o,s){for(var l=new Array(a),u=new Array(a),c=0;a>c;++c)i(t,e,r[c],n,a,l,c),u[c]=l[c];Object.defineProperty(l,"location",{set:function(t){if(Array.isArray(t))for(var e=0;a>e;++e)u[e].location=t[e];else for(var e=0;a>e;++e)u[e].location=t+e;return t},get:function(){for(var t=new Array(a),e=0;a>e;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,i,o,s){e=e||t.FLOAT,i=!!i,o=o||a*a,s=s||0;for(var l=0;a>l;++l){var u=n[r[l]];t.vertexAttribPointer(u,a,e,i,o,s+l*a),t.enableVertexAttribArray(u)}};var f=new Array(a),h=t["vertexAttrib"+a+"fv"];Object.defineProperty(o,s,{set:function(e){for(var i=0;a>i;++i){var o=n[r[i]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))h.call(t,o,e[i]);else{for(var s=0;a>s;++s)f[s]=e[a*i+s];h.call(t,o,f)}}return e},get:function(){return l},enumerable:!0})}function o(t,e,r,n){for(var o={},l=0,u=r.length;u>l;++l){var c=r[l],f=c.name,h=c.type,p=c.locations;switch(h){case"bool":case"int":case"float":i(t,e,p[0],n,1,o,f);break;default:if(h.indexOf("vec")>=0){var d=h.charCodeAt(h.length-1)-48;if(2>d||d>4)throw new s("","Invalid data type for attribute "+f+": "+h);i(t,e,p[0],n,d,o,f)}else{if(!(h.indexOf("mat")>=0))throw new s("","Unknown data type for attribute "+f+": "+h);var d=h.charCodeAt(h.length-1)-48;if(2>d||d>4)throw new s("","Invalid data type for attribute "+f+": "+h);a(t,e,p,n,d,o,f)}}}return o}e.exports=o;var s=t("./GLError"),l=n.prototype;l.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},l.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(l,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{"./GLError":77}],79:[function(t,e,r){"use strict";function n(t){var e=new Function("y","return function(){return y}");return e(t)}function i(t,e){for(var r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function a(t,e,r,a){function l(r){var n=new Function("gl","wrapper","locations","return function(){return gl.getUniform(wrapper.program,locations["+r+"])}");return n(t,e,a)}function u(t,e,r){switch(r){case"bool":case"int":case"sampler2D":case"samplerCube":return"gl.uniform1i(locations["+e+"],obj"+t+")";case"float":return"gl.uniform1f(locations["+e+"],obj"+t+")";default:var n=r.indexOf("vec");if(!(n>=0&&1>=n&&r.length===4+n)){if(0===r.indexOf("mat")&&4===r.length){var i=r.charCodeAt(r.length-1)-48;if(2>i||i>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new s("","Unknown uniform data type for "+name+": "+r)}var i=r.charCodeAt(r.length-1)-48;if(2>i||i>4)throw new s("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new s("","Unrecognized data type for vector "+name+": "+r)}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;a+=parseInt(n)+""===n?"["+n+"]":"."+n,"object"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function f(e){for(var n=["return function updateProperty(obj){"],i=c("",e),o=0;o=0&&1>=e&&t.length===4+e){var r=t.charCodeAt(t.length-1)-48;if(2>r||r>4)throw new s("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(2>r||r>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new s("","Unknown uniform data type for "+name+": "+t)}}function p(t,e,i){if("object"==typeof i){var o=d(i);Object.defineProperty(t,e,{get:n(o),set:f(i),enumerable:!0,configurable:!1})}else a[i]?Object.defineProperty(t,e,{get:l(i),set:f(i),enumerable:!0,configurable:!1}):t[e]=h(r[i].type)}function d(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;ua;++a){var o=t.getActiveUniform(e,a);if(o){var s=n(t,o.type);if(o.size>1)for(var l=0;la;++a){var o=t.getActiveAttrib(e,a);o&&i.push({name:o.name,type:n(t,o.type)})}return i}r.uniforms=i,r.attributes=a;var o={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},s=null},{}],82:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function i(t){this.gl=t,this.shaders=[{},{}],this.programs={}}function a(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){var i=t.getShaderInfoLog(n);try{var a=f(i,r,e)}catch(o){throw console.warn("Failed to format compiler error: "+o),new c(i,"Error compiling shader:\n"+i)}throw new c(i,a.short,a.long)}return n}function o(t,e,r,n,i){var a=t.createProgram();t.attachShader(a,e),t.attachShader(a,r);for(var o=0;on;++n){var a=t.programs[r[n]];a&&(delete t.programs[n],e.deleteProgram(a))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var g=i.prototype;g.getShaderReference=function(t,e){var r=this.gl,i=this.shaders[t===r.FRAGMENT_SHADER|0],o=i[e];if(o&&r.isShader(o.shader))o.count+=1;else{var s=a(r,t,e);o=i[e]=new n(d++,e,t,s,[],1,this)}return o},g.getProgram=function(t,e,r,n){var i=[t.id,e.id,r.join(":"),n.join(":")].join("@"),a=this.programs[i];return a&&this.gl.isProgram(a)||(this.programs[i]=a=o(this.gl,t.shader,e.shader,r,n),t.programs.push(i),e.programs.push(i)),a}},{"./GLError":77,"gl-format-compiler-error":83,"weakmap-shim":99}],83:[function(t,e,r){function n(t,e,r){"use strict";var n=o(e)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===a.FRAGMENT_SHADER?"fragment":"vertex");for(var u=i("Error compiling %s shader %s:\n",l,n),c=i("%s%s",u,t),f=t.split("\n"),h={},p=0;pa.length&&e>0&&(1&e&&(a+=t),e>>=1);)t+=t;return a.substr(0,r)}e.exports=n;var i,a=""},{}],87:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],88:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":87}],89:[function(t,e,r){function n(t){for(var e=Array.isArray(t)?t:i(t),r=0;rI;){switch(e=I,N){case u:I=M();break;case c:I=k();break;case f:I=A();break;case h:I=E();break;case p:I=S();break;case x:I=L();break;case d:I=C();break;case l:I=P();break;case y:I=w();break;case s:I=n()}if(e!==I)switch(H[e]){case"\n":U=0,++B;break;default:++U}}return O+=I,H=H.slice(I),D}function r(e){return F.length&&t(F.join("")),N=b,t("(eof)"),D}function n(){return F=F.length?[]:F,"/"===R&&"*"===z?(V=O+I-1,N=u,R=z,I+1):"/"===R&&"/"===z?(V=O+I-1,N=c,R=z,I+1):"#"===z?(N=f,V=O+I,I):/\s/.test(z)?(N=y,V=O+I,I):(q=/\d/.test(z),G=/[^\w_]/.test(z),V=O+I,N=q?p:G?h:l,I)}function w(){return/[^\s]/g.test(z)?(t(F.join("")),N=s,I):(F.push(z),R=z,I+1)}function A(){return"\n"===z&&"\\"!==R?(t(F.join("")),N=s,I):(F.push(z),R=z,I+1)}function k(){return A()}function M(){return"/"===z&&"*"===R?(F.push(z),t(F.join("")),N=s,I+1):(F.push(z),R=z,I+1)}function E(){if("."===R&&/\d/.test(z))return N=d,I;if("/"===R&&"*"===z)return N=u,I;if("/"===R&&"/"===z)return N=c,I;if("."===z&&F.length){for(;T(F););return N=d,I}if(";"===z||")"===z||"("===z){if(F.length)for(;T(F););return t(z),N=s,I+1}var e=2===F.length&&"="!==z;if(/[\w_\d\s]/.test(z)||e){for(;T(F););return N=s,I}return F.push(z),R=z,I+1}function T(e){for(var r,n,i=0;;){if(r=a.indexOf(e.slice(0,e.length+i).join("")),n=a[r],-1===r){if(i--+e.length>0)continue;n=e.slice(0,1).join("")}return t(n),V+=n.length,F=F.slice(n.length),F.length}}function L(){return/[^a-fA-F0-9]/.test(z)?(t(F.join("")),N=s,I):(F.push(z),R=z,I+1)}function S(){return"."===z?(F.push(z),N=d,R=z,I+1):/[eE]/.test(z)?(F.push(z),N=d,R=z,I+1):"x"===z&&1===F.length&&"0"===F[0]?(N=x,F.push(z),R=z,I+1):/[^\d]/.test(z)?(t(F.join("")),N=s,I):(F.push(z),R=z,I+1)}function C(){return"f"===z&&(F.push(z),R=z,I+=1),/[eE]/.test(z)?(F.push(z),R=z,I+1):/[^\d]/.test(z)?(t(F.join("")),N=s,I):(F.push(z),R=z,I+1)}function P(){if(/[^\d\w_]/.test(z)){var e=F.join("");return N=i.indexOf(e)>-1?v:o.indexOf(e)>-1?m:g,t(F.join("")),N=s,I}return F.push(z),R=z,I+1}var z,R,j,I=0,O=0,N=s,F=[],D=[],B=1,U=0,V=0,q=!1,G=!1,H="";return function(t){return D=[],null!==t?e(t):r()}}e.exports=n;var i=t("./lib/literals"),a=t("./lib/operators"),o=t("./lib/builtins"),s=999,l=9999,u=0,c=1,f=2,h=3,p=4,d=5,g=6,m=7,v=8,y=9,b=10,x=11,_=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":92,"./lib/literals":93,"./lib/operators":94}],92:[function(t,e,r){e.exports=["gl_Position","gl_PointSize","gl_ClipVertex","gl_FragCoord","gl_FrontFacing","gl_FragColor","gl_FragData","gl_FragDepth","gl_Color","gl_SecondaryColor","gl_Normal","gl_Vertex","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_FogCoord","gl_MaxLights","gl_MaxClipPlanes","gl_MaxTextureUnits","gl_MaxTextureCoords","gl_MaxVertexAttribs","gl_MaxVertexUniformComponents","gl_MaxVaryingFloats","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformComponents","gl_MaxDrawBuffers","gl_ModelViewMatrix","gl_ProjectionMatrix","gl_ModelViewProjectionMatrix","gl_TextureMatrix","gl_NormalMatrix","gl_ModelViewMatrixInverse","gl_ProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverse","gl_TextureMatrixInverse","gl_ModelViewMatrixTranspose","gl_ProjectionMatrixTranspose","gl_ModelViewProjectionMatrixTranspose","gl_TextureMatrixTranspose","gl_ModelViewMatrixInverseTranspose","gl_ProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixInverseTranspose","gl_TextureMatrixInverseTranspose","gl_NormalScale","gl_DepthRangeParameters","gl_DepthRange","gl_ClipPlane","gl_PointParameters","gl_Point","gl_MaterialParameters","gl_FrontMaterial","gl_BackMaterial","gl_LightSourceParameters","gl_LightSource","gl_LightModelParameters","gl_LightModel","gl_LightModelProducts","gl_FrontLightModelProduct","gl_BackLightModelProduct","gl_LightProducts","gl_FrontLightProduct","gl_BackLightProduct","gl_FogParameters","gl_Fog","gl_TextureEnvColor","gl_EyePlaneS","gl_EyePlaneT","gl_EyePlaneR","gl_EyePlaneQ","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_ObjectPlaneR","gl_ObjectPlaneQ","gl_FrontColor","gl_BackColor","gl_FrontSecondaryColor","gl_BackSecondaryColor","gl_TexCoord","gl_FogFragCoord","gl_Color","gl_SecondaryColor","gl_TexCoord","gl_FogFragCoord","gl_PointCoord","radians","degrees","sin","cos","tan","asin","acos","atan","pow","exp","log","exp2","log2","sqrt","inversesqrt","abs","sign","floor","ceil","fract","mod","min","max","clamp","mix","step","smoothstep","length","distance","dot","cross","normalize","faceforward","reflect","refract","matrixCompMult","lessThan","lessThanEqual","greaterThan","greaterThanEqual","equal","notEqual","any","all","not","texture2D","texture2DProj","texture2DLod","texture2DProjLod","textureCube","textureCubeLod","dFdx","dFdy"]},{}],93:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],94:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],95:[function(t,e,r){function n(t){var e=i(),r=[];return r=r.concat(e(t)),r=r.concat(e(null))}var i=t("./index");e.exports=n},{"./index":91}],96:[function(e,r,n){!function(e){function r(){var t=arguments[0],e=r.cache;return e[t]&&e.hasOwnProperty(t)||(e[t]=r.parse(t)),r.format.call(null,e[t],arguments)}function i(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function a(t,e){return Array(e+1).join(t)}var o={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};r.format=function(t,e){var n,s,l,u,c,f,h,p=1,d=t.length,g="",m=[],v=!0,y="";for(s=0;d>s;s++)if(g=i(t[s]),"string"===g)m[m.length]=t[s];else if("array"===g){if(u=t[s],u[2])for(n=e[p],l=0;l=0),u[8]){case"b":n=n.toString(2);break;case"c":n=String.fromCharCode(n);break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,u[6]?parseInt(u[6]):0);break;case"e":n=u[7]?n.toExponential(u[7]):n.toExponential();break;case"f":n=u[7]?parseFloat(n).toFixed(u[7]):parseFloat(n);break;case"g":n=u[7]?parseFloat(n).toPrecision(u[7]):parseFloat(n);break;case"o":n=n.toString(8);break;case"s":n=(n=String(n))&&u[7]?n.substring(0,u[7]):n;break;case"u":n>>>=0;break;case"x":n=n.toString(16);break;case"X":n=n.toString(16).toUpperCase()}o.json.test(u[8])?m[m.length]=n:(!o.number.test(u[8])||v&&!u[3]?y="":(y=v?"+":"-",n=n.toString().replace(o.sign,"")),f=u[4]?"0"===u[4]?"0":u[4].charAt(1):" ",h=u[6]-(y+n).length,c=u[6]&&h>0?a(f,h):"",m[m.length]=u[5]?y+n+c:"0"===f?y+c+n:c+y+n)}return m.join("")},r.cache={},r.parse=function(t){for(var e=t,r=[],n=[],i=0;e;){if(null!==(r=o.text.exec(e)))n[n.length]=r[0];else if(null!==(r=o.modulo.exec(e)))n[n.length]="%";else{if(null===(r=o.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){i|=1;var a=[],s=r[2],l=[];if(null===(l=o.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a[a.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=o.key_access.exec(s)))a[a.length]=l[1];else{if(null===(l=o.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a[a.length]=l[1]}r[2]=a}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n[n.length]=r}e=e.substring(r[0].length)}return n};var s=function(t,e,n){return n=(e||[]).slice(0),n.splice(0,0,t),r.apply(null,n)};"undefined"!=typeof n?(n.sprintf=r,n.vsprintf=s):(e.sprintf=r,e.vsprintf=s,"function"==typeof t&&t.amd&&t(function(){return{sprintf:r,vsprintf:s}}))}("undefined"==typeof window?this:window)},{}],97:[function(t,e,r){function n(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:i(e,t)}}var i=t("./hidden-store.js");e.exports=n},{"./hidden-store.js":98}],98:[function(t,e,r){function n(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}e.exports=n},{}],99:[function(t,e,r){function n(){var t=i();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){t(e).value=r},has:function(e){return"value"in t(e)},"delete":function(e){return delete t(e).value}}}var i=t("./create-store.js");e.exports=n},{"./create-store.js":97}],100:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],101:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],102:[function(t,e,r){(function(e,n){"use strict";function i(t){if(t){var e=t.length||t.byteLength,r=y.log2(e);w[r].push(t)}}function a(t){i(t.buffer)}function o(t){var t=y.nextPow2(t),e=y.log2(t),r=w[e];return r.length>0?r.pop():new ArrayBuffer(t)}function s(t){return new Uint8Array(o(t),0,t)}function l(t){return new Uint16Array(o(2*t),0,t)}function u(t){return new Uint32Array(o(4*t),0,t)}function c(t){return new Int8Array(o(t),0,t)}function f(t){return new Int16Array(o(2*t),0,t)}function h(t){return new Int32Array(o(4*t),0,t)}function p(t){return new Float32Array(o(4*t),0,t)}function d(t){return new Float64Array(o(8*t),0,t)}function g(t){return x?new Uint8ClampedArray(o(t),0,t):s(t)}function m(t){return new DataView(o(t),0,t)}function v(t){t=y.nextPow2(t);var e=y.log2(t),r=A[e];return r.length>0?r.pop():new n(t)}var y=t("bit-twiddle"),b=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:b([32,0]),UINT16:b([32,0]),UINT32:b([32,0]),INT8:b([32,0]),INT16:b([32,0]),INT32:b([32,0]),FLOAT:b([32,0]),DOUBLE:b([32,0]),DATA:b([32,0]),UINT8C:b([32,0]),BUFFER:b([32,0])});var x="undefined"!=typeof Uint8ClampedArray,_=e.__TYPEDARRAY_POOL;_.UINT8C||(_.UINT8C=b([32,0])),_.BUFFER||(_.BUFFER=b([32,0]));var w=_.DATA,A=_.BUFFER;r.free=function(t){if(n.isBuffer(t))A[y.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|y.log2(e);w[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=a,r.freeArrayBuffer=i,r.freeBuffer=function(t){A[y.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return o(t);switch(e){case"uint8":return s(t);case"uint16":return l(t);case"uint32":return u(t);case"int8":return c(t);case"int16":return f(t);case"int32":return h(t);case"float":case"float32":return p(t);case"double":case"float64":return d(t);case"uint8_clamped":return g(t);case"buffer":return v(t);case"data":case"dataview":return m(t);default:return null}return null},r.mallocArrayBuffer=o,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=u,r.mallocInt8=c,r.mallocInt16=f,r.mallocInt32=h,r.mallocFloat32=r.mallocFloat=p,r.mallocFloat64=r.mallocDouble=d,r.mallocUint8Clamped=g,r.mallocDataView=m,r.mallocBuffer=v,r.clearCache=function(){for(var t=0;32>t;++t)_.UINT8[t].length=0,_.UINT16[t].length=0,_.UINT32[t].length=0,_.INT8[t].length=0,_.INT16[t].length=0,_.INT32[t].length=0,_.FLOAT[t].length=0,_.DOUBLE[t].length=0,_.UINT8C[t].length=0,w[t].length=0,A[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":100,buffer:48,dup:101}],103:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}function i(t,e){for(var r=0;3>r;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}function a(t,e,r,n){for(var i=h[n],a=0;a=1},f.isTransparent=function(){return this.opacity<1},f.drawTransparent=f.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var f=0;3>f;++f)e.lineWidth(this.lineWidth[f]),r.capSize=this.capSize[f]*u,e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var h=function(){for(var t=new Array(3),e=0;3>e;++e){for(var r=[],n=1;2>=n;++n)for(var i=-1;1>=i;i+=2){var a=(n+e)%3,o=[0,0,0];o[a]=i,r.push(o)}t[e]=r}return t}();f.update=function(t){t=t||{},"lineWidth"in t&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.lineCount=[0,0,0];for(var u=0;3>u;++u){this.lineOffset[u]=l;t:for(var c=0;s>c;++c){for(var f=r[c],h=0;3>h;++h)if(isNaN(f[h])||!isFinite(f[h]))continue t;var p=n[c],d=e[u];if(Array.isArray(d[0])&&(d=e[c]),3===d.length&&(d=[d[0],d[1],d[2],1]),!isNaN(p[0][u])&&!isNaN(p[1][u])){if(p[0][u]<0){var g=f.slice();g[u]+=p[0][u],o.push(f[0],f[1],f[2],d[0],d[1],d[2],d[3],0,0,0,g[0],g[1],g[2],d[0],d[1],d[2],d[3],0,0,0),i(this.bounds,g),l+=2+a(o,g,d,u)}if(p[1][u]>0){var g=f.slice();g[u]+=p[1][u],o.push(f[0],f[1],f[2],d[0],d[1],d[2],d[3],0,0,0,g[0],g[1],g[2],d[0],d[1],d[2],d[3],0,0,0),i(this.bounds,g),l+=2+a(o,g,d,u)}}}this.lineCount[u]=l-this.lineOffset[u]}this.buffer.update(o)}},f.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":136,"gl-buffer":104,"gl-vao":135}],104:[function(t,e,r){arguments[4][75][0].apply(r,arguments)},{dup:75,ndarray:987,"ndarray-ops":982,"typedarray-pool":107}],105:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],106:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],107:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":105,buffer:48,dup:102}],108:[function(t,e,r){arguments[4][76][0].apply(r,arguments)},{"./lib/GLError":109,"./lib/create-attributes":110,"./lib/create-uniforms":111,"./lib/reflect":112,"./lib/runtime-reflect":113,"./lib/shader-cache":114,dup:76}],109:[function(t,e,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],110:[function(t,e,r){arguments[4][78][0].apply(r,arguments)},{"./GLError":109,dup:78}],111:[function(t,e,r){arguments[4][79][0].apply(r,arguments)},{"./GLError":109,"./reflect":112,dup:79}],112:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],113:[function(t,e,r){arguments[4][81][0].apply(r,arguments)},{dup:81}],114:[function(t,e,r){arguments[4][82][0].apply(r,arguments)},{"./GLError":109,dup:82,"gl-format-compiler-error":115,"weakmap-shim":131}],115:[function(t,e,r){arguments[4][83][0].apply(r,arguments)},{"add-line-numbers":116,dup:83,"gl-constants/lookup":120,"glsl-shader-name":121,"sprintf-js":128}],116:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84,"pad-left":117}],117:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{dup:85,"repeat-string":118}],118:[function(t,e,r){arguments[4][86][0].apply(r,arguments)},{dup:86}],119:[function(t,e,r){arguments[4][87][0].apply(r,arguments)},{dup:87}],120:[function(t,e,r){arguments[4][88][0].apply(r,arguments)},{"./1.0/numbers":119,dup:88}],121:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{"atob-lite":122,dup:89,"glsl-tokenizer":127}],122:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{dup:90}],123:[function(t,e,r){arguments[4][91][0].apply(r,arguments)},{"./lib/builtins":124,"./lib/literals":125,"./lib/operators":126,dup:91}],124:[function(t,e,r){arguments[4][92][0].apply(r,arguments)},{dup:92}],125:[function(t,e,r){arguments[4][93][0].apply(r,arguments)},{dup:93}],126:[function(t,e,r){arguments[4][94][0].apply(r,arguments)},{dup:94}],127:[function(t,e,r){arguments[4][95][0].apply(r,arguments)},{"./index":123,dup:95}],128:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{dup:96}],129:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{"./hidden-store.js":130,dup:97}],130:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{dup:98}],131:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{"./create-store.js":129,dup:99}],132:[function(t,e,r){"use strict";function n(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;ii;++i)t.disableVertexAttribArray(i)}else{t.bindBuffer(t.ARRAY_BUFFER,null);for(var i=0;n>i;++i)t.disableVertexAttribArray(i)}}e.exports=n},{}],133:[function(t,e,r){"use strict";function n(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}function i(t){return new n(t)}var a=t("./do-bind.js");n.prototype.bind=function(){a(this.gl,this._elements,this._attributes)},n.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},n.prototype.dispose=function(){},n.prototype.unbind=function(){},n.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._elements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=i},{"./do-bind.js":132}],134:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this.location=t,this.dimension=e,this.a=r,this.b=n,this.c=i,this.d=a}function i(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}function a(t,e){return new i(t,e,e.createVertexArrayOES())}var o=t("./do-bind.js");n.prototype.bind=function(t){switch(this.dimension){case 1:t.vertexAttrib1f(this.location,this.a);break;case 2:t.vertexAttrib2f(this.location,this.a,this.b);break;case 3:t.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:t.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},i.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var t=0;t2&&!this.usingDashes){var C=this.mitreShader;C.bind();var P=C.uniforms;P.matrix=t,P.color=s,P.screenShape=e,P.radius=l*d,C.attributes.p.pointer(f.FLOAT,!1,48,0),f.drawArrays(f.POINTS,0,c/3|0)}}}(),h.drawPick=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0],r=[0,0,0,0];return function(n){var i=this.plot,a=this.pickShader,o=this.lineBuffer,s=this.pickBuffer,l=this.width,u=this.numPoints,c=this.bounds,f=this.vertCount,h=i.gl,p=i.viewBox,d=i.dataBox,g=i.pickPixelRatio,m=c[2]-c[0],v=c[3]-c[1],y=d[2]-d[0],b=d[3]-d[1],x=p[2]-p[0],_=p[3]-p[1];this.pickOffset=n,t[0]=2*m/y,t[4]=2*v/b,t[6]=2*(c[0]-d[0])/y-1,t[7]=2*(c[1]-d[1])/b-1,e[0]=x,e[1]=_,r[0]=255&n,r[1]=n>>>8&255,r[2]=n>>>16&255,r[3]=n>>>24,a.bind();var w=a.uniforms;w.matrix=t,w.width=l*g,w.pickOffset=r,w.screenShape=e;var A=a.attributes;return o.bind(),A.a.pointer(h.FLOAT,!1,16,0),A.d.pointer(h.FLOAT,!1,16,8),s.bind(),A.pick0.pointer(h.UNSIGNED_BYTE,!1,8,0),A.pick1.pointer(h.UNSIGNED_BYTE,!1,8,4),h.drawArrays(h.TRIANGLES,0,f),n+u}}(),h.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(n>r||r>=n+i)return null;var a=r-n,o=this.data;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},h.update=function(t){t=t||{};var e=this.plot.gl;this.color=(t.color||[0,0,1,1]).slice(),this.width=+(t.width||1),this.fill=(t.fill||[!1,!1,!1,!1]).slice(),this.fillColor=i(t.fillColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);for(var r=t.dashes||[1],n=0,a=0;a1,this.dashPattern=l(e,u(o,[n,1,4],[1,0,0])),this.dashPattern.minFilter=e.NEAREST,this.dashPattern.magFilter=e.NEAREST,this.dashLength=n,c.free(o);var p=t.positions;this.data=p;var d=this.bounds;d[0]=d[1]=1/0,d[2]=d[3]=-(1/0);var g=this.numPoints=p.length>>>1;if(0!==g){for(var a=0;g>a;++a){var m=p[2*a],v=p[2*a+1];d[0]=Math.min(d[0],m),d[1]=Math.min(d[1],v),d[2]=Math.max(d[2],m),d[3]=Math.max(d[3],v)}d[0]===d[2]&&(d[2]+=1),d[3]===d[1]&&(d[3]+=1);var y=c.mallocFloat32(24*(g-1)),b=c.mallocUint32(12*(g-1)),x=y.length,_=b.length,s=g;for(this.vertCount=6*(g-1);s>1;){var w=--s,m=p[2*s],v=p[2*s+1];m=(m-d[0])/(d[2]-d[0]),v=(v-d[1])/(d[3]-d[1]);var A=w-1,k=p[2*A],M=p[2*A+1];k=(k-d[0])/(d[2]-d[0]),M=(M-d[1])/(d[3]-d[1]);var E=k-m,T=M-v,L=w|1<<24,S=w-1,C=w,P=w-1|1<<24;y[--x]=-T,y[--x]=-E,y[--x]=v,y[--x]=m,b[--_]=L,b[--_]=S,y[--x]=T,y[--x]=E,y[--x]=M,y[--x]=k,b[--_]=C,b[--_]=P,y[--x]=-T,y[--x]=-E,y[--x]=M,y[--x]=k,b[--_]=C,b[--_]=P,y[--x]=T,y[--x]=E,y[--x]=M,y[--x]=k,b[--_]=C,b[--_]=P,y[--x]=-T,y[--x]=-E,y[--x]=v,y[--x]=m,b[--_]=L,b[--_]=S,y[--x]=T,y[--x]=E,y[--x]=v,y[--x]=m,b[--_]=L,b[--_]=S}this.lineBuffer.update(y),this.pickBuffer.update(b),c.free(y),c.free(b)}},h.dispose=function(){this.plot.removeObject(this),this.lineBuffer.dispose(),this.pickBuffer.dispose(),this.lineShader.dispose(),this.mitreShader.dispose(),this.fillShader.dispose(),this.pickShader.dispose(),this.dashPattern.dispose()}},{"./lib/shaders":137,"gl-buffer":139,"gl-shader":140,"gl-texture2d":164,ndarray:987,"typedarray-pool":167}],139:[function(t,e,r){arguments[4][75][0].apply(r,arguments)},{dup:75,ndarray:987,"ndarray-ops":982,"typedarray-pool":167}],140:[function(t,e,r){arguments[4][76][0].apply(r,arguments)},{"./lib/GLError":141,"./lib/create-attributes":142,"./lib/create-uniforms":143,"./lib/reflect":144,"./lib/runtime-reflect":145,"./lib/shader-cache":146,dup:76}],141:[function(t,e,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],142:[function(t,e,r){arguments[4][78][0].apply(r,arguments)},{"./GLError":141,dup:78}],143:[function(t,e,r){arguments[4][79][0].apply(r,arguments)},{"./GLError":141,"./reflect":144,dup:79}],144:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],145:[function(t,e,r){arguments[4][81][0].apply(r,arguments)},{dup:81}],146:[function(t,e,r){arguments[4][82][0].apply(r,arguments)},{"./GLError":141,dup:82,"gl-format-compiler-error":147,"weakmap-shim":163}],147:[function(t,e,r){arguments[4][83][0].apply(r,arguments)},{"add-line-numbers":148,dup:83,"gl-constants/lookup":152,"glsl-shader-name":153,"sprintf-js":160}],148:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84,"pad-left":149}],149:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{dup:85,"repeat-string":150}],150:[function(t,e,r){arguments[4][86][0].apply(r,arguments)},{dup:86}],151:[function(t,e,r){arguments[4][87][0].apply(r,arguments)},{dup:87}],152:[function(t,e,r){arguments[4][88][0].apply(r,arguments)},{"./1.0/numbers":151,dup:88}],153:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{"atob-lite":154,dup:89,"glsl-tokenizer":159}],154:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{dup:90}],155:[function(t,e,r){arguments[4][91][0].apply(r,arguments)},{"./lib/builtins":156,"./lib/literals":157,"./lib/operators":158,dup:91}],156:[function(t,e,r){arguments[4][92][0].apply(r,arguments)},{dup:92}],157:[function(t,e,r){arguments[4][93][0].apply(r,arguments)},{dup:93}],158:[function(t,e,r){arguments[4][94][0].apply(r,arguments)},{dup:94}],159:[function(t,e,r){arguments[4][95][0].apply(r,arguments)},{"./index":155,dup:95}],160:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{dup:96}],161:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{"./hidden-store.js":162,dup:97}],162:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{dup:98}],163:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{"./create-store.js":161,dup:99}],164:[function(t,e,r){"use strict";function n(t){m=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],v=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],y=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function i(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(0>e||e>i||0>r||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function a(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}function o(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function s(t,e,r,n,i,a,s,l){var u=l.dtype,c=l.shape.slice();if(c.length<2||c.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var f=0,h=0,m=o(c,l.stride.slice());"float32"===u?f=t.FLOAT:"float64"===u?(f=t.FLOAT,m=!1,u="float32"):"uint8"===u?f=t.UNSIGNED_BYTE:(f=t.UNSIGNED_BYTE,m=!1,u="uint8");var v=1;if(2===c.length)h=t.LUMINANCE,c=[c[0],c[1],1],l=p(l.data,c,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==c.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===c[2])h=t.ALPHA;else if(2===c[2])h=t.LUMINANCE_ALPHA;else if(3===c[2])h=t.RGB;else{if(4!==c[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");h=t.RGBA}v=c[2]}if(h!==t.LUMINANCE&&h!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(h=i),h!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=l.size,x=s.indexOf(n)<0;if(x&&s.push(n),f===a&&m)0===l.offset&&l.data.length===y?x?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data):x?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data.subarray(l.offset,l.offset+y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data.subarray(l.offset,l.offset+y));else{var _;_=a===t.FLOAT?g.mallocFloat32(y):g.mallocUint8(y);var w=p(_,c,[c[2],c[2]*c[0],1]);f===t.FLOAT&&a===t.UNSIGNED_BYTE?b(w,l):d.assign(w,l),x?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,_.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,_.subarray(0,y)),a===t.FLOAT?g.freeFloat32(_):g.freeUint8(_)}}function l(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function u(t,e,r,n,i){var o=t.getParameter(t.MAX_TEXTURE_SIZE);if(0>e||e>o||0>r||r>o)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var s=l(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new a(t,s,e,r,n,i)}function c(t,e,r,n){var i=l(t);return t.texImage2D(t.TEXTURE_2D,0,r,r,n,e),new a(t,i,0|e.width,0|e.height,r,n)}function f(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var s=o(n,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,s=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,s=!1,r="uint8");var c=0;if(2===n.length)c=t.LUMINANCE,n=[n[0],n[1],1],e=p(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])c=t.ALPHA;else if(2===n[2])c=t.LUMINANCE_ALPHA;else if(3===n[2])c=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");c=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,s=!1);var f,h,m=e.size;if(s)f=0===e.offset&&e.data.length===m?e.data:e.data.subarray(e.offset,e.offset+m);else{var v=[n[2],n[2]*n[0],1];h=g.malloc(m,r);var y=p(h,n,v,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?d.assign(y,e):b(y,e),f=h.subarray(0,m)}var x=l(t);return t.texImage2D(t.TEXTURE_2D,0,c,n[0],n[1],0,c,u,f),s||g.free(h),new a(t,x,n[0],n[1],c,u)}function h(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(m||n(t),"number"==typeof arguments[1])return u(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return u(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1];if(e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof ImageData)return c(t,e,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return f(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}var p=t("ndarray"),d=t("ndarray-ops"),g=t("typedarray-pool");e.exports=h;var m=null,v=null,y=null,b=function(t,e){d.muls(t,e,255)},x=a.prototype;Object.defineProperties(x,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&m.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),v.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&m.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),v.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t), -this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;2>e;++e)if(y.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return i(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t=0|t,i(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t=0|t,i(this,this._shape[0],t),t}}}),x.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},x.dispose=function(){this.gl.deleteTexture(this.handle)},x.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},x.setPixels=function(t,e,r,n){var i=this.gl;if(this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0,t instanceof HTMLCanvasElement||t instanceof ImageData||t instanceof HTMLImageElement||t instanceof HTMLVideoElement){var a=this._mipLevels.indexOf(n)<0;a?(i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,this.type,t),this._mipLevels.push(n)):i.texSubImage2D(i.TEXTURE_2D,n,e,r,this.format,this.type,t)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>n||r+t.shape[0]>this._shape[0]>>>n||0>e||0>r)throw new Error("gl-texture2d: Texture dimensions are out of bounds");s(i,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:987,"ndarray-ops":982,"typedarray-pool":167}],165:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],166:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],167:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":165,buffer:48,dup:102}],168:[function(t,e,r){var n=t("gl-shader"),i="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position, nextPosition;\nattribute float arcLength, lineWidth;\nattribute vec4 color;\n\nuniform vec2 screenShape;\nuniform float pixelRatio;\nuniform mat4 model, view, projection;\n\nvarying vec4 fragColor;\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\n\nvoid main() {\n vec4 projected = projection * view * model * vec4(position, 1.0);\n vec4 tangentClip = projection * view * model * vec4(nextPosition - position, 0.0);\n vec2 tangent = normalize(screenShape * tangentClip.xy);\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(tangent.y, -tangent.x) / screenShape;\n\n gl_Position = vec4(projected.xy + projected.w * offset, projected.zw);\n\n worldPosition = position;\n pixelArcLength = arcLength;\n fragColor = color;\n}\n",a="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n",o="#define GLSLIFY 1\nprecision mediump float;\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\nlowp vec4 encode_float_1_0(highp float v) {\n highp float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",s=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(t){return n(t,i,a,null,s)},r.createPickShader=function(t){return n(t,i,o,null,s)}},{"gl-shader":175}],169:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=0;3>n;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function i(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;3>r;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}function s(t){var e=t.gl||t.scene&&t.scene.gl,r=g(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var n=m(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=l(e),a=u(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),s=p(new Array(1024),[256,1,4]),f=0;1024>f;++f)s.data[f]=255;var h=c(e,s);h.wrap=e.REPEAT;var d=new o(e,r,n,i,a,h);return d.update(t),d}e.exports=s;var l=t("gl-buffer"),u=t("gl-vao"),c=t("gl-texture2d"),f=t("glsl-read-float"),h=t("binary-search-bounds"),p=t("ndarray"),d=t("./lib/shaders"),g=d.createShader,m=d.createPickShader,v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=o.prototype;y.isTransparent=function(){return this.opacity<1},y.isOpaque=function(){return this.opacity>=1},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||v,view:t.view||v,projection:t.projection||v,clipBounds:i(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||v,view:t.view||v,projection:t.projection||v,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.update=function(t){this.dirty=!0,"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var e=t.position||t.positions;if(e){var r=t.color||t.colors||[0,0,0,1],i=t.lineWidth||1,a=[],o=[],s=[],l=0,u=0,c=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];t:for(var f=1;fm;++m){if(isNaN(d[m])||isNaN(g[m])||!isFinite(d[m])||!isFinite(g[m]))continue t;c[0][m]=Math.min(c[0][m],d[m],g[m]),c[1][m]=Math.max(c[1][m],d[m],g[m])}var v,y;Array.isArray(r[0])?(v=r[f-1],y=r[f]):v=y=r,3===v.length&&(v=[v[0],v[1],v[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]);var b,x;Array.isArray(i)?(b=i[f-1],x=lineWidht[f]):b=x=i;var _=l;l+=n(d,g),a.push(d[0],d[1],d[2],g[0],g[1],g[2],_,b,v[0],v[1],v[2],v[3],d[0],d[1],d[2],g[0],g[1],g[2],_,-b,v[0],v[1],v[2],v[3],g[0],g[1],g[2],d[0],d[1],d[2],l,-b,y[0],y[1],y[2],y[3],g[0],g[1],g[2],d[0],d[1],d[2],l,b,y[0],y[1],y[2],y[3]),u+=4}if(this.buffer.update(a),o.push(l),s.push(e[e.length-1].slice()),this.bounds=c,this.vertexCount=u,this.points=s,this.arcLength=o,"dashes"in t){var w=t.dashes,A=w.slice();A.unshift(0);for(var f=1;ff;++f){for(var m=0;4>m;++m)k.set(f,0,m,0);1&h.le(A,A[A.length-1]*f/255)?k.set(f,0,0,0):k.set(f,0,0,255)}this.texture.setPixels(k)}}},y.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},y.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=f(t.value[0],t.value[1],t.value[2],0),r=h.le(this.arcLength,e);if(0>r)return null;if(r===this.arcLength.length-1)return new a(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],i=this.points[Math.min(r+1,this.points.length-1)],o=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),s=1-o,l=[0,0,0],u=0;3>u;++u)l[u]=s*n[u]+o*i[u];var c=Math.min(.5>o?r:r+1,this.points.length-1);return new a(e,l,c,this.points[c])}},{"./lib/shaders":168,"binary-search-bounds":170,"gl-buffer":171,"gl-texture2d":202,"gl-vao":206,"glsl-read-float":207,ndarray:987}],170:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],171:[function(t,e,r){arguments[4][75][0].apply(r,arguments)},{dup:75,ndarray:987,"ndarray-ops":982,"typedarray-pool":174}],172:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],173:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],174:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":172,buffer:48,dup:102}],175:[function(t,e,r){arguments[4][76][0].apply(r,arguments)},{"./lib/GLError":176,"./lib/create-attributes":177,"./lib/create-uniforms":178,"./lib/reflect":179,"./lib/runtime-reflect":180,"./lib/shader-cache":181,dup:76}],176:[function(t,e,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],177:[function(t,e,r){arguments[4][78][0].apply(r,arguments)},{"./GLError":176,dup:78}],178:[function(t,e,r){arguments[4][79][0].apply(r,arguments)},{"./GLError":176,"./reflect":179,dup:79}],179:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],180:[function(t,e,r){arguments[4][81][0].apply(r,arguments)},{dup:81}],181:[function(t,e,r){arguments[4][82][0].apply(r,arguments)},{"./GLError":176,dup:82,"gl-format-compiler-error":182,"weakmap-shim":198}],182:[function(t,e,r){arguments[4][83][0].apply(r,arguments)},{"add-line-numbers":183,dup:83,"gl-constants/lookup":187,"glsl-shader-name":188,"sprintf-js":195}],183:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84,"pad-left":184}],184:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{dup:85,"repeat-string":185}],185:[function(t,e,r){arguments[4][86][0].apply(r,arguments)},{dup:86}],186:[function(t,e,r){arguments[4][87][0].apply(r,arguments)},{dup:87}],187:[function(t,e,r){arguments[4][88][0].apply(r,arguments)},{"./1.0/numbers":186,dup:88}],188:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{"atob-lite":189,dup:89,"glsl-tokenizer":194}],189:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{dup:90}],190:[function(t,e,r){arguments[4][91][0].apply(r,arguments)},{"./lib/builtins":191,"./lib/literals":192,"./lib/operators":193,dup:91}],191:[function(t,e,r){arguments[4][92][0].apply(r,arguments)},{dup:92}],192:[function(t,e,r){arguments[4][93][0].apply(r,arguments)},{dup:93}],193:[function(t,e,r){arguments[4][94][0].apply(r,arguments)},{dup:94}],194:[function(t,e,r){arguments[4][95][0].apply(r,arguments)},{"./index":190,dup:95}],195:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{dup:96}],196:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{"./hidden-store.js":197,dup:97}],197:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{dup:98}],198:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{"./create-store.js":196,dup:99}],199:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],200:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],201:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":199,buffer:48,dup:102}],202:[function(t,e,r){arguments[4][164][0].apply(r,arguments)},{dup:164,ndarray:987,"ndarray-ops":982,"typedarray-pool":201}],203:[function(t,e,r){arguments[4][132][0].apply(r,arguments)},{dup:132}],204:[function(t,e,r){arguments[4][133][0].apply(r,arguments)},{"./do-bind.js":203,dup:133}],205:[function(t,e,r){arguments[4][134][0].apply(r,arguments)},{"./do-bind.js":203,dup:134}],206:[function(t,e,r){arguments[4][135][0].apply(r,arguments)},{"./lib/vao-emulated.js":204,"./lib/vao-native.js":205,dup:135}],207:[function(t,e,r){function n(t,e,r,n){return i[0]=n,i[1]=r,i[2]=e,i[3]=t,a[0]}e.exports=n;var i=new Uint8Array(4),a=new Float32Array(i.buffer)},{}],208:[function(t,e,r){function n(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}e.exports=n},{}],209:[function(t,e,r){function n(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],210:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],f=t[10],h=t[11],p=t[12],d=t[13],g=t[14],m=t[15],v=e*o-r*a,y=e*s-n*a,b=e*l-i*a,x=r*s-n*o,_=r*l-i*o,w=n*l-i*s,A=u*d-c*p,k=u*g-f*p,M=u*m-h*p,E=c*g-f*d,T=c*m-h*d,L=f*m-h*g;return v*L-y*T+b*E+x*M-_*k+w*A}e.exports=n},{}],211:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,f=n*s,h=i*o,p=i*s,d=i*l,g=a*o,m=a*s,v=a*l;return t[0]=1-f-d,t[1]=c+v,t[2]=h-m,t[3]=0,t[4]=c-v,t[5]=1-u-d,t[6]=p+g,t[7]=0,t[8]=h+m,t[9]=p-g,t[10]=1-u-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],212:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,f=n*l,h=n*u,p=i*l,d=i*u,g=a*u,m=o*s,v=o*l,y=o*u;return t[0]=1-(p+g),t[1]=f+y,t[2]=h-v,t[3]=0,t[4]=f-y,t[5]=1-(c+g),t[6]=d+m,t[7]=0,t[8]=h+v,t[9]=d-m,t[10]=1-(c+p),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}e.exports=n},{}],213:[function(t,e,r){function n(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],214:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],g=e[13],m=e[14],v=e[15],y=r*s-n*o,b=r*l-i*o,x=r*u-a*o,_=n*l-i*s,w=n*u-a*s,A=i*u-a*l,k=c*g-f*d,M=c*m-h*d,E=c*v-p*d,T=f*m-h*g,L=f*v-p*g,S=h*v-p*m,C=y*S-b*L+x*T+_*E-w*M+A*k;return C?(C=1/C,t[0]=(s*S-l*L+u*T)*C,t[1]=(i*L-n*S-a*T)*C,t[2]=(g*A-m*w+v*_)*C,t[3]=(h*w-f*A-p*_)*C,t[4]=(l*E-o*S-u*M)*C,t[5]=(r*S-i*E+a*M)*C,t[6]=(m*x-d*A-v*b)*C,t[7]=(c*A-h*x+p*b)*C,t[8]=(o*L-s*E+u*k)*C,t[9]=(n*E-r*L-a*k)*C,t[10]=(d*w-g*x+v*y)*C,t[11]=(f*x-c*w-p*y)*C,t[12]=(s*M-o*T-l*k)*C,t[13]=(r*T-n*M+i*k)*C,t[14]=(g*b-d*_-m*y)*C,t[15]=(c*_-f*b+h*y)*C,t):null}e.exports=n},{}],215:[function(t,e,r){function n(t,e,r,n){var a,o,s,l,u,c,f,h,p,d,g=e[0],m=e[1],v=e[2],y=n[0],b=n[1],x=n[2],_=r[0],w=r[1],A=r[2];return Math.abs(g-_)<1e-6&&Math.abs(m-w)<1e-6&&Math.abs(v-A)<1e-6?i(t):(f=g-_,h=m-w,p=v-A,d=1/Math.sqrt(f*f+h*h+p*p),f*=d,h*=d,p*=d,a=b*p-x*h,o=x*f-y*p,s=y*h-b*f,d=Math.sqrt(a*a+o*o+s*s),d?(d=1/d,a*=d,o*=d,s*=d):(a=0,o=0,s=0),l=h*s-p*o,u=p*a-f*s,c=f*o-h*a,d=Math.sqrt(l*l+u*u+c*c),d?(d=1/d,l*=d,u*=d,c*=d):(l=0,u=0,c=0),t[0]=a,t[1]=l,t[2]=f,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=s,t[9]=c,t[10]=p,t[11]=0,t[12]=-(a*g+o*m+s*v),t[13]=-(l*g+u*m+c*v),t[14]=-(f*g+h*m+p*v),t[15]=1,t)}var i=t("./identity");e.exports=n},{"./identity":213}],216:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],g=e[12],m=e[13],v=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*f+w*g,t[1]=b*i+x*l+_*h+w*m,t[2]=b*a+x*u+_*p+w*v,t[3]=b*o+x*c+_*d+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*f+w*g,t[5]=b*i+x*l+_*h+w*m,t[6]=b*a+x*u+_*p+w*v,t[7]=b*o+x*c+_*d+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*f+w*g,t[9]=b*i+x*l+_*h+w*m,t[10]=b*a+x*u+_*p+w*v,t[11]=b*o+x*c+_*d+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*f+w*g,t[13]=b*i+x*l+_*h+w*m,t[14]=b*a+x*u+_*p+w*v,t[15]=b*o+x*c+_*d+w*y,t}e.exports=n},{}],217:[function(t,e,r){function n(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t}e.exports=n},{}],218:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u,c,f,h,p,d,g,m,v,y,b,x,_,w,A,k,M,E,T,L=n[0],S=n[1],C=n[2],P=Math.sqrt(L*L+S*S+C*C);return Math.abs(P)<1e-6?null:(P=1/P,L*=P,S*=P,C*=P,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],u=e[2],c=e[3],f=e[4],h=e[5],p=e[6],d=e[7],g=e[8],m=e[9],v=e[10],y=e[11],b=L*L*o+a,x=S*L*o+C*i,_=C*L*o-S*i,w=L*S*o-C*i,A=S*S*o+a,k=C*S*o+L*i,M=L*C*o+S*i,E=S*C*o-L*i,T=C*C*o+a,t[0]=s*b+f*x+g*_,t[1]=l*b+h*x+m*_,t[2]=u*b+p*x+v*_,t[3]=c*b+d*x+y*_,t[4]=s*w+f*A+g*k,t[5]=l*w+h*A+m*k,t[6]=u*w+p*A+v*k,t[7]=c*w+d*A+y*k,t[8]=s*M+f*E+g*T,t[9]=l*M+h*E+m*T,t[10]=u*M+p*E+v*T,t[11]=c*M+d*E+y*T,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}e.exports=n},{}],219:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+f*n,t[7]=l*i+h*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=f*i-s*n,t[11]=h*i-l*n,t}e.exports=n},{}],220:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-u*n,t[1]=o*i-c*n,t[2]=s*i-f*n,t[3]=l*i-h*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+f*i,t[11]=l*n+h*i,t}e.exports=n},{}],221:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+f*n,t[3]=l*i+h*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=f*i-s*n,t[7]=h*i-l*n,t}e.exports=n},{}],222:[function(t,e,r){function n(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}e.exports=n},{}],223:[function(t,e,r){function n(t,e,r){var n,i,a,o,s,l,u,c,f,h,p,d,g=r[0],m=r[1],v=r[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=f,t[9]=h,t[10]=p,t[11]=d,t[12]=n*g+s*m+f*v+e[12],t[13]=i*g+l*m+h*v+e[13],t[14]=a*g+u*m+p*v+e[14],t[15]=o*g+c*m+d*v+e[15]),t}e.exports=n},{}],224:[function(t,e,r){function n(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}e.exports=n},{}],225:[function(t,e,r){"use strict";function n(t,e){for(var r=[0,0,0,0],n=0;4>n;++n)for(var i=0;4>i;++i)r[i]+=t[4*n+i]*e[n];return r}function i(t,e,r,i,a){for(var o=n(i,n(r,n(e,[t[0],t[1],t[2],1]))),s=0;3>s;++s)o[s]/=o[3];return[.5*a[0]*(1+o[0]),.5*a[1]*(1-o[1])]}function a(t,e){if(2===t.length){for(var r=0,n=0,i=0;2>i;++i)r+=Math.pow(e[i]-t[0][i],2),n+=Math.pow(e[i]-t[1][i],2);return r=Math.sqrt(r),n=Math.sqrt(n),1e-6>r+n?[1,0]:[n/(r+n),r/(n+r)]}if(3===t.length){var a=[0,0];return u(t[0],t[1],t[2],e,a),l(t,a)}return[]}function o(t,e){for(var r=[0,0,0],n=0;no;++o)r[o]+=a*i[o];return r}function s(t,e,r,n,s,l){if(1===t.length)return[0,t[0].slice()];for(var u=new Array(t.length),c=0;cd;++d)p+=Math.pow(u[c][d]-e[d],2);h>p&&(h=p,f=c)}for(var g=a(u,e),m=0,c=0;3>c;++c){if(g[c]<-.001||g[c]>1.0001)return null;m+=g[c]}return Math.abs(m-1)>.001?null:[f,o(t,g),g]}var l=t("barycentric"),u=t("polytope-closest-point/lib/closest_point_2d.js");e.exports=s},{barycentric:228,"polytope-closest-point/lib/closest_point_2d.js":269}],226:[function(t,e,r){var n="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec4 m_position = model * vec4(position, 1.0);\n vec4 t_position = view * m_position;\n gl_Position = projection * t_position;\n f_color = color;\n f_normal = normal;\n f_data = position;\n f_eyeDirection = eyePosition - position;\n f_lightDirection = lightPosition - position;\n f_uv = uv;\n}",i="#define GLSLIFY 1\nprecision mediump float;\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat cookTorranceSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution_2_0(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n \n if(!gl_FrontFacing) {\n N = -N;\n }\n\n float specular = cookTorranceSpecular_1_1(L, V, N, roughness, fresnel);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}",a="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}",o="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",s="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}",l="#define GLSLIFY 1\nprecision mediump float;\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",u="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}",c="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}",f="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}",h="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}",p="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n";r.meshShader={vertex:n,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:a,fragment:o,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:s,fragment:l,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:u,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:f,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:h,fragment:p,attributes:[{name:"position",type:"vec3"}]}},{}],227:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,g,m,v,y,b,x,_,w,A,k,M,E){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=m,this.edgeUVs=v,this.edgeIds=g,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=w,this.pointSizes=A,this.pointIds=x,this.pointVAO=k,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=E,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=R,this._view=R,this._projection=R,this._resolution=[1,1]}function i(t){for(var e=w({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;256>n;++n){for(var i=e[n],a=0;3>a;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return _(r,[256,256,4],[4,0,1])}function a(t,e,r){for(var n=new Array(e),i=0;e>i;++i)n[i]=0;for(var a=t.length,i=0;a>i;++i)for(var o=t[i],s=0;sn;++n)r[n]=t[n][2];return r}function s(t){var e=d(t,T);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function l(t){var e=d(t,L);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function u(t){var e=d(t,S);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function c(t){var e=d(t,C);return e.attributes.position.location=0,e.attributes.id.location=1,e}function f(t){var e=d(t,P);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function h(t){var e=d(t,z);return e.attributes.position.location=0,e}function p(t){var e=t.gl,r=s(e),i=l(e),a=u(e),o=c(e),p=f(e),d=h(e),y=v(e,_(new Uint8Array([255,255,255,255]),[1,1,4]));y.generateMipmap(),y.minFilter=e.LINEAR_MIPMAP_LINEAR,y.magFilter=e.LINEAR;var b=g(e),x=g(e),w=g(e),A=g(e),k=g(e),M=m(e,[{buffer:b,type:e.FLOAT,size:3},{buffer:k,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:x,type:e.FLOAT,size:4},{buffer:w,type:e.FLOAT,size:2},{buffer:A,type:e.FLOAT,size:3}]),E=g(e),T=g(e),L=g(e),S=g(e),C=m(e,[{buffer:E,type:e.FLOAT, -size:3},{buffer:S,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:T,type:e.FLOAT,size:4},{buffer:L,type:e.FLOAT,size:2}]),P=g(e),z=g(e),R=g(e),j=g(e),I=g(e),O=m(e,[{buffer:P,type:e.FLOAT,size:3},{buffer:I,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:z,type:e.FLOAT,size:4},{buffer:R,type:e.FLOAT,size:2},{buffer:j,type:e.FLOAT,size:1}]),N=g(e),F=m(e,[{buffer:N,type:e.FLOAT,size:3}]),D=new n(e,y,r,i,a,o,p,d,b,k,x,w,A,M,E,S,T,L,C,P,I,z,R,j,O,N,F);return D.update(t),D}var d=t("gl-shader"),g=t("gl-buffer"),m=t("gl-vao"),v=t("gl-texture2d"),y=t("normals"),b=t("gl-mat4/multiply"),x=t("gl-mat4/invert"),_=t("ndarray"),w=t("colormap"),A=t("simplicial-complex-contour"),k=t("typedarray-pool"),M=t("./lib/shaders"),E=t("./lib/closest-point"),T=M.meshShader,L=M.wireShader,S=M.pointShader,C=M.pickShader,P=M.pointPickShader,z=M.contourShader,R=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],j=n.prototype;j.isOpaque=function(){return this.opacity>=1},j.isTransparent=function(){return this.opacity<1},j.pickSlots=1,j.setPickBase=function(t){this.pickId=t},j.highlight=function(t){if(!t||!this.contourEnable)return void(this.contourCount=0);for(var e=A(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=k.mallocFloat32(6*a),s=0,l=0;a>l;++l)for(var u=r[l],c=0;2>c;++c){var f=u[0];2===u.length&&(f=u[c]);for(var h=n[f][0],p=n[f][1],d=i[f],g=1-d,m=this.positions[h],v=this.positions[p],y=0;3>y;++y)o[s++]=d*m[y]+g*v[y]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),k.free(o)},j.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"contourEnable"in t&&(this.contourEnable=t.contourEnable),"contourColor"in t&&(this.contourColor=t.contourColor),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"opacity"in t&&(this.opacity=t.opacity),t.texture?(this.texture.dispose(),this.texture=v(e,t.texture)):t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(i(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var s=[],l=[],u=[],c=[],f=[],h=[],p=[],d=[],g=[],m=[],b=[],x=[],_=[],w=[];this.cells=r,this.positions=n;var A=t.vertexNormals,k=t.cellNormals;t.useFacetNormals&&!k&&(k=y.faceNormals(r,n)),k||A||(A=y.vertexNormals(r,n));var M=t.vertexColors,E=t.cellColors,T=t.meshColor||[1,1,1,1],L=t.vertexUVs,S=t.vertexIntensity,C=t.cellUVs,P=t.cellIntensity,z=1/0,R=-(1/0);if(!L&&!C)if(S)for(var j=0;jD;++D)!isNaN(F[D])&&isFinite(F[D])&&(this.bounds[0][D]=Math.min(this.bounds[0][D],F[D]),this.bounds[1][D]=Math.max(this.bounds[1][D],F[D]));var B=0,U=0,V=0;t:for(var j=0;jD;++D)if(isNaN(F[D])||!isFinite(F[D]))continue t;m.push(F[0],F[1],F[2]);var H;H=M?M[G]:E?E[j]:T,3===H.length?b.push(H[0],H[1],H[2],1):b.push(H[0],H[1],H[2],H[3]);var Y;Y=L?L[G]:S?[(S[G]-z)/(R-z),0]:C?C[j]:P?[(P[j]-z)/(R-z),0]:[(F[2]-z)/(R-z),0],x.push(Y[0],Y[1]),O?_.push(O[G]):_.push(N),w.push(j),V+=1;break;case 2:for(var D=0;2>D;++D)for(var G=q[D],F=n[G],X=0;3>X;++X)if(isNaN(F[X])||!isFinite(F[X]))continue t;for(var D=0;2>D;++D){var G=q[D],F=n[G];h.push(F[0],F[1],F[2]);var H;H=M?M[G]:E?E[j]:T,3===H.length?p.push(H[0],H[1],H[2],1):p.push(H[0],H[1],H[2],H[3]);var Y;Y=L?L[G]:S?[(S[G]-z)/(R-z),0]:C?C[j]:P?[(P[j]-z)/(R-z),0]:[(F[2]-z)/(R-z),0],d.push(Y[0],Y[1]),g.push(j)}U+=1;break;case 3:for(var D=0;3>D;++D)for(var G=q[D],F=n[G],X=0;3>X;++X)if(isNaN(F[X])||!isFinite(F[X]))continue t;for(var D=0;3>D;++D){var G=q[D],F=n[G];s.push(F[0],F[1],F[2]);var H;H=M?M[G]:E?E[j]:T,3===H.length?l.push(H[0],H[1],H[2],1):l.push(H[0],H[1],H[2],H[3]);var Y;Y=L?L[G]:S?[(S[G]-z)/(R-z),0]:C?C[j]:P?[(P[j]-z)/(R-z),0]:[(F[2]-z)/(R-z),0],c.push(Y[0],Y[1]);var W;W=A?A[G]:k[j],u.push(W[0],W[1],W[2]),f.push(j)}B+=1}}this.pointCount=V,this.edgeCount=U,this.triangleCount=B,this.pointPositions.update(m),this.pointColors.update(b),this.pointUVs.update(x),this.pointSizes.update(_),this.pointIds.update(new Uint32Array(w)),this.edgePositions.update(h),this.edgeColors.update(p),this.edgeUVs.update(d),this.edgeIds.update(new Uint32Array(g)),this.trianglePositions.update(s),this.triangleColors.update(l),this.triangleUVs.update(c),this.triangleNormals.update(u),this.triangleIds.update(new Uint32Array(f))}},j.drawTransparent=j.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||R,n=t.view||R,i=t.projection||R,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;3>o;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:i,clipBounds:a,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,contourColor:this.contourColor,texture:0};this.texture.bind(0);var l=new Array(16);b(l,s.view,s.model),b(l,s.projection,l),x(l,l);for(var o=0;3>o;++o)s.eyePosition[o]=l[12+o]/l[15];for(var u=l[15],o=0;3>o;++o)u+=this.lightPosition[o]*l[4*o+3];for(var o=0;3>o;++o){for(var c=l[12+o],f=0;3>f;++f)c+=l[4*f+o]*this.lightPosition[f];s.lightPosition[o]=c/u}if(this.triangleCount>0){var h=this.triShader;h.bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var h=this.lineShader;h.bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var h=this.pointShader;h.bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var h=this.contourShader;h.bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},j.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||R,n=t.view||R,i=t.projection||R,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;3>o;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255},l=this.pickShader;if(l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l=this.pointPickShader;l.bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},j.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;ao;++o){for(var s=new Array(r+1),l=0;r>=l;++l)s[l]=t[l][o];i[o]=s}i[r]=new Array(r+1);for(var o=0;r>=o;++o)i[r][o]=1;for(var u=new Array(r+1),o=0;r>o;++o)u[o]=e[o];u[r]=1;var c=a(i,u),f=n(c[r+1]);0===f&&(f=1);for(var h=new Array(r+1),o=0;r>=o;++o)h[o]=n(c[o])/f;return h}e.exports=i;var a=t("robust-linear-solve")},{"robust-linear-solve":229}],229:[function(t,e,r){arguments[4][34][0].apply(r,arguments)},{dup:34,"robust-determinant":235}],230:[function(t,e,r){arguments[4][35][0].apply(r,arguments)},{dup:35}],231:[function(t,e,r){arguments[4][36][0].apply(r,arguments)},{dup:36}],232:[function(t,e,r){arguments[4][37][0].apply(r,arguments)},{dup:37,"two-product":234,"two-sum":231}],233:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],234:[function(t,e,r){arguments[4][39][0].apply(r,arguments)},{dup:39}],235:[function(t,e,r){arguments[4][40][0].apply(r,arguments)},{dup:40,"robust-compress":230,"robust-scale":232,"robust-sum":233,"two-product":234}],236:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:0,rgb:[255,255,255,1]}]}},{}],237:[function(t,e,r){"use strict";function n(t){for(var e,r="#",n=0;3>n;++n)e=t[n],e=e.toString(16),r+=("00"+e).substr(e.length);return r}function i(t){return"rgba("+t.join(",")+")"}var a=t("arraytools"),o=t("./colorScales.json");e.exports=function(t){var e,r,s,l,u,c,f,h,p,d,g,m,v,y=[],b=[],x=[],_=[];if(a.isPlainObject(t)||(t={}),t.colormap||(f="jet"),Array.isArray(t.alpha)?2!==t.alpha.length&&(t.alpha=[1,1]):"number"==typeof t.alpha?t.alpha=[t.alpha,t.alpha]:t.alpha=[1,1],"string"==typeof t.colormap){if(f=t.colormap.toLowerCase(),!(f in o))throw Error(f+" not a supported colorscale");c=o[f]}else Array.isArray(t.colormap)&&(c=t.colormap);if(p=t.nshades||72,h=t.format||"hex",g=t.alpha,c.length>p)throw new Error(f+" map requires nshades to be at least size "+c.length);for(e=c.map(function(t){return Math.round(t.index*p)}),g[0]<0&&(g[0]=0),g[1]<0&&(g[0]=0),g[0]>1&&(g[0]=1),g[1]>1&&(g[0]=1),v=0;v=0&&r[3]<=1||(r[3]=g[0]+(g[1]-g[0])*m);for(v=0;va;++a)i[a]=[0,0,0];for(var a=0;ay;++y)d[y]=f[y]-h[y],g+=d[y]*d[y],m[y]=p[y]-h[y],v+=m[y]*m[y];if(g*v>n)for(var b=i[l],x=1/Math.sqrt(g*v),y=0;3>y;++y){var _=(y+1)%3,w=(y+2)%3;b[y]+=x*(m[_]*d[w]-m[w]*d[_])}}for(var a=0;r>a;++a){for(var b=i[a],A=0,y=0;3>y;++y)A+=b[y]*b[y];if(A>n)for(var x=1/Math.sqrt(A),y=0;3>y;++y)b[y]*=x;else for(var y=0;3>y;++y)b[y]=0}return i},r.faceNormals=function(t,e){for(var r=t.length,i=new Array(r),a=0;r>a;++a){for(var o=t[a],s=new Array(3),l=0;3>l;++l)s[l]=e[o[l]];for(var u=new Array(3),c=new Array(3),l=0;3>l;++l)u[l]=s[1][l]-s[0][l],c[l]=s[2][l]-s[0][l];for(var f=new Array(3),h=0,l=0;3>l;++l){var p=(l+1)%3,d=(l+2)%3;f[l]=u[p]*c[d]-u[d]*c[p],h+=f[l]*f[l]}h=h>n?1/Math.sqrt(h):0;for(var l=0;3>l;++l)f[l]*=h;i[a]=f}return i}},{}],269:[function(t,e,r){"use strict";function n(t,e,r,n,s){i.length=x+_)if(0>x)0>_&&0>h?(_=0,-h>=u?(x=1,y=u+2*h+d):(x=-h/u,y=h*x+d)):(x=0,p>=0?(_=0,y=d):-p>=f?(_=1,y=f+2*p+d):(_=-p/f,y=p*_+d));else if(0>_)_=0,h>=0?(x=0,y=d):-h>=u?(x=1,y=u+2*h+d):(x=-h/u,y=h*x+d);else{var w=1/b;x*=w,_*=w,y=x*(u*x+c*_+2*h)+_*(c*x+f*_+2*p)+d}else{var A,k,M,E;0>x?(A=c+h,k=f+p,k>A?(M=k-A,E=u-2*c+f,M>=E?(x=1,_=0,y=u+2*h+d):(x=M/E,_=1-x,y=x*(u*x+c*_+2*h)+_*(c*x+f*_+2*p)+d)):(x=0,0>=k?(_=1,y=f+2*p+d):p>=0?(_=0,y=d):(_=-p/f,y=p*_+d))):0>_?(A=c+p,k=u+h,k>A?(M=k-A,E=u-2*c+f,M>=E?(_=1,x=0,y=f+2*p+d):(_=M/E,x=1-_,y=x*(u*x+c*_+2*h)+_*(c*x+f*_+2*p)+d)):(_=0,0>=k?(x=1,y=u+2*h+d):h>=0?(x=0,y=d):(x=-h/u,y=h*x+d))):(M=f+p-c-h,0>=M?(x=0,_=1,y=f+2*p+d):(E=u-2*c+f,M>=E?(x=1,_=0,y=u+2*h+d):(x=M/E,_=1-x,y=x*(u*x+c*_+2*h)+_*(c*x+f*_+2*p)+d)))}for(var T=1-x-_,l=0;ly?0:y}var i=new Float64Array(4),a=new Float64Array(4),o=new Float64Array(4);e.exports=n},{}],270:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=0,n=0;e>n;++n)r=0|Math.max(r,t[n].length);return r-1}function i(t,e){for(var r=t.length,n=f.mallocUint8(r),i=0;r>i;++i)n[i]=t[i]o;++o)for(var s=t[o],e=s.length,l=0;e>l;++l)for(var u=0;l>u;++u){var p=s[u],d=s[l];i[a++]=0|Math.min(p,d),i[a++]=0|Math.max(p,d)}var g=a/2|0;h(c(i,[g,2]));for(var m=2,o=2;a>o;o+=2)(i[o-2]!==i[o]||i[o-1]!==i[o+1])&&(i[m++]=i[o],i[m++]=i[o+1]);return c(i,[m/2|0,2])}function o(t,e,r,n){for(var i=t.data,a=t.shape[0],o=f.mallocDouble(a),s=0,l=0;a>l;++l){var u=i[2*l],h=i[2*l+1];if(r[u]!==r[h]){var p=e[u],d=e[h];i[2*s]=u,i[2*s+1]=h,o[s++]=(d-n)/(d-p)}}return t.shape[0]=s,c(o,[s])}function s(t,e){var r=f.mallocInt32(2*e),n=t.shape[0],i=t.data;r[0]=0;for(var a=0,o=0;n>o;++o){var s=i[2*o];if(s!==a){for(r[2*a+1]=o;++ai;++i)n[i]=[r[2*i],r[2*i+1]];return n}function u(t,e,r,u){r=r||0,"undefined"==typeof u&&(u=n(t));var c=t.length;if(0===c||1>u)return{cells:[],vertexIds:[],vertexWeights:[]};var h=i(e,+r),d=a(t,u),g=o(d,e,h,+r),m=s(d,0|e.length),v=p(u)(t,d.data,m,h),y=l(d),b=[].slice.call(g.data,0,g.shape[0]);return f.free(h),f.free(d.data),f.free(g.data),f.free(m),{cells:v,vertexIds:y,vertexWeights:b}}e.exports=u;var c=t("ndarray"),f=t("typedarray-pool"),h=t("ndarray-sort"),p=t("./lib/codegen")},{"./lib/codegen":271,ndarray:987,"ndarray-sort":274,"typedarray-pool":277}],271:[function(t,e,r){"use strict";function n(t){function e(t){if(!(t.length<=0)){u.push("R.push(");for(var e=0;e0&&u.push(","),u.push("[");for(var n=0;n0&&u.push(","),u.push("B(C,E,c[",i[0],"],c[",i[1],"])")}u.push("]")}u.push(");")}}var r=0,n=new Array(t+1);n[0]=[[]];for(var i=1;t>=i;++i)for(var s=n[i]=o(i),l=0;l>1,v=E[2*m+1];","if(v===b){return m}","if(b1;--i){t+1>i&&u.push("else "),u.push("if(l===",i,"){");for(var c=[],l=0;i>l;++l)c.push("(S[c["+l+"]]<<"+l+")");u.push("var M=",c.join("+"),";if(M===0||M===",(1<i;++i)n[i]=0,i===e&&(n[i]+=.5),i===r&&(n[i]+=.5);return n}function i(t,e){if(0===e||e===(1<=a;++a)if(e&1<=s;++s)~e&1<n;++n)r[n]=i(t,n);return r}e.exports=a;var o=t("convex-hull")},{"convex-hull":54}],273:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[l.mallocUint8,l.freeUint8];case"uint16":return[l.mallocUint16,l.freeUint16];case"uint32":return[l.mallocUint32,l.freeUint32];case"int8":return[l.mallocInt8,l.freeInt8];case"int16":return[l.mallocInt16,l.freeInt16];case"int32":return[l.mallocInt32,l.freeInt32];case"float32":return[l.mallocFloat,l.freeFloat];case"float64":return[l.mallocDouble,l.freeDouble];default:return null}}function i(t){for(var e=[],r=0;t>r;++r)e.push("s"+r);for(var r=0;t>r;++r)e.push("n"+r);for(var r=1;t>r;++r)e.push("d"+r);for(var r=1;t>r;++r)e.push("e"+r);for(var r=1;t>r;++r)e.push("f"+r);return e}function a(t,e){function r(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function a(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}var o=["'use strict'"],s=["ndarrayInsertionSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(i(t.length)),u=n(e),c=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var f=[],h=1;h1){o.push("dptr=0;sptr=ptr");for(var h=t.length-1;h>=0;--h){var p=t[h];0!==p&&o.push(["for(i",p,"=0;i",p,"left){","dptr=0","sptr=cptr-s0");for(var h=1;hb){break __l}"].join(""));for(var h=t.length-1;h>=1;--h)o.push("sptr+=e"+h,"dptr+=f"+h,"}");o.push("dptr=cptr;sptr=cptr-s0");for(var h=t.length-1;h>=0;--h){var p=t[h];0!==p&&o.push(["for(i",p,"=0;i",p,"=0;--h){var p=t[h];0!==p&&o.push(["for(i",p,"=0;i",p,"left)&&("+r("cptr-s0")+">scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));if(o.push("}"),t.length>1&&u&&o.push("free(scratch)"),o.push("} return "+s),u){var d=new Function("malloc","free",o.join("\n"));return d(u[0],u[1])}var d=new Function(o.join("\n"));return d()}function o(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function o(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function s(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function l(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i=0;--i){var o=t[i];0!==o&&_.push(["for(i",o,"=0;i",o,"1)for(var i=0;i1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function c(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o1)for(var o=0;o=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function f(){t.length>1&&k&&_.push("free(pivot1)","free(pivot2)")}function h(e,r){var n="el"+e,i="el"+r;if(t.length>1){var s="__l"+ ++M;c(s,[n,i],!1,["comp=",o("ptr0"),"-",o("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",s,"}\n","if(comp<0){break ",s,"}"].join(""))}else _.push(["if(",o(a(n)),">",o(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function p(e,r){t.length>1?l([e,r],!1,s("ptr0",o("ptr1"))):_.push(s(a(e),o(a(r))))}function d(e,r,n){if(t.length>1){var i="__l"+ ++M;c(i,[r],!0,[e,"=",o("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",o(a(r)),"-pivot",n].join(""))}function g(e,r){t.length>1?l([e,r],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join(""))}function m(e,r,n){t.length>1?(l([e,r,n],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join(""))}function v(t,e){g(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?l([e,r],!0,[s("ptr0",o("ptr1")),"\n",s("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(s(a(e),o(a(r))),s(a(r),"pivot"+n))}function b(e,r){_.push(["if((",r,"-",e,")<=",u,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function x(e,r,n){t.length>1?(_.push(["__l",++M,":while(true){"].join("")),l([e],!0,["if(",o("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",M,"}"].join("")),_.push(n,"}")):_.push(["while(",o(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),A=["left","right","data","offset"].concat(i(t.length)),k=n(e),M=0;_.push(["function ",w,"(",A.join(","),"){"].join(""));var E=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var T=[],L=1;LL;++L)E.push("b_ptr"+L);E.push("ptr3","ptr4","ptr5","ptr6","ptr7","pivot_ptr","ptr_shift","elementSize="+T.join("*")),k?E.push("pivot1=malloc(elementSize)","pivot2=malloc(elementSize)"):E.push("pivot1=new Array(elementSize),pivot2=new Array(elementSize)")}else E.push("pivot1","pivot2");if(_.push("var "+E.join(",")),h(1,2),h(4,5),h(1,3),h(2,3),h(1,4),h(3,4),h(2,5),h(2,3),h(4,5),t.length>1?l(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",o("ptr1"),"\n","pivot2[pivot_ptr]=",o("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",o("ptr0"),"\n","y=",o("ptr2"),"\n","z=",o("ptr4"),"\n",s("ptr5","x"),"\n",s("ptr6","y"),"\n",s("ptr7","z")].join("")):_.push(["pivot1=",o(a("el2")),"\n","pivot2=",o(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",o(a("el1")),"\n","y=",o(a("el3")),"\n","z=",o(a("el5")),"\n",s(a("index1"),"x"),"\n",s(a("index3"),"y"),"\n",s(a("index5"),"z")].join("")),p("index2","left"),p("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),d("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),g("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),d("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),m("k","less","great"),_.push("break"),_.push("}else{"),v("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),d("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),g("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),d("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),d("comp","great",2),_.push("if(comp>0){"),_.push("if(--greatindex5){"),x("less",1,"++less"),x("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),d("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),g("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),d("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),d("comp","great",2),_.push("if(comp===0){"),_.push("if(--great1&&k){var S=new Function("insertionSort","malloc","free",_.join("\n"));return S(r,k[0],k[1])}var S=new Function("insertionSort",_.join("\n"));return S(r)}function s(t,e){var r=["'use strict'"],n=["ndarraySortWrapper",t.join("d"),e].join(""),s=["array"];r.push(["function ",n,"(",s.join(","),"){"].join(""));for(var l=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],c=0;c0?l.push(["d",m,"=s",m,"-d",d,"*n",d].join("")):l.push(["d",m,"=s",m].join("")),d=m);var p=t.length-1-c;0!==p&&(g>0?l.push(["e",p,"=s",p,"-e",g,"*n",g,",f",p,"=",f[p],"-f",g,"*n",g].join("")):l.push(["e",p,"=s",p,",f",p,"=",f[p]].join("")),g=p)}r.push("var "+l.join(","));var v=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",u,"){","insertionSort(",v.join(","),")}else{","quickSort(",v.join(","),")}"].join("")),r.push("}return "+n);var y=new Function("insertionSort","quickSort",r.join("\n")),b=a(t,e),x=o(t,e,b);return y(b,x)}var l=t("typedarray-pool"),u=32;e.exports=s},{"typedarray-pool":277}],274:[function(t,e,r){"use strict";function n(t){var e=t.order,r=t.dtype,n=[e,r],o=n.join(":"),s=a[o];return s||(a[o]=s=i(e,r)),s(t),t}var i=t("./lib/compile_sort.js"),a={};e.exports=n},{"./lib/compile_sort.js":273}],275:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],276:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],277:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":275,buffer:48,dup:102}],278:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl,r=a(e,[0,0,0,1,1,0,1,1]),i=o(e,s.boxVert,s.lineFrag);return new n(t,r,i)}e.exports=i;var a=t("gl-buffer"),o=t("gl-shader"),s=t("./shaders"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawBox=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o){var s=this.plot,l=this.shader,u=s.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,l.uniforms.lo=t,l.uniforms.hi=e,l.uniforms.color=o,u.drawArrays(u.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":281,"gl-buffer":284,"gl-shader":299}],279:[function(t,e,r){"use strict";function n(t,e,r,n){this.plot=t,this.vbo=e,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function i(t,e){return t-e}function a(t){var e=t.gl,r=o(e),i=s(e,u.gridVert,u.gridFrag),a=s(e,u.tickVert,u.gridFrag),l=new n(t,r,i,a);return l}e.exports=a;var o=t("gl-buffer"),s=t("gl-shader"),l=t("binary-search-bounds"),u=t("./shaders"),c=n.prototype;c.draw=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){for(var n=this.plot,i=this.vbo,a=this.shader,o=this.ticks,s=n.gl,l=n._tickBounds,u=n.dataBox,c=n.viewBox,f=n.gridLineWidth,h=n.gridLineColor,p=n.gridLineEnable,d=n.pixelRatio,g=0;2>g;++g){var m=l[g],v=l[g+2],y=v-m,b=.5*(u[g+2]+u[g]),x=u[g+2]-u[g];e[g]=2*y/x,t[g]=2*(m-b)/x}a.bind(),i.bind(),a.attributes.dataCoord.pointer(),a.uniforms.dataShift=t,a.uniforms.dataScale=e;for(var _=0,g=0;2>g;++g){r[0]=r[1]=0,r[g]=1,a.uniforms.dataAxis=r,a.uniforms.lineWidth=f[g]/(c[g+2]-c[g])*d,a.uniforms.color=h[g];var w=6*o[g].length;p[g]&&s.drawArrays(s.TRIANGLES,_,w),_+=w}}}(),c.drawTickMarks=function(){var t=[0,0],e=[0,0],r=[1,0],n=[0,1],a=[0,0],o=[0,0];return function(){for(var s=this.plot,u=this.vbo,c=this.tickShader,f=this.ticks,h=s.gl,p=s._tickBounds,d=s.dataBox,g=s.viewBox,m=s.pixelRatio,v=s.screenBox,y=v[2]-v[0],b=v[3]-v[1],x=g[2]-g[0],_=g[3]-g[1],w=0;2>w;++w){var A=p[w],k=p[w+2],M=k-A,E=.5*(d[w+2]+d[w]),T=d[w+2]-d[w];e[w]=2*M/T,t[w]=2*(A-E)/T}e[0]*=x/y,t[0]*=x/y,e[1]*=_/b,t[1]*=_/b,c.bind(),u.bind(),c.attributes.dataCoord.pointer();var L=c.uniforms;L.dataShift=t,L.dataScale=e;var S=s.tickMarkLength,C=s.tickMarkWidth,P=s.tickMarkColor,z=0,R=6*f[0].length,j=Math.min(l.ge(f[0],(d[0]-p[0])/(p[2]-p[0]),i),f[0].length),I=Math.min(l.gt(f[0],(d[2]-p[0])/(p[2]-p[0]),i),f[0].length),O=z+6*j,N=6*Math.max(0,I-j),F=Math.min(l.ge(f[1],(d[1]-p[1])/(p[3]-p[1]),i),f[1].length),D=Math.min(l.gt(f[1],(d[3]-p[1])/(p[3]-p[1]),i),f[1].length),B=R+6*F,U=6*Math.max(0,D-F);a[0]=2*(g[0]-S[1])/y-1,a[1]=(g[3]+g[1])/b-1,o[0]=S[1]*m/y,o[1]=C[1]*m/b,L.color=P[1],L.tickScale=o,L.dataAxis=n,L.screenOffset=a,h.drawArrays(h.TRIANGLES,B,U),a[0]=(g[2]+g[0])/y-1,a[1]=2*(g[1]-S[0])/b-1,o[0]=C[0]*m/y,o[1]=S[0]*m/b,L.color=P[0],L.tickScale=o,L.dataAxis=r,L.screenOffset=a,h.drawArrays(h.TRIANGLES,O,N),a[0]=2*(g[2]+S[3])/y-1,a[1]=(g[3]+g[1])/b-1,o[0]=S[3]*m/y,o[1]=C[3]*m/b,L.color=P[3],L.tickScale=o,L.dataAxis=n,L.screenOffset=a,h.drawArrays(h.TRIANGLES,B,U),a[0]=(g[2]+g[0])/y-1,a[1]=2*(g[3]+S[2])/b-1,o[0]=C[2]*m/y,o[1]=S[2]*m/b,L.color=P[2],L.tickScale=o,L.dataAxis=r,L.screenOffset=a,h.drawArrays(h.TRIANGLES,O,N)}}(),c.update=function(){var t=[1,1,-1,-1,1,-1],e=[1,-1,1,1,-1,-1];return function(r){for(var n=r.ticks,i=r.bounds,a=new Float32Array(18*(n[0].length+n[1].length)),o=(this.plot.zeroLineEnable,0),s=[[],[]],l=0;2>l;++l)for(var u=s[l],c=n[l],f=i[l],h=i[l+2],p=0;pg;++g)a[o++]=d,a[o++]=t[g],a[o++]=e[g]}this.ticks=s,this.vbo.update(a)}}(),c.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{"./shaders":281,"binary-search-bounds":283,"gl-buffer":284,"gl-shader":299}],280:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl,r=a(e,[-1,-1,-1,1,1,-1,1,1]),i=o(e,s.lineVert,s.lineFrag),l=new n(t,r,i);return l}e.exports=i;var a=t("gl-buffer"),o=t("gl-shader"),s=t("./shaders"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawLine=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o,s){var l=this.plot,u=this.shader,c=l.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,u.uniforms.start=t,u.uniforms.end=e,u.uniforms.width=o*l.pixelRatio,u.uniforms.color=s,c.drawArrays(c.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":281,"gl-buffer":284,"gl-shader":299}],281:[function(t,e,r){"use strict";var n="#define GLSLIFY 1\nprecision lowp float;\nuniform vec4 color;\nvoid main() {\n gl_FragColor = vec4(color.xyz * color.w, color.w);\n}\n";e.exports={lineVert:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 start, end;\nuniform float width;\n\nvec2 perp(vec2 v) {\n return vec2(v.y, -v.x);\n}\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n vec2 delta = normalize(perp(start - end));\n vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));\n gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);\n}\n",lineFrag:n,textVert:"#define GLSLIFY 1\nattribute vec3 textCoordinate;\n\nuniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;\nuniform float angle;\n\nvoid main() {\n float dataOffset = textCoordinate.z;\n vec2 glyphOffset = textCoordinate.xy;\n mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +\n glyphMatrix * glyphOffset * textScale + screenOffset;\n gl_Position = vec4(screenCoordinate, 0, 1);\n}\n",textFrag:n,gridVert:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale;\nuniform float lineWidth;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;\n gl_Position = vec4(pos, 0, 1);\n}\n",gridFrag:n,boxVert:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 lo, hi;\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);\n}\n",tickVert:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);\n}\n"}},{}],282:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}function i(t){var e=t.gl,r=a(e),i=o(e,u.textVert,u.textFrag),s=new n(t,r,i);return s}e.exports=i;var a=t("gl-buffer"),o=t("gl-shader"),s=t("text-cache"),l=t("binary-search-bounds"),u=t("./shaders"),c=n.prototype;c.drawTicks=function(){var t=[0,0],e=[0,0],r=[0,0];return function(n){var i=this.plot,a=this.shader,o=this.tickX[n],s=this.tickOffset[n],u=i.gl,c=i.viewBox,f=i.dataBox,h=i.screenBox,p=i.pixelRatio,d=i.tickEnable,g=i.tickPad,m=i.tickColor,v=i.tickAngle,y=(i.tickMarkLength,i.labelEnable),b=i.labelPad,x=i.labelColor,_=i.labelAngle,w=this.labelOffset[n],A=this.labelCount[n],k=l.lt(o,f[n]),M=l.le(o,f[n+2]);t[0]=t[1]=0,t[n]=1,e[n]=(c[2+n]+c[n])/(h[2+n]-h[n])-1;var E=2/h[2+(1^n)]-h[1^n];e[1^n]=E*c[1^n]-1,d[n]&&(e[1^n]-=E*p*g[n],M>k&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=m[n],a.uniforms.angle=v[n],u.drawArrays(u.TRIANGLES,s[k],s[M]-s[k]))),y[n]&&(e[1^n]-=E*p*b[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n],a.uniforms.angle=_[n],u.drawArrays(u.TRIANGLES,w,A)),e[1^n]=E*c[2+(1^n)]-1,d[n+2]&&(e[1^n]+=E*p*g[n+2],M>k&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=m[n+2],a.uniforms.angle=v[n+2],u.drawArrays(u.TRIANGLES,s[k],s[M]-s[k]))),y[n+2]&&(e[1^n]+=E*p*b[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n+2],a.uniforms.angle=_[n+2],u.drawArrays(u.TRIANGLES,w,A))}}(),c.drawTitle=function(){var t=[0,0],e=[0,0];return function(){for(var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,o=r.titleCenter,u=r.pixelRatio,c=0;2>c;++c)e[c]=2*(o[c]*u-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var u=0;2>u;++u){var c=a[u],f=a[u+2],h=f-c,p=.5*(o[u+2]+o[u]),d=o[u+2]-o[u],g=l[u],m=l[u+2],v=m-g,y=s[u],b=s[u+2],x=b-y;e[u]=2*h/d*v/x,t[u]=2*(c-p)/d*v/x}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){for(var e=[],r=t.ticks,n=t.bounds,i=0;2>i;++i){for(var a=[Math.floor(e.length/3)],o=[-(1/0)],l=r[i],u=0;ui;++i){this.labelOffset[i]=Math.floor(e.length/3);for(var g=s(t.labelFont[i],t.labels[i]).data,d=t.labelSize[i],u=0;u>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){var a=new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],284:[function(t,e,r){arguments[4][75][0].apply(r,arguments)},{dup:75,ndarray:987,"ndarray-ops":982,"typedarray-pool":287}],285:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],286:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],287:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":285,buffer:48,dup:102}],288:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],289:[function(t,e,r){e.exports=t("cwise-compiler")},{"cwise-compiler":290}],290:[function(t,e,r){"use strict";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function i(t){var e=new n;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===o){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,a(e)}var a=t("./lib/thunk.js");e.exports=i},{"./lib/thunk.js":292}],291:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,f=0;for(n=0;a>n;++n)u.push(["i",n,"=0"].join(""));for(i=0;o>i;++i)for(n=0;a>n;++n)f=c,c=t[n],0===n?u.push(["d",i,"s",n,"=t",i,"p",c].join("")):u.push(["d",i,"s",n,"=(t",i,"p",c,"-s",f,"*t",i,"p",f,")"].join(""));for(l.push("var "+u.join(",")),n=a-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"n;++n){for(f=c,c=t[n],i=0;o>i;++i)l.push(["p",i,"+=d",i,"s",n].join(""));s&&(n>0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r,i){for(var a=e.length,o=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,u=[],c=0;o>c;++c)u.push(["var offset",c,"=p",c].join(""));for(var c=t;a>c;++c)u.push(["for(var j"+c+"=SS[",e[c],"]|0;j",c,">0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",e[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",e[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",e[c],"]=j",c].join(""));for(var c=0;o>c;++c){for(var f=["offset"+c],h=t;a>h;++h)f.push(["j",h,"*t",c,"p",e[h]].join(""));u.push(["p",c,"=(",f.join("+"),")"].join(""))}u.push(n(e,r,i));for(var c=t;a>c;++c)u.push("}");return u.join("\n")}function a(t){for(var e=0,r=t[0].length;r>e;){for(var n=1;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}function l(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,l=new Array(t.arrayArgs.length),c=new Array(t.arrayArgs.length),f=0;fy;++y)_.push(["s",y,"=SS[",y,"]"].join(""));for(var f=0;fy;++y)_.push(["t",f,"p",y,"=t",f,"[",d[f]+y,"]"].join(""));for(var y=0;y0&&_.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var w=new Array(r),f=0;r>f;++f)w[f]="0";_.push(["index=[",w.join(","),"]"].join(""))}for(var f=0;f3&&x.push(o(t.pre,t,c));var E=o(t.body,t,c),T=a(m);r>T?x.push(i(T,m[0],t,E)):x.push(n(m[0],t,E)),t.post.body.length>3&&x.push(o(t.post,t,c)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+x.join("\n")+"\n----------");var L=[t.funcName||"unnamed","_cwise_loop_",l[0].join("s"),"m",T,s(c)].join(""),S=new Function(["function ",L,"(",b.join(","),"){",x.join("\n"),"} return ",L].join(""));return S()}var u=t("uniq");e.exports=l},{uniq:293}],292:[function(t,e,r){"use strict";function n(t){var e=["'use strict'","var CACHED={}"],r=[],n=t.funcName+"_cwise_thunk";e.push(["return function ",n,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var c=0;c=n;++n){for(var i=new Array(r),a=0;n>a;++a)i[a]=t.COLOR_ATTACHMENT0+a;for(var a=n;r>a;++a)i[a]=t.NONE;y[n]=i}}function o(t){switch(t){case d:throw new Error("gl-fbo: Framebuffer unsupported");case g:throw new Error("gl-fbo: Framebuffer incomplete attachment");case m:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case v:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function s(t,e,r,n,i,a){if(!n)return null;var o=p(t,e,r,i,n);return o.magFilter=t.NEAREST,o.minFilter=t.NEAREST,o.mipSamples=1,o.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,a,t.TEXTURE_2D,o.handle,0),o}function l(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function u(t){var e=n(t.gl),r=t.gl,a=t.handle=r.createFramebuffer(),u=t._shape[0],c=t._shape[1],f=t.color.length,h=t._ext,p=t._useStencil,d=t._useDepth,g=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,a);for(var m=0;f>m;++m)t.color[m]=s(r,u,c,g,r.RGBA,r.COLOR_ATTACHMENT0+m);0===f?(t._color_rb=l(r,u,c,r.RGBA4,r.COLOR_ATTACHMENT0),h&&h.drawBuffersWEBGL(y[0])):f>1&&h.drawBuffersWEBGL(y[f]);var v=r.getExtension("WEBGL_depth_texture");v?p?t.depth=s(r,u,c,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):d&&(t.depth=s(r,u,c,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):d&&p?t._depth_rb=l(r,u,c,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):d?t._depth_rb=l(r,u,c,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(t._depth_rb=l(r,u,c,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(var m=0;ml;++l)this.color[l]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=a,this._useStencil=o;var c=this,f=[0|e,0|r];Object.defineProperties(f,{0:{get:function(){return c._shape[0]},set:function(t){return c.width=t}},1:{get:function(){return c._shape[1]},set:function(t){return c.height=t}}}),this._shapeVector=f,u(this)}function f(t,e,r){if(t._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(t._shape[0]!==e||t._shape[1]!==r){var a=t.gl,s=a.getParameter(a.MAX_RENDERBUFFER_SIZE);if(0>e||e>s||0>r||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(a),u=0;ue||e>o||0>r||r>o)throw new Error("gl-fbo: Parameters are too large for FBO");n=n||{};var s=1;if("color"in n){if(s=Math.max(0|n.color,0),0>s)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(s>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(s>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+s+" draw buffers")}}var l=t.UNSIGNED_BYTE,u=t.getExtension("OES_texture_float");if(n.float&&s>0){if(!u)throw new Error("gl-fbo: Context does not support floating point textures");l=t.FLOAT}else n.preferFloat&&s>0&&u&&(l=t.FLOAT);var f=!0;"depth"in n&&(f=!!n.depth);var h=!1;return"stencil"in n&&(h=!!n.stencil),new c(t,e,r,l,s,f,h,i)}var p=t("gl-texture2d");e.exports=h;var d,g,m,v,y=null,b=c.prototype;Object.defineProperties(b,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return f(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t=0|t,f(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t=0|t,f(this,this._shape[0],t),t},enumerable:!1}}),b.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},b.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e_inline_4_arg0_||255>_inline_4_arg1_||255>_inline_4_arg2_||255>_inline_4_arg3_){var _inline_4_l=_inline_4_arg4_-_inline_4_arg6_[0],_inline_4_a=_inline_4_arg5_-_inline_4_arg6_[1],_inline_4_f=_inline_4_l*_inline_4_l+_inline_4_a*_inline_4_a;_inline_4_fthis.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),i=0;r*e*4>i;++i)n[i]=255}return t}}}),f.begin=function(){var t=this.gl;this.shape;t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},f.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},f.query=function(t,e,r){if(!this.gl)return null;var i=this.fbo.shape.slice();t=0|t,e=0|e,"number"!=typeof r&&(r=1);var a=0|Math.min(Math.max(t-r,0),i[0]),o=0|Math.min(Math.max(t+r,0),i[0]),s=0|Math.min(Math.max(e-r,0),i[1]),u=0|Math.min(Math.max(e+r,0),i[1]);if(a>=o||s>=u)return null;var f=[o-a,u-s],h=l(this.buffer,[f[0],f[1],4],[4,4*i[0],1],4*(a+i[0]*s)),p=c(h.hi(f[0],f[1],1),r,r),d=p[0],g=p[1];if(0>d||Math.pow(this.radius,2)l;++l)for(var u=t[l],c=0;2>c;++c)a[c]=0|Math.min(a[c],u[c]),o[c]=0|Math.max(o[c],u[c]);var f=0;switch(n){case"center":f=-.5*(a[0]+o[0]);break;case"right":case"end":f=-o[0];break;case"left":case"start":f=-a[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var h=0;switch(i){case"hanging":case"top":h=-a[1];break;case"middle":h=-.5*(a[1]+o[1]);break;case"alphabetic":case"ideographic":h=-3*r;break;case"bottom":h=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+i+"'")}var p=1/r;return"lineHeight"in e?p*=+e.lineHeight:"width"in e?p=e.width/(o[0]-a[0]):"height"in e&&(p=e.height/(o[1]-a[1])),t.map(function(t){return[p*(t[0]+f),p*(t[1]+h)]})}function i(t,e,r,n){var i=0|Math.ceil(e.measureText(r).width+2*n);if(i>8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.heights)){if(n>i){var l=n;n=i,i=l,l=o,o=s,s=l}e.isConstraint(n,i)||a(t[n],t[i],t[o],t[s])<0&&r.push(n,i)}}function i(t,e){for(var r=[],i=t.length,o=e.stars,s=0;i>s;++s)for(var l=o[s],u=1;uc||e.isConstraint(s,c))){for(var f=l[u-1],h=-1,p=1;ph||a(t[s],t[c],t[f],t[h])<0&&r.push(s,c)}}for(;r.length>0;){for(var c=r.pop(),s=r.pop(),f=-1,h=-1,l=o[s],d=1;df||0>h||a(t[s],t[c],t[f],t[h])>=0||(e.flip(s,c),n(t,e,r,f,s,h),n(t,e,r,s,h,f),n(t,e,r,h,c,f),n(t,e,r,c,f,h))}}var a=t("robust-in-sphere")[4];t("binary-search-bounds");e.exports=i},{"binary-search-bounds":283,"robust-in-sphere":330}],327:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}function a(t,e){for(var r=t.cells(),a=r.length,o=0;a>o;++o){var s=r[o],l=s[0],u=s[1],c=s[2];c>u?l>u&&(s[0]=u,s[1]=c,s[2]=l):l>c&&(s[0]=c,s[1]=l,s[2]=u)}r.sort(i);for(var f=new Array(a),o=0;oo;++o)for(var s=r[o],y=0;3>y;++y){var l=s[y],u=s[(y+1)%3],b=d[3*o+y]=v.locate(u,l,t.opposite(u,l)),x=g[3*o+y]=t.isConstraint(l,u);0>b&&(x?p.push(o):(h.push(o),f[o]=1),e&&m.push([u,l,-1]))}return v}function o(t,e,r){for(var n=0,i=0;i0||l.length>0;){for(;s.length>0;){var p=s.pop();if(u[p]!==-i){u[p]=i;for(var d=(c[p],0);3>d;++d){var g=h[3*p+d];g>=0&&0===u[g]&&(f[3*p+d]?l.push(g):(s.push(g),u[g]=i))}}}var m=l;l=s,s=m,l.length=0,i=-i}var v=o(c,u,e);return r?v.concat(n.boundary):v}var l=t("binary-search-bounds");e.exports=s;var u=n.prototype;u.locate=function(){var t=[0,0,0];return function(e,r,n){var a=e,o=r,s=n;return n>r?e>r&&(a=r,o=n,s=e):e>n&&(a=n,o=e,s=r),0>a?-1:(t[0]=a,t[1]=o,t[2]=s,l.eq(this.cells,t,i))}}()},{"binary-search-bounds":283}],328:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function i(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function a(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r?r:t.type!==d&&(r=p(t.a,t.b,e.b))?r:t.idx-e.idx}function o(t,e){return p(t.a,t.b,e)}function s(t,e,r,n,i){for(var a=h.lt(e,n,o),s=h.gt(e,n,o),l=a;s>l;++l){for(var u=e[l],c=u.lowerIds,f=c.length;f>1&&p(r[c[f-2]],r[c[f-1]],n)>0;)t.push([c[f-1],c[f-2],i]),f-=1;c.length=f,c.push(i);for(var d=u.upperIds,f=d.length;f>1&&p(r[d[f-2]],r[d[f-1]],n)<0;)t.push([d[f-2],d[f-1],i]),f-=1;d.length=f,d.push(i)}}function l(t,e){var r;return(r=t.a[0]f;++f)l.push(new i(t[f],null,d,f));for(var f=0;o>f;++f){var h=e[f],p=t[h[0]],v=t[h[1]];p[0]v[0]&&l.push(new i(v,p,m,f),new i(p,v,g,f))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),b=[new n([y,1],[y,0],-1,[],[],[],[])],x=[],f=0,_=l.length;_>f;++f){var w=l[f],A=w.type;A===d?s(x,b,t,w.a,w.idx):A===m?u(b,t,w):c(b,t,w)}return x}var h=t("binary-search-bounds"),p=t("robust-orientation")[3],d=0,g=1,m=2;e.exports=f},{"binary-search-bounds":283,"robust-orientation":996}],329:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;i>n;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[i-2],t[n]=t[i-1],void(t.length=i-2)}function a(t,e){for(var r=new Array(t),i=0;t>i;++i)r[i]=[];return new n(r,e)}var o=t("binary-search-bounds");e.exports=a;var s=n.prototype;s.isConstraint=function(){function t(t,e){return t[0]-e[0]||t[1]-e[1]}var e=[0,0];return function(r,n){return e[0]=Math.min(r,n),e[1]=Math.max(r,n),o.eq(this.edges,e,t)>=0}}(),s.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},s.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},s.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;i>n;n+=2)if(r[n]===t)return r[n-1];return-1},s.flip=function(t,e){var r=this.opposite(t,e),n=this.opposite(e,t);this.removeTriangle(t,e,r),this.removeTriangle(e,t,n),this.addTriangle(t,n,r),this.addTriangle(e,r,n)},s.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],a=0,o=i.length;o>a;a+=2)e.push([i[a],i[a+1]]);return e},s.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],a=0,o=i.length;o>a;a+=2){var s=i[a],l=i[a+1];rr;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=["m",n,"[",t-r-2,"]"].join("")}return e}function a(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return o(e,t)}function s(t){return t&!0?"-":""}function l(t){if(2===t.length)return[["diff(",o(t[0][0],t[1][1]),",",o(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;rn;++n)r.push(["prod(m",t,"[",n,"],m",t,"[",n,"])"].join(""));return a(r)}function c(t){for(var e=[],r=[],o=i(t),s=0;t>s;++s)o[0][s]="1",o[t-1][s]="w"+s;for(var s=0;t>s;++s)0===(1&s)?e.push.apply(e,l(n(o,s))):r.push.apply(r,l(n(o,s)));for(var c=a(e),f=a(r),h="exactInSphere"+t,p=[],s=0;t>s;++s)p.push("m"+s);for(var d=["function ",h,"(",p.join(),"){"],s=0;t>s;++s){d.push("var w",s,"=",u(s,t),";");for(var g=0;t>g;++g)g!==s&&d.push("var w",s,"m",g,"=scale(w",s,",m",g,"[0]);")}d.push("var p=",c,",n=",f,",d=diff(p,n);return d[d.length-1];}return ",h);var x=new Function("sum","diff","prod","scale",d.join(""));return x(v,y,m,b)}function f(){return 0}function h(){return 0}function p(){return 0}function d(t){var e=_[t.length];return e||(e=_[t.length]=c(t.length)),e.apply(void 0,t)}function g(){for(;_.length<=x;)_.push(c(_.length));for(var t=[],r=["slow"],n=0;x>=n;++n)t.push("a"+n),r.push("o"+n);for(var i=["function testInSphere(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;x>=n;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i=n;++n)e.exports[n]=_[n]}var m=t("two-product"),v=t("robust-sum"),y=t("robust-subtract"),b=t("robust-scale"),x=6,_=[f,h,p];g()},{"robust-scale":332,"robust-subtract":333,"robust-sum":334,"two-product":335}],331:[function(t,e,r){arguments[4][36][0].apply(r,arguments)},{dup:36}],332:[function(t,e,r){arguments[4][37][0].apply(r,arguments)},{dup:37,"two-product":335,"two-sum":331}],333:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],-e[0]);var a,o,s=r+i,l=new Array(s),u=0,c=0,f=0,h=Math.abs,p=t[c],d=h(p),g=-e[f],m=h(g);m>d?(o=p,c+=1,r>c&&(p=t[c],d=h(p))):(o=g,f+=1,i>f&&(g=-e[f],m=h(g))),r>c&&m>d||f>=i?(a=p,c+=1,r>c&&(p=t[c],d=h(p))):(a=g,f+=1,i>f&&(g=-e[f],m=h(g)));for(var v,y,b,x,_,w=a+o,A=w-a,k=o-A,M=k,E=w;r>c&&i>f;)m>d?(a=p,c+=1,r>c&&(p=t[c],d=h(p))):(a=g,f+=1,i>f&&(g=-e[f],m=h(g))),o=M,w=a+o,A=w-a,k=o-A,k&&(l[u++]=k),v=E+w,y=v-E,b=v-y,x=w-y,_=E-b,M=_+x,E=v;for(;r>c;)a=p,o=M,w=a+o,A=w-a,k=o-A,k&&(l[u++]=k),v=E+w,y=v-E,b=v-y,x=w-y,_=E-b,M=_+x,E=v,c+=1,r>c&&(p=t[c]);for(;i>f;)a=g,o=M,w=a+o,A=w-a,k=o-A,k&&(l[u++]=k),v=E+w,y=v-E,b=v-y,x=w-y,_=E-b,M=_+x,E=v,f+=1,i>f&&(g=-e[f]);return M&&(l[u++]=M),E&&(l[u++]=E),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],334:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],335:[function(t,e,r){arguments[4][39][0].apply(r,arguments)},{dup:39}],336:[function(t,e,r){"use strict";function n(t){var e=x(t),r=b(y(e),t);return 0>r?[e,w(e,1/0)]:r>0?[w(e,-(1/0)),e]:[e,e]}function i(t,e){for(var r=new Array(e.length),n=0;n=t.length)return o[e-t.length];var r=t[e];return[y(r[0]),y(r[1])]}for(var o=[],s=0;s=0;--s){var g=n[s],u=g[0],m=e[u],v=m[0],x=m[1],w=t[v],k=t[x];if((w[0]-k[0]||w[1]-k[1])<0){var M=v;v=x,x=M}m[0]=v;var E,T=m[1]=g[1];for(i&&(E=m[2]);s>0&&n[s-1][0]===u;){var g=n[--s],L=g[1];i?e.push([T,L,E]):e.push([T,L]),T=L}i?e.push([T,x,E]):e.push([T,x])}return o}function u(t,e,r){for(var i=t.length+e.length,a=new g(i),o=r,s=0;ss;++s){var d=a.find(s);d===s?(p[s]=f,t[f++]=t[s]):(h=!1,p[s]=-1)}if(t.length=f,h)return null;for(var s=0;i>s;++s)p[s]<0&&(p[s]=p[a.find(s)]);return p}function c(t,e){return t[0]-e[0]||t[1]-e[1]}function f(t,e){var r=t[0]-e[0]||t[1]-e[1];return r?r:t[2]e[2]?1:0}function h(t,e,r){if(0!==t.length){if(e)for(var n=0;n0||p.length>0}function d(t,e,r){var n,i=!1;if(r){n=e;for(var a=new Array(e.length),o=0;o0?r=r.shln(f):0>f&&(c=c.shln(-f)),l(r,c)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),u=t("./div");e.exports=n},{"./div":340,"./is-rat":342,"./lib/is-bn":346,"./lib/num-to-bn":347,"./lib/rationalize":348,"./lib/str-to-bn":349}],342:[function(t,e,r){"use strict";function n(t){return Array.isArray(t)&&2===t.length&&i(t[0])&&i(t[1])}var i=t("./lib/is-bn");e.exports=n},{"./lib/is-bn":346}],343:[function(t,e,r){"use strict";function n(t){return t.cmp(new i(0))}var i=t("bn.js");e.exports=n},{"bn.js":352}],344:[function(t,e,r){"use strict";function n(t){var e=t.length,r=t.words,n=0;if(1===e)n=r[0];else if(2===e)n=r[0]+67108864*r[1];else for(var n=0,i=0;e>i;i++){var a=r[i];n+=a*Math.pow(67108864,i)}return t.sign?-n:n}e.exports=n},{}],345:[function(t,e,r){"use strict";function n(t){var e=a(i.lo(t));if(32>e)return e;var r=a(i.hi(t));return r>20?52:r+32}var i=t("double-bits"),a=t("bit-twiddle").countTrailingZeros;e.exports=n},{"bit-twiddle":351,"double-bits":353}],346:[function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&Boolean(t.words)}t("bn.js");e.exports=n},{"bn.js":352}],347:[function(t,e,r){"use strict";function n(t){var e=a.exponent(t);return 52>e?new i(t):new i(t*Math.pow(2,52-e)).shln(e-52)}var i=t("bn.js"),a=t("double-bits");e.exports=n},{"bn.js":352,"double-bits":353}],348:[function(t,e,r){"use strict";function n(t,e){var r=a(t),n=a(e);if(0===r)return[i(0),i(1)];if(0===n)return[i(0),i(0)];0>n&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}var i=t("./num-to-bn"),a=t("./bn-sign");e.exports=n},{"./bn-sign":343,"./num-to-bn":347}],349:[function(t,e,r){"use strict";function n(t){return new i(t)}var i=t("bn.js");e.exports=n},{"bn.js":352}],350:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[0]),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":348}],351:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],352:[function(t,e,r){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){return null!==t&&"object"==typeof t&&Array.isArray(t.words)?t:(this.sign=!1,this.words=null,this.length=0,this.red=null,("le"===e||"be"===e)&&(r=e,e=10),void(null!==t&&this._init(t||0,e||10,r||"be")))}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;i>a;a++){var o=t.charCodeAt(a)-48;n<<=4,n|=o>=49&&54>=o?o-49+10:o>=17&&22>=o?o-17+10:15&o}return n}function o(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;a>o;o++){var s=t.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}function s(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function l(){s.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function u(){s.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function c(){s.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function f(){s.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function h(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function p(t){h.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).ishln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv.sign=!0,this.minv=this.minv.mod(this.r)}"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26,i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&36>=e),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.sign=!0),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){0>t&&(this.sign=!0,t=-t),67108864>t?(this.words=[67108863&t],this.length=1):4503599627370496>t?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(9007199254740992>t),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3){var s=t[i]|t[i-1]<<8|t[i-2]<<16;this.words[o]|=s<>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}else if("le"===n)for(var i=0,o=0;i>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6){var o=a(t,r,r+6);this.words[i]|=o<>>26-n&4194303,n+=24,n>=26&&(n-=26,i++)}if(r+6!==e){var o=a(t,e,r+6);this.words[i]|=o<>>26-n&4194303}this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;67108863>=i;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,s=a%n,l=Math.min(a,a-s)+r,u=0,c=r;l>c;c+=n)u=o(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){for(var f=1,u=o(t,c,t.length,e),c=0;s>c;c++)f*=e;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},i.prototype.inspect=function(){return(this.red?""};var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(t,e){if(t=t||10,16===t||"hex"===t){for(var n="",i=0,e=0|e||1,a=0,o=0;o>>24-i&16777215,n=0!==a||o!==this.length-1?d[6-l.length]+l+n:l+n,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(n=a.toString(16)+n);n.length%e!==0;)n="0"+n;return this.sign&&(n="-"+n),n}if(t===(0|t)&&t>=2&&36>=t){var u=g[t],c=m[t],n="",f=this.clone();for(f.sign=!1;0!==f.cmpn(0);){var h=f.modn(c).toString(t);f=f.idivn(c),n=0!==f.cmpn(0)?d[u-h.length]+h+n:h+n}return 0===this.cmpn(0)&&(n="0"+n),this.sign&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toArray=function(t){this.strip();var e=new Array(this.byteLength());e[0]=0;var r=this.clone();if("le"!==t)for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[e.length-n-1]=i}else for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[n]=i}return e},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},i.prototype.bitLength=function(){var t=0,e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.iand=function(t){this.sign=this.sign&&t.sign;var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.ixor=function(t){this.sign=this.sign||t.sign;var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);for(var n=t/26|0,i=t%26;this.length<=n;)this.words[this.length++]=0;return e?this.words[n]=this.words[n]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26}for(;0!==i&&a>>26}if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(t.sign){t.sign=!1;var e=this.iadd(t);return t.sign=!0,e._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var r=this.cmp(t);if(0===r)return this.sign=!1,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e}for(;0!==a&&o>26,this.words[o]=67108863&e}if(0===a&&o>>26,a=67108863&r,o=Math.min(n,t.length-1),s=Math.max(0,n-this.length+1);o>=s;s++){var l=n-s,u=0|this.words[l],c=0|t.words[s],f=u*c,h=67108863&f;i=i+(f/67108864|0)|0,h=h+a|0,a=67108863&h,i=i+(h>>>26)|0}e.words[n]=a,r=i}return 0!==r?e.words[n]=r:e.length--,e.strip()},i.prototype._bigMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0,i=0;i=l;l++){var u=i-l,c=0|this.words[u],f=0|t.words[l],h=c*f,p=67108863&h;a=a+(h/67108864|0)|0,p=p+o|0,o=67108863&p,a=a+(p>>>26)|0,n+=a>>>26,a&=67108863}e.words[i]=o,r=a,a=n}return 0!==r?e.words[i]=r:e.length--,e.strip()},i.prototype.mulTo=function(t,e){var r;return r=this.length+t.length<63?this._smallMulTo(t,e):this._bigMulTo(t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var e=this.length,r=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var n=this.length-2;n>=0;n--){for(var i=0,a=0,o=Math.min(n,r-1),s=Math.max(0,n-e+1);o>=s;s++){var l=n-s,u=this.words[l],c=t.words[s],f=u*c,h=67108863&f;i+=f/67108864|0,h+=a,a=67108863&h,i+=h>>>26}this.words[n]=a,this.words[n+1]+=i,i=0}for(var i=0,l=1;l>>26}return this.strip()},i.prototype.imuln=function(t){r("number"==typeof t);for(var e=0,n=0;n>=26,e+=i/67108864|0,e+=a>>>26,this.words[n]=67108863&a}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.mul(this)},i.prototype.ishln=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=67108863>>>26-e<<26-e;if(0!==e){for(var a=0,o=0;o>>26-e}a&&(this.words[o]=a,this.length++)}if(0!==n){for(var o=this.length-1;o>=0;o--)this.words[o+n]=this.words[o];for(var o=0;n>o;o++)this.words[o]=0;this.length+=n}return this.strip()},i.prototype.ishrn=function(t,e,n){r("number"==typeof t&&t>=0);var i;i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<u;u++)l.words[u]=this.words[u];l.length=o}if(0===o);else if(this.length>o){this.length-=o;for(var u=0;u=0&&(0!==c||u>=i);u--){var f=this.words[u];this.words[u]=c<<26-a|f>>>a,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(!this.sign,"imaskn works only with positive numbers"),0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<t?this.isubn(-t):this.sign?1===this.length&&this.words[0]=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),0>t)return this.iaddn(-t);if(this.sign)return this.sign=!1,this.iaddn(t),this.sign=!0,this;this.words[0]-=t;for(var e=0;e>26)-(u/67108864|0),this.words[i+n]=67108863&l}for(;i>26,this.words[i+n]=67108863&l}if(0===s)return this.strip();r(-1===s),s=0;for(var i=0;i>26,this.words[i]=67108863&l}return this.sign=!0,this.strip()},i.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),a=t,o=a.words[a.length-1],s=this._countBits(o);r=26-s,0!==r&&(a=a.shln(r),n.ishln(r),o=a.words[a.length-1]);var l,u=n.length-a.length;if("mod"!==e){l=new i(null),l.length=u+1,l.words=new Array(l.length);for(var c=0;c=0;h--){var p=67108864*n.words[a.length+h]+n.words[a.length+h-1];for(p=Math.min(p/o|0,67108863),n._ishlnsubmul(a,p,h);n.sign;)p--,n.sign=!1,n._ishlnsubmul(a,1,h),0!==n.cmpn(0)&&(n.sign=!n.sign);l&&(l.words[h]=p)}return l&&l.strip(),n.strip(),"div"!==e&&0!==r&&n.ishrn(r),{div:l?l:null,mod:n}},i.prototype.divmod=function(t,e){if(r(0!==t.cmpn(0)),this.sign&&!t.sign){var n,a,o=this.neg().divmod(t,e);return"mod"!==e&&(n=o.div.neg()),"div"!==e&&(a=0===o.mod.cmpn(0)?o.mod:t.sub(o.mod)),{div:n,mod:a}}if(!this.sign&&t.sign){var n,o=this.divmod(t.neg(),e);return"mod"!==e&&(n=o.div.neg()),{div:n,mod:o.mod}}return this.sign&&t.sign?this.neg().divmod(t.neg(),e):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e)},i.prototype.div=function(t){return this.divmod(t,"div").div},i.prototype.mod=function(t){return this.divmod(t,"mod").mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(0===e.mod.cmpn(0))return e.div;var r=e.div.sign?e.mod.isub(t):e.mod,n=t.shrn(1),i=t.andln(1),a=r.cmp(n);return 0>a||1===i&&0===a?e.div:e.div.sign?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(67108863>=t);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+this.words[i])%t;return n},i.prototype.idivn=function(t){r(67108863>=t);for(var e=0,n=this.length-1;n>=0;n--){var i=this.words[n]+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=new i(0),l=new i(1),u=0;e.isEven()&&n.isEven();)e.ishrn(1),n.ishrn(1),++u;for(var c=n.clone(),f=e.clone();0!==e.cmpn(0);){for(;e.isEven();)e.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(f).ishrn(1));for(;n.isEven();)n.ishrn(1),s.isEven()&&l.isEven()?(s.ishrn(1),l.ishrn(1)):(s.iadd(c).ishrn(1),l.isub(f).ishrn(1));e.cmp(n)>=0?(e.isub(n),a.isub(s),o.isub(l)):(n.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:n.ishln(u)}},i.prototype._invmp=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(;e.isEven();)e.ishrn(1),a.isEven()?a.ishrn(1):a.iadd(s).ishrn(1);for(;n.isEven();)n.ishrn(1),o.isEven()?o.ishrn(1):o.iadd(s).ishrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(o)):(n.isub(e),o.isub(a))}return 0===e.cmpn(1)?a:o},i.prototype.gcd=function(t){if(0===this.cmpn(0))return t.clone();if(0===t.cmpn(0))return this.clone();var e=this.clone(),r=t.clone();e.sign=!1,r.sign=!1;for(var n=0;e.isEven()&&r.isEven();n++)e.ishrn(1),r.ishrn(1);for(;;){for(;e.isEven();)e.ishrn(1);for(;r.isEven();)r.ishrn(1);var i=e.cmp(r);if(0>i){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.ishln(n)},i.prototype.invm=function(t){return this.egcd(t).a.mod(t)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<a;a++)this.words[a]=0;return this.words[n]|=i,this.length=n+1,this}for(var o=i,a=n;0!==o&&a>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.cmpn=function(t){var e=0>t;if(e&&(t=-t),this.sign&&!e)return-1;if(!this.sign&&e)return 1;t&=67108863,this.strip();var r;if(this.length>1)r=1;else{var n=this.words[0];r=n===t?0:t>n?-1:1}return this.sign&&(r=-r),r},i.prototype.cmp=function(t){if(this.sign&&!t.sign)return-1;if(!this.sign&&t.sign)return 1;var e=this.ucmp(t);return this.sign?-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length=0;r--){var n=this.words[r],i=t.words[r];if(n!==i){i>n?e=-1:n>i&&(e=1);break}}return e},i.red=function(t){return new h(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(!this.sign,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};s.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},s.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength();while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},s.prototype.split=function(t,e){t.ishrn(this.n,0,e)},s.prototype.imulK=function(t){return t.imul(this.k)},n(l,s),l.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;n>i;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];e.words[e.length++]=a&r;for(var i=10;i>>22,a=o}t.words[i-10]=a>>>22,t.length-=9},l.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e,r=0,n=0;n>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function y(t){if(v[t])return v[t];var y;if("k256"===t)y=new l;else if("p224"===t)y=new u;else if("p192"===t)y=new c;else{if("p25519"!==t)throw new Error("Unknown prime "+t);y=new f}return v[t]=y,y},h.prototype._verify1=function(t){r(!t.sign,"red works only with positives"),r(t.red,"red works only with red numbers")},h.prototype._verify2=function(t,e){r(!t.sign&&!e.sign,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},h.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.mod(this.m)._forceRed(this)},h.prototype.neg=function(t){var e=t.clone();return e.sign=!e.sign,e.iadd(this.m)._forceRed(this)},h.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},h.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},h.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},h.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},h.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.shln(e))},h.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},h.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},h.prototype.isqr=function(t){return this.imul(t,t)},h.prototype.sqr=function(t){return this.mul(t,t)},h.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var e=this.m.andln(3);if(r(e%2===1),3===e){var n=this.m.add(new i(1)).ishrn(2),a=this.pow(t,n);return a}for(var o=this.m.subn(1),s=0;0!==o.cmpn(0)&&0===o.andln(1);)s++,o.ishrn(1);r(0!==o.cmpn(0));var l=new i(1).toRed(this),u=l.redNeg(),c=this.m.subn(1).ishrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var h=this.pow(f,o),a=this.pow(t,o.addn(1).ishrn(1)),p=this.pow(t,o),d=s;0!==p.cmp(l);){for(var g=p,m=0;0!==g.cmp(l);m++)g=g.redSqr();r(d>m);var v=this.pow(h,new i(1).ishln(d-m-1));a=a.redMul(v),h=v.redSqr(),p=p.redMul(h),d=m}return a},h.prototype.invm=function(t){var e=t._invmp(this.m);return e.sign?(e.sign=!1,this.imod(e).redNeg()):this.imod(e)},h.prototype.pow=function(t,e){var r=[];if(0===e.cmpn(0))return new i(1);for(var n=e.clone();0!==n.cmpn(0);)r.push(n.andln(1)),n.ishrn(1);for(var a=t,o=0;o=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},p.prototype.mul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).ishrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},p.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}("undefined"==typeof e||e,this)},{}],353:[function(t,e,r){(function(t){function r(t,e){return p[0]=t,p[1]=e,h[0]}function n(t){return h[0]=t,p[0]}function i(t){return h[0]=t,p[1]}function a(t,e){return p[1]=t,p[0]=e,h[0]}function o(t){return h[0]=t,p[1]}function s(t){return h[0]=t,p[0]}function l(t,e){return d.writeUInt32LE(t,0,!0),d.writeUInt32LE(e,4,!0),d.readDoubleLE(0,!0)}function u(t){return d.writeDoubleLE(t,0,!0),d.readUInt32LE(0,!0)}function c(t){return d.writeDoubleLE(t,0,!0),d.readUInt32LE(4,!0)}var f=!1;if("undefined"!=typeof Float64Array){var h=new Float64Array(1),p=new Uint32Array(h.buffer);h[0]=1,f=!0,1072693248===p[1]?(e.exports=function(t){return h[0]=t,[p[0],p[1]]},e.exports.pack=r,e.exports.lo=n,e.exports.hi=i):1072693248===p[0]?(e.exports=function(t){return h[0]=t,[p[1],p[0]]},e.exports.pack=a,e.exports.lo=o,e.exports.hi=s):f=!1}if(!f){var d=new t(8);e.exports=function(t){return d.writeDoubleLE(t,0,!0),[d.readUInt32LE(0,!0),d.readUInt32LE(4,!0)]},e.exports.pack=l,e.exports.lo=u,e.exports.hi=c}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){var r=e.exports.hi(t);return(r<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){var r=e.exports.hi(t);return!(2146435072&r)}}).call(this,t("buffer").Buffer)},{buffer:48}],354:[function(t,e,r){"use strict";function n(t){return i(t[0])*i(t[1])}var i=t("./lib/bn-sign");e.exports=n},{"./lib/bn-sign":343}],355:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":348}],356:[function(t,e,r){"use strict";function n(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var n=e.divmod(r),o=n.div,s=i(o),l=n.mod;if(0===l.cmpn(0))return s;if(s){var u=a(s)+4,c=i(l.shln(u).divRound(r));return 0>s&&(c=-c),s+c*Math.pow(2,-u)}var f=r.bitLength()-l.bitLength()+53,c=i(l.shln(f).divRound(r));return 1023>f?c*Math.pow(2,-f):(c*=Math.pow(2,-1023),c*Math.pow(2,1023-f))}var i=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=n},{"./lib/bn-to-num":344,"./lib/ctz":345}],357:[function(t,e,r){"use strict";function n(t,e){for(var r=0;t>r;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function i(t,e,r,i){for(var a=0,o=0,s=0,l=t.length;l>s;++s){var u=t[s];if(!n(e,u)){for(var c=0;2*e>c;++c)r[a++]=u[c];i[o++]=s}}return o}function a(t,e,r,n){var a=t.length,o=e.length;if(!(0>=a||0>=o)){var s=t[0].length>>>1;if(!(0>=s)){var l,u=f.mallocDouble(2*s*a),c=f.mallocInt32(a);if(a=i(t,s,u,c),a>0){if(1===s&&n)h.init(a),l=h.sweepComplete(s,r,0,a,u,c,0,a,u,c);else{var d=f.mallocDouble(2*s*o),g=f.mallocInt32(o);o=i(e,s,d,g),o>0&&(h.init(a+o),l=1===s?h.sweepBipartite(s,r,0,a,u,c,0,o,d,g):p(s,r,n,a,u,c,o,d,g),f.free(d),f.free(g))}f.free(u),f.free(c)}return l}}}function o(t,e){c.push([t,e])}function s(t){return c=[],a(t,t,o,!0),c}function l(t,e){return c=[],a(t,e,o,!1),c}function u(t,e,r){switch(arguments.length){case 1:return s(t);case 2:return"function"==typeof e?a(t,t,e,!0):l(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}}e.exports=u;var c,f=t("typedarray-pool"),h=t("./lib/sweep"),p=t("./lib/intersect")},{"./lib/intersect":359,"./lib/sweep":363,"typedarray-pool":366}],358:[function(t,e,r){"use strict";function n(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),i=["function ",n,"(",w.join(),"){","var ",u,"=2*",a,";"],l="for(var i="+c+","+d+"="+u+"*"+c+";i<"+f+";++i,"+d+"+="+u+"){var x0="+h+"["+o+"+"+d+"],x1="+h+"["+o+"+"+d+"+"+a+"],xi="+p+"[i];",A="for(var j="+g+","+b+"="+u+"*"+g+";j<"+m+";++j,"+b+"+="+u+"){var y0="+v+"["+o+"+"+b+"],"+(r?"y1="+v+"["+o+"+"+b+"+"+a+"],":"")+"yi="+y+"[j];";return t?i.push(l,_,":",A):i.push(A,_,":",l),r?i.push("if(y1"+m+"-"+g+"){"),t?(e(!0,!1),o.push("}else{"),e(!1,!1)):(o.push("if("+l+"){"),e(!0,!0),o.push("}else{"),e(!0,!1),o.push("}}else{if("+l+"){"),e(!1,!0),o.push("}else{"),e(!1,!1),o.push("}")),o.push("}}return "+r);var s=i.join("")+o.join(""),u=new Function(s);return u()}var a="d",o="ax",s="vv",l="fp",u="es",c="rs",f="re",h="rb",p="ri",d="rp",g="bs",m="be",v="bb",y="bi",b="bp",x="rv",_="Q",w=[a,o,s,c,f,h,p,g,m,v,y];r.partial=i(!1),r.full=i(!0)},{}],359:[function(t,e,r){"use strict";function n(t,e){var r=8*u.log2(e+1)*(t+1)|0,n=u.nextPow2(M*r);L.lengthS&&(l.free(S),S=l.mallocDouble(i))}function i(t,e,r,n,i,a,o,s,l){var u=M*t;L[u]=e,L[u+1]=r,L[u+2]=n,L[u+3]=i,L[u+4]=a,L[u+5]=o;var c=E*t;S[c]=s,S[c+1]=l}function a(t,e,r,n,i,a,o,s,l,u,c){var f=2*t,h=l*f,p=u[h+e];t:for(var d=i,g=i*f;a>d;++d,g+=f){var m=o[g+e],v=o[g+e+t];if(!(m>p||p>v||n&&p===m)){for(var y=s[d],b=e+1;t>b;++b){var m=o[g+b],v=o[g+b+t],x=u[h+b],_=u[h+b+t];if(x>v||m>_)continue t}var w;if(w=n?r(c,y):r(y,c),void 0!==w)return w}}}function o(t,e,r,n,i,a,o,s,l,u){var c=2*t,f=s*c,h=l[f+e];t:for(var p=n,d=n*c;i>p;++p,d+=c){var g=o[p];if(g!==u){var m=a[d+e],v=a[d+e+t];if(!(m>h||h>v)){for(var y=e+1;t>y;++y){var m=a[d+y],v=a[d+y+t],b=l[f+y],x=l[f+y+t];if(b>v||m>x)continue t}var _=r(g,u);if(void 0!==_)return _}}}}function s(t,e,r,s,l,u,c,g,T){n(t,s+c);var C,P=0,z=2*t;for(i(P++,0,0,s,0,c,r?16:0,-(1/0),1/0),r||i(P++,0,0,c,0,s,1,-(1/0),1/0);P>0;){P-=1;var R=P*M,j=L[R],I=L[R+1],O=L[R+2],N=L[R+3],F=L[R+4],D=L[R+5],B=P*E,U=S[B],V=S[B+1],q=1&D,G=!!(16&D),H=l,Y=u,X=g,W=T;if(q&&(H=g,Y=T,X=l,W=u),!(2&D&&(O=_(t,j,I,O,H,Y,V),I>=O)||4&D&&(I=w(t,j,I,O,H,Y,U),I>=O))){var Z=O-I,Q=F-N;if(G){if(y>t*Z*(Z+Q)){if(C=p.scanComplete(t,j,e,I,O,H,Y,N,F,X,W),void 0!==C)return C;continue}}else{if(t*Math.min(Z,Q)t*Z*Q){if(C=p.scanBipartite(t,j,e,q,I,O,H,Y,N,F,X,W),void 0!==C)return C;continue}}var K=b(t,j,I,O,H,Y,U,V);if(K>I)if(m>t*(K-I)){if(C=h(t,j+1,e,I,K,H,Y,N,F,X,W),void 0!==C)return C}else if(j===t-2){if(C=q?p.sweepBipartite(t,e,N,F,X,W,I,K,H,Y):p.sweepBipartite(t,e,I,K,H,Y,N,F,X,W),void 0!==C)return C}else i(P++,j+1,I,K,N,F,q,-(1/0),1/0),i(P++,j+1,N,F,I,K,1^q,-(1/0),1/0);if(O>K){var $=d(t,j,N,F,X,W),J=X[z*$+j],tt=x(t,j,$,F,X,W,J);if(F>tt&&i(P++,j,K,O,tt,F,(4|q)+(G?16:0),J,V),$>N&&i(P++,j,K,O,N,$,(2|q)+(G?16:0),U,J),$+1===tt){if(C=G?o(t,j,e,K,O,H,Y,$,X,W[$]):a(t,j,e,q,K,O,H,Y,$,X,W[$]),void 0!==C)return C}else if(tt>$){var et;if(G){if(et=A(t,j,K,O,H,Y,J),et>K){var rt=x(t,j,K,et,H,Y,J);if(j===t-2){if(rt>K&&(C=p.sweepComplete(t,e,K,rt,H,Y,$,tt,X,W),void 0!==C))return C;if(et>rt&&(C=p.sweepBipartite(t,e,rt,et,H,Y,$,tt,X,W),void 0!==C))return C}else rt>K&&i(P++,j+1,K,rt,$,tt,16,-(1/0),1/0),et>rt&&(i(P++,j+1,rt,et,$,tt,0,-(1/0),1/0),i(P++,j+1,$,tt,rt,et,1,-(1/0),1/0))}}else et=q?k(t,j,K,O,H,Y,J):A(t,j,K,O,H,Y,J),et>K&&(j===t-2?C=q?p.sweepBipartite(t,e,$,tt,X,W,K,et,H,Y):p.sweepBipartite(t,e,K,et,H,Y,$,tt,X,W):(i(P++,j+1,K,et,$,tt,q,-(1/0),1/0),i(P++,j+1,$,tt,K,et,1^q,-(1/0),1/0)))}}}}}e.exports=s;var l=t("typedarray-pool"),u=t("bit-twiddle"),c=t("./brute"),f=c.partial,h=c.full,p=t("./sweep"),d=t("./median"),g=t("./partition"),m=128,v=1<<22,y=1<<22,b=g("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),x=g("lo===p0",["p0"]),_=g("lol;++l,s+=o)for(var u=i[s],c=l,f=o*(l-1);c>r&&i[f+e]>u;--c,f-=o){for(var h=f,p=f+o,d=0;o>d;++d,++h,++p){var g=i[h];i[h]=i[p],i[p]=g}var m=a[c];a[c]=a[c-1],a[c-1]=m}}function i(t,e,r,i,a,l){if(r+1>=i)return r;for(var u=r,c=i,f=i+r>>>1,h=2*t,p=f,d=a[h*f+e];c>u;){if(s>c-u){n(t,e,u,c,a,l),d=a[h*f+e];break}var g=c-u,m=Math.random()*g+u|0,v=a[h*m+e],y=Math.random()*g+u|0,b=a[h*y+e],x=Math.random()*g+u|0,_=a[h*x+e];b>=v?_>=b?(p=y,d=b):v>=_?(p=m,d=v):(p=x,d=_):b>=_?(p=y,d=b):_>=v?(p=m,d=v):(p=x,d=_);for(var w=h*(c-1),A=h*p,k=0;h>k;++k,++w,++A){var M=a[w];a[w]=a[A],a[A]=M}var E=l[c-1];l[c-1]=l[p],l[p]=E,p=o(t,e,u,c-1,a,l,d);for(var w=h*(c-1),A=h*p,k=0;h>k;++k,++w,++A){var M=a[w];a[w]=a[A],a[A]=M}var E=l[c-1];if(l[c-1]=l[p],l[p]=E,p>f){for(c=p-1;c>u&&a[h*(c-1)+e]===d;)c-=1;c+=1}else{if(!(f>p))break;for(u=p+1;c>u&&a[h*u+e]===d;)u+=1}}return o(t,e,r,f,a,l,a[h*f+e])}e.exports=i;var a=t("./partition"),o=a("lo=0&&n.push("lo=e[k+n]"),t.indexOf("hi")>=0&&n.push("hi=e[k+o]"),r.push(i.replace("_",n.join()).replace("$",t)),Function.apply(void 0,r)}e.exports=n;var i="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],362:[function(t,e,r){"use strict";function n(t,e){4*h>=e?i(0,e-1,t):f(0,e-1,t)}function i(t,e,r){for(var n=2*(t+1),i=t+1;e>=i;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var u=r[l-2],c=r[l-1];if(a>u)break;if(u===a&&o>c)break;r[l]=u,r[l+1]=c,l-=2}r[l]=a,r[l+1]=o}}function a(t,e,r){t*=2,e*=2;var n=r[t],i=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=i}function o(t,e,r){t*=2,e*=2,r[t]=r[e],r[t+1]=r[e+1]}function s(t,e,r,n){t*=2,e*=2,r*=2;var i=n[t],a=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=n[r],n[e+1]=n[r+1],n[r]=i,n[r+1]=a}function l(t,e,r,n,i){t*=2,e*=2,i[t]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function u(t,e,r){t*=2,e*=2;var n=r[t],i=r[e];return i>n?!1:n===i?r[t+1]>r[e+1]:!0}function c(t,e,r,n){t*=2;var i=n[t];return e>i?!0:i===e?n[t+1]>1,m=g-n,v=g+n,y=p,b=m,x=g,_=v,w=d,A=t+1,k=e-1,M=0;u(y,b,r)&&(M=y,y=b,b=M),u(_,w,r)&&(M=_,_=w,w=M),u(y,x,r)&&(M=y,y=x,x=M),u(b,x,r)&&(M=b,b=x,x=M),u(y,_,r)&&(M=y,y=_,_=M),u(x,_,r)&&(M=x,x=_,_=M),u(b,w,r)&&(M=b,b=w,w=M),u(b,x,r)&&(M=b,b=x,x=M),u(_,w,r)&&(M=_,_=w,w=M);for(var E=r[2*b],T=r[2*b+1],L=r[2*_],S=r[2*_+1],C=2*y,P=2*x,z=2*w,R=2*p,j=2*g,I=2*d,O=0;2>O;++O){var N=r[C+O],F=r[P+O],D=r[z+O];r[R+O]=N,r[j+O]=F,r[I+O]=D}o(m,t,r),o(v,e,r);for(var B=A;k>=B;++B)if(c(B,E,T,r))B!==A&&a(B,A,r),++A;else if(!c(B,L,S,r))for(;;){if(c(k,L,S,r)){c(k,E,T,r)?(s(B,A,k,r),++A,--k):(a(B,k,r),--k);break}if(--k=A-2-t?i(t,A-2,r):f(t,A-2,r),h>=e-(k+2)?i(k+2,e,r):f(k+2,e,r),h>=k-A?i(A,k,r):f(A,k,r)}e.exports=n;var h=32},{}],363:[function(t,e,r){"use strict";function n(t){var e=f.nextPow2(t);g.lengthA;++A){var k=s[A],M=b*A;_[d++]=o[M+x],_[d++]=-(k+1),_[d++]=o[M+w],_[d++]=k}for(var A=l;u>A;++A){var k=f[A]+p,E=b*A;_[d++]=c[E+x],_[d++]=-k,_[d++]=c[E+w],_[d++]=k}var T=d>>>1;h(_,T);for(var L=0,S=0,A=0;T>A;++A){var C=0|_[2*A+1];if(C>=p)C=C-p|0,i(v,y,S--,C);else if(C>=0)i(g,m,L--,C);else if(-p>=C){C=-C-p|0;for(var P=0;L>P;++P){var z=e(g[P],C);if(void 0!==z)return z}a(v,y,S++,C)}else{C=-C-1|0;for(var P=0;S>P;++P){var z=e(C,v[P]);if(void 0!==z)return z}a(g,m,L++,C)}}}function s(t,e,r,n,o,s,l,u,c,f){for(var p=0,d=2*t,w=t-1,A=d-1,k=r;n>k;++k){var M=s[k]+1<<1,E=d*k;_[p++]=o[E+w],_[p++]=-M,_[p++]=o[E+A],_[p++]=M}for(var k=l;u>k;++k){var M=f[k]+1<<1,T=d*k;_[p++]=c[T+w],_[p++]=1|-M,_[p++]=c[T+A],_[p++]=1|M}var L=p>>>1;h(_,L);for(var S=0,C=0,P=0,k=0;L>k;++k){var z=0|_[2*k+1],R=1&z;if(L-1>k&&z>>1===_[2*k+3]>>1&&(R=2,k+=1),0>z){for(var j=-(z>>1)-1,I=0;P>I;++I){var O=e(b[I],j);if(void 0!==O)return O}if(0!==R)for(var I=0;S>I;++I){var O=e(g[I],j);if(void 0!==O)return O}if(1!==R)for(var I=0;C>I;++I){var O=e(v[I],j);if(void 0!==O)return O}0===R?a(g,m,S++,j):1===R?a(v,y,C++,j):2===R&&a(b,x,P++,j)}else{var j=(z>>1)-1;0===R?i(g,m,S--,j):1===R?i(v,y,C--,j):2===R&&i(b,x,P--,j)}}}function l(t,e,r,n,o,s,l,u,c,f,d,v){var y=0,b=2*t,x=e,w=e+t,A=1,k=1;n?k=p:A=p;for(var M=o;s>M;++M){var E=M+A,T=b*M;_[y++]=l[T+x],_[y++]=-E,_[y++]=l[T+w],_[y++]=E}for(var M=c;f>M;++M){var E=M+k,L=b*M;_[y++]=d[L+x],_[y++]=-E}var S=y>>>1;h(_,S);for(var C=0,M=0;S>M;++M){var P=0|_[2*M+1];if(0>P){var E=-P,z=!1;if(E>=p?(z=!n,E-=p):(z=!!n,E-=1),z)a(g,m,C++,E);else{var R=v[E],j=b*E,I=d[j+e+1],O=d[j+e+1+t];t:for(var N=0;C>N;++N){var F=g[N],D=b*F;if(!(OB;++B)if(d[j+B+t]y;++y){var b=y+p,x=d*y;_[f++]=a[x+m],_[f++]=-b,_[f++]=a[x+v],_[f++]=b}for(var y=s;l>y;++y){var b=y+1,w=d*y;_[f++]=u[w+m],_[f++]=-b}var A=f>>>1;h(_,A);for(var k=0,y=0;A>y;++y){var M=0|_[2*y+1];if(0>M){var b=-M;if(b>=p)g[k++]=b-p;else{b-=1;var E=c[b],T=d*b,L=u[T+e+1],S=u[T+e+1+t];t:for(var C=0;k>C;++C){var P=g[C],z=o[P];if(z===E)break;var R=d*P;if(!(Sj;++j)if(u[T+j+t]=0;--C)if(g[C]===b){ -for(var j=C+1;k>j;++j)g[j-1]=g[j];break}--k}}}e.exports={init:n,sweepBipartite:o,sweepComplete:s,scanBipartite:l,scanComplete:u};var c=t("typedarray-pool"),f=t("bit-twiddle"),h=t("./sort"),p=1<<28,d=1024,g=c.mallocInt32(d),m=c.mallocInt32(d),v=c.mallocInt32(d),y=c.mallocInt32(d),b=c.mallocInt32(d),x=c.mallocInt32(d),_=c.mallocDouble(8*d)},{"./sort":362,"bit-twiddle":364,"typedarray-pool":366}],364:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],365:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],366:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":364,buffer:48,dup:102}],367:[function(t,e,r){arguments[4][44][0].apply(r,arguments)},{dup:44}],368:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return 0>e?-a:a;var r=i.hi(t),n=i.lo(t);return e>t==t>0?n===o?(r+=1,n=0):n+=1:0===n?(n=o,r-=1):n-=1,i.pack(n,r)}var i=t("double-bits"),a=Math.pow(2,-1074),o=-1>>>0;e.exports=n},{"double-bits":369}],369:[function(t,e,r){arguments[4][353][0].apply(r,arguments)},{buffer:48,dup:353}],370:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),a=0;r>a;++a)n[a]=i(t[a],e[a]);return n}var i=t("big-rat/add");e.exports=n},{"big-rat/add":338}],371:[function(t,e,r){"use strict";function n(t){for(var e=new Array(t.length),r=0;rs;++s)o[s]=a(t[s],r);return o}var i=t("big-rat"),a=t("big-rat/mul");e.exports=n},{"big-rat":341,"big-rat/mul":350}],373:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),a=0;r>a;++a)n[a]=i(t[a],e[a]);return n}var i=t("big-rat/sub");e.exports=n},{"big-rat/sub":355}],374:[function(t,e,r){"use strict";function n(t,e,r,n){for(var i=0;2>i;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],f=Math.min(u,c),h=Math.max(u,c);if(s>h||f>l)return!1}return!0}function i(t,e,r,i){var o=a(t,r,i),s=a(e,r,i);if(o>0&&s>0||0>o&&0>s)return!1;var l=a(r,t,e),u=a(i,t,e);return l>0&&u>0||0>l&&0>u?!1:0===o&&0===s&&0===l&&0===u?n(t,e,r,i):!0}e.exports=i;var a=t("robust-orientation")[3]},{"robust-orientation":996}],375:[function(t,e,r){arguments[4][61][0].apply(r,arguments)},{dup:61}],376:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t,e.length),n=new Array(e.length),a=new Array(e.length),o=[],s=0;s=l&&o.push(s)}for(;o.length>0;){var u=o.pop();n[u]=!1;for(var c=r[u],s=0;sn;++n){var a=t[n];e=Math.max(e,a[0],a[1])}e=(0|e)+1}e=0|e;for(var o=new Array(e),n=0;e>n;++n)o[n]=[];for(var n=0;r>n;++n){var a=t[n];o[a[0]].push(a[1]),o[a[1]].push(a[0])}for(var s=0;e>s;++s)i(o[s],function(t,e){return t-e});return o}e.exports=n;var i=t("uniq")},{uniq:392}],378:[function(t,e,r){"use strict";function n(t,e){function r(t,e){var r=u[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,a){for(var o,s,l,c=0;2>c;++c)if(u[c][n].length>0){o=u[c][n][0],l=c;break}s=o[1^l];for(var f=0;2>f;++f)for(var h=u[f][n],p=0;p0&&(o=d,s=g,l=f)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=u[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=n(s[s.length-2],l,!1);if(u[0][t].length+u[1][t].length===0)break;var c=s[s.length-1],f=t,h=s[1],p=n(c,f,!0);if(i(e[c],e[f],e[h],e[p])<0)break;s.push(t),l=n(c,f)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,u=[new Array(s),new Array(s)],c=0;s>c;++c)u[0][c]=[],u[1][c]=[];for(var c=0;l>c;++c){var f=t[c];u[0][f[0]].push(f),u[1][f[1]].push(f)}for(var h=[],c=0;s>c;++c)u[0][c].length+u[1][c].length===0&&h.push([c]);for(var c=0;s>c;++c)for(var p=0;2>p;++p){for(var d=[];u[p][c].length>0;){var g=(u[0][c].length,a(c,p));o(d,g)?d.push.apply(d,g):(d.length>0&&h.push(d),d=g)}d.length>0&&h.push(d)}return h}e.exports=n;var i=t("compare-angle")},{"compare-angle":379}],379:[function(t,e,r){"use strict";function n(t,e,r){var n=s(t[0],-e[0]),i=s(t[1],-e[1]),a=s(r[0],-e[0]),o=s(r[1],-e[1]),c=u(l(n,a),l(i,o));return c[c.length-1]>=0}function i(t,e,r,i){var s=a(e,r,i);if(0===s){var l=o(a(t,e,r)),u=o(a(t,e,i));if(l===u){if(0===l){var c=n(t,e,r),f=n(t,e,i);return c===f?0:c?1:-1}return 0}return 0===u?l>0?-1:n(t,e,i)?-1:1:0===l?u>0?1:n(t,e,r)?1:-1:o(u-l)}var h=a(t,e,r);if(h>0)return s>0&&a(t,e,i)>0?1:-1;if(0>h)return s>0||a(t,e,i)>0?1:-1;var p=a(t,e,i);return p>0?1:n(t,e,r)?1:-1}e.exports=i;var a=t("robust-orientation"),o=t("signum"),s=t("two-sum"),l=t("robust-product"),u=t("robust-sum")},{"robust-orientation":996,"robust-product":381,"robust-sum":390,signum:382,"two-sum":383}],380:[function(t,e,r){arguments[4][37][0].apply(r,arguments)},{dup:37,"two-product":391,"two-sum":383}],381:[function(t,e,r){"use strict";function n(t,e){if(1===t.length)return a(e,t[0]);if(1===e.length)return a(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.lengtht?-1:t>0?1:0}},{}],383:[function(t,e,r){arguments[4][36][0].apply(r,arguments)},{dup:36}],384:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],385:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}function i(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function a(t,e){var r=d(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return 0>n?y:(r.splice(n,1),a(t,r),b)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function c(t,e){for(var r=0;r>1],a=[],o=[],s=[],r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=d([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=d([t]);else{var r=v.ge(this.leftPoints,t,h),n=v.ge(this.rightPoints,t,p);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},_.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);var n=this.left.remove(t);return n===x?(this.left=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(t[0]>this.mid){if(!this.right)return y;var a=this.left?this.left.count:0;if(4*a>3*(e-1))return s(this,t);var n=this.right.remove(t);return n===x?(this.right=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(1===this.count)return this.leftPoints[0]===t?x:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var o=this,l=this.left;l.right;)o=l,l=l.right;if(o===this)l.right=this.right;else{var u=this.left,n=this.right;o.count-=l.count,o.right=l.left,l.left=u,l.right=n}i(this,l),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return b}for(var u=v.ge(this.leftPoints,t,h);uthis.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return u(this.rightPoints,t,e)}return c(this.leftPoints,e)},_.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return ethis.mid?u(this.rightPoints,t,r):c(this.leftPoints,r)};var w=g.prototype;w.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},w.remove=function(t){if(this.root){var e=this.root.remove(t);return e===x&&(this.root=null),e!==y}return!1},w.queryPoint=function(t,e){return this.root?this.root.queryPoint(t,e):void 0},w.queryInterval=function(t,e,r){return e>=t&&this.root?this.root.queryInterval(t,e,r):void 0},Object.defineProperty(w,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(w,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":384}],386:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]e[1][0])){var i=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return s>o?o-s:i>l?i-l:o-l}r=e[1],n=e[0]}var u,c;t[0][1]e[1][0]))return n(e,t);r=e[1],i=e[0]}var o,s;if(t[0][0]t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=a(r,i,s),u=a(r,i,o);if(0>l){if(0>=u)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=a(s,o,i),u=a(s,o,r),0>l){if(0>=u)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return i[0]-s[0]}e.exports=i;var a=t("robust-orientation")},{"robust-orientation":996}],387:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}function l(t,e){if(e.left){var r=l(t,e.left);if(r)return r}var r=t(e.key,e.value);return r?r:e.right?l(t,e.right):void 0}function u(t,e,r,n){var i=e(t,n.key);if(0>=i){if(n.left){var a=u(t,e,r,n.left);if(a)return a}var a=r(n.key,n.value);if(a)return a}return n.right?u(t,e,r,n.right):void 0}function c(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(0>=o){if(i.left&&(a=c(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}return s>0&&i.right?c(t,e,r,n,i.right):void 0}function f(t,e){this.tree=t,this._stack=e}function h(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function p(t){for(var e,r,n,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=v);if(r=t[l-1],r.left===e){if(n=r.right,n.right&&n.right._color===m){if(n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=v,r._color=v,s._color=v,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}return void(t[l-1]=n)}if(n.left&&n.left._color===m){if(n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=v,n._color=v,e._color=v,o(r),o(n),o(s),l>1){var u=t[l-2];u.left===r?u.left=s:u.right=s}return void(t[l-1]=s)}if(n._color===v){if(r._color===m)return r._color=v,void(r.right=a(m,n));r.right=a(m,n);continue}if(n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=m,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}t[l-1]=n,t[l]=r,l+11){var u=t[l-2];u.right===r?u.right=n:u.left=n}return void(t[l-1]=n)}if(n.right&&n.right._color===m){if(n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=v,n._color=v,e._color=v,o(r),o(n),o(s),l>1){var u=t[l-2];u.right===r?u.right=s:u.left=s}return void(t[l-1]=s)}if(n._color===v){if(r._color===m)return r._color=v,void(r.left=a(m,n));r.left=a(m,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=m,o(r),o(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}t[l-1]=n,t[l]=r,l+1t?-1:t>e?1:0}function g(t){return new s(t||d,null)}e.exports=g;var m=0,v=1,y=s.prototype;Object.defineProperty(y,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(y,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(y,"length",{get:function(){return this.root?this.root._count:0}}),y.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],u=[];i;){var c=r(t,i.key);l.push(i),u.push(c),i=0>=c?i.left:i.right}l.push(new n(m,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){var i=l[f];u[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(var f=l.length-1;f>1;--f){var h=l[f-1],i=l[f];if(h._color===v||i._color===v)break;var p=l[f-2];if(p.left===h)if(h.left===i){var d=p.right;if(!d||d._color!==m){if(p._color=m,p.left=h.right,h._color=v,h.right=p,l[f-2]=h,l[f-1]=i,o(p),o(h),f>=3){var g=l[f-3];g.left===p?g.left=h:g.right=h}break}h._color=v,p.right=a(v,d),p._color=m,f-=1}else{var d=p.right;if(!d||d._color!==m){if(h.right=i.left,p._color=m,p.left=i.right,i._color=v,i.left=h,i.right=p,l[f-2]=i,l[f-1]=h,o(p),o(h),o(i),f>=3){var g=l[f-3];g.left===p?g.left=i:g.right=i}break}h._color=v,p.right=a(v,d),p._color=m,f-=1}else if(h.right===i){var d=p.left;if(!d||d._color!==m){if(p._color=m,p.right=h.left,h._color=v,h.left=p,l[f-2]=h,l[f-1]=i,o(p),o(h),f>=3){var g=l[f-3];g.right===p?g.right=h:g.left=h}break}h._color=v,p.left=a(v,d),p._color=m,f-=1}else{var d=p.left;if(!d||d._color!==m){if(h.left=i.right,p._color=m,p.right=i.left,i._color=v,i.right=h,i.left=p,l[f-2]=i,l[f-1]=h,o(p),o(h),o(i),f>=3){var g=l[f-3];g.right===p?g.right=i:g.left=i}break}h._color=v,p.left=a(v,d),p._color=m,f-=1}}return l[0]._color=v,new s(r,l[0])},y.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(y,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(y,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),y.at=function(t){if(0>t)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new f(this,[])},y.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),0>=a&&(i=n.length),r=0>=a?r.left:r.right}return n.length=i,new f(this,n)},y.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),0>a&&(i=n.length),r=0>a?r.left:r.right}return n.length=i,new f(this,n)},y.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=0>=a?r.left:r.right}return n.length=i,new f(this,n)},y.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=0>a?r.left:r.right}return n.length=i,new f(this,n)},y.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new f(this,n);r=0>=i?r.left:r.right}return new f(this,[])},y.remove=function(t){var e=this.find(t);return e?e.remove():this},y.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=0>=n?r.left:r.right}};var b=f.prototype;Object.defineProperty(b,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(b,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),b.clone=function(){return new f(this.tree,this._stack.slice())},b.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var i=t.length-2;i>=0;--i){var r=t[i];r.left===t[i+1]?e[i]=new n(r._color,r.key,r.value,e[i+1],r.right,r._count):e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count)}if(r=e[e.length-1],r.left&&r.right){var a=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var o=e[a-1];e.push(new n(r._color,o.key,o.value,r.left,r.right,r._count)),e[a-1].key=r.key,e[a-1].value=r.value;for(var i=e.length-2;i>=a;--i)r=e[i],e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count);e[a-1].left=e[a]}if(r=e[e.length-1],r._color===m){var l=e[e.length-2];l.left===r?l.left=null:l.right===r&&(l.right=null),e.pop();for(var i=0;i0?this._stack[this._stack.length-1].key:void 0},enumerable:!0}),Object.defineProperty(b,"value",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1].value:void 0},enumerable:!0}),Object.defineProperty(b,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),b.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),b.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)i=e[a],i.left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},b.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],388:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]s)t=t.left;else if(s>0)if(e[0]!==o[1][0])r=t,t=t.right;else{var l=a(t.right,e);if(l)return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l=a(t.right,e);if(l)return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}function l(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;e>a;++a){var l=t[a],u=l[0][0]a;){for(var m=i[a].x,v=[];r>a;){var y=i[a];if(y.x!==m)break;a+=1,y.segment[0][0]===y.x&&y.segment[1][0]===y.x?y.create&&(y.segment[0][1]e)return-1;var r=(this.slabs[e],a(this.slabs[e],t)),n=-1;if(r&&(n=r.value),this.coordinates[e]===t[0]){var o=null;if(r&&(o=r.key),e>0){var s=a(this.slabs[e-1],t);s&&(o?h(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var l=this.horizontal[e];if(l.length>0){var c=u.ge(l,t[1],i);if(c=l.length)return n;p=l[c]}}if(p.start)if(o){var d=f(o[0],o[1],[t[0],p.y]);o[0][0]>o[1][0]&&(d=-d),d>0&&(n=p.index)}else n=p.index;else p.y!==t[1]&&(n=p.index)}}}return n}},{"./lib/order-segments":386,"binary-search-bounds":384,"functional-red-black-tree":387,"robust-orientation":996}],389:[function(t,e,r){function n(){return!0}function i(t){return function(e,r){var i=t[e];return i?!!i.queryPoint(r,n):!1}}function a(t){for(var e={},r=0;rn)return 1;var i=t[n];if(!i){if(!(n>0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var o=i.key,s=f(r,o[0],o[1]);if(o[0][0]s)i=i.left;else{if(!(s>0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(0>s))return 0;a=1,i=i.right}}return a}}function s(t){return 1}function l(t){return function(e){return t(e[0],e[1])?0:1}}function u(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function c(t){for(var e=t.length,r=[],n=[],i=0;e>i;++i)for(var c=t[i],f=c.length,p=f-1,d=0;f>d;p=d++){var g=c[p],m=c[d];g[0]===m[0]?n.push([g,m]):r.push([g,m])}if(0===r.length)return 0===n.length?s:l(a(n));var v=h(r),y=o(v.slabs,v.coordinates);return 0===n.length?y:u(a(n),y)}e.exports=c;var f=t("robust-orientation")[3],h=t("slab-decomposition"),p=t("interval-tree-1d"),d=t("binary-search-bounds")},{"binary-search-bounds":384,"interval-tree-1d":385,"robust-orientation":996,"slab-decomposition":388}],390:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],391:[function(t,e,r){arguments[4][39][0].apply(r,arguments)},{dup:39}],392:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],393:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function i(t){for(var e=new Array(t),r=0;t>r;++r)e[r]=[];return e}function a(t,e){function r(t){for(var r=t.length,n=[0],i=0;r>i;++i){var a=e[t[i]],o=e[t[(i+1)%r]],s=u(-a[0],a[1]),l=u(-a[0],o[1]),f=u(o[0],a[1]),h=u(o[0],o[1]);n=c(n,c(c(s,l),c(f,h)))}return n[n.length-1]>0}function a(t){for(var e=t.length,r=0;e>r;++r)if(!j[t[r]])return!1;return!0}var p=h(t,e);t=p[0],e=p[1];for(var d=e.length,g=(t.length,o(t,e.length)),m=0;d>m;++m)if(g[m].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var v=s(t,e);v=v.filter(r);for(var y=v.length,b=new Array(y),x=new Array(y),m=0;y>m;++m){b[m]=m;var _=new Array(y),w=v[m].map(function(t){return e[t]}),A=l([w]),k=0;t:for(var M=0;y>M;++M)if(_[M]=0,m!==M){for(var E=v[M],T=E.length,L=0;T>L;++L){var S=A(e[E[L]]);if(0!==S){0>S&&(_[M]=1,k+=1);continue t}}_[M]=1,k+=1}x[m]=[k,m,_]}x.sort(function(t,e){return e[0]-t[0]});for(var m=0;y>m;++m)for(var _=x[m],C=_[1],P=_[2],M=0;y>M;++M)P[M]&&(b[M]=C);for(var z=i(y),m=0;y>m;++m)z[m].push(b[m]),z[b[m]].push(m);for(var R={},j=n(d,!1),m=0;y>m;++m)for(var E=v[m],T=E.length,M=0;T>M;++M){var I=E[M],O=E[(M+1)%T],N=Math.min(I,O)+":"+Math.max(I,O);if(N in R){var F=R[N];z[F].push(m),z[m].push(F),j[I]=j[O]=!0}else R[N]=m}for(var D=[],B=n(y,-1),m=0;y>m;++m)b[m]!==m||a(v[m])?B[m]=-1:(D.push(m),B[m]=0);for(var p=[];D.length>0;){var U=D.pop(),V=z[U];f(V,function(t,e){return t-e});var q,G=V.length,H=B[U];if(0===H){var E=v[U];q=[E]}for(var m=0;G>m;++m){var Y=V[m];if(!(B[Y]>=0)&&(B[Y]=1^H,D.push(Y),0===H)){var E=v[Y];a(E)||(E.reverse(),q.push(E))}}0===H&&p.push(q)}return p}e.exports=a;var o=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),u=t("two-product"),c=t("robust-sum"),f=t("uniq"),h=t("./lib/trim-leaves")},{"./lib/trim-leaves":376,"edges-to-adjacency-list":377,"planar-dual":378,"point-in-big-polygon":389,"robust-sum":390,"two-product":391,uniq:392}],394:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],395:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;t>e;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n,n.prototype.length=function(){return this.roots.length},n.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},n.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var r=e[t];e[t]=e[r],t=r}return t},n.prototype.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];s>o?a[r]=n:o>s?a[n]=r:(a[n]=r,++i[r])}}},{}],396:[function(t,e,r){arguments[4][62][0].apply(r,arguments)},{"bit-twiddle":394,dup:62,"union-find":395}],397:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.abs(a(t,e,r)),i=Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2));return n/i}function i(t,e,r){function i(t){if(x[t])return 1/0;var r=v[t],i=y[t];return 0>r||0>i?1/0:n(e[t],e[r],e[i])}function a(t,e){var r=M[t],n=M[e];M[t]=n,M[e]=r,E[r]=e,E[n]=t}function s(t){return b[M[t]]}function l(t){return 1&t?t-1>>1:(t>>1)-1}function u(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),o=t;if(L>n){var l=s(n);r>l&&(o=n,r=l)}if(L>i){var u=s(i);r>u&&(o=i)}if(o===t)return t;a(t,o),t=o}}function c(t){for(var e=s(t);t>0;){var r=l(t);if(r>=0){var n=s(r);if(n>e){a(t,r),t=r;continue}}return t}}function f(){if(L>0){var t=M[0];return a(0,L-1),L-=1,u(0),t}return-1}function h(t,e){var r=M[t];return b[r]===e?t:(b[r]=-(1/0),c(t),f(),b[r]=e,L+=1,c(L-1))}function p(t){if(!x[t]){x[t]=!0;var e=v[t],r=y[t];v[r]>=0&&(v[r]=e),y[e]>=0&&(y[e]=r),E[e]>=0&&h(E[e],i(e)),E[r]>=0&&h(E[r],i(r))}}function d(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!x[n]||0>i||i===n)break;if(n=i,i=t[n],!x[n]||0>i||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var g=e.length,m=t.length,v=new Array(g),y=new Array(g),b=new Array(g),x=new Array(g),_=0;g>_;++_)v[_]=y[_]=-1,b[_]=1/0,x[_]=!1;for(var _=0;m>_;++_){var w=t[_];if(2!==w.length)throw new Error("Input must be a graph");var A=w[1],k=w[0];-1!==y[k]?y[k]=-2:y[k]=A,-1!==v[A]?v[A]=-2:v[A]=k}for(var M=[],E=new Array(g),_=0;g>_;++_){var T=b[_]=i(_);1/0>T?(E[_]=M.length,M.push(_)):E[_]=-1}for(var L=M.length,_=L>>1;_>=0;--_)u(_);for(;;){var S=f();if(0>S||b[S]>r)break;p(S)}for(var C=[],_=0;g>_;++_)x[_]||(E[_]=C.length,C.push(e[_].slice()));var P=(C.length,[]);return t.forEach(function(t){var e=d(v,t[0]),r=d(y,t[1]);if(e>=0&&r>=0&&e!==r){var n=E[e],i=E[r];n!==i&&P.push([n,i])}}),o.unique(o.normalize(P)),{positions:C,edges:P}}e.exports=i;var a=t("robust-orientation"),o=t("simplicial-complex")},{"robust-orientation":996,"simplicial-complex":396}],398:[function(t,e,r){"use strict";function n(t){return"a"+t}function i(t){return"d"+t}function a(t,e){return"c"+t+"_"+e}function o(t){return"s"+t}function s(t,e){return"t"+t+"_"+e}function l(t){return"o"+t}function u(t){return"x"+t}function c(t){return"p"+t}function f(t,e){return"d"+t+"_"+e}function h(t){return"i"+t}function p(t,e){return"u"+t+"_"+e}function d(t){return"b"+t}function g(t){return"y"+t}function m(t){return"e"+t}function v(t){return"v"+t}function y(t,e,r){for(var n=0,i=0;t>i;++i)e&1<e;++e)F.push(c(e),"+=",p(e,x[t]),";");F.push("}")}function P(t){for(var e=t-1;e>=0;--e)S(e,0);for(var r=[],e=0;I>e;++e)L[e]?r.push(i(e)+".get("+c(e)+")"):r.push(i(e)+"["+c(e)+"]");for(var e=0;b>e;++e)r.push(u(e));F.push(A,"[",E,"++]=phase(",r.join(),");");for(var e=0;t>e;++e)C(e);for(var n=0;I>n;++n)F.push(c(n),"+=",p(n,x[t]),";")}function z(t){for(var e=0;I>e;++e)L[e]?F.push(a(e,0),"=",i(e),".get(",c(e),");"):F.push(a(e,0),"=",i(e),"[",c(e),"];");for(var r=[],e=0;I>e;++e)r.push(a(e,0));for(var e=0;b>e;++e)r.push(u(e));F.push(d(0),"=",A,"[",E,"]=phase(",r.join(),");");for(var n=1;1<n;++n)F.push(d(n),"=",A,"[",E,"+",m(n),"];");for(var o=[],n=1;1<n;++n)o.push("("+d(0)+"!=="+d(n)+")");F.push("if(",o.join("||"),"){");for(var s=[],e=0;O>e;++e)s.push(h(e));for(var e=0;I>e;++e){s.push(a(e,0));for(var n=1;1<n;++n)L[e]?F.push(a(e,n),"=",i(e),".get(",c(e),"+",f(e,n),");"):F.push(a(e,n),"=",i(e),"[",c(e),"+",f(e,n),"];"),s.push(a(e,n))}for(var e=0;1<e;++e)s.push(d(e));for(var e=0;b>e;++e)s.push(u(e));F.push("vertex(",s.join(),");",v(0),"=",w,"[",E,"]=",k,"++;");for(var l=(1<n;++n)if(0===(t&~(1<0;_=_-1&g)x.push(w+"["+E+"+"+m(_)+"]");x.push(v(0));for(var _=0;I>_;++_)1&n?x.push(a(_,l),a(_,g)):x.push(a(_,g),a(_,l));1&n?x.push(p,y):x.push(y,p);for(var _=0;b>_;++_)x.push(u(_));F.push("if(",p,"!==",y,"){","face(",x.join(),")}")}F.push("}",E,"+=1;")}function R(){for(var t=1;1<t;++t)F.push(T,"=",m(t),";",m(t),"=",g(t),";",g(t),"=",T,";")}function j(t,e){if(0>t)return void z(e);P(t),F.push("if(",o(x[t]),">0){",h(x[t]),"=1;"),j(t-1,e|1<r;++r)F.push(c(r),"+=",p(r,x[t]),";");t===O-1&&(F.push(E,"=0;"),R()),S(t,2),j(t-1,e),t===O-1&&(F.push("if(",h(x[O-1]),"&1){",E,"=0;}"),R()),C(t),F.push("}")}var I=L.length,O=x.length;if(2>O)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var N="extractContour"+x.join("_"),F=[],D=[],B=[],U=0;I>U;++U)B.push(n(U));for(var U=0;b>U;++U)B.push(u(U)); -for(var U=0;O>U;++U)D.push(o(U)+"="+n(0)+".shape["+U+"]|0");for(var U=0;I>U;++U){D.push(i(U)+"="+n(U)+".data",l(U)+"="+n(U)+".offset|0");for(var V=0;O>V;++V)D.push(s(U,V)+"="+n(U)+".stride["+V+"]|0")}for(var U=0;I>U;++U){D.push(c(U)+"="+l(U)),D.push(a(U,0));for(var V=1;1<V;++V){for(var q=[],G=0;O>G;++G)V&1<U;++U)for(var V=0;O>V;++V){var H=[s(U,x[V])];V>0&&H.push(s(U,x[V-1])+"*"+o(x[V-1])),D.push(p(U,x[V])+"=("+H.join("-")+")|0")}for(var U=0;O>U;++U)D.push(h(U)+"=0");D.push(k+"=0");for(var Y=["2"],U=O-2;U>=0;--U)Y.push(o(x[U]));D.push(M+"=("+Y.join("*")+")|0",A+"=mallocUint32("+M+")",w+"=mallocUint32("+M+")",E+"=0"),D.push(d(0)+"=0");for(var V=1;1<V;++V){for(var X=[],W=[],G=0;O>G;++G)V&1<n&&e("Must have at least one array argument");var i=t.scalarArguments||0;0>i&&e("Scalar arg count must be > 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var a=t.getters||[],o=new Array(n),s=0;n>s;++s)a.indexOf(s)>=0?o[s]=!0:o[s]=!1;return b(t.vertex,t.cell,t.phase,i,r,o)}var _=t("typedarray-pool");e.exports=x;var w="V",A="P",k="N",M="Q",E="X",T="T"},{"typedarray-pool":401}],399:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],400:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],401:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":399,buffer:48,dup:102}],402:[function(t,e,r){function n(t){if(0>t)return Number("0/0");for(var e=s[0],r=s.length-1;r>0;--r)e+=s[r]/(t+r);var n=t+o+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=7,a=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],o=607/128,s=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function l(t){if(.5>t)return Math.PI/(Math.sin(Math.PI*t)*l(1-t));if(t>100)return Math.exp(n(t));t-=1;for(var e=a[0],r=1;i+2>r;r++)e+=a[r]/(t+r);var o=t+i+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,t+.5)*Math.exp(-o)*e},e.exports.log=n},{}],403:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],404:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],405:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":403,buffer:48,dup:102}],406:[function(t,e,r){"use strict";function n(t){var e=t.length;if(i>e){for(var r=1,n=0;e>n;++n)for(var o=0;n>o;++o)if(t[n]n;++n)s[n]=0;for(var r=1,n=0;e>n;++n)if(!s[n]){var l=1;s[n]=1;for(var o=t[n];o!==n;o=t[o]){if(s[o])return a.freeUint8(s),0;l+=1,s[o]=1}1&l||(r=-r)}return a.freeUint8(s),r}e.exports=n;var i=32,a=t("typedarray-pool")},{"typedarray-pool":405}],407:[function(t,e,r){"use strict";function n(t){var e=t.length;switch(e){case 0:case 1:return 0;case 2:return t[1]}var r,n,i,s=a.mallocUint32(e),l=a.mallocUint32(e),u=0;for(o(t,l),i=0;e>i;++i)s[i]=t[i];for(i=e-1;i>0;--i)n=l[i],r=s[i],s[i]=s[n],s[n]=r,l[i]=l[r],l[r]=n,u=(u+r)*i;return a.freeUint32(l),a.freeUint32(s),u}function i(t,e,r){switch(t){case 0:return r?r:[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}r=r||new Array(t);var n,i,a,o=1;for(r[0]=0,a=1;t>a;++a)r[a]=a,o=o*a|0;for(a=t-1;a>0;--a)n=e/o|0,e=e-n*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}var a=t("typedarray-pool"),o=t("invert-permutation");r.rank=n,r.unrank=i},{"invert-permutation":408,"typedarray-pool":411}],408:[function(t,e,r){"use strict";function n(t,e){e=e||new Array(t.length);for(var r=0;rt)return[];if(0===t)return[[0]];for(var e=0|Math.round(o(t+1)),r=[],n=0;e>n;++n){for(var s=i.unrank(t,n),l=[0],u=0,c=0;c= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":414}],414:[function(t,e,r){arguments[4][290][0].apply(r,arguments)},{"./lib/thunk.js":416,dup:290}],415:[function(t,e,r){arguments[4][291][0].apply(r,arguments)},{dup:291,uniq:417}],416:[function(t,e,r){arguments[4][292][0].apply(r,arguments)},{"./compile.js":415,dup:292}],417:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],418:[function(t,e,r){"use strict";function n(t,e){var r=[];return e=+e||0,i(t.hi(t.shape[0]-1),r,e),r}e.exports=n;var i=t("./lib/zc-core")},{"./lib/zc-core":413}],419:[function(t,e,r){"use strict";function n(t,e){var r=t.length,n=["'use strict';"],i="surfaceNets"+t.join("_")+"d"+e;n.push("var contour=genContour({","order:[",t.join(),"],","scalarArguments: 3,","phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },"),"generic"===e&&n.push("getters:[0],");for(var a=[],l=[],u=0;r>u;++u)a.push("d"+u),l.push("d"+u);for(var u=0;1<u;++u)a.push("v"+u),l.push("v"+u);for(var u=0;1<u;++u)a.push("p"+u),l.push("p"+u);a.push("a","b","c"),l.push("a","c"),n.push("vertex:function vertexFunc(",a.join(),"){");for(var c=[],u=0;1<u;++u)c.push("(p"+u+"<<"+u+")");n.push("var m=(",c.join("+"),")|0;if(m===0||m===",(1<<(1<=1<<(1<>>7){");for(var u=0;1<<(1<u;++u){if(1<<(1<128&&u%128===0){f.length>0&&h.push("}}");var p="vExtra"+f.length;n.push("case ",u>>>7,":",p,"(m&0x7f,",l.join(),");break;"),h=["function ",p,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&u,":");for(var d=new Array(r),g=new Array(r),m=new Array(r),v=new Array(r),y=0,b=0;r>b;++b)d[b]=[],g[b]=[],m[b]=0,v[b]=0;for(var b=0;1<b;++b)for(var x=0;r>x;++x){var _=b^1<b)&&!(u&1<<_)!=!(u&1<w?(d[x].push("-v"+b+"-v"+_),m[x]+=2):(d[x].push("v"+b+"+v"+_),m[x]-=2),y+=1;for(var A=0;r>A;++A)A!==x&&(_&1<x;++x)if(0===d[x].length)k.push("d"+x+"-0.5");else{var M="";m[x]<0?M=m[x]+"*c":m[x]>0&&(M="+"+m[x]+"*c");var E=.5*(d[x].length/y),T=.5+.5*(v[x]/y);k.push("d"+x+"-"+T+"-"+E+"*("+d[x].join("+")+M+")/("+g[x].join("+")+")")}h.push("a.push([",k.join(),"]);","break;")}n.push("}},"),f.length>0&&h.push("}}");for(var L=[],u=0;1<u;++u)L.push("v"+u);L.push("c0","c1","p0","p1","a","b","c"),n.push("cell:function cellFunc(",L.join(),"){");var S=s(r-1);n.push("if(p0){b.push(",S.map(function(t){return"["+t.map(function(t){return"v"+t})+"]"}).join(),")}else{b.push(",S.map(function(t){var e=t.slice();return e.reverse(),"["+e.map(function(t){return"v"+t})+"]"}).join(),")}}});function ",i,"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ",i,";");for(var u=0;uo;++o)i[o]=[r[o]],a[o]=[o];return{positions:i,cells:a}}function a(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return i(t,e);var r=t.order.join()+"-"+t.dtype,a=u[r],e=+e||0;return a||(a=u[r]=n(t.order,t.dtype)),a(t,e)}e.exports=a;var o=t("ndarray-extract-contour"),s=t("triangulate-hypercube"),l=t("zero-crossings"),u={}},{"ndarray-extract-contour":398,"triangulate-hypercube":412,"zero-crossings":418}],420:[function(t,e,r){(function(r){"use strict";function n(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;ol;++l){var u=r[s[l]];n[i++]=u[0],n[i++]=u[1]+1.4,a=Math.max(u[0],a)}return{data:n,shape:a}}function i(t,e){var r=s[t];r||(r=s[t]={" ":{data:new Float32Array(0),shape:.2}});var o=r[e];if(!o)if(e.length<=1||!/\d/.test(e))o=r[e]=n(a(e,{triangles:!0,font:t,textAlign:"left",textBaseline:"alphabetic"}));else{for(var l=e.split(/(\d|\s)/),u=new Array(l.length),c=0,f=0,h=0;h0&&(f+=.02);for(var p=new Float32Array(c),d=0,g=-.5*f,h=0;hd;++d)if(f[d]&&n[d]<=0&&n[d+2]>=0){var g=e[d]-n[d]*(e[d+2]-e[d])/(n[d+2]-n[d]);0===d?o.drawLine(g,e[1],g,e[3],p[d],h[d]):o.drawLine(e[0],g,e[2],g,p[d],h[d])}}for(var d=0;dd;++d)s.drawTicks(d);this.titleEnable&&s.drawTitle();for(var b=this.overlays,d=0;du;++u){var c=s[u].slice(0);0!==c.length&&(c.sort(a),l[u]=Math.min(l[u],c[0].x),l[u+2]=Math.max(l[u+2],c[c.length-1].x))}this.grid.update({bounds:l,ticks:s}),this.text.update({bounds:l,ticks:s,labels:t.labels||["x","y"],labelSize:t.labelSize||[12,12],labelFont:t.labelFont||["sans-serif","sans-serif"],title:t.title||"",titleSize:t.titleSize||18,titleFont:t.titleFont||"sans-serif"}),this.setDirty()},h.dispose=function(){this.box.dispose(),this.grid.dispose(),this.text.dispose(),this.line.dispose();for(var t=this.objects.length-1;t>=0;--t)this.objects[t].dispose();this.objects.length=0;for(var t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},h.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},h.removeObject=function(t){for(var e=this.objects,r=0;rh;++h)o=o&&l[h]===s[h],l[h]=s[h];var p=t.clientWidth===c&&t.clientHeight===f;return c=t.clientWidth,f=t.clientHeight,o?!p:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(h,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){return n.setMode(t),n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var p=0,d=0;return o(t,function(e,r,a,o){var s=1/t.clientHeight,l=s*(r-p),c=s*(a-d),f=h.flipX?1:-1,g=h.flipY?1:-1,m=Math.PI*h.rotateSpeed,v=i();if(1&e)o.shift?n.rotate(v,0,0,-l*m):n.rotate(v,f*m*l,-g*m*c,0);else if(2&e)n.pan(v,-h.translateSpeed*l*u,h.translateSpeed*c*u,0);else if(4&e){var y=h.zoomSpeed*c/window.innerHeight*(v-n.lastT())*50;n.pan(v,0,0,u*(Math.exp(y)-1))}p=r,d=a}),s(t,function(t,e,r){var a=h.flipX?1:-1,o=h.flipY?1:-1,s=i();if(Math.abs(t)>Math.abs(e))n.rotate(s,0,0,-t*a*Math.PI*h.rotateSpeed/window.innerWidth);else{var l=h.zoomSpeed*o*e/window.innerHeight*(s-n.lastT())/100;n.pan(s,0,0,u*(Math.exp(l)-1))}},!0),h}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":28,"mouse-change":960,"mouse-wheel":964,"right-now":990}],424:[function(t,e,r){arguments[4][75][0].apply(r,arguments)},{dup:75,ndarray:987,"ndarray-ops":982,"typedarray-pool":427}],425:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],426:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],427:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":425,buffer:48,dup:102}],428:[function(t,e,r){arguments[4][132][0].apply(r,arguments)},{dup:132}],429:[function(t,e,r){arguments[4][133][0].apply(r,arguments)},{"./do-bind.js":428,dup:133}],430:[function(t,e,r){arguments[4][134][0].apply(r,arguments)},{"./do-bind.js":428,dup:134}],431:[function(t,e,r){arguments[4][135][0].apply(r,arguments)},{"./lib/vao-emulated.js":429,"./lib/vao-native.js":430,dup:135}],432:[function(t,e,r){!function(){"use strict";function t(e){e.permitHostObjects___&&e.permitHostObjects___(t)}function r(t){return!(t.substr(0,p.length)==p&&"___"===t.substr(t.length-3))}function n(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[d];if(e&&e.key===t)return e;if(h(t)){e={key:t};try{return f(t,d,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(r){return}}}function i(t){return t.prototype=null,Object.freeze(t)}function a(){y||"undefined"==typeof console||(y=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}if("undefined"==typeof ses||!ses.ok||ses.ok()){"undefined"!=typeof ses&&(ses.weakMapPermitHostObjects=t);var o=!1;if("function"==typeof WeakMap){var s=WeakMap;if("undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent));else{var l=new s,u=Object.freeze({});if(l.set(u,1),1===l.get(u))return void(e.exports=WeakMap);o=!0}}var c=(Object.prototype.hasOwnProperty,Object.getOwnPropertyNames),f=Object.defineProperty,h=Object.isExtensible,p="weakmap:",d=p+"ident:"+Math.random()+"___";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var g=new ArrayBuffer(25),m=new Uint8Array(g);crypto.getRandomValues(m),d=p+"rand:"+Array.prototype.map.call(m,function(t){return(t%36).toString(36)}).join("")+"___"}if(f(Object,"getOwnPropertyNames",{value:function(t){return c(t).filter(r)}}),"getPropertyNames"in Object){var v=Object.getPropertyNames;f(Object,"getPropertyNames",{value:function(t){return v(t).filter(r)}})}!function(){var t=Object.freeze;f(Object,"freeze",{value:function(e){return n(e),t(e)}});var e=Object.seal;f(Object,"seal",{value:function(t){return n(t),e(t)}});var r=Object.preventExtensions;f(Object,"preventExtensions",{value:function(t){return n(t),r(t)}})}();var y=!1,b=0,x=function(){function t(t,e){var r,i=n(t);return i?u in i?i[u]:e:(r=s.indexOf(t),r>=0?l[r]:e)}function e(t){var e=n(t);return e?u in e:s.indexOf(t)>=0}function r(t,e){var r,i=n(t);return i?i[u]=e:(r=s.indexOf(t),r>=0?l[r]=e:(r=s.length,l[r]=e,s[r]=t)),this}function o(t){var e,r,i=n(t);return i?u in i&&delete i[u]:(e=s.indexOf(t),0>e?!1:(r=s.length-1,s[e]=void 0,l[e]=l[r],s[e]=s[r],s.length=r,l.length=r,!0))}this instanceof x||a();var s=[],l=[],u=b++;return Object.create(x.prototype,{get___:{value:i(t)},has___:{value:i(e)},set___:{value:i(r)},delete___:{value:i(o)}})};x.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},"delete":{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof s?!function(){function r(){function e(t,e){return c?u.has(t)?u.get(t):c.get___(t,e):u.get(t,e)}function r(t){return u.has(t)||(c?c.has___(t):!1)}function n(t){var e=!!u.delete(t);return c?c.delete___(t)||e:e}this instanceof x||a();var l,u=new s,c=void 0,f=!1;return l=o?function(t,e){return u.set(t,e),u.has(t)||(c||(c=new x),c.set(t,e)),this}:function(t,e){if(f)try{u.set(t,e)}catch(r){c||(c=new x),c.set___(t,e)}else u.set(t,e);return this},Object.create(x.prototype,{get___:{value:i(e)},has___:{value:i(r)},set___:{value:i(l)},delete___:{value:i(n)},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");f=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=x.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=x)}}()},{}],433:[function(t,e,r){"use strict";function n(t){var e=s.get(t);if(!e||!t.isBuffer(e._triangleBuffer.buffer)){var r=a(t,new Float32Array([-1,-1,-1,4,4,-1]));e=o(t,[{buffer:r,type:t.FLOAT,size:2}]),e._triangleBuffer=r,s.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}var i="undefined"==typeof WeakMap?t("weak-map"):WeakMap,a=t("gl-buffer"),o=t("gl-vao"),s=new i;e.exports=n},{"gl-buffer":424,"gl-vao":431,"weak-map":432}],434:[function(t,e,r){"use strict";function n(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function i(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont="sans-serif",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=c(t)}function a(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}function o(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,u=n[e],c=0;3>c;++c)if(e!==c){var f=a,h=s,p=o,d=l;u&1<0?(p[c]=-1,d[c]=0):(p[c]=0,d[c]=1)}}function s(t,e){var r=new i(t);return r.update(e),r}e.exports=s;var l=t("./lib/text.js"),u=t("./lib/lines.js"),c=t("./lib/background.js"),f=t("./lib/cube.js"),h=t("./lib/ticks.js"),p=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=i.prototype;d.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;3>s;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),s=!1,c=!1;if("bounds"in t)for(var f=t.bounds,p=0;2>p;++p)for(var d=0;3>d;++d)f[p][d]!==this.bounds[p][d]&&(c=!0),this.bounds[p][d]=f[p][d];if("ticks"in t){r=t.ticks,s=!0,this.autoTicks=!1;for(var p=0;3>p;++p)this.tickSpacing[p]=0}else n("tickSpacing")&&(this.autoTicks=!0,c=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),c=!0,s=!0,this._firstInit=!1),c&&this.autoTicks&&(r=h.create(this.bounds,this.tickSpacing),s=!0),s){for(var p=0;3>p;++p)r[p].sort(function(t,e){return t.x-e.x});h.equal(r,this.ticks)?s=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(s=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var g=a("labels");a("labelFont")&&(g=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(g||s)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=l(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&s&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=u(this.gl,this.bounds,this.ticks))};var g=[new a,new a,new a],m=[0,0,0],v={model:p,view:p,projection:p};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(t){};var y=[0,0,0],b=[0,0,0],x=[0,0,0];d.draw=function(t){t=t||v;for(var e=this.gl,r=t.model||p,i=t.view||p,a=t.projection||p,s=this.bounds,l=f(r,i,a,s),u=l.cubeEdges,c=l.axis,h=i[12],d=i[13],_=i[14],w=i[15],A=this.pixelRatio*(a[3]*h+a[7]*d+a[11]*_+a[15]*w)/e.drawingBufferHeight,k=0;3>k;++k)this.lastCubeProps.cubeEdges[k]=u[k],this.lastCubeProps.axis[k]=c[k];for(var M=g,k=0;3>k;++k)o(g[k],k,this.bounds,u,c);for(var e=this.gl,E=m,k=0;3>k;++k)this.backgroundEnable[k]?E[k]=c[k]:E[k]=0;this._background.draw(r,i,a,s,E,this.backgroundColor),this._lines.bind(r,i,a,this); -for(var k=0;3>k;++k){var T=[0,0,0];c[k]>0?T[k]=s[1][k]:T[k]=s[0][k];for(var L=0;2>L;++L){var S=(k+1+L)%3,C=(k+1+(1^L))%3;this.gridEnable[S]&&this._lines.drawGrid(S,C,this.bounds,T,this.gridColor[S],this.gridWidth[S]*this.pixelRatio)}for(var L=0;2>L;++L){var S=(k+1+L)%3,C=(k+1+(1^L))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(S,C,this.bounds,T,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(var k=0;3>k;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,M[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,M[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);for(var P=n(y,M[k].primalMinor),z=n(b,M[k].mirrorMinor),R=this.lineTickLength,L=0;3>L;++L){var j=A/r[5*L];P[L]*=R[L]*j,z[L]*=R[L]*j}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,M[k].primalOffset,P,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,M[k].mirrorOffset,z,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(var k=0;3>k;++k){for(var I=M[k].primalMinor,O=n(x,M[k].primalOffset),L=0;3>L;++L)this.lineTickEnable[k]&&(O[L]+=A*I[L]*Math.max(this.lineTickLength[L],0)/r[5*L]);if(this.tickEnable[k]){for(var L=0;3>L;++L)O[L]+=A*I[L]*this.tickPad[L]/r[5*L];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],O,this.tickColor[k])}if(this.labelEnable[k]){for(var L=0;3>L;++L)O[L]+=A*I[L]*this.labelPad[L]/r[5*L];O[k]+=.5*(s[0][k]+s[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],O,this.labelColor[k])}}},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":435,"./lib/cube.js":436,"./lib/lines.js":437,"./lib/text.js":439,"./lib/ticks.js":440}],435:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}function i(t){for(var e=[],r=[],i=0,l=0;3>l;++l)for(var u=(l+1)%3,c=(l+2)%3,f=[0,0,0],h=[0,0,0],p=-1;1>=p;p+=2){r.push(i,i+2,i+1,i+1,i+2,i+3),f[l]=p,h[l]=p;for(var d=-1;1>=d;d+=2){f[u]=d;for(var g=-1;1>=g;g+=2)f[c]=g,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),i+=1}var m=u;u=c,c=m}var v=a(t,new Float32Array(e)),y=a(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=o(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=s(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new n(t,v,b,x)}e.exports=i;var a=t("gl-buffer"),o=t("gl-vao"),s=t("./shaders").bg,l=n.prototype;l.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;3>s;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),l.disable(l.POLYGON_OFFSET_FILL)}},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":438,"gl-buffer":444,"gl-vao":449}],436:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;4>n;++n){t[n]=r[12+n];for(var i=0;3>i;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;eg;++g){p[2]=a[g][2];for(var b=0;2>b;++b){p[1]=a[b][1];for(var x=0;2>x;++x)p[0]=a[x][0],n(f[l],p,c),l+=1}}for(var _=-1,g=0;8>g;++g){for(var w=f[g][3],A=0;3>A;++A)h[g][A]=f[g][A]/w;0>w&&(0>_?_=g:h[g][2]_){_=0;for(var k=0;3>k;++k){for(var M=(k+2)%3,E=(k+1)%3,T=-1,L=-1,S=0;2>S;++S){var C=S<T||0>L)L>T&&(_|=1<S;++S){var C=S<T&&(_|=1<g;++g)g!==_&&g!==j&&(0>I?I=g:h[I][1]>h[g][1]&&(I=g));for(var O=-1,g=0;3>g;++g){var N=I^1<O&&(O=N);var E=h[N];E[0]g;++g){var N=I^1<F&&(F=N);var E=h[N];E[0]>h[F][0]&&(F=N)}}var D=m;D[0]=D[1]=D[2]=0,D[o.log2(O^I)]=I&O,D[o.log2(I^F)]=I&F;var B=7^F;B===_||B===j?(B=7^O,D[o.log2(F^B)]=B&F):D[o.log2(O^B)]=B&O;for(var U=v,V=_,k=0;3>k;++k)V&1<t;++t)f[t]=[1,1,1,1],h[t]=[1,1,1]}();var g=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]],m=[1,1,1],v=[0,0,0],y={cubeEdges:m,axis:v}},{"bit-twiddle":441,"gl-mat4/invert":214,"gl-mat4/multiply":216,"robust-orientation":996,"split-polygon":451}],437:[function(t,e,r){"use strict";function n(t){return t[0]=t[1]=t[2]=0,t}function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function a(t,e,r,n,i,a,o,s){this.gl=t,this.vertBuffer=e,this.vao=r,this.shader=n,this.tickCount=i,this.tickOffset=a,this.gridCount=o,this.gridOffset=s}function o(t,e,r){var n=[],i=[0,0,0],o=[0,0,0],c=[0,0,0],f=[0,0,0];n.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var h=0;3>h;++h){for(var p=n.length/3|0,d=0;dh;++h)for(var d=c[h],g=2;g>=0;--g){var m=u[d[g]];s.push(l*m[0],-l*m[1],t)}}for(var s=(this.gl,[]),l=[0,0,0],u=[0,0,0],c=[0,0,0],p=[0,0,0],d=0;3>d;++d){c[d]=s.length/h|0,o(.5*(t[0][d]+t[1][d]),e[d],r),p[d]=(s.length/h|0)-c[d],l[d]=s.length/h|0;for(var g=0;g=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;0>o?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u=0|u);var c=""+l;if(0>o&&(c="-"+c),i){for(var f=""+u;f.lengthi;++i){for(var a=[],o=(.5*(t[0][i]+t[1][i]),0);o*e[i]<=t[1][i];++o)a.push({x:o*e[i],text:n(e[i],o)});for(var o=-1;o*e[i]>=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r}function a(t,e){for(var r=0;3>r;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;na?a=0:a>1&&(a=1);for(var o=1-a,s=t.length,l=new Array(s),u=0;s>u;++u)l[u]=a*t[u]+o*r[u];return l}function a(t,e){for(var r=[],a=[],o=n(t[t.length-1],e),s=t[t.length-1],l=t[0],u=0;uo&&c>0||o>0&&0>c){var f=i(s,c,l,o);r.push(f),a.push(f.slice())}0>c?a.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=c}return{positive:r,negative:a}}function o(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;la&&u>0||a>0&&0>u)&&r.push(i(o,u,s,a)),u>=0&&r.push(s.slice()),a=u}return r}function s(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;la&&u>0||a>0&&0>u)&&r.push(i(o,u,s,a)),0>=u&&r.push(s.slice()),a=u}return r}var l=t("robust-dot-product"),u=t("robust-sum");e.exports=a,e.exports.positive=o,e.exports.negative=s},{"robust-dot-product":452,"robust-sum":454}],452:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t[0],e[0]),n=1;na;++a){for(var o=d,s=g,l=0;3>l;++l)s[l]=o[l]=r[l];s[3]=o[3]=1,s[a]+=1,f(s,s,e),s[3]<0&&(t[a]=1/0),o[a]-=1,f(o,o,e),o[3]<0&&(t[a]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,c=(o[1]/o[3]-s[1]/s[3])*i;t[a]=.25*Math.sqrt(u*u+c*c)}return t}function a(t,e,r,n,a){var f=e.model||h,d=e.view||h,g=e.projection||h,y=t.bounds,a=a||l(f,d,g,y),b=a.axis;a.edges;u(p,d,f),u(p,g,p);for(var x=m,_=0;3>_;++_)x[_].lo=1/0,x[_].hi=-(1/0),x[_].pixelsPerDataUnit=1/0;var w=o(c(p,p));c(p,p);for(var A=0;3>A;++A){var k=(A+1)%3,M=(A+2)%3,E=v;t:for(var _=0;2>_;++_){var T=[];if(b[A]<0!=!!_){E[A]=y[_][A];for(var L=0;2>L;++L){E[k]=y[L^_][k];for(var S=0;2>S;++S)E[M]=y[S^L^_][M],T.push(E.slice())}for(var L=0;LS;++S)x[S].lo=Math.min(x[S].lo,M[S]),x[S].hi=Math.max(x[S].hi,M[S]),S!==A&&(x[S].pixelsPerDataUnit=Math.min(x[S].pixelsPerDataUnit,Math.abs(C[S])))}}}return x}e.exports=a;var o=t("extract-frustum-planes"),s=t("split-polygon"),l=t("./lib/cube.js"),u=t("gl-mat4/multiply"),c=t("gl-mat4/transpose"),f=t("gl-vec4/transformMat4"),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),p=new Float32Array(16),d=[0,0,0,1],g=[0,0,0,1],m=[new n(1/0,-(1/0),1/0),new n(1/0,-(1/0),1/0),new n(1/0,-(1/0),1/0)],v=[0,0,0]},{"./lib/cube.js":436,"extract-frustum-planes":443,"gl-mat4/multiply":216,"gl-mat4/transpose":224,"gl-vec4/transformMat4":450,"split-polygon":451}],545:[function(t,e,r){arguments[4][294][0].apply(r,arguments)},{dup:294,"gl-texture2d":549}],546:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],547:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],548:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":546,buffer:48,dup:102}],549:[function(t,e,r){arguments[4][164][0].apply(r,arguments)},{dup:164,ndarray:987,"ndarray-ops":982,"typedarray-pool":548}],550:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],551:[function(t,e,r){arguments[4][289][0].apply(r,arguments)},{"cwise-compiler":552,dup:289}],552:[function(t,e,r){arguments[4][290][0].apply(r,arguments)},{"./lib/thunk.js":554,dup:290}],553:[function(t,e,r){arguments[4][291][0].apply(r,arguments)},{dup:291,uniq:555}],554:[function(t,e,r){arguments[4][292][0].apply(r,arguments)},{"./compile.js":553,dup:292}],555:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],556:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],557:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":550,buffer:48,dup:102}],558:[function(t,e,r){arguments[4][298][0].apply(r,arguments)},{"bit-twiddle":550,"cwise/lib/wrapper":551,dup:298,"gl-fbo":545,ndarray:987,"typedarray-pool":557}],559:[function(t,e,r){arguments[4][76][0].apply(r,arguments)},{"./lib/GLError":560,"./lib/create-attributes":561,"./lib/create-uniforms":562,"./lib/reflect":563,"./lib/runtime-reflect":564,"./lib/shader-cache":565,dup:76}],560:[function(t,e,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],561:[function(t,e,r){arguments[4][78][0].apply(r,arguments)},{"./GLError":560,dup:78}],562:[function(t,e,r){arguments[4][79][0].apply(r,arguments)},{"./GLError":560,"./reflect":563,dup:79}],563:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],564:[function(t,e,r){arguments[4][81][0].apply(r,arguments)},{dup:81}],565:[function(t,e,r){arguments[4][82][0].apply(r,arguments)},{"./GLError":560,dup:82,"gl-format-compiler-error":566,"weakmap-shim":582}],566:[function(t,e,r){arguments[4][83][0].apply(r,arguments)},{"add-line-numbers":567,dup:83,"gl-constants/lookup":571,"glsl-shader-name":572,"sprintf-js":579}],567:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84,"pad-left":568}],568:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{dup:85,"repeat-string":569}],569:[function(t,e,r){arguments[4][86][0].apply(r,arguments)},{dup:86}],570:[function(t,e,r){arguments[4][87][0].apply(r,arguments)},{dup:87}],571:[function(t,e,r){arguments[4][88][0].apply(r,arguments)},{"./1.0/numbers":570,dup:88}],572:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{"atob-lite":573,dup:89,"glsl-tokenizer":578}],573:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{dup:90}],574:[function(t,e,r){arguments[4][91][0].apply(r,arguments)},{"./lib/builtins":575,"./lib/literals":576,"./lib/operators":577,dup:91}],575:[function(t,e,r){arguments[4][92][0].apply(r,arguments)},{dup:92}],576:[function(t,e,r){arguments[4][93][0].apply(r,arguments)},{dup:93}],577:[function(t,e,r){arguments[4][94][0].apply(r,arguments)},{dup:94}],578:[function(t,e,r){arguments[4][95][0].apply(r,arguments)},{"./index":574,dup:95}],579:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{dup:96}],580:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{"./hidden-store.js":581,dup:97}],581:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{dup:98}],582:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{"./create-store.js":580,dup:99}],583:[function(t,e,r){arguments[4][75][0].apply(r,arguments)},{dup:75,ndarray:987,"ndarray-ops":982,"typedarray-pool":586}],584:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],585:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],586:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":584,buffer:48,dup:102}],587:[function(t,e,r){arguments[4][132][0].apply(r,arguments)},{dup:132}],588:[function(t,e,r){arguments[4][133][0].apply(r,arguments)},{"./do-bind.js":587,dup:133}],589:[function(t,e,r){arguments[4][134][0].apply(r,arguments)},{"./do-bind.js":587,dup:134}],590:[function(t,e,r){arguments[4][135][0].apply(r,arguments)},{"./lib/vao-emulated.js":588,"./lib/vao-native.js":589, -dup:135}],591:[function(t,e,r){"use strict";var n=t("gl-shader"),i="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n",a="#define GLSLIFY 1\nprecision mediump float;\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}";e.exports=function(t){return n(t,i,a,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":559}],592:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}function i(t,e){function r(t,e,r,n,a,o){var s=[t,e,r,0,0,0,1];s[n+3]=1,s[n]=a,i.push.apply(i,s),s[6]=-1,i.push.apply(i,s),s[n]=o,i.push.apply(i,s),i.push.apply(i,s),s[6]=1,i.push.apply(i,s),s[n]=a,i.push.apply(i,s)}var i=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=a(t,i),u=o(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),c=s(t);c.attributes.position.location=0,c.attributes.color.location=1,c.attributes.weight.location=2;var f=new n(t,l,u,c);return f.update(e),f}var a=t("gl-buffer"),o=t("gl-vao"),s=t("./shaders/index");e.exports=i;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],u=n.prototype,c=[0,0,0],f=[0,0,0],h=[0,0];u.isTransparent=function(){return!1},u.drawTransparent=function(t){},u.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||l,o=t.view||l,s=t.projection||l;this.axes&&(i=this.axes.lastCubeProps.axis);for(var u=c,p=f,d=0;3>d;++d)i&&i[d]<0?(u[d]=this.bounds[0][d],p[d]=this.bounds[1][d]):(u[d]=this.bounds[1][d],p[d]=this.bounds[0][d]);h[0]=e.drawingBufferWidth,h[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=s,n.uniforms.coordinates=[this.position,u,p],n.uniforms.colors=this.colors,n.uniforms.screenShape=h;for(var d=0;3>d;++d)n.uniforms.lineWidth=this.lineWidth[d]*this.pixelRatio,this.enabled[d]&&(r.draw(e.TRIANGLES,6,6*d),this.drawSides[d]&&r.draw(e.TRIANGLES,12,18+12*d));r.unbind()},u.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},u.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":591,"gl-buffer":583,"gl-vao":590}],593:[function(t,e,r){"use strict";function n(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function i(t,e){var r=null;try{r=t.getContext("webgl",e),r||(r=t.getContext("experimental-webgl",e))}catch(n){return null}return r}function a(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(0>e){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){var r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function o(t){return"boolean"==typeof t?t:!0}function s(t){function e(){if(!_&&G.autoResize){var t=w.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*G.pixelRatio),i=0|Math.ceil(r*G.pixelRatio);if(n!==w.width||i!==w.height){w.width=n,w.height=i;var a=w.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",F=!0}}}function r(){for(var t=j.length,e=N.length,r=0;e>r;++r)O[r]=0;t:for(var r=0;t>r;++r){var n=j[r],i=n.pickSlots;if(i){for(var a=0;e>a;++a)if(O[a]+i<255){I[r]=a,n.setPickBase(O[a]+1),O[a]+=i;continue t}var o=h(k,q);I[r]=e,N.push(o),O.push(i),n.setPickBase(1),e+=1}else I[r]=-1}for(;e>0&&0===O[e-1];)O.pop(),N.pop().dispose()}function s(){return G.contextLost?!0:void(k.isContextLost()&&(G.contextLost=!0,G.mouseListener.enabled=!1,G.selection.object=null,G.oncontextloss&&G.oncontextloss()))}function y(){if(!s()){k.colorMask(!0,!0,!0,!0),k.depthMask(!0),k.disable(k.BLEND),k.enable(k.DEPTH_TEST);for(var t=j.length,e=N.length,r=0;e>r;++r){var n=N[r];n.shape=H,n.begin();for(var i=0;t>i;++i)if(I[i]===r){var a=j[i];a.drawPick&&(a.pixelRatio=1,a.drawPick(V))}n.end()}}}function b(){if(!s()){e();var t=G.camera.tick();V.view=G.camera.matrix,F=F||t,D=D||t,P.pixelRatio=G.pixelRatio,R.pixelRatio=G.pixelRatio;var r=j.length,n=W[0],i=W[1];n[0]=n[1]=n[2]=1/0,i[0]=i[1]=i[2]=-(1/0);for(var o=0;r>o;++o){var l=j[o];l.pixelRatio=G.pixelRatio,l.axes=G.axes,F=F||!!l.dirty,D=D||!!l.dirty;var u=l.bounds;if(u)for(var f=u[0],h=u[1],p=0;3>p;++p)n[p]=Math.min(n[p],f[p]),i[p]=Math.max(i[p],h[p])}var g=G.bounds;if(G.autoBounds)for(var p=0;3>p;++p){if(i[p]p;++p)b=b||Z[0][p]!==g[0][p]||Z[1][p]!==g[1][p],Z[0][p]=g[0][p],Z[1][p]=g[1][p];if(b){for(var x=[0,0,0],o=0;3>o;++o)x[o]=a((g[1][o]-g[0][o])/10);P.autoTicks?P.update({bounds:g,tickSpacing:x}):P.update({bounds:g})}D=D||b,F=F||b;var _=k.drawingBufferWidth,w=k.drawingBufferHeight;q[0]=_,q[1]=w,H[0]=0|Math.max(_/G.pixelRatio,1),H[1]=0|Math.max(w/G.pixelRatio,1),m(B,G.fovy,_/w,G.zNear,G.zFar);for(var o=0;16>o;++o)U[o]=0;U[15]=1;for(var A=0,o=0;3>o;++o)A=Math.max(A,g[1][o]-g[0][o]);for(var o=0;3>o;++o)G.autoScale?U[5*o]=G.aspect[o]/(g[1][o]-g[0][o]):U[5*o]=1/A,G.autoCenter&&(U[12+o]=.5*-U[5*o]*(g[0][o]+g[1][o]));for(var o=0;r>o;++o){var l=j[o];l.axesBounds=g,G.clipToBounds&&(l.clipBounds=g)}if(E.object&&(G.snapToData?R.position=E.dataCoordinate:R.position=E.dataPosition,R.bounds=g),D&&(D=!1,y()),F){G.axesPixels=c(G.axes,V,_,w),G.onrender&&G.onrender(),k.bindFramebuffer(k.FRAMEBUFFER,null),k.viewport(0,0,_,w);var M=G.clearColor;k.clearColor(M[0],M[1],M[2],M[3]),k.clear(k.COLOR_BUFFER_BIT|k.DEPTH_BUFFER_BIT),k.depthMask(!0),k.colorMask(!0,!0,!0,!0),k.enable(k.DEPTH_TEST),k.depthFunc(k.LEQUAL),k.disable(k.BLEND),k.disable(k.CULL_FACE);var S=!1;P.enable&&(S=S||P.isTransparent(),P.draw(V)),R.axes=P,E.object&&R.draw(V),k.disable(k.CULL_FACE);for(var o=0;r>o;++o){var l=j[o];l.axes=P,l.pixelRatio=G.pixelRatio,l.isOpaque&&l.isOpaque()&&l.draw(V),l.isTransparent&&l.isTransparent()&&(S=!0)}if(S){T.shape=q,T.bind(),k.clear(k.DEPTH_BUFFER_BIT),k.colorMask(!1,!1,!1,!1),k.depthMask(!0),k.depthFunc(k.LESS),P.enable&&P.isTransparent()&&P.drawTransparent(V);for(var o=0;r>o;++o){var l=j[o];l.isOpaque&&l.isOpaque()&&l.draw(V)}k.enable(k.BLEND),k.blendEquation(k.FUNC_ADD),k.blendFunc(k.ONE,k.ONE_MINUS_SRC_ALPHA),k.colorMask(!0,!0,!0,!0),k.depthMask(!1),k.clearColor(0,0,0,0),k.clear(k.COLOR_BUFFER_BIT),P.isTransparent()&&P.drawTransparent(V);for(var o=0;r>o;++o){var l=j[o];l.isTransparent&&l.isTransparent()&&l.drawTransparent(V)}k.bindFramebuffer(k.FRAMEBUFFER,null),k.blendFunc(k.ONE,k.ONE_MINUS_SRC_ALPHA),k.disable(k.DEPTH_TEST),L.bind(),T.color[0].bind(0),L.uniforms.accumBuffer=0,d(k),k.disable(k.BLEND)}F=!1;for(var o=0;r>o;++o)j[o].dirty=!1}}}function x(){_||G.contextLost||(requestAnimationFrame(x),b())}t=t||{};var _=!1,w=(t.pixelRatio||parseFloat(window.devicePixelRatio),t.canvas);if(!w)if(w=document.createElement("canvas"),t.container){var A=t.container;A.appendChild(w)}else document.body.appendChild(w);var k=t.gl;if(k||(k=i(w,t.glOptions||{premultipliedAlpha:!0,antialias:!0})),!k)throw new Error("webgl not supported");var M=t.bounds||[[-10,-10,-10],[10,10,10]],E=new n,T=p(k,[k.drawingBufferWidth,k.drawingBufferHeight],{preferFloat:!0}),L=v(k),S=t.camera||{eye:[2,0,0],center:[0,0,0],up:[0,1,0],zoomMin:.1,zoomMax:100,mode:"turntable"},C=t.axes||{},P=u(k,C);P.enable=!C.disable;var z=t.spikes||{},R=f(k,z),j=[],I=[],O=[],N=[],F=!0,D=!0,B=new Array(16),U=new Array(16),V={view:null,projection:B,model:U},D=!0,q=[k.drawingBufferWidth,k.drawingBufferHeight],G={gl:k,contextLost:!1,pixelRatio:t.pixelRatio||parseFloat(window.devicePixelRatio),canvas:w,selection:E,camera:l(w,S),axes:P,axesPixels:null,spikes:R,bounds:M,objects:j,shape:q,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:o(t.autoResize),autoBounds:o(t.autoBounds),autoScale:!!t.autoScale,autoCenter:o(t.autoCenter),clipToBounds:o(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:V,oncontextloss:null,mouseListener:null},H=[k.drawingBufferWidth/G.pixelRatio|0,k.drawingBufferHeight/G.pixelRatio|0];G.autoResize&&e(),window.addEventListener("resize",e),G.update=function(t){_||(t=t||{},F=!0,D=!0)},G.add=function(t){_||(t.axes=P,j.push(t),I.push(-1),F=!0,D=!0,r())},G.remove=function(t){if(!_){var e=j.indexOf(t);0>e||(j.splice(e,1),I.pop(),F=!0,D=!0,r())}},G.dispose=function(){if(!_&&(_=!0,window.removeEventListener("resize",e),w.removeEventListener("webglcontextlost",s),G.mouseListener.enabled=!1,!G.contextLost)){P.dispose(),R.dispose();for(var t=0;ts;++s){var l=N[s].query(e,H[1]-r-1,G.pickRadius);if(l){if(l.distance>E.distance)continue;for(var u=0;i>u;++u){var c=j[u];if(I[u]===s){var f=c.pick(l);f&&(E.screen=l.coord,E.distance=l.distance,E.object=c,E.index=f.distance,E.dataPosition=f.position,E.dataCoordinate=f.dataCoordinate,E.data=f,o=!0)}}}}}a&&a!==E.object&&(a.highlight&&a.highlight(null),F=!0),E.object&&(E.object.highlight&&E.object.highlight(E.data),F=!0),o=o||E.object!==a,o&&G.onselect&&G.onselect(E),1&t&&!(1&X)&&G.onclick&&G.onclick(E),X=t}}),w.addEventListener("webglcontextlost",s);var W=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],Z=[W[0].slice(),W[1].slice()];return x(),G.redraw=function(){_||(F=!0,b())},G}e.exports=s;var l=t("3d-view-controls"),u=t("gl-axes3d"),c=t("gl-axes3d/properties"),f=t("gl-spikes3d"),h=t("gl-select-static"),p=t("gl-fbo"),d=t("a-big-triangle"),g=t("mouse-change"),m=t("gl-mat4/perspective"),v=t("./lib/shader")},{"./lib/shader":422,"3d-view-controls":423,"a-big-triangle":433,"gl-axes3d":434,"gl-axes3d/properties":544,"gl-fbo":545,"gl-mat4/perspective":217,"gl-select-static":558,"gl-spikes3d":592,"mouse-change":960}],594:[function(t,e,r){"use strict";e.exports={vertex:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 position;\nattribute vec2 offset;\nattribute vec4 color;\n\nuniform mat3 viewTransform;\nuniform vec2 pixelScale;\n\nvarying vec4 fragColor;\n\nvec4 computePosition_1_0(vec2 position, vec2 offset, mat3 view, vec2 scale) {\n vec3 xposition = view * vec3(position, 1.0);\n return vec4(\n xposition.xy + scale * offset * xposition.z,\n 0,\n xposition.z);\n}\n\n\n\n\nvoid main() {\n fragColor = color;\n\n gl_Position = computePosition_1_0(\n position,\n offset,\n viewTransform,\n pixelScale);\n}\n",fragment:"#define GLSLIFY 1\nprecision lowp float;\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\n}\n",pickVertex:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 position;\nattribute vec2 offset;\nattribute vec4 id;\n\nuniform mat3 viewTransform;\nuniform vec2 pixelScale;\nuniform vec4 pickOffset;\n\nvarying vec4 fragColor;\n\nvec4 computePosition_1_0(vec2 position, vec2 offset, mat3 view, vec2 scale) {\n vec3 xposition = view * vec3(position, 1.0);\n return vec4(\n xposition.xy + scale * offset * xposition.z,\n 0,\n xposition.z);\n}\n\n\n\n\nvoid main() {\n vec4 fragId = id + pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n fragColor = fragId / 255.0;\n\n gl_Position = computePosition_1_0(\n position,\n offset,\n viewTransform,\n pixelScale);\n}\n",pickFragment:"#define GLSLIFY 1\nprecision lowp float;\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],595:[function(t,e,r){arguments[4][75][0].apply(r,arguments)},{dup:75,ndarray:987,"ndarray-ops":982,"typedarray-pool":623}],596:[function(t,e,r){arguments[4][76][0].apply(r,arguments)},{"./lib/GLError":597,"./lib/create-attributes":598,"./lib/create-uniforms":599,"./lib/reflect":600,"./lib/runtime-reflect":601,"./lib/shader-cache":602,dup:76}],597:[function(t,e,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],598:[function(t,e,r){arguments[4][78][0].apply(r,arguments)},{"./GLError":597,dup:78}],599:[function(t,e,r){arguments[4][79][0].apply(r,arguments)},{"./GLError":597,"./reflect":600,dup:79}],600:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],601:[function(t,e,r){arguments[4][81][0].apply(r,arguments)},{dup:81}],602:[function(t,e,r){arguments[4][82][0].apply(r,arguments)},{"./GLError":597,dup:82,"gl-format-compiler-error":603,"weakmap-shim":619}],603:[function(t,e,r){arguments[4][83][0].apply(r,arguments)},{"add-line-numbers":604,dup:83,"gl-constants/lookup":608,"glsl-shader-name":609,"sprintf-js":616}],604:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84,"pad-left":605}],605:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{dup:85,"repeat-string":606}],606:[function(t,e,r){arguments[4][86][0].apply(r,arguments)},{dup:86}],607:[function(t,e,r){arguments[4][87][0].apply(r,arguments)},{dup:87}],608:[function(t,e,r){arguments[4][88][0].apply(r,arguments)},{"./1.0/numbers":607,dup:88}],609:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{"atob-lite":610,dup:89,"glsl-tokenizer":615}],610:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{dup:90}],611:[function(t,e,r){arguments[4][91][0].apply(r,arguments)},{"./lib/builtins":612,"./lib/literals":613,"./lib/operators":614,dup:91}],612:[function(t,e,r){arguments[4][92][0].apply(r,arguments)},{dup:92}],613:[function(t,e,r){arguments[4][93][0].apply(r,arguments)},{dup:93}],614:[function(t,e,r){arguments[4][94][0].apply(r,arguments)},{dup:94}],615:[function(t,e,r){arguments[4][95][0].apply(r,arguments)},{"./index":611,dup:95}],616:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{dup:96}],617:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{"./hidden-store.js":618,dup:97}],618:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{dup:98}],619:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{"./create-store.js":617,dup:99}],620:[function(t,e,r){arguments[4][420][0].apply(r,arguments)},{_process:53,dup:420,"vectorize-text":624}],621:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],622:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],623:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":621,buffer:48,dup:102}],624:[function(t,e,r){arguments[4][323][0].apply(r,arguments)},{"./lib/vtext":625,dup:323}],625:[function(t,e,r){arguments[4][324][0].apply(r,arguments)},{cdt2d:626,"clean-pslg":638,dup:324,ndarray:987,"planar-graph-to-polyline":693,"simplify-planar-graph":697,"surface-nets":710}],626:[function(t,e,r){arguments[4][325][0].apply(r,arguments)},{"./lib/delaunay":627,"./lib/filter":628,"./lib/monotone":629,"./lib/triangulation":630,dup:325}],627:[function(t,e,r){arguments[4][326][0].apply(r,arguments)},{"binary-search-bounds":631,dup:326,"robust-in-sphere":632}],628:[function(t,e,r){arguments[4][327][0].apply(r,arguments)},{"binary-search-bounds":631,dup:327}],629:[function(t,e,r){arguments[4][328][0].apply(r,arguments)},{"binary-search-bounds":631,dup:328,"robust-orientation":996}],630:[function(t,e,r){arguments[4][329][0].apply(r,arguments)},{"binary-search-bounds":631,dup:329}],631:[function(t,e,r){arguments[4][283][0].apply(r,arguments)},{dup:283}],632:[function(t,e,r){arguments[4][330][0].apply(r,arguments)},{dup:330,"robust-scale":634,"robust-subtract":635,"robust-sum":636,"two-product":637}],633:[function(t,e,r){arguments[4][36][0].apply(r,arguments)},{dup:36}],634:[function(t,e,r){arguments[4][37][0].apply(r,arguments)},{dup:37,"two-product":637,"two-sum":633}],635:[function(t,e,r){arguments[4][333][0].apply(r,arguments)},{dup:333}],636:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],637:[function(t,e,r){arguments[4][39][0].apply(r,arguments)},{dup:39}],638:[function(t,e,r){arguments[4][336][0].apply(r,arguments)},{"./lib/rat-seg-intersect":639,"big-rat":643,"big-rat/cmp":641,"big-rat/to-float":658,"box-intersect":659,"compare-cell":667,dup:336,nextafter:668,"rat-vec":671,"robust-segment-intersect":674,"union-find":675}],639:[function(t,e,r){arguments[4][337][0].apply(r,arguments)},{"big-rat/div":642,"big-rat/mul":652,"big-rat/sign":656,"big-rat/sub":657,"big-rat/to-float":658,dup:337,"rat-vec/add":670,"rat-vec/muls":672,"rat-vec/sub":673}],640:[function(t,e,r){arguments[4][338][0].apply(r,arguments)},{"./lib/rationalize":650,dup:338}],641:[function(t,e,r){arguments[4][339][0].apply(r,arguments)},{dup:339}],642:[function(t,e,r){arguments[4][340][0].apply(r,arguments)},{"./lib/rationalize":650,dup:340}],643:[function(t,e,r){arguments[4][341][0].apply(r,arguments)},{"./div":642,"./is-rat":644,"./lib/is-bn":648,"./lib/num-to-bn":649,"./lib/rationalize":650,"./lib/str-to-bn":651,dup:341}],644:[function(t,e,r){arguments[4][342][0].apply(r,arguments)},{"./lib/is-bn":648,dup:342}],645:[function(t,e,r){arguments[4][343][0].apply(r,arguments)},{"bn.js":654,dup:343}],646:[function(t,e,r){arguments[4][344][0].apply(r,arguments)},{dup:344}],647:[function(t,e,r){arguments[4][345][0].apply(r,arguments)},{"bit-twiddle":653,"double-bits":655,dup:345}],648:[function(t,e,r){arguments[4][346][0].apply(r,arguments)},{"bn.js":654,dup:346}],649:[function(t,e,r){arguments[4][347][0].apply(r,arguments)},{"bn.js":654,"double-bits":655,dup:347}],650:[function(t,e,r){arguments[4][348][0].apply(r,arguments)},{"./bn-sign":645,"./num-to-bn":649,dup:348}],651:[function(t,e,r){arguments[4][349][0].apply(r,arguments)},{"bn.js":654,dup:349}],652:[function(t,e,r){arguments[4][350][0].apply(r,arguments)},{"./lib/rationalize":650,dup:350}],653:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],654:[function(t,e,r){arguments[4][352][0].apply(r,arguments)},{dup:352}],655:[function(t,e,r){arguments[4][353][0].apply(r,arguments)},{buffer:48,dup:353}],656:[function(t,e,r){arguments[4][354][0].apply(r,arguments)},{"./lib/bn-sign":645,dup:354}],657:[function(t,e,r){arguments[4][355][0].apply(r,arguments)},{"./lib/rationalize":650,dup:355}],658:[function(t,e,r){arguments[4][356][0].apply(r,arguments)},{"./lib/bn-to-num":646,"./lib/ctz":647,dup:356}],659:[function(t,e,r){arguments[4][357][0].apply(r,arguments)},{"./lib/intersect":661,"./lib/sweep":665,dup:357,"typedarray-pool":623}],660:[function(t,e,r){arguments[4][358][0].apply(r,arguments)},{dup:358}],661:[function(t,e,r){arguments[4][359][0].apply(r,arguments)},{"./brute":660,"./median":662,"./partition":663,"./sweep":665,"bit-twiddle":666,dup:359,"typedarray-pool":623}],662:[function(t,e,r){arguments[4][360][0].apply(r,arguments)},{"./partition":663,dup:360}],663:[function(t,e,r){arguments[4][361][0].apply(r,arguments)},{dup:361}],664:[function(t,e,r){arguments[4][362][0].apply(r,arguments)},{dup:362}],665:[function(t,e,r){arguments[4][363][0].apply(r,arguments)},{"./sort":664,"bit-twiddle":666,dup:363,"typedarray-pool":623}],666:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],667:[function(t,e,r){arguments[4][44][0].apply(r,arguments)},{dup:44}],668:[function(t,e,r){arguments[4][368][0].apply(r,arguments)},{"double-bits":669,dup:368}],669:[function(t,e,r){arguments[4][353][0].apply(r,arguments)},{buffer:48,dup:353}],670:[function(t,e,r){arguments[4][370][0].apply(r,arguments)},{"big-rat/add":640,dup:370}],671:[function(t,e,r){arguments[4][371][0].apply(r,arguments)},{"big-rat":643,dup:371}],672:[function(t,e,r){arguments[4][372][0].apply(r,arguments)},{"big-rat":643,"big-rat/mul":652,dup:372}],673:[function(t,e,r){arguments[4][373][0].apply(r,arguments)},{"big-rat/sub":657,dup:373}],674:[function(t,e,r){arguments[4][374][0].apply(r,arguments)},{dup:374,"robust-orientation":996}],675:[function(t,e,r){arguments[4][61][0].apply(r,arguments)},{dup:61}],676:[function(t,e,r){arguments[4][376][0].apply(r,arguments)},{dup:376,"edges-to-adjacency-list":677}],677:[function(t,e,r){arguments[4][377][0].apply(r,arguments)},{dup:377,uniq:692}],678:[function(t,e,r){arguments[4][378][0].apply(r,arguments)},{"compare-angle":679,dup:378}],679:[function(t,e,r){arguments[4][379][0].apply(r,arguments)},{dup:379,"robust-orientation":996,"robust-product":681,"robust-sum":690,signum:682,"two-sum":683}],680:[function(t,e,r){arguments[4][37][0].apply(r,arguments)},{dup:37,"two-product":691,"two-sum":683}],681:[function(t,e,r){arguments[4][381][0].apply(r,arguments)},{dup:381,"robust-scale":680,"robust-sum":690}],682:[function(t,e,r){arguments[4][382][0].apply(r,arguments)},{dup:382}],683:[function(t,e,r){arguments[4][36][0].apply(r,arguments)},{dup:36}],684:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],685:[function(t,e,r){arguments[4][385][0].apply(r,arguments)},{"binary-search-bounds":684,dup:385}],686:[function(t,e,r){arguments[4][386][0].apply(r,arguments)},{dup:386,"robust-orientation":996}],687:[function(t,e,r){arguments[4][387][0].apply(r,arguments)},{dup:387}],688:[function(t,e,r){arguments[4][388][0].apply(r,arguments)},{"./lib/order-segments":686,"binary-search-bounds":684,dup:388,"functional-red-black-tree":687,"robust-orientation":996}],689:[function(t,e,r){arguments[4][389][0].apply(r,arguments)},{"binary-search-bounds":684,dup:389,"interval-tree-1d":685,"robust-orientation":996,"slab-decomposition":688}],690:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],691:[function(t,e,r){arguments[4][39][0].apply(r,arguments)},{dup:39}],692:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],693:[function(t,e,r){arguments[4][393][0].apply(r,arguments)},{"./lib/trim-leaves":676,dup:393,"edges-to-adjacency-list":677,"planar-dual":678,"point-in-big-polygon":689,"robust-sum":690,"two-product":691,uniq:692}],694:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],695:[function(t,e,r){arguments[4][395][0].apply(r,arguments)},{dup:395}],696:[function(t,e,r){arguments[4][62][0].apply(r,arguments)},{"bit-twiddle":694,dup:62,"union-find":695}],697:[function(t,e,r){arguments[4][397][0].apply(r,arguments)},{dup:397,"robust-orientation":996,"simplicial-complex":696}],698:[function(t,e,r){arguments[4][398][0].apply(r,arguments)},{dup:398,"typedarray-pool":623}],699:[function(t,e,r){arguments[4][402][0].apply(r,arguments)},{dup:402}],700:[function(t,e,r){arguments[4][406][0].apply(r,arguments)},{dup:406,"typedarray-pool":623}],701:[function(t,e,r){arguments[4][407][0].apply(r,arguments)},{dup:407,"invert-permutation":702,"typedarray-pool":623}],702:[function(t,e,r){arguments[4][408][0].apply(r,arguments)},{dup:408}],703:[function(t,e,r){arguments[4][412][0].apply(r,arguments)},{dup:412,gamma:699,"permutation-parity":700,"permutation-rank":701}],704:[function(t,e,r){arguments[4][413][0].apply(r,arguments)},{"cwise-compiler":705,dup:413}],705:[function(t,e,r){arguments[4][290][0].apply(r,arguments)},{"./lib/thunk.js":707,dup:290}],706:[function(t,e,r){arguments[4][291][0].apply(r,arguments)},{dup:291,uniq:708}],707:[function(t,e,r){arguments[4][292][0].apply(r,arguments)},{"./compile.js":706,dup:292}],708:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],709:[function(t,e,r){arguments[4][418][0].apply(r,arguments)},{"./lib/zc-core":704,dup:418}],710:[function(t,e,r){arguments[4][419][0].apply(r,arguments)},{dup:419,"ndarray-extract-contour":698,"triangulate-hypercube":703,"zero-crossings":709}],711:[function(t,e,r){"use strict";function n(t){if(t in h)return h[t];var e=c(t,{polygons:!0,font:"sans-serif",textAlign:"left",textBaseline:"alphabetic"}),r=[],n=[];e.forEach(function(t){t.forEach(function(t){for(var e=0;eo;++o)i[o]=Math.min(i[o],r[a+o]),i[2+o]=Math.max(i[2+o],r[a+o]);return h[t]={coords:r,normals:n,bounds:i}}function i(t,e,r,n,i,a,o){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.offsetBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.numPoints=0,this.numVertices=0,this.pickOffset=0,this.points=null}function a(t,e){var r=t.gl,n=o(r,f.vertex,f.fragment),a=o(r,f.pickVertex,f.pickFragment),l=s(r),u=s(r),c=s(r),h=s(r),p=new i(t,n,a,l,u,c,h);return p.update(e),t.addObject(p),p}e.exports=a;var o=t("gl-shader"),s=t("gl-buffer"),l=t("text-cache"),u=t("typedarray-pool"),c=t("vectorize-text"),f=t("./lib/shaders"),h={},p=i.prototype;!function(){function t(){var t=this.plot,n=this.bounds,i=t.viewBox,a=t.dataBox,o=t.pixelRatio,s=n[2]-n[0],l=n[3]-n[1],u=a[2]-a[0],c=a[3]-a[1];e[0]=2*s/u,e[4]=2*l/c,e[6]=2*(n[0]-a[0])/u-1,e[7]=2*(n[1]-a[1])/c-1;var f=i[2]-i[0],h=i[3]-i[1];r[0]=2*o/f,r[1]=2*o/h}var e=[1,0,0,0,1,0,0,0,1],r=[1,1];p.draw=function(){var n=this.plot,i=this.shader,a=this.numVertices,o=n.gl;t.call(this),i.bind(),i.uniforms.pixelScale=r,i.uniforms.viewTransform=e,this.positionBuffer.bind(),i.attributes.position.pointer(),this.offsetBuffer.bind(),i.attributes.offset.pointer(),this.colorBuffer.bind(),i.attributes.color.pointer(o.UNSIGNED_BYTE,!0),o.drawArrays(o.TRIANGLES,0,a)};var n=[0,0,0,0];p.drawPick=function(i){var a=this.plot,o=this.pickShader,s=this.numVertices,l=a.gl;this.pickOffset=i;for(var u=0;4>u;++u)n[u]=i>>8*u&255;return t.call(this),o.bind(),o.uniforms.pixelScale=r,o.uniforms.viewTransform=e,o.uniforms.pickOffset=n,this.positionBuffer.bind(),o.attributes.position.pointer(),this.offsetBuffer.bind(),o.attributes.offset.pointer(),this.idBuffer.bind(),o.attributes.id.pointer(l.UNSIGNED_BYTE,!1),l.drawArrays(l.TRIANGLES,0,s),i+this.numPoints}}(),p.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(n>r||r>=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},p.update=function(t){t=t||{};var e=t.positions||[],r=t.colors||[],i=t.glyphs||[],a=t.sizes||[],o=t.borderWidths||[],s=t.borderColors||[];this.points=e;for(var c=this.bounds=[1/0,1/0,-(1/0),-(1/0)],f=0,h=0;h>1;for(var p=0;2>p;++p)c[p]=Math.min(c[p],e[2*h+p]),c[2+p]=Math.max(c[2+p],e[2*h+p])}c[0]===c[2]&&(c[2]+=1),c[3]===c[1]&&(c[3]+=1);for(var d=1/(c[2]-c[0]),g=1/(c[3]-c[1]),m=c[0],v=c[1],y=u.mallocFloat32(2*f),b=u.mallocFloat32(2*f),x=u.mallocUint8(4*f),_=u.mallocUint32(f),w=0,h=0;h=a?i(0,a-1,t,e,r,n):f(0,a-1,t,e,r,n)}function i(t,e,r,n,i,a){for(var o=t+1;e>=o;++o){for(var s=r[o],l=n[2*o],u=n[2*o+1],c=i[o],f=a[o],h=o;h>t;){var p=r[h-1],d=n[2*(h-1)];if((p-s||l-d)>=0)break;r[h]=p,n[2*h]=d,n[2*h+1]=n[2*h-1],i[h]=i[h-1],a[h]=a[h-1],h-=1}r[h]=s,n[2*h]=l,n[2*h+1]=u,i[h]=c,a[h]=f}}function a(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],u=i[t],c=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=u,a[e]=c}function o(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function s(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],u=i[2*t+1],c=a[t],f=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=u,a[r]=c,o[r]=f}function l(t,e,r,n,i,a,o,s,l,u,c){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],u[t]=u[e],c[t]=c[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,u[e]=a,c[e]=o}function u(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function f(t,e,r,n,p,d){var g=(e-t+1)/6|0,m=t+g,v=e-g,y=t+e>>1,b=y-g,x=y+g,_=m,w=b,A=y,k=x,M=v,E=t+1,T=e-1,L=0;u(_,w,r,n,p,d)&&(L=_,_=w,w=L),u(k,M,r,n,p,d)&&(L=k,k=M,M=L),u(_,A,r,n,p,d)&&(L=_,_=A,A=L),u(w,A,r,n,p,d)&&(L=w,w=A,A=L),u(_,k,r,n,p,d)&&(L=_,_=k,k=L),u(A,k,r,n,p,d)&&(L=A,A=k,k=L),u(w,M,r,n,p,d)&&(L=w,w=M,M=L),u(w,A,r,n,p,d)&&(L=w,w=A,A=L),u(k,M,r,n,p,d)&&(L=k,k=M,M=L);var S=r[w],C=n[2*w],P=n[2*w+1],z=p[w],R=d[w],j=r[k],I=n[2*k],O=n[2*k+1],N=p[k],F=d[k],D=_,B=A,U=M,V=m,q=y,G=v,H=r[D],Y=r[B],X=r[U];r[V]=H,r[q]=Y,r[G]=X;for(var W=0;2>W;++W){var Z=n[2*D+W],Q=n[2*B+W],K=n[2*U+W];n[2*V+W]=Z,n[2*q+W]=Q,n[2*G+W]=K}var $=p[D],J=p[B],tt=p[U];p[V]=$,p[q]=J,p[G]=tt;var et=d[D],rt=d[B],nt=d[U];d[V]=et,d[q]=rt,d[G]=nt,o(b,t,r,n,p,d),o(x,e,r,n,p,d);for(var it=E;T>=it;++it)if(c(it,S,C,P,z,r,n,p))it!==E&&a(it,E,r,n,p,d),++E;else if(!c(it,j,I,O,N,r,n,p))for(;;){if(c(T,j,I,O,N,r,n,p)){c(T,S,C,P,z,r,n,p)?(s(it,E,T,r,n,p,d),++E,--T):(a(it,T,r,n,p,d),--T);break}if(--T=E-2-t?i(t,E-2,r,n,p,d):f(t,E-2,r,n,p,d),h>=e-(T+2)?i(T+2,e,r,n,p,d):f(T+2,e,r,n,p,d),h>=T-E?i(E,T,r,n,p,d):f(E,T,r,n,p,d)}e.exports=n;var h=32},{}],740:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s){for(var l=r,u=r;n>u;++u){var c=t[2*u],f=t[2*u+1],h=e[u];c>=i&&o>=c&&f>=a&&s>=f&&(u===l?l+=1:(t[2*u]=t[2*l],t[2*u+1]=t[2*l+1],e[u]=e[l],t[2*l]=c,t[2*l+1]=f,e[l]=h,l+=1))}return l}function i(t,e,r){this.pixelSize=t,this.offset=e,this.count=r}function a(t,e,r,a){function l(i,a,o,s,u,c){var f=.5*o,h=s+1,p=u-s;r[_]=p,x[_++]=c;for(var d=0;2>d;++d)for(var g=0;2>g;++g){var m=i+d*f,v=a+g*f,y=n(t,e,h,u,m,v,m+f,v+f);if(y!==h){if(y-h>=Math.max(.9*p,32)){var b=u+s>>>1;l(m,v,f,h,b,c+1),h=b}l(m,v,f,h,y,c+1),h=y}}}var u=t.length>>>1;if(1>u)return[];for(var c=1/0,f=1/0,h=-(1/0),p=-(1/0),d=0;u>d;++d){var g=t[2*d],m=t[2*d+1];c=Math.min(c,g),h=Math.max(h,g),f=Math.min(f,m),p=Math.max(p,m),e[d]=d}c===h&&(h+=1+Math.abs(h)),f===p&&(p+=1+Math.abs(h));var v=1/(h-c),y=1/(p-f),b=Math.max(h-c,p-f);a=a||[0,0,0,0],a[0]=c,a[1]=f,a[2]=h,a[3]=p;var x=o.mallocInt32(u),_=0;l(c,f,b,0,u,0),s(x,t,e,r,u);for(var w=[],A=0,k=u,_=u-1;_>=0;--_){t[2*_]=(t[2*_]-c)*v,t[2*_+1]=(t[2*_+1]-f)*y;var M=x[_];M!==A&&(w.push(new i(b*Math.pow(.5,M),_+1,k-(_+1))),k=_+1,A=M)}return w.push(new i(b*Math.pow(.5,M+1),0,k)),o.free(x),w}var o=t("typedarray-pool"),s=t("./lib/sort");e.exports=a},{"./lib/sort":739,"typedarray-pool":743}],741:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],742:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],743:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":741,buffer:48,dup:102}],744:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.weightBuffer=n,this.shader=i,this.pickShader=a,this.scales=[],this.size=12,this.borderSize=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.pickOffset=0,this.points=null,this.xCoords=null}function i(t,e){var r=t.gl,i=o(r),s=o(r),l=o(r),u=a(r,c.pointVertex,c.pointFragment),f=a(r,c.pickVertex,c.pickFragment),h=new n(t,i,s,l,u,f);return h.update(e),t.addObject(h),h}var a=t("gl-shader"),o=t("gl-buffer"),s=t("binary-search-bounds"),l=t("snap-points-2d"),u=t("typedarray-pool"),c=t("./lib/shader");e.exports=i;var f=n.prototype;f.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.xCoords&&u.free(this.xCoords),this.plot.removeObject(this)},f.update=function(t){function e(e,r){return e in t?t[e]:r}t=t||{},this.size=e("size",12),this.color=e("color",[1,0,0,1]).slice(),this.borderSize=e("borderSize",1),this.borderColor=e("borderColor",[0,0,0,1]).slice(),this.xCoords&&u.free(this.xCoords);var r=t.positions,n=u.mallocFloat32(r.length),i=u.mallocInt32(r.length>>>1);n.set(r);var a=u.mallocFloat32(r.length);this.points=r,this.scales=l(n,i,a,this.bounds),this.offsetBuffer.update(n),this.pickBuffer.update(i),this.weightBuffer.update(a);for(var o=u.mallocFloat32(r.length>>>1),s=0,c=0;s>>1,this.pickOffset=0},f.drawPick=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=this.plot,i=this.pickShader,a=this.scales,o=this.offsetBuffer,l=this.pickBuffer,u=this.bounds,c=this.size,f=this.borderSize,h=n.gl,p=n.pickPixelRatio,d=n.viewBox,g=n.dataBox;if(0===this.pointCount)return r;var m=u[2]-u[0],v=u[3]-u[1],y=g[2]-g[0],b=g[3]-g[1],x=(d[2]-d[0])*p/n.pixelRatio,_=(d[3]-d[1])*p/n.pixelRatio,w=Math.min(y/x,b/_);t[0]=2*m/y,t[4]=2*v/b,t[6]=2*(u[0]-g[0])/y-1,t[7]=2*(u[1]-g[1])/b-1,this.pickOffset=r,e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,i.bind(),i.uniforms.matrix=t,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointSize=p*(c+f),i.uniforms.pickOffset=e,0===this.borderSize?i.uniforms.centerFraction=2:i.uniforms.centerFraction=c/(c+f+1.25),o.bind(),i.attributes.position.pointer(),l.bind(),i.attributes.pickId.pointer(h.UNSIGNED_BYTE);for(var A=this.xCoords,k=(g[0]-u[0]-w*c*p)/m,M=(g[2]-u[0]+w*c*p)/m,E=a.length-1;E>=0;--E){var T=a[E];if(!(T.pixelSize1)){var L=T.offset,S=T.count+L,C=s.ge(A,k,L,S-1),P=s.lt(A,M,C,S-1)+1;h.drawArrays(h.POINTS,C,P-C)}}return r+this.pointCount}}(),f.draw=function(){var t=[1,0,0,0,1,0,0,0,1];return function(){var e=this.plot,r=this.shader,n=this.scales,i=this.offsetBuffer,a=this.bounds,o=this.size,l=this.borderSize,u=e.gl,c=e.pixelRatio,f=e.viewBox,h=e.dataBox;if(0!==this.pointCount){var p=a[2]-a[0],d=a[3]-a[1],g=h[2]-h[0],m=h[3]-h[1],v=f[2]-f[0],y=f[3]-f[1],b=Math.min(g/v,m/y);t[0]=2*p/g,t[4]=2*d/m,t[6]=2*(a[0]-h[0])/g-1,t[7]=2*(a[1]-h[1])/m-1,r.bind(),r.uniforms.matrix=t,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointSize=c*(o+l),r.uniforms.useWeight=1,0===this.borderSize?r.uniforms.centerFraction=2:r.uniforms.centerFraction=o/(o+l+1.25),i.bind(),r.attributes.position.pointer(),this.weightBuffer.bind(),r.attributes.weight.pointer();for(var x=this.xCoords,_=(h[0]-a[0]-b*o*c)/p,w=(h[2]-a[0]+b*o*c)/p,A=!0,k=n.length-1;k>=0;--k){var M=n[k];if(!(M.pixelSize1)){var E=M.offset,T=M.count+E,L=s.ge(x,_,E,T-1),S=s.lt(x,w,L,T-1)+1;u.drawArrays(u.POINTS,L,S-L),A&&(A=!1,r.uniforms.useWeight=0)}}}}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(n>r||r>=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{"./lib/shader":712,"binary-search-bounds":713,"gl-buffer":714,"gl-shader":715,"snap-points-2d":740,"typedarray-pool":743}],745:[function(t,e,r){"use strict";function n(t,e){var r=a[e];if(r||(r=a[e]={}),t in r)return r[t];for(var n=i(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=i(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-(1/0),-(1/0)]],l=0;lc;++c)s[0][c]=Math.min(s[0][c],u[c]),s[1][c]=Math.max(s[1][c],u[c]);return r[t]=[o,n,s]}var i=t("vectorize-text");e.exports=n;var a={}},{"vectorize-text":779}],746:[function(t,e,r){function n(t,e){var r=i(t,e),n=r.attributes;return n.position.location=0,n.color.location=1,n.glyph.location=2,n.id.location=3,r}var i=t("gl-shader"),a="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1])) ) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n \n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}",o="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n \n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}",s="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) ||\n any(greaterThan(position, clipBounds[1])) ) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * view * model * vec4(position, 1);\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n",l="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) ||\n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n discard;\n } else {\n gl_FragColor = interpColor * opacity;\n }\n}\n",u="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) || \n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n discard;\n } else {\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n }\n}",c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:c},h={vertex:o,fragment:l,attributes:c},p={vertex:s,fragment:l,attributes:c},d={vertex:a,fragment:u,attributes:c},g={vertex:o,fragment:u,attributes:c},m={vertex:s,fragment:u,attributes:c};r.createPerspective=function(t){return n(t,f)},r.createOrtho=function(t){return n(t,h)},r.createProject=function(t){return n(t,p)},r.createPickPerspective=function(t){return n(t,d)},r.createPickOrtho=function(t){return n(t,g)},r.createPickProject=function(t){return n(t,m)}},{"gl-shader":748}],747:[function(t,e,r){arguments[4][75][0].apply(r,arguments)},{dup:75,ndarray:987,"ndarray-ops":982,"typedarray-pool":778}],748:[function(t,e,r){arguments[4][76][0].apply(r,arguments)},{"./lib/GLError":749,"./lib/create-attributes":750,"./lib/create-uniforms":751,"./lib/reflect":752,"./lib/runtime-reflect":753,"./lib/shader-cache":754,dup:76}],749:[function(t,e,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],750:[function(t,e,r){arguments[4][78][0].apply(r,arguments)},{"./GLError":749,dup:78}],751:[function(t,e,r){arguments[4][79][0].apply(r,arguments)},{"./GLError":749,"./reflect":752,dup:79}],752:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],753:[function(t,e,r){arguments[4][81][0].apply(r,arguments)},{dup:81}],754:[function(t,e,r){arguments[4][82][0].apply(r,arguments)},{"./GLError":749,dup:82,"gl-format-compiler-error":755,"weakmap-shim":771}],755:[function(t,e,r){arguments[4][83][0].apply(r,arguments)},{"add-line-numbers":756,dup:83,"gl-constants/lookup":760,"glsl-shader-name":761,"sprintf-js":768}],756:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84,"pad-left":757}],757:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{dup:85,"repeat-string":758}],758:[function(t,e,r){arguments[4][86][0].apply(r,arguments)},{dup:86}],759:[function(t,e,r){arguments[4][87][0].apply(r,arguments)},{dup:87}],760:[function(t,e,r){arguments[4][88][0].apply(r,arguments)},{"./1.0/numbers":759,dup:88}],761:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{"atob-lite":762,dup:89,"glsl-tokenizer":767}],762:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{dup:90}],763:[function(t,e,r){arguments[4][91][0].apply(r,arguments)},{"./lib/builtins":764,"./lib/literals":765,"./lib/operators":766,dup:91}],764:[function(t,e,r){arguments[4][92][0].apply(r,arguments)},{dup:92}],765:[function(t,e,r){arguments[4][93][0].apply(r,arguments)},{dup:93}],766:[function(t,e,r){arguments[4][94][0].apply(r,arguments)},{dup:94}],767:[function(t,e,r){arguments[4][95][0].apply(r,arguments)},{"./index":763,dup:95}],768:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{dup:96}],769:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{"./hidden-store.js":770,dup:97}],770:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{dup:98}],771:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{"./create-store.js":769,dup:99}],772:[function(t,e,r){arguments[4][132][0].apply(r,arguments)},{dup:132}],773:[function(t,e,r){arguments[4][133][0].apply(r,arguments)},{"./do-bind.js":772,dup:133}],774:[function(t,e,r){arguments[4][134][0].apply(r,arguments)},{"./do-bind.js":772,dup:134}],775:[function(t,e,r){arguments[4][135][0].apply(r,arguments)},{"./lib/vao-emulated.js":773,"./lib/vao-native.js":774,dup:135}],776:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],777:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],778:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":776,buffer:48,dup:102}],779:[function(t,e,r){arguments[4][323][0].apply(r,arguments)},{"./lib/vtext":780,dup:323}],780:[function(t,e,r){arguments[4][324][0].apply(r,arguments)},{cdt2d:781,"clean-pslg":793,dup:324,ndarray:987,"planar-graph-to-polyline":848,"simplify-planar-graph":852,"surface-nets":865}],781:[function(t,e,r){arguments[4][325][0].apply(r,arguments)},{"./lib/delaunay":782,"./lib/filter":783,"./lib/monotone":784,"./lib/triangulation":785,dup:325}],782:[function(t,e,r){arguments[4][326][0].apply(r,arguments)},{"binary-search-bounds":786,dup:326,"robust-in-sphere":787}],783:[function(t,e,r){arguments[4][327][0].apply(r,arguments)},{"binary-search-bounds":786,dup:327}],784:[function(t,e,r){arguments[4][328][0].apply(r,arguments)},{"binary-search-bounds":786,dup:328,"robust-orientation":996}],785:[function(t,e,r){arguments[4][329][0].apply(r,arguments)},{"binary-search-bounds":786,dup:329}],786:[function(t,e,r){arguments[4][283][0].apply(r,arguments)},{dup:283}],787:[function(t,e,r){arguments[4][330][0].apply(r,arguments)},{dup:330,"robust-scale":789,"robust-subtract":790,"robust-sum":791,"two-product":792}],788:[function(t,e,r){arguments[4][36][0].apply(r,arguments)},{dup:36}],789:[function(t,e,r){arguments[4][37][0].apply(r,arguments)},{dup:37,"two-product":792,"two-sum":788}],790:[function(t,e,r){arguments[4][333][0].apply(r,arguments)},{dup:333}],791:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],792:[function(t,e,r){arguments[4][39][0].apply(r,arguments)},{dup:39}],793:[function(t,e,r){arguments[4][336][0].apply(r,arguments)},{"./lib/rat-seg-intersect":794,"big-rat":798,"big-rat/cmp":796,"big-rat/to-float":813,"box-intersect":814,"compare-cell":822,dup:336,nextafter:823,"rat-vec":826,"robust-segment-intersect":829,"union-find":830}],794:[function(t,e,r){arguments[4][337][0].apply(r,arguments)},{"big-rat/div":797,"big-rat/mul":807,"big-rat/sign":811,"big-rat/sub":812,"big-rat/to-float":813,dup:337,"rat-vec/add":825,"rat-vec/muls":827,"rat-vec/sub":828}],795:[function(t,e,r){arguments[4][338][0].apply(r,arguments)},{"./lib/rationalize":805,dup:338}],796:[function(t,e,r){arguments[4][339][0].apply(r,arguments)},{dup:339}],797:[function(t,e,r){arguments[4][340][0].apply(r,arguments)},{"./lib/rationalize":805,dup:340}],798:[function(t,e,r){arguments[4][341][0].apply(r,arguments)},{"./div":797,"./is-rat":799,"./lib/is-bn":803,"./lib/num-to-bn":804,"./lib/rationalize":805,"./lib/str-to-bn":806,dup:341}],799:[function(t,e,r){arguments[4][342][0].apply(r,arguments)},{"./lib/is-bn":803,dup:342}],800:[function(t,e,r){arguments[4][343][0].apply(r,arguments)},{"bn.js":809,dup:343}],801:[function(t,e,r){arguments[4][344][0].apply(r,arguments)},{dup:344}],802:[function(t,e,r){arguments[4][345][0].apply(r,arguments)},{"bit-twiddle":808,"double-bits":810,dup:345}],803:[function(t,e,r){arguments[4][346][0].apply(r,arguments)},{"bn.js":809,dup:346}],804:[function(t,e,r){arguments[4][347][0].apply(r,arguments)},{"bn.js":809,"double-bits":810,dup:347}],805:[function(t,e,r){arguments[4][348][0].apply(r,arguments)},{"./bn-sign":800,"./num-to-bn":804,dup:348}],806:[function(t,e,r){arguments[4][349][0].apply(r,arguments)},{"bn.js":809,dup:349}],807:[function(t,e,r){arguments[4][350][0].apply(r,arguments)},{"./lib/rationalize":805,dup:350}],808:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],809:[function(t,e,r){arguments[4][352][0].apply(r,arguments)},{dup:352}],810:[function(t,e,r){arguments[4][353][0].apply(r,arguments)},{buffer:48,dup:353}],811:[function(t,e,r){arguments[4][354][0].apply(r,arguments)},{"./lib/bn-sign":800,dup:354}],812:[function(t,e,r){arguments[4][355][0].apply(r,arguments)},{"./lib/rationalize":805,dup:355}],813:[function(t,e,r){arguments[4][356][0].apply(r,arguments)},{"./lib/bn-to-num":801,"./lib/ctz":802,dup:356}],814:[function(t,e,r){arguments[4][357][0].apply(r,arguments)},{"./lib/intersect":816,"./lib/sweep":820,dup:357,"typedarray-pool":778}],815:[function(t,e,r){arguments[4][358][0].apply(r,arguments)},{dup:358}],816:[function(t,e,r){arguments[4][359][0].apply(r,arguments)},{"./brute":815,"./median":817,"./partition":818,"./sweep":820,"bit-twiddle":821,dup:359,"typedarray-pool":778}],817:[function(t,e,r){arguments[4][360][0].apply(r,arguments)},{"./partition":818,dup:360}],818:[function(t,e,r){arguments[4][361][0].apply(r,arguments)},{dup:361}],819:[function(t,e,r){arguments[4][362][0].apply(r,arguments)},{dup:362}],820:[function(t,e,r){arguments[4][363][0].apply(r,arguments)},{"./sort":819,"bit-twiddle":821,dup:363,"typedarray-pool":778}],821:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],822:[function(t,e,r){arguments[4][44][0].apply(r,arguments)},{dup:44}],823:[function(t,e,r){arguments[4][368][0].apply(r,arguments)},{"double-bits":824,dup:368}],824:[function(t,e,r){arguments[4][353][0].apply(r,arguments)},{buffer:48,dup:353}],825:[function(t,e,r){arguments[4][370][0].apply(r,arguments)},{"big-rat/add":795,dup:370}],826:[function(t,e,r){arguments[4][371][0].apply(r,arguments)},{"big-rat":798,dup:371}],827:[function(t,e,r){arguments[4][372][0].apply(r,arguments)},{"big-rat":798,"big-rat/mul":807,dup:372}],828:[function(t,e,r){arguments[4][373][0].apply(r,arguments)},{"big-rat/sub":812,dup:373}],829:[function(t,e,r){arguments[4][374][0].apply(r,arguments)},{dup:374,"robust-orientation":996}],830:[function(t,e,r){arguments[4][61][0].apply(r,arguments)},{dup:61}],831:[function(t,e,r){arguments[4][376][0].apply(r,arguments)},{dup:376,"edges-to-adjacency-list":832}],832:[function(t,e,r){arguments[4][377][0].apply(r,arguments)},{dup:377,uniq:847}],833:[function(t,e,r){arguments[4][378][0].apply(r,arguments)},{"compare-angle":834,dup:378}],834:[function(t,e,r){arguments[4][379][0].apply(r,arguments)},{dup:379,"robust-orientation":996,"robust-product":836,"robust-sum":845,signum:837,"two-sum":838}],835:[function(t,e,r){arguments[4][37][0].apply(r,arguments)},{dup:37,"two-product":846,"two-sum":838}],836:[function(t,e,r){arguments[4][381][0].apply(r,arguments)},{dup:381,"robust-scale":835,"robust-sum":845}],837:[function(t,e,r){arguments[4][382][0].apply(r,arguments)},{dup:382}],838:[function(t,e,r){arguments[4][36][0].apply(r,arguments)},{dup:36}],839:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],840:[function(t,e,r){arguments[4][385][0].apply(r,arguments)},{"binary-search-bounds":839,dup:385}],841:[function(t,e,r){arguments[4][386][0].apply(r,arguments)},{dup:386,"robust-orientation":996}],842:[function(t,e,r){arguments[4][387][0].apply(r,arguments)},{dup:387}],843:[function(t,e,r){arguments[4][388][0].apply(r,arguments)},{"./lib/order-segments":841,"binary-search-bounds":839,dup:388,"functional-red-black-tree":842,"robust-orientation":996}],844:[function(t,e,r){arguments[4][389][0].apply(r,arguments)},{"binary-search-bounds":839,dup:389,"interval-tree-1d":840,"robust-orientation":996,"slab-decomposition":843}],845:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],846:[function(t,e,r){arguments[4][39][0].apply(r,arguments)},{dup:39}],847:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],848:[function(t,e,r){arguments[4][393][0].apply(r,arguments)},{"./lib/trim-leaves":831,dup:393,"edges-to-adjacency-list":832,"planar-dual":833,"point-in-big-polygon":844,"robust-sum":845,"two-product":846,uniq:847}],849:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],850:[function(t,e,r){arguments[4][395][0].apply(r,arguments)},{dup:395}],851:[function(t,e,r){arguments[4][62][0].apply(r,arguments)},{"bit-twiddle":849,dup:62,"union-find":850}],852:[function(t,e,r){arguments[4][397][0].apply(r,arguments)},{dup:397,"robust-orientation":996,"simplicial-complex":851}],853:[function(t,e,r){arguments[4][398][0].apply(r,arguments)},{dup:398,"typedarray-pool":778}],854:[function(t,e,r){arguments[4][402][0].apply(r,arguments)},{dup:402}],855:[function(t,e,r){arguments[4][406][0].apply(r,arguments)},{dup:406,"typedarray-pool":778}],856:[function(t,e,r){arguments[4][407][0].apply(r,arguments)},{dup:407,"invert-permutation":857,"typedarray-pool":778}],857:[function(t,e,r){arguments[4][408][0].apply(r,arguments)},{dup:408}],858:[function(t,e,r){arguments[4][412][0].apply(r,arguments)},{dup:412,gamma:854,"permutation-parity":855,"permutation-rank":856}],859:[function(t,e,r){arguments[4][413][0].apply(r,arguments)},{"cwise-compiler":860,dup:413}],860:[function(t,e,r){arguments[4][290][0].apply(r,arguments)},{"./lib/thunk.js":862,dup:290}],861:[function(t,e,r){arguments[4][291][0].apply(r,arguments)},{dup:291,uniq:863}],862:[function(t,e,r){arguments[4][292][0].apply(r,arguments)},{"./compile.js":861,dup:292}],863:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],864:[function(t,e,r){arguments[4][418][0].apply(r,arguments)},{"./lib/zc-core":859,dup:418}],865:[function(t,e,r){arguments[4][419][0].apply(r,arguments)},{dup:419,"ndarray-extract-contour":853,"triangulate-hypercube":858,"zero-crossings":864}],866:[function(t,e,r){"use strict";function n(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function i(t,e,r,i){return n(i,i,r),n(i,i,e),n(i,i,t)}function a(t,e){this.index=t,this.dataCoordinate=this.position=e}function o(t,e,r,n,i,o,s,l,u,c,f,h){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=o,this.glyphBuffer=s,this.idBuffer=l,this.vao=u,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=f,this.pickProjectShader=h,this.points=[],this._selectResult=new a(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.dirty=!0}function s(t){return t[0]=t[1]=t[2]=0,t}function l(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function u(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function c(t){for(var e=S,r=0;2>r;++r)for(var n=0;3>n;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}function f(t,e,r,n,a){var o,f=e.axesProject,h=e.gl,p=t.uniforms,d=r.model||x,g=r.view||x,m=r.projection||x,y=e.axesBounds,b=c(e.clipBounds);o=e.axes?e.axes.lastCubeProps.axis:[1,1,1],w[0]=2/h.drawingBufferWidth,w[1]=2/h.drawingBufferHeight,t.bind(),p.view=g,p.projection=m,p.screenSize=w,p.highlightId=e.highlightId,p.highlightScale=e.highlightScale,p.clipBounds=b,p.pickGroup=e.pickId/255,p.pixelRatio=e.pixelRatio;for(var _=0;3>_;++_)if(f[_]&&e.projectOpacity[_]<1===n){p.scale=e.projectScale[_],p.opacity=e.projectOpacity[_];for(var S=T,C=0;16>C;++C)S[C]=0;for(var C=0;4>C;++C)S[5*C]=1;S[5*_]=0,o[_]<0?S[12+_]=y[0][_]:S[12+_]=y[1][_],v(S,d,S),p.model=S;var P=(_+1)%3,z=(_+2)%3,R=s(A),j=s(k);R[P]=1,j[z]=1;var I=i(m,g,d,l(M,R)),O=i(m,g,d,l(E,j));if(Math.abs(I[1])>Math.abs(O[1])){var N=I;I=O,O=N,N=R,R=j,j=N;var F=P;P=z,z=F}I[0]<0&&(R[P]=-1),O[1]>0&&(j[z]=-1);for(var D=0,B=0,C=0;4>C;++C)D+=Math.pow(d[4*P+C],2),B+=Math.pow(d[4*z+C],2);R[P]/=Math.sqrt(D),j[z]/=Math.sqrt(B),p.axes[0]=R,p.axes[1]=j,p.fragClipBounds[0]=u(L,b[0],_,-1e8),p.fragClipBounds[1]=u(L,b[1],_,1e8),e.vao.draw(h.TRIANGLES,e.vertexCount),e.lineWidth>0&&(h.lineWidth(e.lineWidth),e.vao.draw(h.LINES,e.lineVertexCount,e.vertexCount))}}function h(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||x,s.view=n.view||x,s.projection=n.projection||x,w[0]=2/o.drawingBufferWidth,w[1]=2/o.drawingBufferHeight,s.screenSize=w,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=z,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}f(e,r,n,i,a),r.vao.unbind()}function p(t){var e=t.gl,r=y.createPerspective(e),n=y.createOrtho(e),i=y.createProject(e),a=y.createPickPerspective(e),s=y.createPickOrtho(e),l=y.createPickProject(e),u=d(e),c=d(e),f=d(e),h=d(e),p=g(e,[{buffer:u,size:3,type:e.FLOAT},{buffer:c,size:4,type:e.FLOAT},{buffer:f,size:2,type:e.FLOAT},{buffer:h,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),m=new o(e,r,n,i,u,c,f,h,p,a,s,l);return m.update(t),m}var d=t("gl-buffer"),g=t("gl-vao"),m=t("typedarray-pool"),v=t("gl-mat4/multiply"),y=t("./lib/shaders"),b=t("./lib/glyphs"),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=p;var _=o.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;3>t;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},_.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;3>t;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],A=[0,0,0],k=[0,0,0],M=[0,0,0,1],E=[0,0,0,1],T=x.slice(),L=[0,0,0],S=[[0,0,0],[0,0,0]],C=[-1e8,-1e8,-1e8],P=[1e8,1e8,1e8],z=[C,P];_.draw=function(t){var e=this.useOrtho?this.orthoShader:this.shader;h(e,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){var e=this.useOrtho?this.orthoShader:this.shader;h(e,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){var e=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;h(e,this.pickProjectShader,this,t,!1,!0)},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||0>e)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;3>i;++i)n.position[i]=n.dataCoordinate[i]=r[i]; -return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if(t=t||{},"perspective"in t&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-(1/0),-(1/0),-(1/0)],l=t.glyph,u=t.color,c=t.size,f=t.angle,h=t.lineColor,p=0,d=0,g=0,v=n.length;t:for(var y=0;v>y;++y){for(var x=n[y],_=0;3>_;++_)if(isNaN(x[_])||!isFinite(x[_]))continue t;var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b("\u25cf",i);var A=w[0],k=w[1],M=w[2];d+=3*A.cells.length,g+=2*k.edges.length}var E=d+g,T=m.mallocFloat(3*E),L=m.mallocFloat(4*E),S=m.mallocFloat(2*E),C=m.mallocUint32(E),P=[0,a[1]],z=0,R=d,j=[0,0,0,1],I=[0,0,0,1],O=Array.isArray(u)&&Array.isArray(u[0]),N=Array.isArray(h)&&Array.isArray(h[0]);t:for(var y=0;v>y;++y){for(var x=n[y],_=0;3>_;++_){if(isNaN(x[_])||!isFinite(x[_])){p+=1;continue t}s[_]=Math.max(s[_],x[_]),o[_]=Math.min(o[_],x[_])}var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b("\u25cf",i);var A=w[0],k=w[1],M=w[2];if(Array.isArray(u)){var F;if(F=O?u[y]:u,3===F.length){for(var _=0;3>_;++_)j[_]=F[_];j[3]=1}else if(4===F.length)for(var _=0;4>_;++_)j[_]=F[_]}else j[0]=j[1]=j[2]=0,j[3]=1;if(Array.isArray(h)){var F;if(F=N?h[y]:h,3===F.length){for(var _=0;3>_;++_)I[_]=F[_];I[_]=1}else if(4===F.length)for(var _=0;4>_;++_)I[_]=F[_]}else I[0]=I[1]=I[2]=0,I[3]=1;var D=.5;Array.isArray(c)?D=+c[y]:c?D=+c:this.useOrtho&&(D=12);var B=0;Array.isArray(f)?B=+f[y]:f&&(B=+f);for(var U=Math.cos(B),V=Math.sin(B),x=n[y],_=0;3>_;++_)s[_]=Math.max(s[_],x[_]),o[_]=Math.min(o[_],x[_]);a[0]<0?P[0]=a[0]*(1+M[1][0]):a[0]>0&&(P[0]=-a[0]*(1+M[0][0]));for(var q=A.cells,G=A.positions,_=0;_Y;++Y){for(var X=0;3>X;++X)T[3*z+X]=x[X];for(var X=0;4>X;++X)L[4*z+X]=j[X];C[z]=p;var W=G[H[Y]];S[2*z]=D*(U*W[0]-V*W[1]+P[0]),S[2*z+1]=D*(V*W[0]+U*W[1]+P[1]),z+=1}for(var q=k.edges,G=k.positions,_=0;_Y;++Y){for(var X=0;3>X;++X)T[3*R+X]=x[X];for(var X=0;4>X;++X)L[4*R+X]=I[X];C[R]=p;var W=G[H[Y]];S[2*R]=D*(U*W[0]-V*W[1]+P[0]),S[2*R+1]=D*(V*W[0]+U*W[1]+P[1]),R+=1}p+=1}this.vertexCount=d,this.lineVertexCount=g,this.pointBuffer.update(T),this.colorBuffer.update(L),this.glyphBuffer.update(S),this.idBuffer.update(new Uint32Array(C)),m.free(T),m.free(L),m.free(S),m.free(C),this.bounds=[o,s],this.points=n,this.pointCount=n.length}},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},{"./lib/glyphs":745,"./lib/shaders":746,"gl-buffer":747,"gl-mat4/multiply":216,"gl-vao":775,"typedarray-pool":778}],867:[function(t,e,r){"use strict";r.boxVertex="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 vertex;\n\nuniform vec2 cornerA, cornerB;\n\nvoid main() {\n gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\n}\n",r.boxFragment="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"},{}],868:[function(t,e,r){arguments[4][75][0].apply(r,arguments)},{dup:75,ndarray:987,"ndarray-ops":982,"typedarray-pool":871}],869:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],870:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],871:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bit-twiddle":869,buffer:48,dup:102}],872:[function(t,e,r){arguments[4][76][0].apply(r,arguments)},{"./lib/GLError":873,"./lib/create-attributes":874,"./lib/create-uniforms":875,"./lib/reflect":876,"./lib/runtime-reflect":877,"./lib/shader-cache":878,dup:76}],873:[function(t,e,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],874:[function(t,e,r){arguments[4][78][0].apply(r,arguments)},{"./GLError":873,dup:78}],875:[function(t,e,r){arguments[4][79][0].apply(r,arguments)},{"./GLError":873,"./reflect":876,dup:79}],876:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],877:[function(t,e,r){arguments[4][81][0].apply(r,arguments)},{dup:81}],878:[function(t,e,r){arguments[4][82][0].apply(r,arguments)},{"./GLError":873,dup:82,"gl-format-compiler-error":879,"weakmap-shim":895}],879:[function(t,e,r){arguments[4][83][0].apply(r,arguments)},{"add-line-numbers":880,dup:83,"gl-constants/lookup":884,"glsl-shader-name":885,"sprintf-js":892}],880:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84,"pad-left":881}],881:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{dup:85,"repeat-string":882}],882:[function(t,e,r){arguments[4][86][0].apply(r,arguments)},{dup:86}],883:[function(t,e,r){arguments[4][87][0].apply(r,arguments)},{dup:87}],884:[function(t,e,r){arguments[4][88][0].apply(r,arguments)},{"./1.0/numbers":883,dup:88}],885:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{"atob-lite":886,dup:89,"glsl-tokenizer":891}],886:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{dup:90}],887:[function(t,e,r){arguments[4][91][0].apply(r,arguments)},{"./lib/builtins":888,"./lib/literals":889,"./lib/operators":890,dup:91}],888:[function(t,e,r){arguments[4][92][0].apply(r,arguments)},{dup:92}],889:[function(t,e,r){arguments[4][93][0].apply(r,arguments)},{dup:93}],890:[function(t,e,r){arguments[4][94][0].apply(r,arguments)},{dup:94}],891:[function(t,e,r){arguments[4][95][0].apply(r,arguments)},{"./index":887,dup:95}],892:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{dup:96}],893:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{"./hidden-store.js":894,dup:97}],894:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{dup:98}],895:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{"./create-store.js":893,dup:99}],896:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.boxBuffer=e,this.boxShader=r,this.enabled=!0,this.selectBox=[1/0,1/0,-(1/0),-(1/0)],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}function i(t,e){var r=t.gl,i=o(r,[0,0,0,1,1,0,1,1]),l=a(r,s.boxVertex,s.boxFragment),u=new n(t,i,l);return u.update(e),t.addOverlay(u),u}var a=t("gl-shader"),o=t("gl-buffer"),s=t("./lib/shaders");e.exports=i;var l=n.prototype;l.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),i=(this.outerFill,this.outerColor),a=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,u=t.viewBox,c=t.pixelRatio,f=(e[0]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],h=(e[1]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1],p=(e[2]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],d=(e[3]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1];if(f=Math.max(f,u[0]),h=Math.max(h,u[1]),p=Math.min(p,u[2]),d=Math.min(d,u[3]),!(f>p||h>d)){o.bind();var g=s[2]-s[0],m=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,g,h,i),o.drawBox(0,h,f,d,i),o.drawBox(0,d,g,m,i),o.drawBox(p,h,g,d,i)),this.innerFill&&o.drawBox(f,h,p,d,n),r>0){var v=r*c;o.drawBox(f-v,h-v,p+v,h+v,a),o.drawBox(f-v,d-v,p+v,d+v,a),o.drawBox(f-v,h-v,f+v,d+v,a),o.drawBox(p-v,h-v,p+v,d+v,a)}}}},l.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},l.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":867,"gl-buffer":868,"gl-shader":872}],897:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}function i(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r}e.exports=i;var a=n.prototype;a.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},a.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),u=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,u,s[0],u,e[0],r[0]),t[1]&&a.drawLine(l,u,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,u,s[2],u,e[2],r[2]),t[3]&&a.drawLine(l,u,l,s[3],e[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],898:[function(t,e,r){var n=t("gl-shader"),i="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec4 uv;\nattribute vec2 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\n\nvoid main() {\n worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n value = f.x;\n kill = f.y;\n planeCoordinate = uv.xy;\n \n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}",a="#define GLSLIFY 1\nprecision mediump float;\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\n\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\n\nvoid main() {\n if(kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = beckmannSpecular_1_1(L, V, N, roughness);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n float interpValue = (value - lowerBound.z) / (upperBound.z - lowerBound.z);\n vec4 surfaceColor = texture2D(colormap, vec2(interpValue, interpValue));\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n",o="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec4 uv;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = dataCoordinate.z;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\n planeCoordinate = uv.zw;\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n",s="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if(kill > 0.0 || \n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}";r.createShader=function(t){var e=n(t,i,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec2"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,i,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec2"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"}]);return e.attributes.uv.location=0,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"}]);return e.attributes.uv.location=0,e}},{"gl-shader":905}],899:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],900:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],901:[function(t,e,r){arguments[4][236][0].apply(r,arguments)},{dup:236}],902:[function(t,e,r){arguments[4][237][0].apply(r,arguments)},{"./colorScales.json":901,arraytools:47,dup:237}],903:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],904:[function(t,e,r){arguments[4][75][0].apply(r,arguments)},{dup:75,ndarray:987,"ndarray-ops":982,"typedarray-pool":958}],905:[function(t,e,r){arguments[4][76][0].apply(r,arguments)},{"./lib/GLError":906,"./lib/create-attributes":907,"./lib/create-uniforms":908,"./lib/reflect":909,"./lib/runtime-reflect":910,"./lib/shader-cache":911,dup:76}],906:[function(t,e,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],907:[function(t,e,r){arguments[4][78][0].apply(r,arguments)},{"./GLError":906,dup:78}],908:[function(t,e,r){arguments[4][79][0].apply(r,arguments)},{"./GLError":906,"./reflect":909,dup:79}],909:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],910:[function(t,e,r){arguments[4][81][0].apply(r,arguments)},{dup:81}],911:[function(t,e,r){arguments[4][82][0].apply(r,arguments)},{"./GLError":906,dup:82,"gl-format-compiler-error":912,"weakmap-shim":928}],912:[function(t,e,r){arguments[4][83][0].apply(r,arguments)},{"add-line-numbers":913,dup:83,"gl-constants/lookup":917,"glsl-shader-name":918,"sprintf-js":925}],913:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84,"pad-left":914}],914:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{dup:85,"repeat-string":915}],915:[function(t,e,r){arguments[4][86][0].apply(r,arguments)},{dup:86}],916:[function(t,e,r){arguments[4][87][0].apply(r,arguments)},{dup:87}],917:[function(t,e,r){arguments[4][88][0].apply(r,arguments)},{"./1.0/numbers":916,dup:88}],918:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{"atob-lite":919,dup:89,"glsl-tokenizer":924}],919:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{dup:90}],920:[function(t,e,r){arguments[4][91][0].apply(r,arguments)},{"./lib/builtins":921,"./lib/literals":922,"./lib/operators":923,dup:91}],921:[function(t,e,r){arguments[4][92][0].apply(r,arguments)},{dup:92}],922:[function(t,e,r){arguments[4][93][0].apply(r,arguments)},{dup:93}],923:[function(t,e,r){arguments[4][94][0].apply(r,arguments)},{dup:94}],924:[function(t,e,r){arguments[4][95][0].apply(r,arguments)},{"./index":920,dup:95}],925:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{dup:96}],926:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{"./hidden-store.js":927,dup:97}],927:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{dup:98}],928:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{"./create-store.js":926,dup:99}],929:[function(t,e,r){arguments[4][164][0].apply(r,arguments)},{dup:164,ndarray:987,"ndarray-ops":982,"typedarray-pool":958}],930:[function(t,e,r){arguments[4][132][0].apply(r,arguments)},{dup:132}],931:[function(t,e,r){arguments[4][133][0].apply(r,arguments)},{"./do-bind.js":930,dup:133}],932:[function(t,e,r){arguments[4][134][0].apply(r,arguments)},{"./do-bind.js":930,dup:134}],933:[function(t,e,r){arguments[4][135][0].apply(r,arguments)},{"./lib/vao-emulated.js":931,"./lib/vao-native.js":932,dup:135}],934:[function(t,e,r){"use strict";function n(t){if(t in l)return l[t];for(var e=[],r=0;t>r;++r)e.push("out",r,"s=0.5*(inp",r,"l-inp",r,"r);");for(var n=["array"],i=["junk"],r=0;t>r;++r){n.push("array"),i.push("out"+r+"s");var a=o(t);a[r]=-1,n.push({array:0,offset:a.slice()}),a[r]=1,n.push({array:0,offset:a.slice()}),i.push("inp"+r+"l","inp"+r+"r")}return l[t]=s({args:n,pre:c,post:c,body:{body:e.join(""),args:i.map(function(t){return{name:t,lvalue:0===t.indexOf("out"),rvalue:0===t.indexOf("inp"),count:"junk"!==t|0}}),thisVars:[],localVars:[]},funcName:"fdTemplate"+t})}function i(t){function e(e){for(var r=a-e.length,n=[],i=[],s=[],l=0;a>l;++l)e.indexOf(l+1)>=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),i.push("s["+l+"]-2"));var u=".lo("+n.join()+").hi("+i.join()+")";if(0===n.length&&(u=""),r>0){o.push("if(1");for(var l=0;a>l;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||o.push("&&s[",l,"]>2");o.push("){grad",r,"(src.pick(",s.join(),")",u);for(var l=0;a>l;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||o.push(",dst.pick(",s.join(),",",l,")",u);o.push(");")}for(var l=0;l1){dst.set(",s.join(),",",c,",0.5*(src.get(",h.join(),")-src.get(",p.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):o.push("if(s[",c,"]>1){diff(",f,",src.pick(",h.join(),")",u,",src.pick(",p.join(),")",u,");}else{zero(",f,");};");break;case"mirror":0===r?o.push("dst.set(",s.join(),",",c,",0);"):o.push("zero(",f,");");break;case"wrap":var d=s.slice(),g=s.slice();e[l]<0?(d[c]="s["+c+"]-2",g[c]="0"):(d[c]="s["+c+"]-1",g[c]="1"),0===r?o.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",d.join(),")-src.get(",g.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):o.push("if(s[",c,"]>2){diff(",f,",src.pick(",d.join(),")",u,",src.pick(",g.join(),")",u,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&o.push("};")}var r=t.join(),i=u[r];if(i)return i;for(var a=t.length,o=["function gradient(dst,src){var s=src.shape.slice();"],s=0;1<s;++s){for(var c=[],p=0;a>p;++p)s&1<=s;++s)m.push("grad"+s),v.push(n(s));m.push(o.join(""));var y=Function.apply(void 0,m),i=y.apply(void 0,v);return l[r]=i,i}function a(t,e,r){if(Array.isArray(r)){if(r.length!==e.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else r="string"==typeof r?o(e.dimension,r):o(e.dimension,"clamp");if(t.dimension!==e.dimension+1)throw new Error("ndarray-gradient: output dimension must be +1 input dimension");if(t.shape[e.dimension]!==e.dimension)throw new Error("ndarray-gradient: output shape must match input shape");for(var n=0;na;++a){n=n||e.surfaceProject[a];for(var o=0;3>o;++o)i=i||e.contourProject[a][o]}for(var a=0;3>a;++a){for(var s=D.projections[a],o=0;16>o;++o)s[o]=0;for(var o=0;4>o;++o)s[5*o]=1;s[5*a]=0,s[12+a]=e.axesBounds[+(r[a]>0)][a],A(s,t.model,s);for(var l=D.clipBounds[a],u=0;2>u;++u)for(var o=0;3>o;++o)l[u][o]=t.clipBounds[u][o];l[0][a]=-1e8,l[1][a]=1e8}return D.showSurface=n,D.showContour=i,D}function s(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=B;n.model=t.model||R,n.view=t.view||R,n.projection=t.projection||R,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=k(n.inverseModel,n.model);for(var i=0;2>i;++i)for(var a=n.clipBounds[i],s=0;3>s;++s)a[s]=Math.min(Math.max(this.clipBounds[i][s],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.shape=n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=V;var l=U;A(l,n.view,n.model),A(l,n.projection,l),k(l,l);for(var i=0;3>i;++i)n.eyePosition[i]=l[12+i]/l[15];for(var u=l[15],i=0;3>i;++i)u+=this.lightPosition[i]*l[4*i+3];for(var i=0;3>i;++i){for(var c=l[12+i],s=0;3>s;++s)c+=l[4*s+i]*this.lightPosition[s];n.lightPosition[i]=c/u}var f=o(n,this);if(f.showSurface&&e===this.opacity<1){this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vao.draw(r.TRIANGLES,this._vertexCount);for(var i=0;3>i;++i)this.surfaceProject[i]&&(this._shader.uniforms.model=f.projections[i],this._shader.uniforms.clipBounds=f.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(f.showContour&&!e){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var p=this._contourVAO;p.bind();for(var i=0;3>i;++i){h.uniforms.permutation=I[i],r.lineWidth(this.contourWidth[i]);for(var s=0;si;++i){h.uniforms.model=f.projections[i],h.uniforms.clipBounds=f.clipBounds[i];for(var s=0;3>s;++s)if(this.contourProject[i][s]){h.uniforms.permutation=I[s],r.lineWidth(this.contourWidth[s]);for(var d=0;di;++i)if(0!==this._dynamicCounts[i]){h.uniforms.model=n.model,h.uniforms.clipBounds=n.clipBounds,h.uniforms.permutation=I[i],r.lineWidth(this.dynamicWidth[i]),h.uniforms.contourColor=this.dynamicColor[i],h.uniforms.contourTint=this.dynamicTint[i],h.uniforms.height=this.dynamicLevel[i],p.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]);for(var s=0;3>s;++s)this.contourProject[s][i]&&(h.uniforms.model=f.projections[s],h.uniforms.clipBounds=f.clipBounds[s],p.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]))}p.unbind()}}function l(t,e){var r=e.shape.slice(),n=t.shape.slice();b.assign(t.lo(1,1).hi(r[0],r[1]),e),b.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),b.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),b.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),b.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))}function u(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function c(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],1]:[t[0],t[1],t[2],t[3]]:[0,0,0,1]}function f(t){if(Array.isArray(t)){if(Array.isArray(t))return[c(t[0]),c(t[1]),c(t[2])];var e=c(t);return[e.slice(),e.slice(),e.slice()]}}function h(t){var e=t.gl,r=(t.field||t.coords&&t.coords[2]||_([],[0,0]),L(e)),n=C(e),i=S(e),o=P(e),s=d(e),l=g(e,[{buffer:s,size:4,stride:z,offset:0},{buffer:s,size:2,stride:z,offset:16},{buffer:s,size:3,stride:z,offset:24}]),u=d(e),c=g(e,[{buffer:u,size:4}]),f=d(e),h=g(e,[{buffer:f,size:2,type:e.FLOAT}]),p=m(e,1,O,e.RGBA,e.UNSIGNED_BYTE);p.minFilter=e.LINEAR,p.magFilter=e.LINEAR;var v=new a(e,[0,0],[[0,0,0],[0,0,0]],r,n,s,l,p,i,o,u,c,f,h),y={levels:[[],[],[]]};for(var b in t)y[b]=t[b];return y.colormap=y.colormap||"jet",v.update(y),v}e.exports=h;var p=t("bit-twiddle"),d=t("gl-buffer"),g=t("gl-vao"),m=t("gl-texture2d"),v=t("typedarray-pool"),y=t("colormap"),b=t("ndarray-ops"),x=t("ndarray-pack"),_=t("ndarray"),w=t("surface-nets"),A=t("gl-mat4/multiply"),k=t("gl-mat4/invert"),M=t("binary-search-bounds"),E=t("ndarray-gradient"),_=t("ndarray"),T=t("./lib/shaders"),L=T.createShader,S=T.createContourShader,C=T.createPickShader,P=T.createPickContourShader,z=36,R=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],j=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],I=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];!function(){for(var t=0;3>t;++t){var e=I[t],r=(t+1)%3,n=(t+2)%3;e[r+0]=1,e[n+3]=1,e[t+6]=1}}();var O=265,N=a.prototype;N.isTransparent=function(){return this.opacity<1},N.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;3>t;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0; -return!1},N.pickSlots=1,N.setPickBase=function(t){this.pickId=t};var F=[0,0,0],D={showSurface:!1,showContour:!1,projections:[R.slice(),R.slice(),R.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},B={model:R,view:R,projection:R,inverseModel:R.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1},U=R.slice(),V=[1,0,0,0,1,0,0,0,1];N.draw=function(t){return s.call(this,t,!1)},N.drawTransparent=function(t){return s.call(this,t,!0)};var q={model:R,view:R,projection:R,inverseModel:R,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};N.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=q;r.model=t.model||R,r.view=t.view||R,r.projection=t.projection||R,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=V;for(var n=0;2>n;++n)for(var i=r.clipBounds[n],a=0;3>a;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var s=o(r,this);if(s.showSurface){this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount);for(var n=0;3>n;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var u=this._contourVAO;u.bind();for(var a=0;3>a;++a){e.lineWidth(this.contourWidth[a]),l.uniforms.permutation=I[a];for(var n=0;nn;++n){l.uniforms.model=s.projections[n],l.uniforms.clipBounds=s.clipBounds[n];for(var a=0;3>a;++a)if(this.contourProject[n][a]){l.uniforms.permutation=I[a],e.lineWidth(this.contourWidth[a]);for(var c=0;c>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;2>c;++c)for(var f=c?a:1-a,h=0;2>h;++h)for(var p=h?l:1-l,d=i+c,g=s+h,m=f*p,v=0;3>v;++v)u[v]+=this._field[v].get(d,g)*m;for(var y=this._pickResult.level,b=0;3>b;++b)if(y[b]=M.le(this.contourLevels[b],u[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]Math.abs(_-u[b])&&(y[b]+=1)}r.index[0]=.5>a?i:i+1,r.index[1]=.5>l?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1];for(var v=0;3>v;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},N.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=u(t.contourWidth,Number)),"showContour"in t&&(this.showContour=u(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=u(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=f(t.contourColor)),"contourProject"in t&&(this.contourProject=u(t.contourProject,function(t){return u(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=f(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=u(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=u(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds);var e=t.field||t.coords&&t.coords[2]||null;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var r=(e.shape[0]+2)*(e.shape[1]+2);r>this._field[2].data.length&&(v.freeFloat(this._field[2].data),this._field[2].data=v.mallocFloat(p.nextPow2(r))),this._field[2]=_(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),l(this._field[2],e),this.shape=e.shape.slice();for(var n=this.shape,a=0;2>a;++a)this._field[2].size>this._field[a].data.length&&(v.freeFloat(this._field[a].data),this._field[a].data=v.mallocFloat(this._field[2].size)),this._field[a]=_(this._field[a].data,[n[0]+2,n[1]+2]);if(t.coords){var o=t.coords;if(!Array.isArray(o)||3!==o.length)throw new Error("gl-surface: invalid coordinates for x/y");for(var a=0;2>a;++a){for(var s=o[a],c=0;2>c;++c)if(s.shape[c]!==n[c])throw new Error("gl-surface: coords have incorrect shape");l(this._field[a],s)}}else if(t.ticks){var h=t.ticks;if(!Array.isArray(h)||2!==h.length)throw new Error("gl-surface: invalid ticks");for(var a=0;2>a;++a){var d=h[a];if((Array.isArray(d)||d.length)&&(d=_(d)),d.shape[0]!==n[a])throw new Error("gl-surface: invalid tick length");var g=_(d.data,n);g.stride[a]=d.stride[0],g.stride[1^a]=0,l(this._field[a],g)}}else{for(var a=0;2>a;++a){var m=[0,0];m[a]=1,this._field[a]=_(this._field[a].data,[n[0]+2,n[1]+2],m,0)}this._field[0].set(0,0,0);for(var c=0;ca;++a)E(b.pick(a),y[a],"mirror");for(var x=_(v.mallocFloat(3*y[2].size),[n[0]+2,n[1]+2,3]),a=0;aR?(R=Math.max(Math.abs(C),Math.abs(P),Math.abs(z)),1e-8>R?(z=1,P=C=0,R=1):R=1/R):R=1/Math.sqrt(R),x.set(a,c,0,C*R),x.set(a,c,1,P*R),x.set(a,c,2,z*R)}v.free(b.data);for(var I=[1/0,1/0,1/0],O=[-(1/0),-(1/0),-(1/0)],N=(n[0]-1)*(n[1]-1)*6,F=v.mallocFloat(p.nextPow2(9*N)),D=0,B=0,a=0;aU;++U)for(var V=0;2>V;++V)for(var q=0;3>q;++q){var G=this._field[q].get(1+a+U,1+c+V);if(isNaN(G)||!isFinite(G))continue t}for(var q=0;6>q;++q){var H=a+j[q][0],Y=c+j[q][1],X=this._field[0].get(H+1,Y+1),W=this._field[1].get(H+1,Y+1),G=this._field[2].get(H+1,Y+1),C=x.get(H+1,Y+1,0),P=x.get(H+1,Y+1,1),z=x.get(H+1,Y+1,2);F[D++]=H,F[D++]=Y,F[D++]=X,F[D++]=W,F[D++]=G,F[D++]=0,F[D++]=C,F[D++]=P,F[D++]=z,I[0]=Math.min(I[0],X),I[1]=Math.min(I[1],W),I[2]=Math.min(I[2],G),O[0]=Math.max(O[0],X),O[1]=Math.max(O[1],W),O[2]=Math.max(O[2],G),B+=1}}this._vertexCount=B,this._coordinateBuffer.update(F.subarray(0,D)),v.freeFloat(F),v.free(x.data),this.bounds=[I,O]}var Z=!1;if("levels"in t){var Q=t.levels;Q=Array.isArray(Q[0])?Q.slice():[[],[],Q];for(var a=0;3>a;++a)Q[a]=Q[a].slice(),Q.sort(function(t,e){return t-e});t:for(var a=0;3>a;++a){if(Q[a].length!==this.contourLevels[a].length){Z=!0;break}for(var c=0;c$;++$){for(var Q=this.contourLevels[$],J=[],tt=[],et=[0,0],a=0;aq;++q){var it=rt.positions[nt[q]],at=it[0],ot=0|Math.floor(at),st=at-ot,lt=it[1],ut=0|Math.floor(lt),ct=lt-ut,ft=!1;e:for(var ht=0;2>ht;++ht){et[ht]=0;for(var pt=($+ht+1)%3,U=0;2>U;++U)for(var dt=U?st:1-st,H=0|Math.min(Math.max(ot+U,0),n[0]),V=0;2>V;++V){var gt=V?ct:1-ct,Y=0|Math.min(Math.max(ut+V,0),n[1]),G=this._field[pt].get(H,Y);if(!isFinite(G)||isNaN(G)){ft=!0;break e}var mt=dt*gt;et[ht]+=mt*G}}if(ft){if(q>0){for(var vt=0;4>vt;++vt)K.pop();B-=1}continue t}K.push(et[0],et[1],it[0],it[1]),B+=1}tt.push(B)}this._contourOffsets[$]=J,this._contourCounts[$]=tt}for(var yt=v.mallocFloat(K.length),a=0;at;++t)v.freeFloat(this._field[t].data)},N.highlight=function(t){if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(var e=0;3>e;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;var r;if(r=this.snapToData?t.dataCoordinate:t.position,this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,a=v.mallocFloat(12*i[0]*i[1]),o=0;3>o;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var s=(o+1)%3,l=(o+2)%3,u=this._field[o],c=this._field[s],f=this._field[l],h=w(u,r[o]),p=h.cells,d=h.positions;this._dynamicOffsets[o]=n;for(var e=0;em;++m){var y=d[g[m]],b=+y[0],x=0|b,_=0|Math.min(x+1,i[0]),A=b-x,k=1-A,M=+y[1],E=0|M,T=0|Math.min(E+1,i[1]),L=M-E,S=1-L,C=k*S,P=k*L,z=A*S,R=A*L,j=C*c.get(x,E)+P*c.get(x,T)+z*c.get(_,E)+R*c.get(_,T),I=C*f.get(x,E)+P*f.get(x,T)+z*f.get(_,E)+R*f.get(_,T);if(isNaN(j)||isNaN(I)){m&&(n-=1);break}a[2*n+0]=j,a[2*n+1]=I,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(a.subarray(0,2*n)),v.freeFloat(a)}}},{"./lib/shaders":898,"binary-search-bounds":899,"bit-twiddle":900,colormap:902,"gl-buffer":904,"gl-mat4/invert":214,"gl-mat4/multiply":216,"gl-texture2d":929,"gl-vao":933,ndarray:987,"ndarray-gradient":934,"ndarray-ops":982,"ndarray-pack":939,"surface-nets":957,"typedarray-pool":958}],960:[function(t,e,r){"use strict";function n(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==g.alt,g.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==g.shift,g.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==g.control,g.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==g.meta,g.meta=!!t.metaKey),e}function n(t,n){var a=i.x(n),o=i.y(n);"buttons"in n&&(t=0|n.buttons),(t!==h||a!==p||o!==d||r(n))&&(h=0|t,p=a||0,d=o||0,e(h,p,d,g))}function a(t){n(0,t)}function o(){(h||p||d||g.shift||g.alt||g.meta||g.control)&&(p=d=0,h=0,g.shift=g.alt=g.control=g.meta=!1,e(0,0,0,g))}function s(t){r(t)&&e(h,p,d,g)}function l(t){0===i.buttons(t)?n(0,t):n(h,t)}function u(t){n(h|i.buttons(t),t)}function c(t){n(h&~i.buttons(t),t)}function f(){m||(m=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",u),t.addEventListener("mouseup",c),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}e||(e=t,t=window);var h=0,p=0,d=0,g={shift:!1,alt:!1,control:!1,meta:!1},m=!1;f();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return m},set:function(t){t&&f()},enumerable:!0},buttons:{get:function(){return h},enumerable:!0},x:{get:function(){return p},enumerable:!0},y:{get:function(){return d},enumerable:!0},mods:{get:function(){return g},enumerable:!0}}),v}e.exports=n;var i=t("mouse-event")},{"mouse-event":961}],961:[function(t,e,r){"use strict";function n(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){var e=t.which;if(2===e)return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<=0&&r=0&&r+1=0&&n=0&&n+1=0&&s=0&&s+1=0&&i=0&&i+1=0&&l=0&&l+1=0&&h=0&&h+1e;++e)r=+arguments[e+1],i[e]=Math.floor(r),a[e]=r-i[e],o[e]=0<=i[e]&&i[e]e;++e){for(u=1,c=t.offset,l=0;n>l;++l)if(e&1<r;++r){t[r]=o[(n+1)*n+r];for(var i=0;n>i;++i)t[r]+=o[(n+1)*i+r]*e[i]}for(var a=o[(n+1)*(n+1)-1],i=0;n>i;++i)a+=o[(n+1)*i+n]*e[i];for(var s=1/a,r=0;n>r;++r)t[r]*=s;return t}),t}var i=t("ndarray-warp"),a=t("gl-matrix-invert");e.exports=n},{"gl-matrix-invert":971,"ndarray-warp":980}],982:[function(t,e,r){"use strict";function n(t){if(!t)return s;for(var e=0;e>",rrshift:">>>"};!function(){for(var t in l){var e=l[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];r[t]=a({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=a({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var f=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=o({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=o({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=a({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=a({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=a({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=o({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":983}],983:[function(t,e,r){arguments[4][290][0].apply(r,arguments)},{"./lib/thunk.js":985,dup:290}],984:[function(t,e,r){arguments[4][291][0].apply(r,arguments)},{dup:291,uniq:986}],985:[function(t,e,r){arguments[4][292][0].apply(r,arguments)},{"./compile.js":984,dup:292}],986:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],987:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;te&&(r="View_Nil"+t);var n="generic"===t;if(-1===e){var a="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}",o=new Function(a); -return o()}if(0===e){var a="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}",o=new Function("TrivialArray",a);return o(f[t][0])}var a=["'use strict'"],s=l(e),u=s.map(function(t){return"i"+t}),c="this.offset+"+s.map(function(t){return"this.stride["+t+"]*i"+t}).join("+"),h=s.map(function(t){return"b"+t}).join(","),p=s.map(function(t){return"c"+t}).join(",");a.push("function "+r+"(a,"+h+","+p+",d){this.data=a","this.shape=["+h+"]","this.stride=["+p+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+t+"'","proto.dimension="+e),a.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+s.map(function(t){return"this.shape["+t+"]"}).join("*"),"}})"),1===e?a.push("proto.order=[0]"):(a.push("Object.defineProperty(proto,'order',{get:"),4>e?(a.push("function "+r+"_order(){"),2===e?a.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),n?a.push("return this.data.set("+c+",v)}"):a.push("return this.data["+c+"]=v}"),a.push("proto.get=function "+r+"_get("+u.join(",")+"){"),n?a.push("return this.data.get("+c+")}"):a.push("return this.data["+c+"]}"),a.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),a.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),g=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+g.join(","));for(var m=0;e>m;++m)a.push("if(typeof i"+m+"==='number'&&i"+m+">=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var m=0;e>m;++m)a.push("if(typeof i"+m+"==='number'){d=i"+m+"|0;if(d<0){c+=b"+m+"*(a"+m+"-1);a"+m+"=ceil(-a"+m+"/d)}else{a"+m+"=ceil(a"+m+"/d)}b"+m+"*=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"b"+t}).join(",")+",c)}");for(var v=new Array(e),y=new Array(e),m=0;e>m;++m)v[m]="a[i"+m+"]",y[m]="b[i"+m+"]";a.push("proto.transpose=function "+r+"_transpose("+u+"){"+u.map(function(t,e){return t+"=("+t+"===undefined?"+e+":"+t+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+v.join(",")+","+y.join(",")+",this.offset)}"),a.push("proto.pick=function "+r+"_pick("+u+"){var a=[],b=[],c=this.offset");for(var m=0;e>m;++m)a.push("if(typeof i"+m+"==='number'&&i"+m+">=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var o=new Function("CTOR_LIST","ORDER",a.join("\n"));return o(f[t],i)}function o(t){if(u(t))return"buffer";if(c)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"}function s(t,e,r,n){if(void 0===t){var i=f.array[0];return i([])}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var l=s-1,u=1;l>=0;--l)r[l]=u,u*=e[l]}if(void 0===n){n=0;for(var l=0;s>l;++l)r[l]<0&&(n-=(e[l]-1)*r[l])}for(var c=o(t),h=f[c];h.length<=s+1;)h.push(a(c,h.length-1));var i=h[s+1];return i(t,e,r,n)}var l=t("iota-array"),u=t("is-buffer"),c="undefined"!=typeof Float64Array,f={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=s},{"iota-array":988,"is-buffer":989}],988:[function(t,e,r){"use strict";function n(t){for(var e=new Array(t),r=0;t>r;++r)e[r]=r;return e}e.exports=n},{}],989:[function(t,e,r){e.exports=function(t){return!(null==t||!(t._isBuffer||t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)))}},{}],990:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],991:[function(t,e,r){arguments[4][36][0].apply(r,arguments)},{dup:36}],992:[function(t,e,r){arguments[4][37][0].apply(r,arguments)},{dup:37,"two-product":995,"two-sum":991}],993:[function(t,e,r){arguments[4][333][0].apply(r,arguments)},{dup:333}],994:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],995:[function(t,e,r){arguments[4][39][0].apply(r,arguments)},{dup:39}],996:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;nr;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=["m",n,"[",t-r-1,"]"].join("")}return e}function a(t){return 1&t?"-":""}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;ru;++u)0===(1&u)?e.push.apply(e,s(n(a,u))):r.push.apply(r,s(n(a,u))),l.push("m"+u);var c=o(e),g=o(r),m="orientation"+t+"Exact",v=["function ",m,"(",l.join(),"){var p=",c,",n=",g,",d=sub(p,n);return d[d.length-1];};return ",m].join(""),y=new Function("sum","prod","scale","sub",v);return y(h,f,p,d)}function u(t){var e=_[t.length];return e||(e=_[t.length]=l(t.length)),e.apply(void 0,t)}function c(){for(;_.length<=g;)_.push(l(_.length));for(var t=[],r=["slow"],n=0;g>=n;++n)t.push("a"+n),r.push("o"+n);for(var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;g>=n;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i=n;++n)e.exports[n]=_[n]}var f=t("two-product"),h=t("robust-sum"),p=t("robust-scale"),d=t("robust-subtract"),g=5,m=1.1102230246251565e-16,v=(3+16*m)*m,y=(7+56*m)*m,b=l(3),x=l(4),_=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){var n,i=(t[1]-r[1])*(e[0]-r[0]),a=(t[0]-r[0])*(e[1]-r[1]),o=i-a;if(i>0){if(0>=a)return o;n=i+a}else{if(!(0>i))return o;if(a>=0)return o;n=-(i+a)}var s=v*n;return o>=s||-s>=o?o:b(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],p=a*u,d=o*l,g=o*s,m=i*u,v=i*l,b=a*s,_=c*(p-d)+f*(g-m)+h*(v-b),w=(Math.abs(p)+Math.abs(d))*Math.abs(c)+(Math.abs(g)+Math.abs(m))*Math.abs(f)+(Math.abs(v)+Math.abs(b))*Math.abs(h),A=y*w;return _>A||-_>A?_:x(t,e,r,n)}];c()},{"robust-scale":992,"robust-subtract":993,"robust-sum":994,"two-product":995}],997:[function(t,e,r){"use strict";function n(t){return t.split("").map(function(t){return t in i?i[t]:""}).join("")}e.exports=n;var i={" ":" ",0:"\u2070",1:"\xb9",2:"\xb2",3:"\xb3",4:"\u2074",5:"\u2075",6:"\u2076",7:"\u2077",8:"\u2078",9:"\u2079","+":"\u207a","-":"\u207b",a:"\u1d43",b:"\u1d47",c:"\u1d9c",d:"\u1d48",e:"\u1d49",f:"\u1da0",g:"\u1d4d",h:"\u02b0",i:"\u2071",j:"\u02b2",k:"\u1d4f",l:"\u02e1",m:"\u1d50",n:"\u207f",o:"\u1d52",p:"\u1d56",r:"\u02b3",s:"\u02e2",t:"\u1d57",u:"\u1d58",v:"\u1d5b",w:"\u02b7",x:"\u02e3",y:"\u02b8",z:"\u1dbb"}},{}],998:[function(e,r,n){!function(){function e(t,r){if(t=t?t:"",r=r||{},t instanceof e)return t;if(!(this instanceof e))return new e(t,r);var i=n(t);this._originalInput=t,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=U(100*this._a)/100,this._format=r.format||i.format,this._gradientType=r.gradientType,this._r<1&&(this._r=U(this._r)),this._g<1&&(this._g=U(this._g)),this._b<1&&(this._b=U(this._b)),this._ok=i.ok,this._tc_id=D++}function n(t){var e={r:0,g:0,b:0},r=1,n=!1,a=!1;return"string"==typeof t&&(t=I(t)),"object"==typeof t&&(t.hasOwnProperty("r")&&t.hasOwnProperty("g")&&t.hasOwnProperty("b")?(e=i(t.r,t.g,t.b),n=!0,a="%"===String(t.r).substr(-1)?"prgb":"rgb"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("v")?(t.s=z(t.s),t.v=z(t.v),e=l(t.h,t.s,t.v),n=!0,a="hsv"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("l")&&(t.s=z(t.s),t.l=z(t.l),e=o(t.h,t.s,t.l),n=!0,a="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=M(r),{ok:n,format:t.format||a,r:V(255,q(e.r,0)),g:V(255,q(e.g,0)),b:V(255,q(e.b,0)),a:r}}function i(t,e,r){return{r:255*E(t,255),g:255*E(e,255),b:255*E(r,255)}}function a(t,e,r){t=E(t,255),e=E(e,255),r=E(r,255);var n,i,a=q(t,e,r),o=V(t,e,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(r>e?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,l:s}}function o(t,e,r){function n(t,e,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?t+6*(e-t)*r:.5>r?e:2/3>r?t+(e-t)*(2/3-r)*6:t}var i,a,o;if(t=E(t,360),e=E(e,100),r=E(r,100),0===e)i=a=o=r;else{var s=.5>r?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}function s(t,e,r){t=E(t,255),e=E(e,255),r=E(r,255);var n,i,a=q(t,e,r),o=V(t,e,r),s=a,l=a-o;if(i=0===a?0:l/a,a==o)n=0;else{switch(a){case t:n=(e-r)/l+(r>e?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,v:s}}function l(t,e,r){t=6*E(t,360),e=E(e,100),r=E(r,100);var n=B.floor(t),i=t-n,a=r*(1-e),o=r*(1-i*e),s=r*(1-(1-i)*e),l=n%6,u=[r,o,a,a,s,r][l],c=[s,r,r,o,a,a][l],f=[a,a,s,r,r,o][l];return{r:255*u,g:255*c,b:255*f}}function u(t,e,r,n){var i=[P(U(t).toString(16)),P(U(e).toString(16)),P(U(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function c(t,e,r,n){var i=[P(R(n)),P(U(t).toString(16)),P(U(e).toString(16)),P(U(r).toString(16))];return i.join("")}function f(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.s-=r/100,n.s=T(n.s),e(n)}function h(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.s+=r/100,n.s=T(n.s),e(n)}function p(t){return e(t).desaturate(100)}function d(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.l+=r/100,n.l=T(n.l),e(n)}function g(t,r){r=0===r?0:r||10;var n=e(t).toRgb();return n.r=q(0,V(255,n.r-U(255*-(r/100)))),n.g=q(0,V(255,n.g-U(255*-(r/100)))),n.b=q(0,V(255,n.b-U(255*-(r/100)))),e(n)}function m(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.l-=r/100,n.l=T(n.l),e(n)}function v(t,r){var n=e(t).toHsl(),i=(U(n.h)+r)%360;return n.h=0>i?360+i:i,e(n)}function y(t){var r=e(t).toHsl();return r.h=(r.h+180)%360,e(r)}function b(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+120)%360,s:r.s,l:r.l}),e({h:(n+240)%360,s:r.s,l:r.l})]}function x(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+90)%360,s:r.s,l:r.l}),e({h:(n+180)%360,s:r.s,l:r.l}),e({h:(n+270)%360,s:r.s,l:r.l})]}function _(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+72)%360,s:r.s,l:r.l}),e({h:(n+216)%360,s:r.s,l:r.l})]}function w(t,r,n){r=r||6,n=n||30;var i=e(t).toHsl(),a=360/n,o=[e(t)];for(i.h=(i.h-(a*r>>1)+720)%360;--r;)i.h=(i.h+a)%360,o.push(e(i));return o}function A(t,r){r=r||6;for(var n=e(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/r;r--;)s.push(e({h:i,s:a,v:o})),o=(o+l)%1;return s}function k(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function M(t){return t=parseFloat(t),(isNaN(t)||0>t||t>1)&&(t=1),t}function E(t,e){S(t)&&(t="100%");var r=C(t);return t=V(e,q(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),B.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function T(t){return V(1,q(0,t))}function L(t){return parseInt(t,16)}function S(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function C(t){return"string"==typeof t&&-1!=t.indexOf("%")}function P(t){return 1==t.length?"0"+t:""+t}function z(t){return 1>=t&&(t=100*t+"%"),t}function R(t){return Math.round(255*parseFloat(t)).toString(16)}function j(t){return L(t)/255}function I(t){t=t.replace(N,"").replace(F,"").toLowerCase();var e=!1;if(H[t])t=H[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=X.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=X.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=X.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=X.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=X.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=X.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=X.hex8.exec(t))?{a:j(r[1]),r:L(r[2]),g:L(r[3]),b:L(r[4]),format:e?"name":"hex8"}:(r=X.hex6.exec(t))?{r:L(r[1]),g:L(r[2]),b:L(r[3]),format:e?"name":"hex"}:(r=X.hex3.exec(t))?{r:L(r[1]+""+r[1]),g:L(r[2]+""+r[2]),b:L(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function O(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var N=/^[\s,#]+/,F=/\s+$/,D=0,B=Math,U=B.round,V=B.min,q=B.max,G=B.random;e.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n,i,a,o=this.toRgb();return t=o.r/255,e=o.g/255,r=o.b/255,n=.03928>=t?t/12.92:Math.pow((t+.055)/1.055,2.4),i=.03928>=e?e/12.92:Math.pow((e+.055)/1.055,2.4),a=.03928>=r?r/12.92:Math.pow((r+.055)/1.055,2.4),.2126*n+.7152*i+.0722*a},setAlpha:function(t){return this._a=M(t),this._roundA=U(100*this._a)/100,this},toHsv:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=s(this._r,this._g,this._b),e=U(360*t.h),r=U(100*t.s),n=U(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=a(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=a(this._r,this._g,this._b),e=U(360*t.h),r=U(100*t.s),n=U(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return u(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return c(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:U(this._r),g:U(this._g),b:U(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+U(this._r)+", "+U(this._g)+", "+U(this._b)+")":"rgba("+U(this._r)+", "+U(this._g)+", "+U(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:U(100*E(this._r,255))+"%",g:U(100*E(this._g,255))+"%",b:U(100*E(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+U(100*E(this._r,255))+"%, "+U(100*E(this._g,255))+"%, "+U(100*E(this._b,255))+"%)":"rgba("+U(100*E(this._r,255))+"%, "+U(100*E(this._g,255))+"%, "+U(100*E(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":this._a<1?!1:Y[u(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+c(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=e(t);n=a.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0,i=!e&&n&&("hex"===t||"hex6"===t||"hex3"===t||"name"===t);return i?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),("hex"===t||"hex6"===t)&&(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(d,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(h,arguments)},greyscale:function(){return this._applyModification(p,arguments)},spin:function(){return this._applyModification(v,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(w,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(b,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},e.fromRatio=function(t,r){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&("a"===i?n[i]=t[i]:n[i]=z(t[i]));t=n}return e(t,r)},e.equals=function(t,r){return t&&r?e(t).toRgbString()==e(r).toRgbString():!1},e.random=function(){return e.fromRatio({r:G(),g:G(),b:G()})},e.mix=function(t,r,n){n=0===n?0:n||50;var i,a=e(t).toRgb(),o=e(r).toRgb(),s=n/100,l=2*s-1,u=o.a-a.a;i=l*u==-1?l:(l+u)/(1+l*u),i=(i+1)/2;var c=1-i,f={r:o.r*i+a.r*c,g:o.g*i+a.g*c,b:o.b*i+a.b*c,a:o.a*s+a.a*(1-s)};return e(f)},e.readability=function(t,r){var n=e(t),i=e(r);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},e.isReadable=function(t,r,n){var i,a,o=e.readability(t,r);switch(a=!1,i=O(n),i.level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},e.mostReadable=function(t,r,n){var i,a,o,s,l=null,u=0;n=n||{},a=n.includeFallbackColors,o=n.level,s=n.size;for(var c=0;cu&&(u=i,l=e(r[c]));return e.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,e.mostReadable(t,["#fff","#000"],n))};var H=e.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Y=e.hexNames=k(H),X=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();"undefined"!=typeof r&&r.exports?r.exports=e:"function"==typeof t&&t.amd?t(function(){return e}):window.tinycolor=e}()},{}],999:[function(e,r,i){!function(){function e(t,e){function r(e){var r,n=t.arcs[0>e?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],0>e?[r,i]:[i,r]}function n(t,e){for(var r in t){var n=t[r];delete e[n.start],delete n.start,delete n.end,n.forEach(function(t){i[0>t?~t:t]=1}),s.push(n)}}var i={},a={},o={},s=[],l=-1;return e.forEach(function(r,n){var i,a=t.arcs[0>r?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++l],e[l]=r,e[n]=i)}),e.forEach(function(t){var e,n,i=r(t),s=i[0],l=i[1];if(e=o[s])if(delete o[e.end],e.push(t),e.end=l,n=a[l]){delete a[n.start];var u=n===e?e:e.concat(n);a[u.start=e.start]=o[u.end=n.end]=u}else a[e.start]=o[e.end]=e;else if(e=a[l])if(delete a[e.start],e.unshift(t),e.start=s,n=o[s]){delete o[n.end];var c=n===e?e:n.concat(e);a[c.start=n.start]=o[c.end=e.end]=c}else a[e.start]=o[e.end]=e;else e=[t],a[e.start=s]=o[e.end=l]=e}),n(o,a),n(a,o),e.forEach(function(t){i[0>t?~t:t]||s.push([t])}),s}function i(t,r,n){function i(t){var e=0>t?~t:t;(c[e]||(c[e]=[])).push({i:t,g:u})}function a(t){t.forEach(i)}function o(t){t.forEach(a)}function s(t){"GeometryCollection"===t.type?t.geometries.forEach(s):t.type in f&&(u=t,f[t.type](t.arcs))}var l=[];if(arguments.length>1){var u,c=[],f={LineString:a,MultiLineString:o,Polygon:o,MultiPolygon:function(t){t.forEach(o)}};s(r),c.forEach(arguments.length<3?function(t){l.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&l.push(t[0].i)})}else for(var h=0,p=t.arcs.length;p>h;++h)l.push(h);return{type:"MultiLineString",arcs:e(t,l)}}function a(t,r){function i(t){t.forEach(function(e){e.forEach(function(e){(o[e=0>e?~e:e]||(o[e]=[])).push(t)})}),s.push(t)}function a(e){return p(l(t,{type:"Polygon",arcs:[e]}).coordinates[0])>0}var o={},s=[],u=[];return r.forEach(function(t){"Polygon"===t.type?i(t.arcs):"MultiPolygon"===t.type&&t.arcs.forEach(i)}),s.forEach(function(t){if(!t._){var e=[],r=[t];for(t._=1,u.push(e);t=r.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){o[0>t?~t:t].forEach(function(t){t._||(t._=1,r.push(t))})})})}}),s.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:u.map(function(r){var i=[];if(r.forEach(function(t){t.forEach(function(t){t.forEach(function(t){o[0>t?~t:t].length<2&&i.push(t)})})}),i=e(t,i),(n=i.length)>1)for(var s,l=a(r[0][0]),u=0;ut?~t:t],i=0,a=n.length;a>i;++i)e.push(r=n[i].slice()),l(r,i);0>t&&u(e,a)}function n(t){return t=t.slice(),l(t,0),t}function i(t){for(var e=[],n=0,i=t.length;i>n;++n)r(t[n],e);return e.length<2&&e.push(e[0].slice()),e}function a(t){for(var e=i(t);e.length<4;)e.push(e[0].slice());return e}function o(t){return t.map(a)}function s(t){var e=t.type;return"GeometryCollection"===e?{type:e,geometries:t.geometries.map(s)}:e in f?{type:e,coordinates:f[e](t)}:null}var l=v(t.transform),c=t.arcs,f={Point:function(t){return n(t.coordinates)},MultiPoint:function(t){return t.coordinates.map(n)},LineString:function(t){return i(t.arcs)},MultiLineString:function(t){return t.arcs.map(i)},Polygon:function(t){return o(t.arcs)},MultiPolygon:function(t){return t.arcs.map(o)}};return s(e)}function u(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r}function c(t,e){for(var r=0,n=t.length;n>r;){var i=r+n>>>1;t[i]t&&(t=~t);var r=i[t];r?r.push(e):i[t]=[e]})}function r(t,r){t.forEach(function(t){e(t,r)})}function n(t,e){"GeometryCollection"===t.type?t.geometries.forEach(function(t){n(t,e)}):t.type in o&&o[t.type](t.arcs,e)}var i={},a=t.map(function(){return[]}),o={LineString:e,MultiLineString:r,Polygon:r,MultiPolygon:function(t,e){t.forEach(function(t){r(t,e)})}};t.forEach(n);for(var s in i)for(var l=i[s],u=l.length,f=0;u>f;++f)for(var h=f+1;u>h;++h){var p,d=l[f],g=l[h];(p=a[d])[s=c(p,g)]!==g&&p.splice(s,0,g),(p=a[g])[s=c(p,d)]!==d&&p.splice(s,0,d)}return a}function h(t,e){function r(t){a.remove(t),t[1][2]=e(t),a.push(t)}var n=v(t.transform),i=y(t.transform),a=m();return e||(e=d),t.arcs.forEach(function(t){for(var o,s,l=[],u=0,c=0,f=t.length;f>c;++c)s=t[c],n(t[c]=[s[0],s[1],1/0],c);for(var c=1,f=t.length-1;f>c;++c)o=t.slice(c-1,c+2),o[1][2]=e(o),l.push(o),a.push(o);for(var c=0,f=l.length;f>c;++c)o=l[c],o.previous=l[c-1],o.next=l[c+1];for(;o=a.pop();){var h=o.previous,p=o.next;o[1][2]0;){var r=(e+1>>1)-1,i=n[r];if(g(t,i)>=0)break;n[i._=e]=i,n[t._=e=r]=t}}function e(t,e){for(;;){var r=e+1<<1,a=r-1,o=e,s=n[o];if(i>a&&g(n[a],s)<0&&(s=n[o=a]),i>r&&g(n[r],s)<0&&(s=n[o=r]),o===e)break;n[s._=e]=s,n[t._=e=o]=t}}var r={},n=[],i=0;return r.push=function(e){return t(n[e._=i]=e,i++),i},r.pop=function(){if(!(0>=i)){var t,r=n[0];return--i>0&&(t=n[i],e(n[t._=0]=t,0)),r}},r.remove=function(r){var a,o=r._;if(n[o]===r)return o!==--i&&(a=n[i],(g(a,r)<0?t:e)(n[a._=o]=a,o)),o},r}function v(t){if(!t)return b;var e,r,n=t.scale[0],i=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,s){s||(e=r=0),t[0]=(e+=t[0])*n+a,t[1]=(r+=t[1])*i+o}}function y(t){if(!t)return b;var e,r,n=t.scale[0],i=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,s){s||(e=r=0);var l=(t[0]-a)/n|0,u=(t[1]-o)/i|0;t[0]=l-e,t[1]=u-r,e=l,r=u}}function b(){}var x={version:"1.6.19",mesh:function(t){return l(t,i.apply(this,arguments))},meshArcs:i,merge:function(t){return l(t,a.apply(this,arguments))},mergeArcs:a,feature:o,neighbors:f,presimplify:h};"function"==typeof t&&t.amd?t(x):"object"==typeof r&&r.exports?r.exports=x:this.topojson=x}()},{}],1e3:[function(t,e,r){e.exports={name:"plotly.js",version:"1.4.1",description:"The open source javascript graphing library that powers plotly",license:"MIT",main:"./src/index.js",webpack:"./dist/plotly.min.js",repository:{type:"git",url:"https://github.com/plotly/plotly.js.git"},bugs:{url:"https://github.com/plotly/plotly.js/issues"},author:"Plotly, Inc.",keywords:["graphing","plotting","data","visualization","plotly"],scripts:{preprocess:"node tasks/preprocess.js",bundle:"node tasks/bundle.js",header:"node tasks/header.js",build:"npm run preprocess && npm run bundle && npm run header",cibuild:"node tasks/cibundle.js",watch:"node tasks/watch_plotly.js",lint:"cd src && jshint . || true","test-jasmine":"karma start test/jasmine/karma.conf.js","citest-jasmine":"karma start test/jasmine/karma.ciconf.js","test-image":"./tasks/test_image.sh","test-syntax":"node test/syntax_test.js",test:"npm run test-jasmine && npm test-image","start-test_dashboard":"node devtools/test_dashboard/server.js","start-image_viewer":"node devtools/image_viewer/server.js",baseline:"./tasks/baseline.sh",version:"npm run build && git add -A dist",postversion:"git push && git push --tags"},dependencies:{"3d-view":"^2.0.0","alpha-shape":"^1.0.0",arraytools:"^1.0.0","convex-hull":"^1.0.3",d3:"3.5.6","delaunay-triangulate":"^1.1.6","es6-promise":"^3.0.2","fast-isnumeric":"^1.1.1","fs-extra":"^0.26.2","gl-error2d":"^1.0.0","gl-error3d":"^1.0.0","gl-line2d":"^1.2.1","gl-line3d":"^1.0.1","gl-mat4":"^1.1.2","gl-mesh3d":"^1.0.4","gl-plot2d":"^1.1.6","gl-plot3d":"^1.3.0","gl-scatter2d":"^1.0.5","gl-scatter2d-fancy":"^1.1.1","gl-scatter3d":"^1.0.4","gl-select-box":"^1.0.1","gl-spikes2d":"^1.0.1","gl-surface3d":"^1.1.0","mouse-change":"^1.1.1","mouse-wheel":"^1.0.2",ndarray:"^1.0.16","ndarray-fill":"^1.0.1","ndarray-homography":"^1.0.0","ndarray-ops":"^1.2.2","right-now":"^1.0.0","robust-orientation":"^1.1.3","sane-topojson":"^1.2.0","superscript-text":"^1.0.0",tinycolor2:"1.1.2",topojson:"^1.6.19"},devDependencies:{ -brfs:"^1.4.1",browserify:"^12.0.1","browserify-transform-tools":"^1.5.0",ecstatic:"^1.2.0",falafel:"^1.2.0",glob:"^6.0.1","jasmine-core":"^2.3.4",jshint:"^2.8.0",karma:"^0.13.15","karma-browserify":"^4.4.1","karma-chrome-launcher":"^0.2.1","karma-coverage":"^0.5.3","karma-firefox-launcher":"^0.1.6","karma-jasmine":"^0.3.6","node-sass":"^3.4.1",open:"0.0.5","prepend-file":"^1.3.0",prettysize:"0.0.3",through2:"^2.0.0","uglify-js":"^2.5.0",watchify:"^3.6.0",xml2js:"^0.4.15"}}},{}],1001:[function(t,e,r){e.exports=["",{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],1002:[function(t,e,r){var n=t("../../plotly"),i=t("./arrow_paths"),a=t("../../plots/font_attributes"),o=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:!0,text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:o({},a,{}),opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:i.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},ax:{valType:"number",dflt:-10},ay:{valType:"number",dflt:-30},xref:{valType:"enumerated",values:["paper",n.Plots.subplotsRegistry.cartesian.idRegex.x.toString()]},x:{valType:"number"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yref:{valType:"enumerated",values:["paper",n.Plots.subplotsRegistry.cartesian.idRegex.y.toString()]},y:{valType:"number"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":1049,"../../plotly":1070,"../../plots/font_attributes":1079,"./arrow_paths":1001}],1003:[function(t,e,r){"use strict";function n(t,e){function r(e,r){return o.Lib.coerce(t,n,u.layoutAttributes,e,r)}var n={};r("opacity"),r("align"),r("bgcolor");var i=r("bordercolor"),a=o.Color.opacity(i);r("borderpad");var s=r("borderwidth"),l=r("showarrow");l&&(r("arrowcolor",a?n.bordercolor:o.Color.defaultLine),r("arrowhead"),r("arrowsize"),r("arrowwidth",2*(a&&s||1)),r("ax"),r("ay"),o.Lib.noneOrAll(t,n,["ax","ay"])),r("text",l?" ":"new text"),r("textangle"),o.Lib.coerceFont(r,"font",e.font);for(var c=["x","y"],f=0;2>f;f++){var h=c[f],p={_fullLayout:e},d=o.Axes.coerceRef(t,n,p,h),g=.5;if("paper"!==d){var m=o.Axes.getFromId(p,d);if(g=m.range[0]+g*(m.range[1]-m.range[0]),-1!==["date","category"].indexOf(m.type)&&"string"==typeof t[h]){var v;"date"===m.type?(v=o.Lib.dateTime2ms(t[h]),v!==!1&&(t[h]=v)):(m._categories||[]).length&&(v=m._categories.indexOf(t[h]),-1!==v&&(t[h]=v))}}r(h,g),l||r(h+"anchor")}return o.Lib.noneOrAll(t,n,["x","y"]),n}function i(t){var e=t._fullLayout;e.annotations.forEach(function(e){var r=o.Axes.getFromId(t,e.xref),n=o.Axes.getFromId(t,e.yref);if(r||n){var i=(e._xsize||0)/2,a=e._xshift||0,s=(e._ysize||0)/2,l=e._yshift||0,u=i-a,c=i+a,f=s-l,h=s+l;if(e.showarrow){var p=3*e.arrowsize*e.arrowwidth;u=Math.max(u,p),c=Math.max(c,p),f=Math.max(f,p),h=Math.max(h,p)}r&&r.autorange&&o.Axes.expand(r,[r.l2c(e.x)],{ppadplus:c,ppadminus:u}),n&&n.autorange&&o.Axes.expand(n,[n.l2c(e.y)],{ppadplus:h,ppadminus:f})}})}function a(t,e,r,n,i,a,o,s){var l=r-t,u=i-t,c=o-i,f=n-e,h=a-e,p=s-a,d=l*p-c*f;if(0===d)return null;var g=(u*p-c*h)/d,m=(u*f-l*h)/d;return 0>m||m>1||0>g||g>1?null:{x:t+l*g,y:e+f*g}}var o=t("../../plotly"),s=t("d3"),l=t("fast-isnumeric"),u=e.exports={};u.ARROWPATHS=t("./arrow_paths"),u.layoutAttributes=t("./attributes"),u.supplyLayoutDefaults=function(t,e){for(var r=t.annotations||[],i=e.annotations=[],a=0;at?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}X.selectAll("tspan.line").attr({y:0,x:0});var n=U.select(".annotation-math-group"),i=!n.empty(),l=o.Drawing.bBox((i?n:X).node()),c=l.width,f=l.height,h=Math.round(c+2*G),p=Math.round(f+2*G);j._w=c,j._h=f;var g=!1;if(["x","y"].forEach(function(e){var n,i=o.Axes.getFromId(t,j[e+"ref"]||e),a=(F+("x"===e?0:90))*Math.PI/180,s=h*Math.abs(Math.cos(a))+p*Math.abs(Math.sin(a)),l=j[e+"anchor"];if(i){if(!i.autorange&&(j[e]-i.range[0])*(j[e]-i.range[1])>0)return void(g=!0);N[e]=i._offset+i.l2p(j[e]),n=.5}else n=j[e],"y"===e&&(n=1-n),N[e]="x"===e?w.l+w.w*n:w.t+w.h*n;var u=0;u=j.showarrow?j["a"+e]:s*r(n,l),N[e]+=u,j["_"+e+"type"]=i&&i.type,j["_"+e+"size"]=s,j["_"+e+"shift"]=u}),g)return void U.remove();var m,v;j.showarrow&&(m=o.Lib.constrain(N.x-j.ax,1,d.width-1),v=o.Lib.constrain(N.y-j.ay,1,d.height-1)),N.x=o.Lib.constrain(N.x,1,d.width-1),N.y=o.Lib.constrain(N.y,1,d.height-1);var y=G-l.top,b=G-l.left;i?n.select("svg").attr({x:G-1,y:G}):(X.attr({x:b,y:y}),X.selectAll("tspan.line").attr({y:y,x:b})),H.call(o.Drawing.setRect,V/2,V/2,h-V,p-V),U.call(o.Drawing.setRect,Math.round(N.x-h/2),Math.round(N.y-p/2),h,p);var x="annotations["+e+"]",_=function(r,n){s.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var i=N.x+r,l=N.y+n,c=o.Lib.rotationXYMatrix(F,i,l),f=o.Lib.apply2DTransform(c),h=o.Lib.apply2DTransform2(c),p=H.attr("width")/2,d=H.attr("height")/2,g=[[i-p,l-d,i-p,l+d],[i-p,l+d,i+p,l+d],[i+p,l+d,i+p,l-d],[i+p,l-d,i-p,l-d]].map(h);if(!g.reduce(function(t,e){return t^!!a(m,v,m+1e6,v+1e6,e[0],e[1],e[2],e[3])},!1)){g.forEach(function(t){var e=a(i,l,m,v,t[0],t[1],t[2],t[3]);e&&(i=e.x,l=e.y)});var y=j.arrowwidth,b=j.arrowcolor,_=D.append("g").style({opacity:o.Color.opacity(b)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),A=_.append("path").attr("d","M"+i+","+l+"L"+m+","+v).style("stroke-width",y+"px").call(o.Color.stroke,o.Color.rgb(b));u.arrowhead(A,j.arrowhead,"end",j.arrowsize);var k=_.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(i-m)+","+(l-v),transform:"translate("+m+","+v+")"}).style("stroke-width",y+6+"px").call(o.Color.stroke,"rgba(0,0,0,0)").call(o.Color.fill,"rgba(0,0,0,0)");if(t._context.editable){var M,E,T;o.Fx.dragElement({element:k.node(),prepFn:function(){E=Number(U.attr("x")),T=Number(U.attr("y")),M={},I&&I.autorange&&(M[I._name+".autorange"]=!0),O&&O.autorange&&(M[O._name+".autorange"]=!0)},moveFn:function(t,e){_.attr("transform","translate("+t+","+e+")");var r=f(E,T),n=r[0]+t,i=r[1]+e;U.call(o.Drawing.setPosition,n,i),M[x+".x"]=I?j.x+t/I._m:(m+t-w.l)/w.w,M[x+".y"]=O?j.y+e/O._m:1-(v+e-w.t)/w.h,B.attr({transform:"rotate("+F+","+n+","+i+")"})},doneFn:function(e){if(e){o.relayout(t,M);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};j.showarrow&&_(0,0);var A=o.Lib.rotationXYMatrix(F,N.x,N.y),k=o.Lib.apply2DTransform(A);if(t._context.editable){var M,E,T;o.Fx.dragElement({element:U.node(),prepFn:function(){M=Number(U.attr("x")),E=Number(U.attr("y")),T={}},moveFn:function(t,e){U.call(o.Drawing.setPosition,M+t,E+e);var r="pointer";if(j.showarrow)T[x+".ax"]=j.ax+t,T[x+".ay"]=j.ay+e,_(t,e);else{if(I)T[x+".x"]=j.x+t/I._m;else{var n=j._xsize/w.w,i=j.x+j._xshift/w.w-n/2;T[x+".x"]=o.Fx.dragAlign(i+t/w.w,n,0,1,j.xanchor)}if(O)T[x+".y"]=j.y+e/O._m;else{var a=j._ysize/w.h,s=j.y-j._yshift/w.h-a/2;T[x+".y"]=o.Fx.dragAlign(s-e/w.h,a,0,1,j.yanchor)}I&&O||(r=o.Fx.dragCursors(I?.5:T[x+".x"],O?.5:T[x+".y"],j.xanchor,j.yanchor))}var l=k(M,E),u=l[0]+t,c=l[1]+e;U.call(o.Drawing.setPosition,u,c),B.attr({transform:"rotate("+F+","+u+","+c+")"}),o.Fx.setCursor(U,r)},doneFn:function(e){if(o.Fx.setCursor(U),e){o.relayout(t,T);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var h,p=t.layout,d=t._fullLayout;if(!l(e)||-1===e){if(!e&&Array.isArray(i))return p.annotations=i,u.supplyLayoutDefaults(p,d),void u.drawAll(t);if("remove"===i)return delete p.annotations,d.annotations=[],void u.drawAll(t);if(r&&"add"!==i){for(h=0;he;h--)d._infolayer.selectAll('.annotation[data-index="'+(h-1)+'"]').attr("data-index",String(h)),u.draw(t,h)}}d._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var m=p.annotations[e],v=d.annotations[e];if(m){var y={xref:m.xref,yref:m.yref},b={};"string"==typeof r&&r?b[r]=i:o.Lib.isPlainObject(r)&&(b=r);var x=Object.keys(b);for(h=0;hh;h++){var k=A[h];if(void 0===b[k]&&void 0!==m[k]){var M=o.Axes.getFromId(t,o.Axes.coerceRef(y,{},t,k)),E=o.Axes.getFromId(t,o.Axes.coerceRef(m,{},t,k)),T=m[k],L=v["_"+k+"type"];if(void 0!==b[k+"ref"]){var S="auto"===m[k+"anchor"],C="x"===k?w.w:w.h,P=(v["_"+k+"size"]||0)/(2*C);if(M&&E)T=(T-M.range[0])/(M.range[1]-M.range[0]),T=E.range[0]+T*(E.range[1]-E.range[0]);else if(M){if(T=(T-M.range[0])/(M.range[1]-M.range[0]),T=M.domain[0]+T*(M.domain[1]-M.domain[0]),S){var z=T+P,R=T-P;2/3>T+R?T=R:T+z>4/3&&(T=z)}}else E&&(S&&(1/3>T?T+=P:T>2/3&&(T-=P)),T=(T-E.domain[0])/(E.domain[1]-E.domain[0]),T=E.range[0]+T*(E.range[1]-E.range[0]))}E&&E===M&&L&&("log"===L&&"log"!==E.type?T=Math.pow(10,T):"log"!==L&&"log"===E.type&&(T=T>0?Math.log(T)/Math.LN10:void 0)),m[k]=T}}var j=n(m,d);d.annotations[e]=j;var I=o.Axes.getFromId(t,j.xref),O=o.Axes.getFromId(t,j.yref),N={x:0,y:0},F=+j.textangle||0,D=d._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",j.opacity).on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:m,fullAnnotation:j})}),B=D.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),U=B.append("svg").call(o.Drawing.setPosition,0,0),V=j.borderwidth,q=j.borderpad,G=V+q,H=U.append("rect").attr("class","bg").style("stroke-width",V+"px").call(o.Color.stroke,j.bordercolor).call(o.Color.fill,j.bgcolor),Y=j.font,X=U.append("text").classed("annotation",!0).attr("data-unformatted",j.text).text(j.text);t._context.editable?X.call(o.util.makeEditable,U).call(c).on("edit",function(r){j.text=r,this.attr({"data-unformatted":j.text}),this.call(c);var n={};n["annotations["+e+"].text"]=j.text,I&&I.autorange&&(n[I._name+".autorange"]=!0),O&&O.autorange&&(n[O._name+".autorange"]=!0),o.relayout(t,n)}):X.call(c),B.attr({transform:"rotate("+F+","+N.x+","+N.y+")"}).call(o.Drawing.setPosition,N.x,N.y)}},u.arrowhead=function(t,e,r,n){l(n)||(n=1);var i=t.node(),a=u.ARROWPATHS[e||0];if(a){"string"==typeof r&&r||(r="end");var c,f,h,p,d=(o.Drawing.getPx(t,"stroke-width")||1)*n,g=t.style("stroke")||o.Color.defaultLine,m=t.style("stroke-opacity")||1,v=r.indexOf("start")>=0,y=r.indexOf("end")>=0,b=a.backoff*d;if("line"===i.nodeName){if(c={x:+t.attr("x1"),y:+t.attr("y1")},f={x:+t.attr("x2"),y:+t.attr("y2")},h=Math.atan2(c.y-f.y,c.x-f.x),p=h+Math.PI,b){var x=b*Math.cos(h),_=b*Math.sin(h);v&&(c.x-=x,c.y-=_,t.attr({x1:c.x,y1:c.y})),y&&(f.x+=x,f.y+=_,t.attr({x2:f.x,y2:f.y}))}}else if("path"===i.nodeName){var w=i.getTotalLength(),A="";if(v){var k=i.getPointAtLength(0),M=i.getPointAtLength(.1);h=Math.atan2(k.y-M.y,k.x-M.x),c=i.getPointAtLength(Math.min(b,w)),b&&(A="0px,"+b+"px,")}if(y){var E=i.getPointAtLength(w),T=i.getPointAtLength(w-.1);if(p=Math.atan2(E.y-T.y,E.x-T.x),f=i.getPointAtLength(Math.max(0,w-b)),b){var L=A?2*b:b;A+=w-L+"px,"+w+"px"}}else A&&(A+=w+"px");A&&t.style("stroke-dasharray",A)}var S=function(r,n){e>5&&(n=0),s.select(i.parentElement).append("path").attr({"class":t.attr("class"),d:a.path,transform:"translate("+r.x+","+r.y+")rotate("+180*n/Math.PI+")scale("+d+")"}).style({fill:g,opacity:m,"stroke-width":0})};v&&S(c,h),y&&S(f,p)}},u.calcAutorange=function(t){var e=t._fullLayout,r=e.annotations;if(r.length&&t._fullData.length){var n={};r.forEach(function(t){n[t.xref]=!0,n[t.yref]=!0});var a=o.Axes.list(t).filter(function(t){return t.autorange&&n[t._id]});if(a.length)return o.Lib.syncOrAsync([u.drawAll,i],t)}}},{"../../plotly":1070,"./arrow_paths":1001,"./attributes":1002,d3:64,"fast-isnumeric":72}],1004:[function(t,e,r){r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff"},{}],1005:[function(t,e,r){"use strict";function n(t){if(a(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var o=0;o=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults,o.defaultLine=s.defaultLine,o.lightLine=s.lightLine,o.background=s.background,o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||o.background).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},s={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return i(s).toRgbString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;el&&(a[1]-=(G-l)/2)):r.node()&&!r.classed("js-placeholder")&&(G=i.Drawing.bBox(e.node()).height),G){if(G+=5,"top"===o.titleside)O.domain[1]-=G/u._size.h,a[1]*=-1;else{O.domain[0]+=G/u._size.h;var c=Math.max(1,r.selectAll("tspan.line").size());a[1]+=(1-c)*l}e.attr("transform","translate("+a+")"),O.setScale()}}V.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(u._size.h*(1-O.domain[1]))+")");var m=V.select(".cbfills").selectAll("rect.cbfill").data(p);m.enter().append("rect").classed("cbfill",!0).style("stroke","none"),m.exit().remove(),m.each(function(t,e){var r=[0===e?f[0]:(p[e]+p[e-1])/2,e===p.length-1?f[1]:(p[e]+p[e+1])/2].map(O.c2p).map(Math.round);e!==p.length-1&&(r[1]+=r[1]>r[0]?1:-1),n.select(this).attr({x:C,width:Math.max(A,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2)}).style("fill",g(t))});var v=V.select(".cblines").selectAll("path.cbline").data(o.line.color&&o.line.width?h:[]);return v.enter().append("path").classed("cbline",!0),v.exit().remove(),v.each(function(t){n.select(this).attr("d","M"+C+","+(Math.round(O.c2p(t))+o.line.width/2%1)+"h"+A).call(i.Drawing.lineGroupStyle,o.line.width,d(t),o.line.dash)}),O._axislayer.selectAll("g."+O._id+"tick,path").remove(),O._pos=C+A+(o.outlinewidth||0)/2-("outside"===o.ticks?1:0),O.side="right",i.Axes.doTicks(t,O)}function l(){var r=A+o.outlinewidth/2+i.Drawing.bBox(O._axislayer.node()).width;if(x=q.select("text"),x.node()&&!x.classed("js-placeholder")){var n,a=q.select(".h"+O._id+"title-math-group").node();n=a&&-1!==["top","bottom"].indexOf(o.titleside)?i.Drawing.bBox(a).width:i.Drawing.bBox(q.node()).right-C-u._size.l,r=Math.max(r,n)}var s=2*o.xpad+r+o.borderwidth+o.outlinewidth/2,l=R-j;V.select(".cbbg").attr({x:C-o.xpad-(o.borderwidth+o.outlinewidth)/2,y:j-L,width:Math.max(s,2),height:Math.max(l+2*L,2)}).call(i.Color.fill,o.bgcolor).call(i.Color.stroke,o.bordercolor).style({"stroke-width":o.borderwidth}),V.selectAll(".cboutline").attr({x:C,y:j+o.ypad+("top"===o.titleside?G:0),width:Math.max(A,2),height:Math.max(l-2*o.ypad-G,2)}).call(i.Color.stroke,o.outlinecolor).style({fill:"None","stroke-width":o.outlinewidth});var c=({center:.5,right:1}[o.xanchor]||0)*s;V.attr("transform","translate("+(u._size.l-c)+","+u._size.t+")"),i.Plots.autoMargin(t,e,{x:o.x,y:o.y,l:s*({right:1,center:.5}[o.xanchor]||0),r:s*({left:1,center:.5}[o.xanchor]||0),t:l*({bottom:1,middle:.5}[o.yanchor]||0),b:l*({top:1,middle:.5}[o.yanchor]||0)})}var u=t._fullLayout;if("function"!=typeof o.fillcolor&&"function"!=typeof o.line.color)return void u._infolayer.selectAll("g."+e).remove();var c,f=n.extent(("function"==typeof o.fillcolor?o.fillcolor:o.line.color).domain()),h=[],p=[],d="function"==typeof o.line.color?o.line.color:function(){return o.line.color},g="function"==typeof o.fillcolor?o.fillcolor:function(){return o.fillcolor},m=o.levels.end+o.levels.size/100,v=o.levels.size,y=1.001*f[0]-.001*f[1],b=1.001*f[1]-.001*f[0];for(c=o.levels.start;0>(c-m)*v;c+=v)c>y&&b>c&&h.push(c);if("function"==typeof o.fillcolor)if(o.filllevels)for(m=o.filllevels.end+o.filllevels.size/100,v=o.filllevels.size,c=o.filllevels.start;0>(c-m)*v;c+=v)c>f[0]&&c1){var U=Math.pow(10,Math.floor(Math.log(B)/Math.LN10));F*=U*i.Lib.roundUp(B/U,[2,5,10]),(Math.abs(o.levels.start)/o.levels.size+1e-6)%1<2e-6&&(O.tick0=0)}O.dtick=F}O.domain=[z+S,z+E-S],O.setScale();var V=u._infolayer.selectAll("g."+e).data([0]);V.enter().append("g").classed(e,!0).each(function(){var t=n.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0)}),V.attr("transform","translate("+Math.round(u._size.l)+","+Math.round(u._size.t)+")");var q=V.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(u._size.l)+",-"+Math.round(u._size.t)+")");O._axislayer=V.select(".cbaxis");var G=0;-1!==["top","bottom"].indexOf(o.titleside)&&i.Titles.draw(t,O._id+"title");var H=i.Lib.syncOrAsync([i.Plots.previousPromises,s,i.Plots.previousPromises,l],t);if(H&&H.then&&(t._promises||[]).push(H),t._context.editable){var Y,X,W;i.Fx.dragElement({element:V.node(),prepFn:function(){Y=V.attr("transform"),i.Fx.setCursor(V)},moveFn:function(e,r){var n=t._fullLayout._size;V.attr("transform",Y+" translate("+e+","+r+")"),X=i.Fx.dragAlign(P+e/n.w,k,0,1,o.xanchor),W=i.Fx.dragAlign(z-r/n.h,E,0,1,o.yanchor);var a=i.Fx.dragCursors(X,W,o.xanchor,o.yanchor);i.Fx.setCursor(V,a)},doneFn:function(r){if(i.Fx.setCursor(V),r&&void 0!==X&&void 0!==W){var n,a=e.substr(2);t._fullData.some(function(t){return t.uid===a?(n=t.index,!0):void 0}),i.restyle(t,{"colorbar.x":X,"colorbar.y":W},n)}}})}return H}var o={};return Object.keys(a).forEach(function(t){o[t]=null}),o.fillcolor=null,o.line={color:null,width:null,dash:null},o.levels={start:null,end:null,size:null},o.filllevels=null,Object.keys(o).forEach(function(t){r[t]=function(e){return arguments.length?(o[t]=i.Lib.isPlainObject(o[t])?i.Lib.extendFlat(o[t],e):e,r):o[t]}}),r.options=function(t){return Object.keys(t).forEach(function(e){"function"==typeof r[e]&&r[e](t[e])}),r},r._opts=o,r}},{"../../plotly":1070,"./attributes":1006,d3:64}],1009:[function(t,e,r){"use strict";e.exports=function(t){return"object"==typeof t.colorbar&&null!==t.colorbar}},{}],1010:[function(t,e,r){"use strict";r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.draw=t("./draw"),r.hasColorbar=t("./has_colorbar")},{"./attributes":1006,"./defaults":1007,"./draw":1008,"./has_colorbar":1009}],1011:[function(t,e,r){e.exports={zauto:{valType:"boolean",dflt:!0},zmin:{valType:"number",dflt:null},zmax:{valType:"number",dflt:null},colorscale:{valType:"colorscale"},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!0},_deprecated:{scl:{valType:"colorscale"},reversescl:{valType:"boolean"}}}},{}],1012:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./scales"),a=t("./flip_scale");e.exports=function(t,e,r,o){var s,l;r?(s=n.nestedProperty(t,r).get(),l=n.nestedProperty(t._input,r).get()):(s=t,l=t._input);var u=s[o+"auto"],c=s[o+"min"],f=s[o+"max"],h=s.colorscale;(u!==!1||void 0===c)&&(c=n.aggNums(Math.min,null,e)),(u!==!1||void 0===f)&&(f=n.aggNums(Math.max,null,e)),c===f&&(c-=.5,f+=.5),s[o+"min"]=c,s[o+"max"]=f,l[o+"min"]=c,l[o+"max"]=f,s.autocolorscale&&(h=0>c*f?i.RdBu:c>=0?i.Reds:i.Blues,l.colorscale=h,s.reversescale&&(h=a(h)),s.colorscale=h)}},{"../../lib":1053,"./flip_scale":1015,"./scales":1022}],1013:[function(t,e,r){var n=t("./scales");e.exports=n.RdBu},{"./scales":1022}],1014:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,u,c){var f=c.prefix,h=c.cLetter,p=f.slice(0,f.length-1),d=f?i.nestedProperty(t,p).get()||{}:t,g=f?i.nestedProperty(e,p).get()||{}:e,m=d[h+"min"],v=d[h+"max"],y=d.colorscale,b=n(m)&&n(v)&&v>m;u(f+h+"auto",!b),u(f+h+"min"),u(f+h+"max");var x;void 0!==y&&(x=!s(y)),u(f+"autocolorscale",x);var _=u(f+"colorscale"),w=u(f+"reversescale");if(w&&(g.colorscale=l(_)),"marker.line."!==f){var A;f&&(A=a(d));var k=u(f+"showscale",A);k&&o(d,g,r)}}},{"../../lib":1053,"../colorbar/defaults":1007,"../colorbar/has_colorbar":1009,"./flip_scale":1015,"./is_valid_scale":1019,"fast-isnumeric":72}],1015:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=new Array(r),i=r-1,a=0;i>=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],1016:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":1013,"./is_valid_scale_array":1020,"./scales":1022}],1017:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;lf;f++)s=t[f],u[f]=e+s[0]*(r-e),c[f]=s[1];var h=n.scale.linear().domain(u).interpolate(n.interpolateRgb).range(c);return function(t){return a(t)?h(t):i(t).isValid()?t:o.defaultLine}}},{"../color":1005,d3:64,"fast-isnumeric":72,tinycolor2:998}],1022:[function(t,e,r){e.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YIGnBu:[[0,"rgb(8, 29, 88)"],[.125,"rgb(37, 52, 148)"],[.25,"rgb(34, 94, 168)"],[.375,"rgb(29, 145, 192)"],[.5,"rgb(65, 182, 196)"],[.625,"rgb(127, 205, 187)"],[.75,"rgb(199, 233, 180)"],[.875,"rgb(237, 248, 217)"],[1,"rgb(255, 255, 217)"]],Greens:[[0,"rgb(0, 68, 27)"],[.125,"rgb(0, 109, 44)"],[.25,"rgb(35, 139, 69)"],[.375,"rgb(65, 171, 93)"],[.5,"rgb(116, 196, 118)"],[.625,"rgb(161, 217, 155)"],[.75,"rgb(199, 233, 192)"],[.875,"rgb(229, 245, 224)"],[1,"rgb(247, 252, 245)"]],YIOrRd:[[0,"rgb(128, 0, 38)"],[.125,"rgb(189, 0, 38)"],[.25,"rgb(227, 26, 28)"],[.375,"rgb(252, 78, 42)"],[.5,"rgb(253, 141, 60)"],[.625,"rgb(254, 178, 76)"],[.75,"rgb(254, 217, 118)"],[.875,"rgb(255, 237, 160)"],[1,"rgb(255, 255, 204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5, 10, 172)"],[.35,"rgb(106, 137, 247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220, 170, 132)"],[.7,"rgb(230, 145, 90)"],[1,"rgb(178, 10, 28)"]],Reds:[[0,"rgb(220, 220, 220)"],[.2,"rgb(245, 195, 157)"],[.4,"rgb(245, 160, 105)"],[1,"rgb(178, 10, 28)"]],Blues:[[0,"rgb(5, 10, 172)"],[.35,"rgb(40, 60, 190)"],[.5,"rgb(70, 100, 245)"],[.6,"rgb(90, 120, 245)"],[.7,"rgb(106, 137, 247)"],[1,"rgb(220, 220, 220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0, 0, 200)"],[.25,"rgb(0, 25, 255)"],[.375,"rgb(0, 152, 255)"],[.5,"rgb(44, 255, 150)"],[.625,"rgb(151, 255, 0)"],[.75,"rgb(255, 234, 0)"],[.875,"rgb(255, 111, 0)"],[1,"rgb(255, 0, 0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]], -Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],1023:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(i*i+o*o,p/2),c=Math.pow(s*s+l*l,p/2),f=(c*c*i-u*u*s)*n,h=(c*c*o-u*u*l)*n,d=3*c*(u+c),g=3*u*(u+c);return[[a.round(e[0]+(d&&f/d),2),a.round(e[1]+(d&&h/d),2)],[a.round(e[0]-(g&&f/g),2),a.round(e[1]-(g&&h/g),2)]]}var i=t("../../plotly"),a=t("d3"),o=t("fast-isnumeric"),s=e.exports={};s.font=function(t,e,r,n){e&&e.family&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(i.Color.fill,n)},s.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},s.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},s.setRect=function(t,e,r,n,i){t.call(s.setPosition,e,r).call(s.setSize,n,i)},s.translatePoints=function(t,e,r){t.each(function(t){var n=t.xp||e.c2p(t.x),i=t.yp||r.c2p(t.y),s=a.select(this);o(n)&&o(i)?"text"===this.nodeName?s.attr("x",n).attr("y",i):s.attr("transform","translate("+n+","+i+")"):s.remove()})},s.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},s.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:1>e?1:Math.round(e):r||0},s.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var o=(((t||[])[0]||{}).trace||{}).line||{},l=e||o.width||0,u=n||o.dash||"";a.select(this).call(i.Color.stroke,r||o.color).call(s.dashLine,u,l)})},s.dashLine=function(t,e,r){var n=Math.max(r,3);"solid"===e?e="":"dot"===e?e=n+"px,"+n+"px":"dash"===e?e=3*n+"px,"+3*n+"px":"longdash"===e?e=5*n+"px,"+5*n+"px":"dashdot"===e?e=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===e&&(e=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},s.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=a.select(this);try{r.call(i.Color.fill,e[0].trace.fillcolor)}catch(n){console.log(n,t),r.remove()}})};var l=t("./symbol_defs");s.symbolNames=[],s.symbolFuncs=[],s.symbolNeedLines={},s.symbolNoDot={},s.symbolList=[],Object.keys(l).forEach(function(t){var e=l[t];s.symbolList=s.symbolList.concat([e.n,t,e.n+100,t+"-open"]),s.symbolNames[e.n]=t,s.symbolFuncs[e.n]=e.f,e.needLine&&(s.symbolNeedLines[e.n]=!0),e.noDot?s.symbolNoDot[e.n]=!0:s.symbolList=s.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var u=s.symbolNames.length,c="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";s.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=s.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=u||t>=400?0:Math.floor(Math.max(t,0))},s.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=r.line;if(i.Plots.traceIs(e,"symbols")){var o=i.Scatter.getBubbleSizeFn(e);t.attr("d",function(t){var n;n="various"===t.ms||"various"===r.size?3:i.Scatter.isBubble(e)?o(t.ms):(r.size||6)/2,t.mrc=n;var a=s.symbolNumber(t.mx||r.symbol)||0,l=a%100;return t.om=a%200>=100,s.symbolFuncs[l](n)+(a>=200?c:"")}).style("opacity",function(t){return(t.mo+1||r.opacity+1)-1})}var l=(e._input||{}).marker||{},u=s.tryColorscale(r,l,""),f=s.tryColorscale(r,l,"line.");t.each(function(t){var e,o,s;t.so?(s=n.outlierwidth,o=n.outliercolor,e=r.outliercolor):(s=(t.mlw+1||n.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,o="mlc"in t?t.mlcc=f(t.mlc):Array.isArray(n.color)?i.Color.defaultLine:n.color,e="mc"in t?t.mcc=u(t.mc):Array.isArray(r.color)?i.Color.defaultLine:r.color||"rgba(0,0,0,0)");var l=a.select(this);t.om?l.call(i.Color.stroke,e).style({"stroke-width":(s||1)+"px",fill:"none"}):(l.style("stroke-width",s+"px").call(i.Color.fill,e),s&&l.call(i.Color.stroke,o))})}},s.tryColorscale=function(t,e,r){var n=i.Lib.nestedProperty(t,r+"color").get(),a=i.Lib.nestedProperty(t,r+"colorscale").get(),s=i.Lib.nestedProperty(t,r+"cauto").get(),l=i.Lib.nestedProperty(t,r+"cmin"),u=i.Lib.nestedProperty(t,r+"cmax"),c=l.get(),f=u.get();return a&&Array.isArray(n)?(!s&&o(c)&&o(f)||(c=1/0,f=-(1/0),n.forEach(function(t){o(t)&&(c>t&&(c=+t),t>f&&(f=+t))}),c>f&&(c=0,f=1),l.set(c),u.set(f),i.Lib.nestedProperty(e,r+"cmin").set(c),i.Lib.nestedProperty(e,r+"cmax").set(f)),i.Colorscale.makeScaleFunction(a,c,f)):i.Lib.identity};var f={start:1,end:-1,middle:0,bottom:1,top:-1},h=1.3;s.textPointStyle=function(t,e){t.each(function(t){var r=a.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var l=t.tp||e.textposition,u=-1!==l.indexOf("top")?"top":-1!==l.indexOf("bottom")?"bottom":"middle",c=-1!==l.indexOf("left")?"end":-1!==l.indexOf("right")?"start":"middle",p=t.ts||e.textfont.size,d=t.mrc?t.mrc/.8+1:0;p=o(p)&&p>0?p:0,r.call(s.font,t.tf||e.textfont.family,p,t.tc||e.textfont.color).attr("text-anchor",c).text(n).call(i.util.convertToTspans);var g=a.select(this.parentNode),m=r.selectAll("tspan.line"),v=((m[0].length||1)-1)*h+1,y=f[c]*d,b=.75*p+f[u]*d+(f[u]-1)*v*p/2;g.attr("transform","translate("+y+","+b+")"),v>1&&m.attr({x:r.attr("x"),y:r.attr("y")})})};var p=.5;s.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,i="M"+t[0],a=[];for(r=1;rr;r++)o.push(n(t[r-1],t[r],t[r+1],e));for(o.push(n(t[a-1],t[a],t[0],e)),r=1;a>=r;r++)i+="C"+o[r-1][1]+" "+o[r][0]+" "+t[r];return i+="C"+o[a][1]+" "+o[0][0]+" "+t[0]+"Z"};var d={hv:function(t,e){return"H"+a.round(e[0],2)+"V"+a.round(e[1],2)},vh:function(t,e){return"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},hvh:function(t,e){return"H"+a.round((t[0]+e[0])/2,2)+"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},vhv:function(t,e){return"V"+a.round((t[1]+e[1])/2,2)+"H"+a.round(e[0],2)+"V"+a.round(e[1],2)}},g=function(t,e){return"L"+a.round(e[0],2)+","+a.round(e[1],2)};s.steps=function(t){var e=d[t]||g;return function(t){for(var r="M"+a.round(t[0][0],2)+","+a.round(t[0][1],2),n=1;n=v&&(a.selectAll("[data-bb]").attr("data-bb",null),m=[]),t.setAttribute("data-bb",m.length),m.push(u),i.Lib.extendFlat({},u)},s.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=a.select("base");n.size()&&n.attr("href")&&(r=window.location.href+r),t.attr("clip-path","url("+r+")")}},{"../../plotly":1070,"./symbol_defs":1024,d3:64,"fast-isnumeric":72}],1024:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+","+r+"H"+e+"L0,-"+i+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+",-"+r+"H"+e+"L0,"+i+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M"+r+",-"+e+"V"+e+"L-"+i+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+r+",-"+e+"V"+e+"L"+i+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(t*-.309,2),o=n.round(.809*t,2);return"M"+e+","+a+"L"+r+","+o+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(e*-.309,2),u=n.round(.118*e,2),c=n.round(.809*e,2),f=n.round(.382*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+f+"L-"+o+","+c+"L-"+a+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:64}],1025:[function(t,e,r){e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],1026:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=a.visible&&-1!==["linear","log"].indexOf(r.type),u=[];if(l){for(var c=s(a),f=0;fo;o++)a[o]={x:r[o],y:n[o]};return a[0].trace=t,s.calc({calcdata:[a],_fullLayout:e}),a},s.plot=function(t,e,r){var s=e.x(),l=e.y();e.plot.select(".errorlayer").selectAll("g.errorbars").remove();var u;e.plot.select(".errorlayer").selectAll("g.errorbars").data(r).enter().append("g").attr("class","errorbars").each(function(t){var e=t[0].trace,r=e.error_x,c=e.error_y,f=i.Scatter.hasMarkers(e)&&e.marker.maxdisplayed>0;(c.visible||r.visible)&&a.select(this).selectAll("g").data(i.Lib.identity).enter().append("g").each(function(t){u=n(t,s,l);var e,i=a.select(this);if(!f||t.vis){if(c.visible&&o(u.x)&&o(u.yh)&&o(u.ys)){var h=c.width;e="M"+(u.x-h)+","+u.yh+"h"+2*h+"m-"+h+",0V"+u.ys,u.noYS||(e+="m-"+h+",0h"+2*h),i.append("path").classed("yerror",!0).attr("d",e)}if(r.visible&&o(u.y)&&o(u.xh)&&o(u.xs)){var p=(r.copy_ystyle?c:r).width;e="M"+u.xh+","+(u.y-p)+"v"+2*p+"m0,-"+p+"H"+u.xs,u.noXS||(e+="m0,-"+p+"v"+2*p),i.append("path").classed("xerror",!0).attr("d",e)}}})})},s.style=function(t){a.select(t).selectAll("g.errorbars").each(function(t){var e=a.select(this),r=t[0].trace,n=r.error_y||{},o=r.error_x||{};e.selectAll("g path.yerror").style("stroke-width",n.thickness+"px").call(i.Color.stroke,n.color),o.copy_ystyle&&(o=n),e.selectAll("g path.xerror").style("stroke-width",o.thickness+"px").call(i.Color.stroke,o.color)})},s.hoverInfo=function(t,e,r){e.error_y.visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),e.error_x.visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}},{"../../plotly":1070,"./attributes":1025,"./calc":1026,"./defaults":1028,d3:64,"fast-isnumeric":72}],1030:[function(t,e,r){var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:a({},n,{}),traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":1049,"../../plots/font_attributes":1079,"../color/attributes":1004}],1031:[function(t,e,r){"use strict";function n(t){return t.visible&&o.Plots.traceIs(t,"showLegend")}function i(t){return-1!==(t.traceorder||"").indexOf("grouped")}function a(t){return-1!==(t.traceorder||"").indexOf("reversed")}var o=t("../../plotly"),s=t("d3"),l=e.exports={};l.layoutAttributes=t("./attributes"),l.supplyLayoutDefaults=function(t,e,r){function s(t,e){return o.Lib.coerce(c,f,l.layoutAttributes,t,e)}for(var u,c=t.legend||{},f=e.legend={},h=0,p="normal",d=0;d1);g!==!1&&(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),o.Lib.coerceFont(s,"font",e.font),s("traceorder",p),i(e.legend)&&s("tracegroupgap"),s("x"),s("xanchor"),s("y"),s("yanchor"),o.Lib.noneOrAll(c,f,["x","y"]))},l.lines=function(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,n=o.Scatter.hasLines(e),i=s.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);i.enter().append("path").classed("js-fill",!0),i.exit().remove(),i.attr("d","M5,0h30v6h-30z").call(o.Drawing.fillGroupStyle);var a=s.select(this).select(".legendlines").selectAll("path").data(n?[t]:[]);a.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),a.exit().remove(),a.call(o.Drawing.lineGroupStyle)},l.points=function(t){function e(t,e,r){var n=o.Lib.nestedProperty(l,t).get(),i=Array.isArray(n)&&e?e(n):n;if(r){if(ir[1])return r[1]}return i}function r(t){return t[0]}var n,i,a=t[0],l=a.trace,u=o.Scatter.hasMarkers(l),c=o.Scatter.hasText(l),f=o.Scatter.hasLines(l);if(u||c||f){var h={},p={};u&&(h.mc=e("marker.color",r),h.mo=e("marker.opacity",o.Lib.mean,[.2,1]),h.ms=e("marker.size",o.Lib.mean,[2,16]),h.mlc=e("marker.line.color",r),h.mlw=e("marker.line.width",o.Lib.mean,[0,5]),p.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),f&&(p.line={width:e("line.width",r,[0,10])}),c&&(h.tx="Aa",h.tp=e("textposition",r),h.ts=10,h.tc=e("textfont.color",r),h.tf=e("textfont.family",r)),n=[o.Lib.minExtend(a,h)],i=o.Lib.minExtend(l,p)}var d=s.select(this).select("g.legendpoints"),g=d.selectAll("path.scatterpts").data(u?n:[]);g.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),g.exit().remove(),g.call(o.Drawing.pointStyle,i),u&&(n[0].mrc=3);var m=d.selectAll("g.pointtext").data(c?n:[]);m.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),m.exit().remove(),m.selectAll("text").call(o.Drawing.textPointStyle,i)},l.bars=function(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},i=s.select(this).select("g.legendpoints").selectAll("path.legendbar").data(o.Plots.traceIs(e,"bar")?[t]:[]);i.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),i.exit().remove(),i.each(function(t){var e=(t.mlw+1||n.width+1)-1,i=s.select(this);i.style("stroke-width",e+"px").call(o.Color.fill,t.mc||r.color),e&&i.call(o.Color.stroke,t.mlc||n.color)})},l.boxes=function(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendbox").data(o.Plots.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(t){var r=(t.lw+1||e.line.width+1)-1,n=s.select(this);n.style("stroke-width",r+"px").call(o.Color.fill,t.fc||e.fillcolor),r&&n.call(o.Color.stroke,t.lc||e.line.color)})},l.pie=function(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendpie").data(o.Plots.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(o.Pie.styleOne,t[0],e)},l.style=function(t){t.each(function(t){var e=s.select(this),r=e.selectAll("g.legendfill").data([t]);r.enter().append("g").classed("legendfill",!0);var n=e.selectAll("g.legendlines").data([t]);n.enter().append("g").classed("legendlines",!0);var i=e.selectAll("g.legendsymbols").data([t]);i.enter().append("g").classed("legendsymbols",!0),i.style("opacity",t[0].trace.opacity),i.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(l.bars).each(l.boxes).each(l.pie).each(l.lines).each(l.points)},l.texts=function(t,e,r,n,i){function a(t){o.util.convertToTspans(t,function(){e.firstRender&&l.repositionLegend(e,i)}),t.selectAll("tspan.line").attr({x:t.attr("x")})}var u=e._fullLayout,c=r[0].trace,f=o.Plots.traceIs(c,"pie"),h=c.index,p=f?r[0].label:c.name,d=s.select(t).selectAll("text.legendtext").data([0]);d.enter().append("text").classed("legendtext",!0),d.attr({x:40,y:0}).style("text-anchor","start").call(o.Drawing.font,u.legend.font).text(p).attr({"data-unformatted":p}),e._context.editable&&!f?d.call(o.util.makeEditable).call(a).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(a),this.text()||(t=" "),o.restyle(e,"name",t,h)}):d.call(a)},l.getLegendData=function(t,e){function r(t,r){if(""!==t&&i(e))-1===g.indexOf(t)?(g.push(t),m=!0,d[t]=[[r]]):d[t].push([r]);else{var n="~~i"+y;g.push(n),d[n]=[[r]],y++}}var s,l,u,c,f,h,p,d={},g=[],m=!1,v={},y=0;for(f=0;ff;f++)b=d[g[f]],x[f]=a(e)?b.reverse():b;else{for(x=[new Array(_)],f=0;_>f;f++)b=d[g[f]][0],x[0][a(e)?_-f-1:f]=b;_=1}return e._lgroupsLength=_,x},l.draw=function(t){var e=t._fullLayout;if(e._infolayer&&t.calcdata){var r=e.legend,n=e.showlegend&&l.getLegendData(t.calcdata,r),a=e.hiddenlabels||[];if(!e.showlegend||!n.length)return e._infolayer.selectAll(".legend").remove(),void o.Plots.autoMargin(t,"legend");"undefined"==typeof t.firstRender?t.firstRender=!0:t.firstRender&&(t.firstRender=!1);var u=e._infolayer.selectAll("svg.legend").data([0]);u.enter(0).append("svg").attr("class","legend");var c=u.selectAll("rect.bg").data([0]);c.enter(0).append("rect").attr("class","bg"),c.call(o.Color.stroke,r.bordercolor).call(o.Color.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px");var f=u.selectAll("g.groups").data(n);f.enter().append("g").attr("class","groups"),f.exit().remove(),i(r)&&f.attr("transform",function(t,e){return"translate(0,"+e*r.tracegroupgap+")"});var h=f.selectAll("g.traces").data(o.Lib.identity);if(h.enter().append("g").attr("class","traces"),h.exit().remove(),h.call(l.style).style("opacity",function(t){var e=t[0].trace;return o.Plots.traceIs(e,"pie")?-1!==a.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(e,r){l.texts(this,t,e,r,h);var n=s.select(this).selectAll("rect").data([0]);n.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(o.Color.fill,"rgba(0,0,0,0)"),n.on("click",function(){if(!t._dragged){var r,n,i=t._fullData,s=e[0].trace,l=s.legendgroup,u=[];if(o.Plots.traceIs(s,"pie")){var c=e[0].label,f=a.slice(),h=f.indexOf(c);-1===h?f.push(c):f.splice(h,1),o.relayout(t,"hiddenlabels",f)}else{if(""===l)u=[s.index];else for(var p=0;ptspan"),d=1.3*a.font.size,g=p[0].length||1,m=h.node()&&o.Drawing.bBox(h.node()).width,v=i.select("g[class*=math-group]");if(!n.showlegend)return void i.remove();if(v.node()){var y=o.Drawing.bBox(v.node());d=y.height,m=y.width,v.attr("transform","translate(0,"+d/4+")")}else e=d*(.3+(1-g)/2),h.attr("y",e),p.attr("y",e);r=Math.max(d*g,16)+3,i.attr("transform","translate("+l+","+(5+l+c+r/2)+")"),f.attr({x:0,y:-r/2,height:r}),c+=r,u=Math.max(u,m||0)}),i(a)&&(c+=(a._lgroupsLength-1)*a.tracegroupgap),e.selectAll(".legendtoggle").attr("width",(t._context.editable?0:u)+40),u+=45+2*l,c+=10+2*l;var f=n.l+n.w*a.x,h=n.t+n.h*(1-a.y),p="left";"right"===a.xanchor||"auto"===a.xanchor&&a.x>=2/3?(f-=u,p="right"):("center"===a.xanchor||"auto"===a.xanchor&&a.x>1/3)&&(f-=u/2,p="center");var d="top";"bottom"===a.yanchor||"auto"===a.yanchor&&a.y<=1/3?(h-=c,d="bottom"):("middle"===a.yanchor||"auto"===a.yanchor&&a.y<2/3)&&(h-=c/2,d="middle"),u=Math.ceil(u),c=Math.ceil(c),f=Math.round(f),h=Math.round(h),r._infolayer.selectAll("svg.legend").call(o.Drawing.setRect,f,h,u,c),r._infolayer.selectAll("svg.legend .bg").call(o.Drawing.setRect,l/2,l/2,u-l,c-l),o.Plots.autoMargin(t,"legend",{x:a.x,y:a.y,l:u*({right:1,center:.5}[p]||0),r:u*({left:1,center:.5}[p]||0),b:c*({top:1,middle:.5}[d]||0),t:c*({bottom:1,middle:.5}[d]||0)})}},{"../../plotly":1070,"./attributes":1030,d3:64}],1032:[function(t,e,r){"use strict";function n(t,e){var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,a=t._fullLayout,o={};if("zoom"===n)for(var s,u,c,f="in"===i?.5:2,h=(1+f)/2,d=(1-f)/2,g=l.Axes.list(t,null,!0),m=0;mm;m++){var v=o[m];c=g[v]={};for(var y=0;yl;l++){var c=s[l],h={_fullLayout:e},p=u.Axes.coerceRef(t,n,h,c);if("path"!==o){var d=.25,g=.75;if("paper"!==p){var m=u.Axes.getFromId(h,p),v=a(m);d=v(m.range[0]+d*(m.range[1]-m.range[0])),g=v(m.range[0]+g*(m.range[1]-m.range[0]))}r(c+"0",d),r(c+"1",g)}}return"path"===o?r("path"):u.Lib.noneOrAll(t,n,["x0","x1","y0","y1"]),n}function i(t){return"category"===t.type?t.c2l:t.d2l}function a(t){return"category"===t.type?t.l2c:t.l2d}function o(t){return function(e){return t(e.replace("_"," "))}}function s(t,e){var r,n,a,s,l=e.type,c=u.Axes.getFromId(t,e.xref),h=u.Axes.getFromId(t,e.yref),p=t._fullLayout._size;if(c?(r=i(c),n=function(t){return c._offset+c.l2p(r(t,!0))}):n=function(t){return p.l+p.w*t},h?(a=i(h),s=function(t){return h._offset+h.l2p(a(t,!0))}):s=function(t){return p.t+p.h*(1-t)},"path"===l)return c&&"date"===c.type&&(n=o(n)),h&&"date"===h.type&&(s=o(s)),f.convertPath(e.path,n,s);var d=n(e.x0),g=n(e.x1),m=s(e.y0),v=s(e.y1);if("line"===l)return"M"+d+","+m+"L"+g+","+v;if("rect"===l)return"M"+d+","+m+"H"+g+"V"+v+"H"+d+"Z";var y=(d+g)/2,b=(m+v)/2,x=Math.abs(y-d),_=Math.abs(b-m),w="A"+x+","+_,A=y+x+","+b,k=y+","+(b-_);return"M"+A+w+" 0 1,1 "+k+w+" 0 0,1 "+A+"Z"}function l(t,e,r,n,i){var a="category"===t.type?Number:t.d2c;if(void 0!==e)return[a(e),a(r)];if(n){var s,l,u,c,f,d=1/0,g=-(1/0),m=n.match(h);for("date"===t.type&&(a=o(a)),s=0;sf&&(d=f),f>g&&(g=f)));return g>=d?[d,g]:void 0}}var u=t("../../plotly"),c=t("fast-isnumeric"),f=e.exports={};f.layoutAttributes=t("./attributes"),f.supplyLayoutDefaults=function(t,e){for(var r=t.shapes||[],i=e.shapes=[],a=0;ae;l--)p._shapelayer.selectAll('[data-index="'+(l-1)+'"]').attr("data-index",String(l)),f.draw(t,l)}}p._shapelayer.selectAll('[data-index="'+e+'"]').remove();var g=h.shapes[e];if(g){var m={xref:g.xref,yref:g.yref},v={};"string"==typeof r&&r?v[r]=o:u.Lib.isPlainObject(r)&&(v=r);var y=Object.keys(v);for(l=0;ll;l++){var _=x[l];if(void 0===v[_]&&void 0!==g[_]){var w,A=_.charAt(0),k=u.Axes.getFromId(t,u.Axes.coerceRef(m,{},t,A)),M=u.Axes.getFromId(t,u.Axes.coerceRef(g,{},t,A)),E=g[_];void 0!==v[A+"ref"]&&(k?(w=i(k)(E),E=(w-k.range[0])/(k.range[1]-k.range[0])):E=(E-M.domain[0])/(M.domain[1]-M.domain[0]),M?(w=M.range[0]+E*(M.range[1]-M.range[0]),E=a(M)(w)):E=k.domain[0]+E*(k.domain[1]-k.domain[0])),g[_]=E}}var T=n(g,p);p.shapes[e]=T;var L={"data-index":String(e),"fill-rule":"evenodd",d:s(t,T)},S=(T.xref+T.yref).replace(/paper/g,""),C=T.line.width?T.line.color:"rgba(0,0,0,0)",P=p._shapelayer.append("path").attr(L).style("opacity",T.opacity).call(u.Color.stroke,C).call(u.Color.fill,T.fillcolor).call(u.Drawing.dashLine,T.line.dash,T.line.width);S&&P.call(u.Drawing.setClipUrl,"clip"+p._uid+S)}};var h=/[MLHVQCTSZ][^MLHVQCTSZ]*/g,p=/[^\s,]+/g,d={M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},g={M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},m={M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0};f.convertPath=function(t,e,r){return t.replace(h,function(t){var n=0,i=t.charAt(0),a=d[i],o=g[i],s=m[i],l=t.substr(1).replace(p,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),n++,n>s&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),console.log("ignoring extra params in segment "+t)),i+l})},f.calcAutorange=function(t){var e,r,n,i,a,o=t._fullLayout,s=o.shapes;if(s.length&&t._fullData.length)for(e=0;ef?r=f:(u.left-=P.offsetLeft,u.right-=P.offsetLeft,u.top-=P.offsetTop,u.bottom-=P.offsetTop,P.selection.each(function(){var t=n.Drawing.bBox(this);n.Lib.bBoxIntersect(u,t,l)&&(r=Math.max(r,s*(t[P.side]-u[o])+l))}),r=Math.min(f,r)),r>0||0>f){var h={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[P.side];e.attr("transform","translate("+h+")")}}}function c(){R=0,j=!0,I=D,d._infolayer.select("."+e).attr({"data-unformatted":I}).text(I).on("mouseover.opacity",function(){i.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){i.select(this).transition().duration(1e3).style("opacity",0)})}if(!e)return n.Axes.listIds(t).forEach(function(e){s.draw(t,e+"title")}),void s.draw(t,"gtitle");var f,h,p,d=t._fullLayout,g=d._size,m=e.charAt(0),v="cb"===e.substr(1,2);if(v){var y=e.substr(3).replace("title","");t._fullData.some(function(e,r){return e.uid===y?(f=r,h=t.calcdata[r][0].t.cb.axis,!0):void 0})}else h=d[n.Axes.id2name(e.replace("title",""))]||d;var b,x,_,w,A,k=h===d?"title":h._name+".title",M=v?"colorscale":(h._id||m).toUpperCase()+" axis",E=h.titlefont.family,T=h.titlefont.size,L=h.titlefont.color,S="",C={},P={selection:i.select(t).selectAll("g."+h._id+"tick"),side:h.side},z=v?0:1.5;v?(P.offsetLeft=g.l,P.offsetTop=g.t):P.selection.size()&&(A=i.select(P.selection.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/),A&&(P.offsetLeft=+A[1],P.offsetTop=+A[2])),v&&h.titleside?(b=g.l+h.titlex*g.w,x=g.t+(1-h.titley)*g.h+("top"===h.titleside?3+.75*T:-3-.25*T),p={x:b,y:x,"text-anchor":"start"},P={},e="h"+e):"x"===m?(_=h,w="free"===_.anchor?{_offset:g.t+(1-(_.position||0))*g.h,_length:0}:n.Axes.getFromId(t,_.anchor),b=_._offset+_._length/2,x=w._offset+("top"===_.side?-10-T*(z+(_.showticklabels?1:0)):w._length+10+T*(z+(_.showticklabels?1.5:.5))),p={x:b,y:x,"text-anchor":"middle"},P.side||(P.side="bottom")):"y"===m?(w=h,_="free"===w.anchor?{_offset:g.l+(w.position||0)*g.w,_length:0}:n.Axes.getFromId(t,w.anchor),x=w._offset+w._length/2,b=_._offset+("right"===w.side?_._length+10+T*(z+(w.showticklabels?1:.5)):-10-T*(z+(w.showticklabels?.5:0))),C={center:0},p={x:b,y:x,"text-anchor":"middle"},S={rotate:"-90",offset:0},P.side||(P.side="left")):(M="Plot",T=d.titlefont.size,b=d.width/2,x=d._size.t/2,p={x:b,y:x,"text-anchor":"middle"},P={});var R=1,j=!1,I=h.title.trim();""===I&&(R=0),I.match(/Click to enter .+ title/)&&(R=.2,j=!0);var O;if(v){O=i.select(t).selectAll("."+h._id.substr(1)+" .cbtitle");var N="h"===e.charAt(0)?e.substr(1):"h"+e;O.selectAll("."+N+",."+N+"-math-group").remove()}else O=d._infolayer.selectAll(".g-"+e).data([0]),O.enter().append("g").classed("g-"+e,!0);var F=O.selectAll("text").data([0]);F.enter().append("text"),F.text(I).attr("class",e),F.attr({"data-unformatted":I}).call(r);var D="Click to enter "+M.replace(/\d+/,"")+" title";t._context.editable?(I||c(),F.call(n.util.makeEditable).on("edit",function(e){if(v){var r=t._fullData[f];o.traceIs(r,"markerColorscale")?n.restyle(t,"marker.colorbar.title",e,f):n.restyle(t,"colorbar.title",e,f)}else n.relayout(t,k,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(r)}).on("input",function(t){this.text(t||" ").attr(p).selectAll("tspan.line").attr(p)})):(!I||I.match(/Click to enter .+ title/))&&F.remove(),F.classed("js-placeholder",j)}},{"../../plotly":1070,d3:64,"fast-isnumeric":72}],1038:[function(t,e,r){e.exports={DZA:"algeria",AGO:"angola",EGY:"egypt",BGD:"bangladesh|^(?=.*east).*paki?stan",NER:"\\bniger(?!ia)",LIE:"liechtenstein",NAM:"namibia",BGR:"bulgaria",BOL:"bolivia",GHA:"ghana|gold.?coast",CCK:"\\bcocos|keeling",PAK:"^(?!.*east).*paki?stan",CPV:"verde",JOR:"jordan",LBR:"liberia",LBY:"libya",MYS:"malaysia",IOT:"british.?indian.?ocean",PRI:"puerto.?rico",MYT:"mayotte",PRK:"^(?=.*democrat).*\\bkorea|^(?=.*people).*\\bkorea|^(?=.*north).*\\bkorea|\\bd\\.?p\\.?r\\.?k",PSE:"palestin|\\bgaza|west.?bank",TZA:"tanzania",BWA:"botswana|bechuana",KHM:"cambodia|kampuchea|khmer|^p\\.?r\\.?k\\.?$",UMI:"minor.?outlying.?is",TTO:"trinidad|tobago",PRY:"paraguay",HKG:"hong.?kong",SAU:"\\bsa\\w*.?arabia",LBN:"lebanon",SVN:"slovenia",BFA:"burkina|\\bfaso|upper.?volta",SVK:"^(?!.*cze).*slovak",MRT:"mauritania",HRV:"croatia",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai).*china|^p\\.?r\\.?c\\.?$",KNA:"kitts|\\bnevis",JAM:"jamaica",SMR:"san.?marino",GIB:"gibraltar",DJI:"djibouti",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",FIN:"finland",URY:"uruguay",VAT:"holy.?see|vatican|papal.?st",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SYC:"seychell",NPL:"nepal",CXR:"christmas",LAO:"\\blaos?\\b",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",BVT:"bouvet",ZAF:"\\bs\\w*.?africa",KIR:"kiribati",PHL:"philippines",SXM:"^(?!.*martin)(?!.*saba).*maarten",ROU:"r(o|u|ou)mania",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",SYR:"syria",MAC:"maca(o|u)",NFK:"norfolk",NIC:"nicaragua",MLT:"\\bmalta",KAZ:"kazak",TCA:"turks",PYF:"french.?polynesia|tahiti",NIU:"niue",DMA:"dominica(?!n)",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",BEN:"benin|dahome",GUF:"^(?=.*french).*guiana",BEL:"^(?!.*luxem).*belgium",MSR:"montserrat",TGO:"togo",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GUM:"\\bguam",LKA:"sri.?lanka|ceylon",SSD:"\\bs\\w*.?sudan",FLK:"falkland|malvinas",PCN:"pitcairn",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",GUY:"guyana|british.?guiana",CRI:"costa.?rica",COK:"\\bcook",MAR:"morocco|\\bmaroc",MNP:"mariana",LSO:"lesotho|basuto",HUN:"^(?!.*austr).*hungary",TKM:"turkmen",SUR:"surinam|dutch.?guiana",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",BMU:"bermuda",HMD:"heard.*mcdonald",TCD:"\\bchad",GEO:"^(?!.*south).*georgia",MNE:"^(?!.*serbia).*montenegro",MNG:"mongolia",MHL:"marshall",MTQ:"martinique",CSK:"czechoslovakia",BLZ:"belize|^(?=.*british).*honduras",DDR:"german.?democratic.?republic|^(d|g)\\.?d\\.?r\\.?$|^(?=.*east).*germany",MMR:"myanmar|burma",AFG:"afghan",BDI:"burundi",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",BLR:"belarus|byelo",BLM:"barth(e|\xe9)lemy",GRD:"grenada",TKL:"tokelau",GRC:"greece|hellenic|hellas",GRL:"greenland",SHN:"helena",AND:"andorra",MOZ:"mozambique",TJK:"tajik",THA:"thailand|\\bsiam",HTI:"haiti",MEX:"\\bmexic",ANT:"^(?=.*\\bant).*(nether|dutch)",ZWE:"zimbabwe|^(?!.*northern).*rhodesia",LCA:"\\blucia",IND:"india(?!.*ocea)",LVA:"latvia",BTN:"bhutan",VCT:"vincent",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",NOR:"norway",CZE:"^(?=.*rep).*czech|czechia|bohemia",ATF:"french.?southern|\\bfr.*\\bso.*\\ban.*\\b\\bt",ATG:"antigua",FJI:"fiji",HND:"^(?!.*brit).*honduras",MUS:"mauritius",DOM:"dominican",LUX:"^(?!.*belg).*luxem",ISR:"israel",YUG:"yugoslavia",FSM:"micronesia",PER:"peru",REU:"r(e|\xe9)union",IDN:"indonesia",VUT:"vanuatu|new.?hebrides",MKD:"macedonia|^f\\.?y\\.?r\\.?o\\.?m\\.?$",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bdr|\\bdr.*congo|\\bd\\.?r\\.?c|\\bd\\.?r\\.?o\\.?c|\\br\\.?d\\.?c|belgian.?congo|congo.?free.?state|kinshasa|zaire|l\\w{1,2}opoldville",COG:"^(?!.*\\bdem)(?!.*\\bdr)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l\\w{1,2}opoldville)(?!.*free).*\\bcongo",ISL:"iceland",GLP:"guadeloupe",ETH:"ethiopia|abyssinia",COM:"comoro",COL:"colombia",NGA:"nigeria",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TWN:"taiwan|taipei|formosa",PRT:"portugal",MDA:"moldov|b(a|e)ssarabia",GGY:"guernsey",MDG:"madagascar|malagasy",ATA:"antarctica",ECU:"ecuador",SEN:"senegal",ESH:"sahara",MDV:"maldive",ASM:"^(?=.*americ).*samoa",SPM:"miquelon",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",LTU:"lithuania",RWA:"rwanda",ZMB:"zambia|northern.?rhodesia",GMB:"gambia",WLF:"futuna|wallis",JEY:"jersey",FRO:"faroe|faeroe",GTM:"guatemala",DNK:"denmark",IMN:"^(?=.*isle).*\\bman",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baust.*\\bemp",SJM:"svalbard",VEN:"venezuela",PLW:"palau",KEN:"kenya|british.?east.?africa|east.?africa.?prot",TUR:"turkey",ALB:"albania",OMN:"\\boman|trucial",TUV:"tuvalu",ALA:"\\b(a|\xe5)land",BRN:"brunei",TUN:"tunisia",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",BRB:"barbados",BRA:"brazil",CIV:"ivoire|ivory",SRB:"^(?!.*monte).*serbia",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",USA:"^(?!.*islands).*united.?states|^u\\.?s\\.?a\\.?$|^u\\.?s\\.?$",QAT:"qatar",WSM:"^(?!.*amer).*samoa",AZE:"azerbaijan",GNB:"bissau|^(?=.*portu).*guinea",SWZ:"swaziland",TON:"tonga",CAN:"canada",UKR:"ukrain",KOR:"^(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea|\\br\\.?o\\.?k\\b",AIA:"anguill?a",CAF:"\\bcen.*\\baf|^c\\.?a\\.?r\\.?$",CHE:"switz|swiss",CYP:"cyprus",BIH:"herzegovina|bosnia",SGP:"singapore",SGS:"south.?georgia|sandwich",SOM:"somali",UZB:"uzbek",CMR:"cameroon",POL:"poland",EAZ:"zanz",KWT:"kuwait",ERI:"eritrea",GAB:"gabon",CYM:"cayman",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",EST:"estonia",MWI:"malawi|nyasa",ESP:"spain",IRQ:"\\biraq|mesopotamia",SLV:"el.?salvador",MLI:"\\bmali\\b",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",IRL:"ireland",IRN:"\\biran|persia",ABW:"^(?!.*bonaire).*\\baruba",SLE:"sierra",PAN:"panama",SDN:"^(?!.*\\bs(?!u)).*sudan",SLB:"solomon",NZL:"new.?zealand",MCO:"monaco",ITA:"italy",JPN:"japan",KGZ:"kyrgyz|kirghiz",UGA:"uganda",NCL:"new.?caledonia",PNG:"papua|\\bp.*\\bn.*\\bguin.*|^p\\.?n\\.?g\\.?$|new.?guinea",ARG:"argentin",SWE:"sweden",BHS:"bahamas",BHR:"bahrain",ARM:"armenia",NRU:"nauru",CUB:"\\bcuba"}},{}],1039:[function(t,e,r){"use strict";var n=e.exports={};n.projNames={equirectangular:"equirectangular",mercator:"mercator",orthographic:"orthographic","natural earth":"naturalEarth",kavrayskiy7:"kavrayskiy7",miller:"miller",robinson:"robinson",eckert4:"eckert4","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant","conic equal area":"conicEqualArea","conic conformal":"conicConformal","conic equidistant":"conicEquidistant",gnomonic:"gnomonic",stereographic:"stereographic",mollweide:"mollweide",hammer:"hammer","transverse mercator":"transverseMercator","albers usa":"albersUsa"},n.axesNames=["lonaxis","lataxis"],n.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},n.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},n.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,80],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]}},n.clipPad=.001,n.precision=.1,n.landColor="#F0DC82",n.waterColor="#3399FF",n.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},n.sphereSVG={type:"Sphere"},n.fillLayers=["ocean","land","lakes"],n.lineLayers=["subunits","countries","coastlines","rivers","frame"],n.baseLayers=["ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame"],n.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"},n.baseLayersOverChoropleth=["rivers","lakes"]},{}],1040:[function(t,e,r){e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],1041:[function(t,e,r){e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],1042:[function(t,e,r){e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],1043:[function(t,e,r){"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],1044:[function(t,e,r){var n=t("./plotly");r.version=t("../package.json").version,r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.setPlotConfig=t("./plot_api/set_plot_config"),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=n.Fx,r.Snapshot=n.Snapshot,r.PlotSchema=n.PlotSchema,r.Queue=n.Queue,r.d3=t("d3")},{"../build/ploticon":2,"../package.json":1e3,"./plot_api/set_plot_config":1069,"./plotly":1070,d3:64}],1045:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){Array.isArray(t)&&(e[r]=t[n])}},{}],1046:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("./nested_property"),o=t("../components/colorscale/get_scale");Object.keys(t("../components/colorscale/scales"));r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)}},"boolean":{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,i){!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if(n.strict===!0&&"string"!=typeof t)return void e.set(r); -var i=String(t);void 0===t||n.noBlank===!0&&!i?e.set(r):e.set(i)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},axisid:{coerceFunction:function(t,e,r){if("string"==typeof t&&t.charAt(0)===r){var n=Number(t.substr(1));if(n%1===0&&n>1)return void e.set(t)}e.set(r)}},sceneid:{coerceFunction:function(t,e,r){if("string"==typeof t&&t.substr(0,5)===r){var n=Number(t.substr(5));if(n%1===0&&n>1)return void e.set(t)}e.set(r)}},geoid:{coerceFunction:function(t,e,r){if("string"==typeof t&&t.substr(0,3)===r){var n=Number(t.substr(3));if(n%1===0&&n>1)return void e.set(t)}e.set(r)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==n.extras.indexOf(t))return void e.set(t);for(var i=t.split("+"),a=0;a2)return!1;var l=o[0].split("-");if(l.length>3||3!==l.length&&o[1])return!1;if(4===l[0].length)r=Number(l[0]);else{if(2!==l[0].length)return!1;var u=(new Date).getFullYear();r=((Number(l[0])-u+70)%100+200)%100+u-70}return s(r)?1===l.length?new Date(r,0,1).getTime():(n=Number(l[1])-1,l[1].length>2||!(n>=0&&11>=n)?!1:2===l.length?new Date(r,n,1).getTime():(i=Number(l[2]),l[2].length>2||!(i>=1&&31>=i)?!1:(i=new Date(r,n,i).getTime(),o[1]?(l=o[1].split(":"),l.length>3?!1:(a=Number(l[0]),l[0].length>2||!(a>=0&&23>=a)?!1:(i+=36e5*a,1===l.length?i:(n=Number(l[1]),l[1].length>2||!(n>=0&&59>=n)?!1:(i+=6e4*n,2===l.length?i:(t=Number(l[2]),t>=0&&60>t?i+1e3*t:!1)))))):i))):!1},r.isDateTime=function(t){return r.dateTime2ms(t)!==!1},r.ms2DateTime=function(t,e){if("undefined"==typeof o)return void console.log("d3 is not defined");e||(e=0);var r=new Date(t),i=o.time.format("%Y-%m-%d")(r);return 7776e6>e?(i+=" "+n(r.getHours(),2),432e6>e&&(i+=":"+n(r.getMinutes(),2),108e5>e&&(i+=":"+n(r.getSeconds(),2),3e5>e&&(i+="."+n(r.getMilliseconds(),3)))),i.replace(/([:\s]00)*\.?[0]*$/,"")):i};var l={H:["%H:%M:%S~%L","%H:%M:%S","%H:%M"],I:["%I:%M:%S~%L%p","%I:%M:%S%p","%I:%M%p"],D:["%H","%I%p","%Hh"]},u={Y:["%Y~%m~%d","%Y%m%d","%y%m%d","%m~%d~%Y","%d~%m~%Y"],Yb:["%b~%d~%Y","%d~%b~%Y","%Y~%d~%b","%Y~%b~%d"],y:["%m~%d~%y","%d~%m~%y","%y~%m~%d"],yb:["%b~%d~%y","%d~%b~%y","%y~%d~%b","%y~%b~%d"]},c=o.time.format.utc,f={Y:{H:["%Y~%m~%dT%H:%M:%S","%Y~%m~%dT%H:%M:%S~%L"].map(c),I:[],D:["%Y%m%d%H%M%S","%Y~%m","%m~%Y"].map(c)},Yb:{H:[],I:[],D:["%Y~%b","%b~%Y"].map(c)},y:{H:[],I:[],D:[]},yb:{H:[],I:[],D:[]}};["Y","Yb","y","yb"].forEach(function(t){u[t].forEach(function(e){f[t].D.push(c(e)),["H","I","D"].forEach(function(r){l[r].forEach(function(n){var i=f[t][r];i.push(c(e+"~"+n)),i.push(c(n+"~"+e))})})})});var h=/[a-z]*/g,p=function(t){return t.substr(0,3)},d=/(mon|tue|wed|thu|fri|sat|sun|the|of|st|nd|rd|th)/g,g=/[\s,\/\-\.\(\)]+/g,m=/~?([ap])~?m(~|$)/,v=function(t,e){return e+"m "},y=/\d\d\d\d/,b=/(^|~)[a-z]{3}/,x=/[ap]m/,_=/:/,w=/q([1-4])/,A=["31~mar","30~jun","30~sep","31~dec"],k=function(t,e){return A[e-1]},M=/ ?([+\-]\d\d:?\d\d|Z)$/;r.parseDate=function(t){if(t.getTime)return t;if("string"!=typeof t)return!1;t=t.toLowerCase().replace(h,p).replace(d,"").replace(g,"~").replace(m,v).replace(w,k).trim().replace(M,"");var e,r,n=null,o=i(t),s=a(t);e=f[o][s],r=e.length;for(var l=0;r>l&&!(n=e[l].parse(t));l++);if(!(n instanceof Date))return!1;var u=n.getTimezoneOffset();return n.setTime(n.getTime()+60*u*1e3),n}},{d3:64,"fast-isnumeric":72}],1048:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i={init:function(t){if(t._ev instanceof n)return t;var e=new n;return t._ev=e,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t.emit=function(r,n){"undefined"!=typeof $&&$(t).trigger(r,n),e.emit(r,n)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof $&&(n=$(t).triggerHandler(e,r));var a=t._ev;if(!a)return n;var o=a._events[e];if(!o)return n;"function"==typeof o&&(o=[o]);for(var s=o.pop(),l=0;ld;d++){o=t[d];for(s in o)l=h[s],u=o[s],e&&u&&(i(u)||(c=a(u)))?(c?(c=!1,f=l&&a(l)?l:[]):f=l&&i(l)?l:{},h[s]=n([f,u],e,r)):("undefined"!=typeof u||r)&&(h[s]=u)}return h}var i=t("./is_plain_object.js"),a=Array.isArray;r.extendFlat=function(){return n(arguments,!1,!1)},r.extendDeep=function(){return n(arguments,!0,!1)},r.extendDeepAll=function(){return n(arguments,!0,!0)}},{"./is_plain_object.js":1054}],1050:[function(t,e,r){"use strict";function n(t,e){var r=u[t];return r(e)}function i(t){for(var e,r,n=0;ny;y++)c=l(d,y),p=u(e,y),v[y]=n(c,p);else v=n(d,e);return v}var s=t("../plotly"),l=t("tinycolor2"),u=t("fast-isnumeric"),c=t("./str2rgbarray"),f=t("../components/color/attributes").defaultLine,h=1;e.exports=o},{"../components/color/attributes":1004,"../plotly":1070,"./str2rgbarray":1063,"fast-isnumeric":72,tinycolor2:998}],1052:[function(t,e,r){"use strict";function n(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(e>r)break;t=t.slice(0,e)+l(t.slice(e+5,r))+t.slice(r+6)}return t}function i(t){return t.replace(/\/g,"\n")}function a(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=0;(e=t.indexOf("&",e))>=0;){var r=t.indexOf(";",e);if(e>r)e+=1;else{var n=u[t.slice(e+1,r)];t=n?t.slice(0,e)+n+t.slice(r+1):t.slice(0,e)+t.slice(r+1)}}return t}function s(t){return""+o(a(n(i(t))))}var l=t("superscript-text"),u={mu:"\u03bc",amp:"&",lt:"<",gt:">"};e.exports=s},{"superscript-text":997}],1053:[function(t,e,r){"use strict";var n=t("d3"),i=e.exports={};i.nestedProperty=t("./nested_property"),i.isPlainObject=t("./is_plain_object");var a=t("./coerce");i.valObjects=a.valObjects,i.coerce=a.coerce,i.coerce2=a.coerce2,i.coerceFont=a.coerceFont;var o=t("./dates");i.dateTime2ms=o.dateTime2ms,i.isDateTime=o.isDateTime,i.ms2DateTime=o.ms2DateTime,i.parseDate=o.parseDate;var s=t("./search");i.findBin=s.findBin,i.sorterAsc=s.sorterAsc,i.distinctVals=s.distinctVals,i.roundUp=s.roundUp;var l=t("./stats");i.aggNums=l.aggNums,i.len=l.len,i.mean=l.mean,i.variance=l.variance,i.stdev=l.stdev,i.interp=l.interp;var u=t("./matrix");i.init2dArray=u.init2dArray,i.transposeRagged=u.transposeRagged,i.dot=u.dot,i.translationMatrix=u.translationMatrix,i.rotationMatrix=u.rotationMatrix,i.rotationXYMatrix=u.rotationXYMatrix,i.apply2DTransform=u.apply2DTransform,i.apply2DTransform2=u.apply2DTransform2;var c=t("./extend");i.extendFlat=c.extendFlat,i.extendDeep=c.extendDeep,i.extendDeepAll=c.extendDeepAll,i.notifier=t("./notifier"),i.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;ar?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},i.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},i.identity=function(t){return t},i.randstr=function f(t,e,r){if(r||(r=16),void 0===e&&(e=24),0>=e)return"0";var n,i,a,o=Math.log(Math.pow(2,e))/Math.log(r),s="";for(n=2;o===1/0;n*=2)o=Math.log(Math.pow(2,e/n))/Math.log(r)*n;var l=o-Math.floor(o);for(n=0;n-1||u!==1/0&&u>=Math.pow(2,e)?f(t,e,r):s},i.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},i.smooth=function(t,e){if(e=Math.round(e)||0,2>e)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;l>r;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;o>r;r++){for(a=0,n=0;l>n;n++)i=r+n+1-e,-o>i?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),0>i?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},i.promiseError=function(t){console.log(t,t.stack)},i.syncOrAsync=function(t,e,r){function n(){return i.markTime("async done "+o.name),i.syncOrAsync(t,e,r)}for(var a,o;t.length;){if(o=t.splice(0,1)[0],a=o(e),a&&a.then)return a.then(n).then(void 0,i.promiseError);i.markTime("sync done "+o.name)}return r&&r(e)},i.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;ni;i++)e[i][r]=t[i]},i.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,o,s=3,l=Object.keys(t);for(n=0;nn;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;i>e;e++)n=Math.max(n,t[e].length);var a=new Array(n);for(e=0;n>e;e++)for(a[e]=new Array(i),r=0;i>r;r++)a[e][r]=t[r][e];return a},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,i,a=t.length;if(t[0].length)for(n=new Array(a),i=0;a>i;i++)n[i]=r.dot(t[i],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),i=0;ii;i++)n+=t[i]*e[i];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],1056:[function(t,e,r){"use strict";function n(t,e){return function(){var r,i,a,o,s,l=t;for(o=0;o=0;e--){if(n=t[e],o=!1,Array.isArray(n))for(r=n.length-1;r>=0;r--)u(n[r])?o?n[r]=void 0:n.pop():o=!0;else if("object"==typeof n&&null!==n)for(a=Object.keys(n),o=!1,r=a.length-1;r>=0;r--)u(n[a[r]])&&!i(n[a[r]],a[r])?delete n[a[r]]:o=!0;if(o)return}}function u(t){return void 0===t||null===t?!0:"object"!=typeof t?!1:Array.isArray(t)?!t.length:!Object.keys(t).length}function c(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var f=t("fast-isnumeric");e.exports=function(t,e){if(f(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,l=e.split(".");sr||r>a||o>n||n>s?!1:e&&u(t)?!1:!0}function r(t,e){var r=t[0],l=t[1];if(i>r||r>a||o>l||l>s)return!1;var u,c,f,h,p,d=n.length,g=n[0][0],m=n[0][1],v=0;for(u=1;d>u;u++)if(c=g,f=m,g=n[u][0],m=n[u][1],h=Math.min(c,g),!(h>r||r>Math.max(c,g)||l>Math.max(f,m)))if(l=l&&r!==h&&v++}return v%2===1}var n=t.slice(),i=n[0][0],a=i,o=n[0][1],s=o;n.push(n[0]);for(var l=1;la;a++)if(o=[t[a][0]-l[0],t[a][1]-l[1]],s=n(o,u),0>s||s>c||Math.abs(n(o,h))>i)return!0;return!1};i.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(o+1);for(var u=l+1;u1){var s=t.pop();r(s)}return{addPt:r,raw:t,filtered:n}}},{"./matrix":1055}],1059:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],a=0;a=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;rt}function i(t,e){return e>=t}function a(t,e){return t>e}function o(t,e){return t>=e}var s=t("fast-isnumeric");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var l,u,c=0,f=e.length,h=0;for(u=e[e.length-1]>=e[0]?r?n:i:r?o:a;f>c&&h++<100;)l=Math.floor((c+f)/2),u(e[l],t)?c=l+1:f=l;return h>90&&console.log("Long binary search..."),c-1},r.sorterAsc=function(t,e){return t-e},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;n>s;s++)e[s+1]>e[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a>i&&o++<100;)n=u((i+a)/2),e[n]<=t?i=n+s:a=n-l;return e[i]}},{"fast-isnumeric":72}],1061:[function(t,e,r){"use strict";var n=t("../plotly");e.exports=function(t){var e=function(){};for(var r in t)"function"==typeof t[r]&&(t[r]=e);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var i=document.createElement("div");return i.textContent="Webgl is not supported by your browser - visit http://get.webgl.org for more info",i.style.cursor="pointer",i.style.fontSize="24px",i.style.color=n.Color.defaults[0],t.container.appendChild(i),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("http://get.webgl.org")},!1}},{"../plotly":1070}],1062:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,i,a){var o,s;if(a||(a=i.length),n(e)||(e=!1),Array.isArray(i[0])){for(s=new Array(a),o=0;a>o;o++)s[o]=r.aggNums(t,e,i[o]);i=s}for(o=0;a>o;o++)n(e)?n(i[o])&&(e=t(+e,+i[o])):e=i[o];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,i){return e||(e=r.len(t)),n(i)||(i=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-i,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if(e=e*t.length-.5,0>e)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":72}],1063:[function(t,e,r){"use strict";function n(t){return t=i(t),a.str2RgbaArray(t.toRgbString())}var i=t("tinycolor2"),a=t("arraytools");e.exports=n},{arraytools:47,tinycolor2:998}],1064:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function a(t,e,r){var n="math-output-"+l.Lib.randstr([],64),a=u.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.node()],function(){var e=u.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())console.log("There was an error in the tex syntax.",t),r();else{var n=a.select("svg").node().getBoundingClientRect();r(a.select(".MathJax_SVG"),e,n)}a.remove()})}function o(t){for(var e=l.util.html_entity_decode(t),r=e.split(/(<[^<>]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),r=e&&e[2].toLowerCase(),n=f[r];if(void 0!==n){var i=e[1],a=e[3],o=a.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===r){if(i)return"";if("href"!==a.substr(0,4).toLowerCase())return"";var s=document.createElement("a");return s.href=a.substr(4).replace(/["'=]/g,""),-1===h.indexOf(s.protocol)?"":'"}if("br"===r)return"
";if(i)return"sup"===r?'':"sub"===r?'':"";var u=""}return l.util.xml_entity_encode(t).replace(/");i>0;i=r.indexOf("
",i+1))n.push(i);var a=0;n.forEach(function(t){for(var e=t+a,n=r.slice(0,e),i="",o=n.length-1;o>=0;o--){var s=n[o].match(/<(\/?).*>/i);if(s&&"
"!==n[o]){s[1]||(i=n[o]);break}}i&&(r.splice(e+1,0,i),r.splice(e,0,""),a+=2)});var o=r.join(""),s=o.split(/
/gi);return s.length>1&&(r=s.map(function(t,e){return''+t+""})),r.join("")}function s(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}var l=t("../plotly"),u=t("d3"),c=e.exports={};u.selection.prototype.appendSVG=function(t){for(var e=''+t+"",r=(new DOMParser).parseFromString(e,"application/xml"),n=r.documentElement.firstChild;n;)this.node().appendChild(this.node().ownerDocument.importNode(n,!0)),n=n.nextSibling;return r.querySelector("parsererror")?(console.log(r.querySelector("parsererror div").textContent),null):u.select(this.node().lastChild)},c.html_entity_decode=function(t){var e=u.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":e.html(t).text()});return e.remove(),r},c.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},c.convertToTspans=function(t,e){function r(){p.empty()||(d=c.attr("class")+"-math",p.select("svg."+d).remove()),t.text("").style({visibility:"visible","white-space":"pre"}),h=t.appendSVG(s),h||t.text(i),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(c)}var i=t.text(),s=o(i),c=t,f=!c.attr("data-notex")&&s.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),h=i,p=u.select(c.node().parentNode);if(!p.empty()){var d=c.attr("class")?c.attr("class").split(" ")[0]:"text";d+="-math",p.selectAll("svg."+d).remove(),p.selectAll("g."+d+"-group").remove(),t.style({visibility:null});for(var g=t.node();g&&g.removeAttribute;g=g.parentNode)g.removeAttribute("data-bb");if(f){var m=l.Lib.getPlotDiv(c.node());(m&&m._promises||[]).push(new Promise(function(t){c.style({visibility:"hidden"});var i={fontSize:parseInt(c.style("font-size"),10)};a(f[2],i,function(i,a,o){p.selectAll("svg."+d).remove(),p.selectAll("g."+d+"-group").remove();var s=i&&i.select("svg");if(!s||!s.node())return r(),void t();var l=p.append("g").classed(d+"-group",!0).attr({"pointer-events":"none"});l.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({"class":d,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=c.style("fill")||"black";s.select("g").attr({fill:u,stroke:u});var f=n(s,"width"),h=n(s,"height"),g=+c.attr("x")-f*{start:0,middle:.5,end:1}[c.attr("text-anchor")||"start"],m=parseInt(c.style("font-size"),10)||n(c,"height"),v=-m/4;"y"===d[0]?(l.attr({transform:"rotate("+[-90,+c.attr("x"),+c.attr("y")]+") translate("+[-f/2,v-h/2]+")"}),s.attr({x:+c.attr("x"),y:+c.attr("y")})):"l"===d[0]?s.attr({x:c.attr("x"),y:v-h/2}):"a"===d[0]?s.attr({x:0,y:v}):s.attr({x:g,y:+c.attr("y")+v-h/2}),e&&e.call(c,l),t(l)})}))}else r();return t}};var f={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},h=["http:","https:","mailto:"],p=new RegExp("]*)?/?>","g");c.plainText=function(t){return(t||"").replace(p," ")},c.makeEditable=function(t,e,r){function n(){a(),o.style({opacity:0});var t,e=h.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&u.select(o.node().parentNode).select(t).style({opacity:0})}function i(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function a(){var t=u.select(l.Lib.getPlotDiv(o.node())),e=t.select(".svg-container"),n=e.append("div");n.classed("plugin-editable editable",!0).style({position:"absolute","font-family":o.style("font-family")||"Arial","font-size":o.style("font-size")||12,color:r.fill||o.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(o.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||o.attr("data-unformatted")).call(s(o,e,r)).on("blur",function(){o.text(this.textContent).style({opacity:1});var t,e=u.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&u.select(o.node().parentNode).select(t).style({opacity:0});var r=this.textContent;u.select(this).transition().duration(0).remove(),u.select(document).on("mouseup",null),c.edit.call(o,r)}).on("focus",function(){var t=this;u.select(document).on("mouseup",function(){return u.event.target===t?!1:void(document.activeElement===n.node()&&n.node().blur())})}).on("keyup",function(){27===u.event.which?(o.style({opacity:1}),u.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),c.cancel.call(o,this.textContent)):(c.input.call(o,this.textContent),u.select(this).call(s(o,e,r)))}).on("keydown",function(){13===u.event.which&&this.blur()}).call(i)}r||(r={});var o=this,c=u.dispatch("edit","input","cancel"),f=u.select(this.node()).style({"pointer-events":"all"}),h=e||f;return e&&f.style({"pointer-events":"none"}),r.immediate?n():h.on("click",n),u.rebind(this,c,"on")}},{"../plotly":1070,d3:64}],1065:[function(t,e,r){"use strict";var n=e.exports={},i=t("../constants/geo_constants").locationmodeToLayer,a=t("topojson").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../constants/geo_constants":1039,topojson:999}],1066:[function(t,e,r){"use strict";function n(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}function i(t,e){t._fullLayout._paperdiv.style("background","white"),L.defaultConfig.setBackground(t,e)}function a(t,e){t._context||(t._context=L.Lib.extendFlat({},L.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=i:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)), -r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function o(t,e,r){var n=P.select(t).selectAll(".plot-container").data([0]);n.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=n.selectAll(".svg-container").data([0]);i.enter().append("div").classed("svg-container",!0).style("position","relative"),i.html(""),e&&(t.data=e),r&&(t.layout=r),L.micropolar.manager.fillLayout(t),"initial"===t._fullLayout.autosize&&t._context.autosizable&&(w(t,{}),t._fullLayout.autosize=r.autosize=!0),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=L.micropolar.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var a=t.framework.svg(),o=1,s=t._fullLayout.title;""!==s&&s||(o=0);var l="Click to enter title",u=function(){this.call(L.util.convertToTspans)},c=a.select(".title-group text").call(u);if(t._context.editable){c.attr({"data-unformatted":s}),s&&s!==l||(o=.2,c.attr({"data-unformatted":l}).text(l).style({opacity:o}).on("mouseover.opacity",function(){P.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){P.select(this).transition().duration(1e3).style("opacity",0)}));var f=function(){this.call(L.util.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(u),this.call(f)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(u)})};c.call(f)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),j.addLinks(t),Promise.resolve()}function s(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var n=L.Axes.list({_fullLayout:t});for(e=0;ee;e++){var o=t.annotations[e];o.ref&&("paper"===o.ref?(o.xref="paper",o.yref="paper"):"data"===o.ref&&(o.xref="x",o.yref="y"),delete o.ref),l(o,"xref"),l(o,"yref")}void 0===t.shapes||Array.isArray(t.shapes)||(console.log("shapes must be an array"),delete t.shapes);var s=(t.shapes||[]).length;for(e=0;s>e;e++){var u=t.shapes[e];l(u,"xref"),l(u,"yref")}var c=t.legend;c&&(c.x>3?(c.x=1.02,c.xanchor="left"):c.x<-2&&(c.x=-.02,c.xanchor="right"),c.y>3?(c.y=1.02,c.yanchor="bottom"):c.y<-2&&(c.y=-.02,c.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var h,p,d,g,m,v,y,b=j.getSubplotIds(t,"gl3d");for(e=0;er;++r)y[r]=m[e]+g*v[2+4*r];h.camera={eye:{x:y[0],y:y[1],z:y[2]},center:{x:m[0],y:m[1],z:m[2]},up:{x:v[1],y:v[5],z:v[9]}},delete h.cameraposition}return L.Lib.markTime("finished rest of cleanLayout, starting color"),L.Color.clean(t),L.Lib.markTime("finished cleanLayout color.clean"),t}function l(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=L.Axes.cleanId(r,n))}function u(t,e){for(var r=[],n=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid})),i=0;is&&(o=L.Lib.randstr(n),-1!==r.indexOf(o));s++);a.uid=L.Lib.randstr(n),n.push(a.uid)}if(r.push(a.uid),"histogramy"===a.type&&"xbins"in a&&!("ybins"in a)&&(a.ybins=a.xbins,delete a.xbins),a.error_y&&"opacity"in a.error_y){var l=L.Color.defaults,u=a.error_y.color||(j.traceIs(a,"bar")?L.Color.defaultLine:l[i%l.length]);a.error_y.color=L.Color.addOpacity(L.Color.rgb(u),L.Color.opacity(u)*a.error_y.opacity),delete a.error_y.opacity}"bardir"in a&&("h"!==a.bardir||!j.traceIs(a,"bar")&&"histogram"!==a.type.substr(0,9)||(a.orientation="h",x(a)),delete a.bardir),"histogramy"===a.type&&x(a),("histogramx"===a.type||"histogramy"===a.type)&&(a.type="histogram"),"scl"in a&&(a.colorscale=a.scl,delete a.scl),"reversescl"in a&&(a.reversescale=a.reversescl,delete a.reversescl),a.xaxis&&(a.xaxis=L.Axes.cleanId(a.xaxis,"x")),a.yaxis&&(a.yaxis=L.Axes.cleanId(a.yaxis,"y")),j.traceIs(a,"gl3d")&&a.scene&&(a.scene=j.subplotsRegistry.gl3d.cleanId(a.scene)),j.traceIs(a,"pie")||(Array.isArray(a.textposition)?a.textposition=a.textposition.map(c):a.textposition&&(a.textposition=c(a.textposition))),f(a,"line")&&delete a.line,"marker"in a&&(f(a.marker,"line")&&delete a.marker.line,f(a,"marker")&&delete a.marker),L.Lib.markTime("finished rest of cleanData, starting color"),L.Color.clean(a),L.Lib.markTime("finished cleanData color.clean")}}function c(t){var e="middle",r="center";return-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right"),e+" "+r}function f(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}function h(t){var e,r,n,i,a=L.Axes.list(t),o=t._fullData,s=t._fullLayout,l=t.calcdata=new Array(o.length);for(t.firstscatter=!0,t.numboxes=0,t._hmpixcount=0,t._hmlumcount=0,s._piecolormap={},s._piedefaultcolorcount=0,e=0;en?a.push(i+n):a.push(n);return a}function d(t,e,r){var n,i;for(n=0;n=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||0>i&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function g(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),d(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&d(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function m(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&l0){var s=_(t._boundingBoxMargins),l=s.left+s.right,u=s.bottom+s.top,c=a._container.node().getBoundingClientRect(),f=1-2*o.frameMargins;i=Math.round(f*(c.width-l)),n=Math.round(f*(c.height-u))}else r=window.getComputedStyle(t),n=parseFloat(r.height)||a.height,i=parseFloat(r.width)||a.width;return Math.abs(a.width-i)>1||Math.abs(a.height-n)>1?(a.height=t.layout.height=n,a.width=t.layout.width=i):"initial"!==a.autosize&&(delete e.autosize,a.autosize=t.layout.autosize=!0),j.sanitizeMargins(a),e}function A(t){var e=P.select(t),r=t._fullLayout;if(r._hasGL3D&&j.subplotsRegistry.gl3d.initAxes(t),r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),"initial"===r.autosize&&(w(t,{}),r.autosize=!0,t.layout.autosize=!0),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._geocontainer=r._paperdiv.selectAll(".geo-container").data([0]),r._geocontainer.enter().append("div").classed("geo-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];P.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=L.Lib.randstr(n)}r._paperdiv.selectAll(".main-svg").attr({xmlns:"http://www.w3.org/2000/svg","xmlns:xmlns:xlink":"http://www.w3.org/1999/xlink"}),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=L.Axes.getSubplots(t);i.join("")!==Object.keys(t._fullLayout._plots||{}).join("")&&k(t,i),r._hasCartesian&&M(t,i),r._shapelayer=r._paper.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._geoimages=r._paper.append("g").classed("geoimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework");var a=L.Lib.syncOrAsync([E,function(){return L.Axes.doTicks(t,"redraw")},L.Fx.init],t);return a&&a.then&&t._promises.push(a),a}function k(t,e){function r(e,r){return function(){return L.Axes.getFromId(t,e,r)}}for(var n,i,a=t._fullLayout._plots={},o=0;o0;if(b){var x=L.Axes.getSubplots(t).join(""),_=Object.keys(t._fullLayout._plots||{}).join("");(t.framework!==A||y||_!==x)&&(t.framework=A,A(t))}else y&&A(t);var w=t._fullLayout,k=!t.calcdata||t.calcdata.length!==(t.data||[]).length;k&&(h(t),(t._context.doubleClick!==!1||t._context.displayModeBar!==!1)&&L.Axes.saveRangeInitial(t));for(var M=0;MV.range[0]?[1,2]:[2,1]);else{var q=V.range[0],G=V.range[1];"log"===z?(0>=q&&0>=G&&i(F+".autorange",!0),0>=q?q=G/1e6:0>=G&&(G=q/1e6),i(F+".range[0]",Math.log(q)/Math.LN10),i(F+".range[1]",Math.log(G)/Math.LN10)):(i(F+".range[0]",Math.pow(10,q)),i(F+".range[1]",Math.pow(10,G)))}else i(F+".autorange",!0)}if("reverse"===O)D.range?D.range.reverse():(i(F+".autorange",!0),D.range=[1,0]),B.autorange?b=!0:y=!0;else if("annotations"===P.parts[0]||"shapes"===P.parts[0]){var H=P.parts[1],Y=P.parts[0],X=h[Y]||[],W=L[L.Lib.titleCase(Y)],Z=X[H]||{};2===P.parts.length&&("add"===d[S]||L.Lib.isPlainObject(d[S])?M[S]="remove":"remove"===d[S]?-1===H?(M[Y]=X,delete M[S]):M[S]=Z:console.log("???",d)),!a(Z,"x")&&!a(Z,"y")||L.Lib.containsAny(S,["color","opacity","align","dash"])||(b=!0),W.draw(t,H,P.parts.slice(2).join("."),d[S]),delete d[S]}else 0===P.parts[0].indexOf("scene")?y=!0:0===P.parts[0].indexOf("geo")?y=!0:!p._hasGL2D||-1===S.indexOf("axis")&&"plot_bgcolor"!==P.parts[0]?"hiddenlabels"===S?b=!0:-1!==P.parts[0].indexOf("legend")?g=!0:-1!==S.indexOf("title")?m=!0:-1!==P.parts[0].indexOf("bgcolor")?v=!0:P.parts.length>1&&L.Lib.containsAny(P.parts[1],["tick","exponent","grid","zeroline"])?m=!0:-1!==S.indexOf(".linewidth")&&-1!==S.indexOf("axis")?m=v=!0:P.parts.length>1&&-1!==P.parts[1].indexOf("line")?v=!0:P.parts.length>1&&"mirror"===P.parts[1]?m=v=!0:"margin.pad"===S?m=v=!0:"margin"===P.parts[0]||"autorange"===P.parts[1]||"rangemode"===P.parts[1]||"type"===P.parts[1]||"domain"===P.parts[1]||S.match(/^(bar|box|font)/)?b=!0:-1!==["hovermode","dragmode"].indexOf(S)?x=!0:-1===["hovermode","dragmode","height","width","autosize"].indexOf(S)&&(y=!0):y=!0,P.set(z)}L.Queue&&L.Queue.add(t,U,[t,M],U,[t,k]),d.autosize&&(d=w(t,d)),(d.height||d.width||d.autosize)&&(b=!0);var Q=Object.keys(d),K=[j.previousPromises];if(y||b)K.push(function(){return t.layout=void 0,b&&(t.calcdata=void 0),L.plot(t,"",h)});else if(Q.length&&(j.supplyDefaults(t),p=t._fullLayout,g&&K.push(function(){return L.Legend.draw(t),j.previousPromises(t)}),v&&K.push(E),m&&K.push(function(){return L.Axes.doTicks(t,"redraw"),L.Titles.draw(t,"gtitle"),j.previousPromises(t)}),x)){C(t);var $;for($=j.getSubplotIds(p,"gl3d"),_=0;_<$.length;_++)c=p[$[_]]._scene,c.handleDragmode(p.dragmode);for($=j.getSubplotIds(p,"gl2d"),_=0;_<$.length;_++)c=p._plots[$[_]]._scene2d,c.updateFx(p)}var J=L.Lib.syncOrAsync(K,t);return J&&J.then||(J=Promise.resolve(t)),J.then(function(){return t.emit("plotly_relayout",L.Lib.extendDeep({},k)),t})}},{"../components/modebar/manage":1034,"../lib/events":1048,"../plotly":1070,d3:64,"fast-isnumeric":72,"gl-mat4/fromQuat":211}],1067:[function(t,e,r){"use strict";function n(t,e){try{t._fullLayout._paper.style("background",e)}catch(r){console.log(r)}}e.exports={staticPlot:!1,editable:!1,autosizable:!1,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:n,topojsonURL:"https://cdn.plot.ly/"}},{}],1068:[function(t,e,r){"use strict";function n(t){var e=m.attributes,r=l({type:t}),n=c(t),i=h(t),a={},f={};a.type=null,b(a,e),a=o(r.attributes,a,"attributes",t),void 0!==i.attributes&&b(a,i.attributes),a.type=t,a=u(a),s(a),T.traces[t]=y({},n,{attributes:a}),void 0!==r.layoutAttributes&&(f=o(r.layoutAttributes,f,"layoutAttributes",t),s(f),T.traces[t].layoutAttributes=f)}function i(){var t=m.layoutAttributes,e={};e=o(t,e,"layoutAttributes","*"),e=f(e),e=p(e),e=u(e),s(e),e=d(e),T.layout={layoutAttributes:e}}function a(){T.defs={valObjects:v.valObjects,metaKeys:E.concat(["description","role"])}}function o(t,e,r,n){var i,a,s,u,c;return Object.keys(t).forEach(function(f){return f===_?void Object.keys(t[f]).forEach(function(u){i=l({module:t[f][u]}),void 0!==i&&(a=i[r],s=o(a,{},r,n),v.nestedProperty(e,u).set(b({},s)))}):f===w?void Object.keys(t[f]).forEach(function(i){i===n&&(u=l({module:t[f][i]}),void 0!==u&&(c=u[r],c=o(c,{},r,n),x(e,c)))}):void(e[f]=v.isPlainObject(t[f])?x({},t[f]):t[f])}),e}function s(t){function e(t){return{valType:"string"}}function r(t,r,n){C.isValObject(t)?"data_array"===t.valType?(t.role="data",n[r+"src"]=e(r)):t.arrayOk===!0&&(n[r+"src"]=e(r)):v.isPlainObject(t)&&(t.role="object")}C.crawl(t,r)}function l(t){if("type"in t)return"area"===t.type?{attributes:L}:m.getModule({type:t.type});var e=m.subplotsRegistry,r=t.module;return e[r]?e[r]:"module"in t?g[r]:void 0}function u(t){return Object.keys(t).forEach(function(e){"_"===e.charAt(0)&&-1===E.indexOf(e)&&delete t[e]}),t}function c(t){return"area"===t?{}:m.modules[t].meta||{}}function f(t){return y(t,{radialaxis:S.radialaxis,angularaxis:S.angularaxis}),y(t,S.layout),t}function h(t){if("area"===t)return{};var e=m.subplotsRegistry,r=Object.keys(e).filter(function(e){return m.traceIs({type:t},e)})[0];return void 0===r?{}:e[r]}function p(t){var e=m.subplotsRegistry;return Object.keys(t).forEach(function(r){Object.keys(e).forEach(function(n){var i,a=e[n];i="cartesian"===n?a.attrRegex.x.test(r)||a.attrRegex.y.test(r):a.attrRegex.test(r),i&&(t[r][A]=!0)})}),t}function d(t){return Object.keys(t).forEach(function(e){var r=b({},t[e]);if(r[k]===!0){var n=e.substr(0,e.length-1);delete r[k],t[e]={items:{}},t[e].items[n]=r,t[e].role="object"}}),t}var g=t("../plotly"),m=t("../plots/plots"),v=t("../lib"),y=v.extendFlat,b=v.extendDeep,x=v.extendDeepAll,_="_nestedModules",w="_composedModules",A="_isSubplotObj",k="_isLinkedToArray",M="_deprecated",E=[A,k,M],T={traces:{},layout:{},defs:{}},L=t("../plots/polar/area_attributes"),S=t("../plots/polar/axis_attributes"),C=e.exports={};C.get=function(){return m.allTypes.concat("area").forEach(n),i(),a(),T},C.crawl=function(t,e){Object.keys(t).forEach(function(r){var n=t[r];-1===E.indexOf(r)&&(e(n,r,t),C.isValObject(n)||v.isPlainObject(n)&&C.crawl(n,e))})},C.isValObject=function(t){return t&&void 0!==t.valType}},{"../lib":1053,"../plotly":1070,"../plots/plots":1109,"../plots/polar/area_attributes":1110,"../plots/polar/axis_attributes":1111}],1069:[function(t,e,r){"use strict";var n=t("../plotly");e.exports=function(t){return n.Lib.extendFlat(n.defaultConfig,t)}},{"../plotly":1070}],1070:[function(t,e,r){t("es6-promise").polyfill(),r.Lib=t("./lib"),r.util=t("./lib/svg_text_utils"),r.Queue=t("./lib/queue"),t("../build/plotcss"),r.MathJaxConfig=t("./fonts/mathjax_config"),r.defaultConfig=t("./plot_api/plot_config");var n=r.Plots=t("./plots/plots"),i=t("./plots/cartesian");n.registerSubplot(i),r.Axes=t("./plots/cartesian/axes"),r.Fx=t("./plots/cartesian/graph_interact");var a=t("./plots/geo");n.registerSubplot(a);var o=t("./plots/gl3d");n.registerSubplot(o);var s=t("./plots/gl2d");n.registerSubplot(s),r.micropolar=t("./plots/polar/micropolar"),r.Color=t("./components/color"),r.Drawing=t("./components/drawing"),r.Colorscale=t("./components/colorscale"),r.Colorbar=t("./components/colorbar"),r.ErrorBars=t("./components/errorbars"),r.Annotations=t("./components/annotations"),r.Shapes=t("./components/shapes"),r.Titles=t("./components/titles"),r.Legend=t("./components/legend"),r.ModeBar=t("./components/modebar"),r.Scatter=t("./traces/scatter"),r.Bar=t("./traces/bar"),r.Box=t("./traces/box"),r.Heatmap=t("./traces/heatmap"),r.Histogram=t("./traces/histogram"),r.Histogram2d=t("./traces/histogram2d"),r.Histogram2dContour=t("./traces/histogram2dcontour"),r.Pie=t("./traces/pie"),r.Contour=t("./traces/contour"),r.Scatter3D=t("./traces/scatter3d"),r.Surface=t("./traces/surface"),r.Mesh3D=t("./traces/mesh3d"),r.ScatterGeo=t("./traces/scattergeo"),r.Choropleth=t("./traces/choropleth"),r.ScatterGl=t("./traces/scattergl"),t("./plot_api/plot_api"),r.PlotSchema=t("./plot_api/plot_schema"),r.Snapshot=t("./snapshot")},{"../build/plotcss":1,"./components/annotations":1003,"./components/color":1005,"./components/colorbar":1010,"./components/colorscale":1018,"./components/drawing":1023,"./components/errorbars":1029,"./components/legend":1031,"./components/modebar":1033,"./components/shapes":1036,"./components/titles":1037,"./fonts/mathjax_config":1043,"./lib":1053,"./lib/queue":1059,"./lib/svg_text_utils":1064,"./plot_api/plot_api":1066,"./plot_api/plot_config":1067,"./plot_api/plot_schema":1068,"./plots/cartesian":1076,"./plots/cartesian/axes":1073,"./plots/cartesian/graph_interact":1075,"./plots/geo":1081,"./plots/gl2d":1093,"./plots/gl3d":1096,"./plots/plots":1109,"./plots/polar/micropolar":1112,"./snapshot":1116,"./traces/bar":1125,"./traces/box":1136,"./traces/choropleth":1144,"./traces/contour":1151,"./traces/heatmap":1162,"./traces/histogram":1173,"./traces/histogram2d":1178,"./traces/histogram2dcontour":1182,"./traces/mesh3d":1186,"./traces/pie":1191,"./traces/scatter":1199,"./traces/scatter3d":1207,"./traces/scattergeo":1210,"./traces/scattergl":1215,"./traces/surface":1220,"es6-promise":71}],1071:[function(t,e,r){e.exports={type:{valType:"enumerated",values:[],dflt:"scatter"},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0},showlegend:{valType:"boolean",dflt:!0},legendgroup:{valType:"string",dflt:""},opacity:{valType:"number",min:0,max:1,dflt:1},name:{valType:"string"},uid:{valType:"string",dflt:""},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none"],dflt:"all"},stream:{token:{valType:"string",noBlank:!0,strict:!0},maxpoints:{valType:"number",min:0}}}},{}],1072:[function(t,e,r){e.exports={xaxis:{valType:"axisid",dflt:"x"},yaxis:{valType:"axisid",dflt:"y"}}},{}],1073:[function(t,e,r){"use strict";function n(t,e){if("-"===t.type){var r=t._id,n=r.charAt(0);-1!==r.indexOf("scene")&&(r=n);var s=o(e,r,n);if(s){if("histogram"===s.type&&n==={v:"y",h:"x"}[s.orientation||"v"])return void(t.type="linear");if(a(s,n)){for(var l,u=i(s),c=[],f=0;fl&&u>e&&(void 0===i[r]?a[c]=L.tickText(t,e):a[c]=h(t,e,String(i[r])),c++);return c=864e5?t._tickround="d":r>=36e5?t._tickround="H":r>=6e4?t._tickround="M":r>=1e3?t._tickround="S":t._tickround=3-Math.round(Math.log(r/2)/Math.LN10);else{T(r)||(r=Number(r.substr(1))),t._tickround=2-Math.floor(Math.log(r)/Math.LN10+.01),e="log"===t.type?Math.pow(10,Math.max(t.range[0],t.range[1])):Math.max(Math.abs(t.range[0]),Math.abs(t.range[1]));var n=Math.floor(Math.log(e)/Math.LN10+.01);Math.abs(n)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((n-1)/3):t._tickexponent=n)}else"M"===r.charAt(0)?t._tickround=2===r.length?"m":"y":t._tickround=null}function f(t,e){var r=t.match(Y),n=new Date(e);if(r){var i=Math.min(+r[1]||6,6),a=String(e/1e3%1+2.0000005).substr(2,i).replace(/0+$/,"")||"0";return E.time.format(t.replace(Y,a))(n)}return E.time.format(t)(n)}function h(t,e,r){var n=t.tickfont||t._td._fullLayout.font;return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function p(t,e,r,n){var i,a=e.x,o=t._tickround,s=new Date(a),l="";r&&t.hoverformat?i=f(t.hoverformat,a):t.tickformat?i=f(t.tickformat,a):(n&&(T(o)?o+=2:o={y:"m",m:"d",d:"H",H:"M",M:"S",S:2}[o]),"y"===o?i=B(s):"m"===o?i=U(s):(a!==t._tmin||r||(l="
"+B(s)),"d"===o?i=V(s):"H"===o?i=q(s):(a!==t._tmin||r||(l="
"+V(s)+", "+B(s)),i=G(s),"M"!==o&&(i+=H(s),"S"!==o&&(i+=v(k(a/1e3,1),t,"none",r).substr(1)))))),e.text=i+l}function d(t,e,r,n,i){var a=t.dtick,o=e.x;if(!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),t.tickformat||"string"==typeof a&&"L"===a.charAt(0))e.text=v(Math.pow(10,o),t,i,n);else if(T(a)||"D"===a.charAt(0)&&k(o+.01,1)<.1)if(-1!==["e","E","power"].indexOf(t.exponentformat)){var s=Math.round(o);0===s?e.text=1:1===s?e.text="10":s>1?e.text="10"+s+"":e.text="10\u2212"+-s+"",e.fontSize*=1.25}else e.text=v(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,k(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);("0"===l||"1"===l)&&("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(0>o?.5:.25)))}}function g(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function m(t,e,r,n,i){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=v(e.x,t,i,n)}function v(t,e,r,n){var i=0>t,a=e._tickround,o=r||e.exponentformat||"B",s=e._tickexponent,l=e.tickformat;if(n){var u={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:T(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range:[0,t||1]};c(u),a=(Number(u._tickround)||0)+4,s=u._tickexponent,e.hoverformat&&(l=e.hoverformat)}if(l)return E.format(l)(t).replace(/-/g,"\u2212");var f=Math.pow(10,-a)/2;if("none"===o&&(s=0),t=Math.abs(t),f>t)t="0",i=!1;else{if(t+=f,s&&(t*=Math.pow(10,-s),a+=s),0===a)t=String(Math.floor(t));else if(0>a){t=String(Math.round(t)),t=t.substr(0,t.length+a);for(var h=a;0>h;h++)t+="0"}else{t=String(t);var p=t.indexOf(".")+1;p&&(t=t.substr(0,p+a).replace(/\.?0+$/,""))}t=y(t,e._td._fullLayout.separators)}if(s&&"hide"!==o){var d;d=0>s?"\u2212"+-s:"power"!==o?"+"+s:String(s),"e"===o||("SI"===o||"B"===o)&&(s>12||-15>s)?t+="e"+d:"E"===o?t+="E"+d:"power"===o?t+="×10"+d+"":"B"===o&&9===s?t+="B":("SI"===o||"B"===o)&&(t+=X[s/3+5])}return i?"\u2212"+t:t}function y(t,e){var r=e.charAt(0),n=e.charAt(1),i=t.split("."),a=i[0],o=i.length>1?r+i[1]:"";if(n&&(i.length>1||a.length>4))for(;W.test(a);)a=a.replace(W,"$1"+n+"$2");return a+o}function b(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,a=[],o=0;o1)for(n=1;nu[1]-.01&&(e.domain=[0,1]),M.Lib.noneOrAll(t.domain,e.domain,[0,1])}return e},L.coerceRef=function(t,e,r,n){var i=r._fullLayout._hasGL2D?[]:L.listIds(r,n),a=n+"ref",o={};return o[a]={valType:"enumerated",values:i.concat(["paper"]),dflt:i[0]||"paper"},M.Lib.coerce(t,e,o,a)},L.clearTypes=function(t,e){Array.isArray(e)&&e.length||(e=t._fullData.map(function(t,e){return e})),e.forEach(function(e){var r=t.data[e];delete(L.getFromId(t,r.xaxis)||{}).type,delete(L.getFromId(t,r.yaxis)||{}).type})};var P=/^[xyz][0-9]*$/,z=/^[xyz]axis[0-9]*$/;L.id2name=function(t){if("string"==typeof t&&t.match(P)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},L.name2id=function(t){if(t.match(z)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},L.cleanId=function(t,e){if(t.match(P)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},L.cleanName=function(t,e){if(t.match(P)&&(!e||t.charAt(0)===e)){var r=t.substr(5).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+"axis"+r}},L.counterLetter=function(t){return{x:"y",y:"x"}[t.charAt(0)]},L.autoType=function(t){return L.moreDates(t)?"date":L.category(t)?"category":s(t)?"linear":"-"},L.getShowAttrDflt=function(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};return r.every(n)||1===r.length?t[r[0]]:void 0},L.moreDates=function(t){for(var e,r=0,n=0,i=Math.max(1,(t.length-1)/1e3),a=0;a2*n},L.category=function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a2*n},L.cleanDatum=function(t){try{if("object"==typeof t&&null!==t&&t.getTime)return M.Lib.ms2DateTime(t);if("string"!=typeof t&&!T(t))return"";t=t.toString().replace(/['"%,$# ]/g,"")}catch(e){console.log(e,t)}return t},L.BADNUM=void 0,L.setConvert=function(t){function e(e,r){if(e>0)return Math.log(e)/Math.LN10;if(0>=e&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-3*i*Math.abs(n-a))}return L.BADNUM}function r(t){return Math.pow(10,t)}function n(t){return T(t)?Number(t):L.BADNUM}var i=10;if(t.c2l="log"===t.type?e:n,t.l2c="log"===t.type?r:n,t.l2d=function(e){return t.c2d(t.l2c(e))},t.p2d=function(e){return t.l2d(t.p2l(e))},t.setScale=function(){var e,r=t._td._fullLayout._size;if(t._categories||(t._categories=[]),t.overlaying){var n=L.getFromId(t._td,t.overlaying);t.domain=n.domain}for(t.range&&2===t.range.length&&t.range[0]!==t.range[1]||(t.range=[-1,1]),e=0;2>e;e++)T(t.range[e])||(t.range[e]=T(t.range[1-e])?t.range[1-e]*(e?10:.1):e?1:-1),t.range[e]<-(Number.MAX_VALUE/2)?t.range[e]=-(Number.MAX_VALUE/2):t.range[e]>Number.MAX_VALUE/2&&(t.range[e]=Number.MAX_VALUE/2);if("y"===t._id.charAt(0)?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[0]-t.range[1]),t._b=-t._m*t.range[1]):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[1]-t.range[0]),t._b=-t._m*t.range[0]),!isFinite(t._m)||!isFinite(t._b))throw M.Lib.notifier("Something went wrong with axis scaling","long"),t._td._replotting=!1,new Error("axis scaling")},t.l2p=function(e){return T(e)?E.round(M.Lib.constrain(t._b+t._m*e,-i*t._length,(1+i)*t._length),2):L.BADNUM},t.p2l=function(e){return(e-t._b)/t._m},t.c2p=function(e,r){return t.l2p(t.c2l(e,r))},t.p2c=function(e){return t.l2c(t.p2l(e))},-1!==["linear","log","-"].indexOf(t.type))t.c2d=n,t.d2c=function(t){return t=L.cleanDatum(t),T(t)?Number(t):L.BADNUM},t.d2l=function(e,r){return"log"===t.type?t.c2l(t.d2c(e),r):t.d2c(e)};else if("date"===t.type){if(t.c2d=function(t){return T(t)?M.Lib.ms2DateTime(t):L.BADNUM},t.d2c=function(t){return T(t)?Number(t):M.Lib.dateTime2ms(t)},t.d2l=t.d2c,t.range&&t.range.length>1)try{var a=t.range.map(M.Lib.dateTime2ms);!T(t.range[0])&&T(a[0])&&(t.range[0]=a[0]),!T(t.range[1])&&T(a[1])&&(t.range[1]=a[1])}catch(o){console.log(o,t.range)}}else"category"===t.type&&(t.c2d=function(e){return t._categories[Math.round(e)]},t.d2c=function(e){-1===t._categories.indexOf(e)&&t._categories.push(e);var r=t._categories.indexOf(e);return-1===r?L.BADNUM:r},t.d2l=t.d2c);t.makeCalcdata=function(e,r){var n,i,a;if(r in e)for(n=e[r],i=new Array(n.length),a=0;a2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},L.doAutoRange=function(t){if(t._length||t.setScale(),t.autorange&&t._min&&t._max&&t._min.length&&t._max.length){var e,r=t._min[0].val,n=t._max[0].val;for(e=1;e0&&u>0&&c/u>f&&(s=a,l=o,f=c/u);r===n?t.range=h?[r+1,"normal"!==t.rangemode?0:r-1]:["normal"!==t.rangemode?0:r-1,r+1]:f&&(("linear"===t.type||"-"===t.type)&&("tozero"===t.rangemode&&s.val>=0?s={val:0,pad:0}:"nonnegative"===t.rangemode&&(s.val-f*s.pad<0&&(s={val:0,pad:0}),l.val<0&&(l={val:1,pad:0})),f=(l.val-s.val)/(t._length-s.pad-l.pad)),t.range=[s.val-f*s.pad,l.val+f*l.pad],t.range[0]===t.range[1]&&(t.range=[t.range[0]-1,t.range[0]+1]),h&&t.range.reverse());var p=t._td.layout[t._name];p||(t._td.layout[t._name]=p={}),p!==t&&(p.range=t.range.slice(),p.autorange=t.autorange)}},L.saveRangeInitial=function(t,e){for(var r,n,i,a=L.list(t,"",!0),o=!1,s=0;sd&&(d=g/10),u=t.c2l(d),c=t.c2l(g),y&&(u=Math.min(0,u),c=Math.max(0,c)),n(u)){for(p=!0,o=0;o=h?p=!1:s.val>=u&&s.pad<=h&&(t._min.splice(o,1),o--);p&&t._min.push({val:u,pad:y&&0===u?0:h})}if(n(c)){for(p=!0,o=0;o=c&&s.pad>=f?p=!1:s.val<=c&&s.pad<=f&&(t._max.splice(o,1),o--);p&&t._max.push({val:c,pad:y&&0===c?0:f})}}}if(t.autorange&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,u,c,f,h,p,d,g,m=e.length,v=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),x=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),_=n(r.vpadplus||r.vpad),w=n(r.vpadminus||r.vpad);for(a=0;6>a;a++)i(a);for(a=m-1;a>5;a--)i(a)}},L.autoBin=function(t,e,r,n){function i(t){return(1+100*(t-p)/f.dtick)%100<2}var a=M.Lib.aggNums(Math.min,null,t),o=M.Lib.aggNums(Math.max,null,t);if("category"===e.type)return{start:a-.5,end:o+.5,size:1};var s;if(r)s=(o-a)/r;else{var l=M.Lib.distinctVals(t),u=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),c=u*M.Lib.roundUp(l.minDiff/u,[.9,1.9,4.9,9.9],!0);s=Math.max(c,2*M.Lib.stdev(t)/Math.pow(t.length,n?.25:.4))}var f={type:"log"===e.type?"linear":e.type,range:[a,o]};L.autoTicks(f,s);var h,p=L.tickIncrement(L.tickFirst(f),f.dtick,"reverse");if("number"==typeof f.dtick){for(var d=0,g=0,m=0,v=0,y=0;yg&&(d>.3*b||i(a)||i(o))){var x=f.dtick/2;p+=a>p+x?x:-x}var _=1+Math.floor((o-p)/f.dtick);h=p+_*f.dtick}else for(h=p;o>=h;)h=L.tickIncrement(h,f.dtick);return{start:p,end:h,size:f.dtick}},L.calcTicks=function(t){if("array"===t.tickmode)return l(t);if("auto"===t.tickmode||!t.dtick){var e,r=t.nticks;r||("category"===t.type?(e=t.tickfont?1.2*(t.tickfont.size||12):15,r=t._length/e):(e="y"===t._id.charAt(0)?40:80,r=M.Lib.constrain(t._length/e,4,9)+1)),L.autoTicks(t,Math.abs(t.range[1]-t.range[0])/r),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t._forceTick0)}t.tick0||(t.tick0="date"===t.type?new Date(2e3,0,1).getTime():0),c(t),t._tmin=L.tickFirst(t);var n=t.range[1]=a:a>=o)&&(i.push(o),!(i.length>1e3));o=L.tickIncrement(o,t.dtick,n));t._tmax=i[i.length-1];for(var s=new Array(i.length),u=0;u157788e5?(e/=315576e5,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*u(e,r,j)):e>12096e5?(e/=26298e5,t.dtick="M"+u(e,1,I)):e>432e5?(t.dtick=u(e,864e5,N),t.tick0=new Date(2e3,0,2).getTime()):e>18e5?t.dtick=u(e,36e5,I):e>3e4?t.dtick=u(e,6e4,O):e>500?t.dtick=u(e,1e3,O):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=u(e,r,j));else if("log"===t.type)if(t.tick0=0,e>.7)t.dtick=Math.ceil(e);else if(Math.abs(t.range[1]-t.range[0])<1){var n=1.5*Math.abs((t.range[1]-t.range[0])/e);e=Math.abs(Math.pow(10,t.range[1])-Math.pow(10,t.range[0]))/n,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+u(e,r,j)}else t.dtick=e>.3?"D2":"D1";else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=u(e,r,j));if(0===t.dtick&&(t.dtick=1),!T(t.dtick)&&"string"!=typeof t.dtick){var i=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(i)}},L.tickIncrement=function(t,e,r){var n=r?-1:1;if(T(e))return t+n*e;var i=e.charAt(0),a=n*Number(e.substr(1));if("M"===i){var o=new Date(t);return o.setMonth(o.getMonth()+a)}if("L"===i)return Math.log(Math.pow(10,t)+a)/Math.LN10;if("D"===i){var s="D2"===e?D:F,l=t+.01*n,u=M.Lib.roundUp(k(l,1),s,r);return Math.floor(l)+Math.log(E.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},L.tickFirst=function(t){var e=t.range[1]n:n>u;)u=L.tickIncrement(u,i,e);return u}if("L"===c)return Math.log(r((Math.pow(10,n)-a)/f)*f+a)/Math.LN10;if("D"===c){var h="D2"===i?D:F,p=M.Lib.roundUp(k(n,1),h,e);return Math.floor(n)+Math.log(E.round(Math.pow(10,p),1))/Math.LN10}throw"unrecognized dtick "+String(i)};var B=E.time.format("%Y"),U=E.time.format("%b %Y"),V=E.time.format("%b %-d"),q=E.time.format("%b %-d %Hh"),G=E.time.format("%H:%M"),H=E.time.format(":%S"),Y=/%(\d?)f/g;L.tickText=function(t,e,r){function n(n){var i;return void 0===n?!0:r?"none"===n:(i={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==i)}var i,a=h(t,e),o="array"===t.tickmode,s=r||o;if(o&&Array.isArray(t.ticktext)){for(var l=Math.abs(t.range[1]-t.range[0])/1e4,u=0;u1&&ei&&(w=90),a(u,w)}l._lastangle=w}return r||M.Titles.draw(t,e+"title"),e+" done"}var u=n.selectAll("g."+x).data(y,b);if(!l.showticklabels||!T(i))return u.remove(),void M.Titles.draw(t,e+"title");var c,f,p,d;if("x"===m){var v="bottom"===z?1:-1;c=function(t){return t.dx},d=i+(k+A)*v,f=function(t){return t.dy+d+t.fontSize*("bottom"===z?1:-.5)},p=function(t){return T(t)&&0!==t&&180!==t?0>t*v?"end":"start":"middle"}}else f=function(t){return t.dy+t.fontSize/2},c=function(t){return t.dx+i+(k+A+(90===Math.abs(l.tickangle)?t.fontSize/2:0))*("right"===z?1:-1)},p=function(t){return T(t)&&90===Math.abs(t)?"middle":"right"===z?"start":"end"};var _=0,w=0,L=[];u.enter().append("g").classed(x,1).append("text").attr("text-anchor","middle").each(function(e){var r=E.select(this),n=t._promises.length;r.call(M.Drawing.setPosition,c(e),f(e)).call(M.Drawing.font,e.font,e.fontSize,e.fontColor).text(e.text).call(M.util.convertToTspans),n=t._promises[n],n?L.push(t._promises.pop().then(function(){a(r,l.tickangle)})):a(r,l.tickangle)}),u.exit().remove(),u.each(function(t){_=Math.max(_,t.fontSize)}),a(u,l._lastangle||l.tickangle);var S=M.Lib.syncOrAsync([o,s]);return S&&S.then&&t._promises.push(S),S}function o(t,e){return t.visible!==!0||t.xaxis+t.yaxis!==e?!1:M.Plots.traceIs(t,"bar")&&t.orientation==={x:"h",y:"v"}[m]?!0:t.fill&&t.fill.charAt(t.fill.length-1)===m}function s(e,r,i){var a=e.gridlayer,s=e.zerolinelayer,u=e["hidegrid"+m]?[]:j,c="M0,0"+("x"===m?"v":"h")+r._length,f=a.selectAll("path."+_).data(l.showgrid===!1?[]:u,b);f.enter().append("path").classed(_,1).classed("crisp",1).attr("d",c).each(function(t){l.zeroline&&("linear"===l.type||"-"===l.type)&&Math.abs(t.x)g;g++){var b=l.mirrors[o._id+f[g]];("ticks"===b||"labels"===b)&&(h[g]=!0)}return void 0!==n[2]&&(h[2]=!0),h.forEach(function(t,e){var r=n[e],i=R[e];t&&T(r)&&(y+=p+(r+A*i)+d+i*l.ticklen)}),i(r,y),s(e,o,t),a(r,n[3])}}).filter(function(t){return t&&t.then});return I.length?Promise.all(I):0},L.swap=function(t,e){for(var r=x(t,e),n=0;n0;n--)r.push(e);return r}function i(t,e){for(var r=[],n=0;nI||I>N.width||0>O||O>N.height)return h(t,e)}else I="xpx"in e?e.xpx:d[0]._length/2,O="ypx"in e?e.ypx:g[0]._length/2;if(v="xval"in e?n(p,e.xval):i(d,I),y="yval"in e?n(p,e.yval):i(g,O),!w(v[0])||!w(y[0]))return console.log("Plotly.Fx.hover failed",e,t),h(t,e)}var F=1/0;for(x=0;x1||-1!==M.hoverinfo.indexOf("name")?M.name:void 0,index:!1,distance:Math.min(F,E.MAXDIST),color:A.Color.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},z=R.length,"array"===L){var D=e[x];"pointNumber"in D?(P.index=D.pointNumber,L="closest"):(L="","xval"in D&&(S=D.xval,L="x"),"yval"in D&&(C=D.yval,L=L?"closest":"y"))}else S=v[T],C=y[T];if(M._module&&M._module.hoverPoints){var B=M._module.hoverPoints(P,S,C,L);if(B)for(var U,V=0;Vz&&(R.splice(0,z),F=R[0].distance)}if(0===R.length)return h(t,e);var q="y"===m&&j.length>1;R.sort(function(t,e){return t.distance-e.distance});var G={hovermode:m,rotateLabels:q,bgColor:A.Color.combine(a.plot_bgcolor,a.paper_bgcolor),container:a._hoverlayer,outerContainer:a._paperdiv},H=l(R,G);u(R,q?d[0]:g[0]),c(H,q);var Y=t._hoverdata,X=[];for(b=0;b128?"#000":A.Color.background;if(t.name&&void 0===t.zLabelVal){var h=document.createElement("p");h.innerHTML=t.name,r=h.textContent||"",r.length>15&&(r=r.substr(0,12)+"...")}void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"
"),n+=(n?"z: ":"")+t.zLabel):b&&t[i+"Label"]===p?n=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&(n+=(n?"
":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var d=e.select("text.nums").style("fill",u).call(A.Drawing.setPosition,0,0).text(n).attr("data-notex",1).call(A.util.convertToTspans);d.selectAll("tspan.line").call(A.Drawing.setPosition,0,0);var g=e.select("text.name"),w=0;r&&r!==n?(g.style("fill",l).text(r).call(A.Drawing.setPosition,0,0).attr("data-notex",1).call(A.util.convertToTspans),g.selectAll("tspan.line").call(A.Drawing.setPosition,0,0),w=g.node().getBoundingClientRect().width+2*j):(g.remove(),e.select("rect").remove()),e.select("path").style({fill:l,stroke:u});var k,M,E=d.node().getBoundingClientRect(),T=c._offset+(t.x0+t.x1)/2,S=f._offset+(t.y0+t.y1)/2,C=Math.abs(t.x1-t.x0),P=Math.abs(t.y1-t.y0),z=E.width+R+j+w;t.ty0=m-E.top,t.bx=E.width+2*j,t.by=E.height+2*j,t.anchor="start",t.txwidth=E.width,t.tx2width=w,t.offset=0,a?(t.pos=T,k=y>=S+P/2+z,M=S-P/2-z>=0,"top"!==t.idealAlign&&k||!M?k?(S+=P/2,t.anchor="start"):t.anchor="middle":(S-=P/2,t.anchor="end")):(t.pos=S,k=v>=T+C/2+z,M=T-C/2-z>=0,"left"!==t.idealAlign&&k||!M?k?(T+=C/2,t.anchor="start"):t.anchor="middle":(T-=C/2,t.anchor="end")),d.attr("text-anchor",t.anchor),w&&g.attr("text-anchor",t.anchor),e.attr("transform","translate("+T+","+S+")"+(a?"rotate("+L+")":""))}),M}function u(t,e){function r(t){var e=t[0],r=t[t.length-1];if(i=f-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-h,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(.01>a)){if(-.01>i){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;oh&&u++;for(o=t.length-1;o>=0&&!(0>=u);o--)l=t[o],l.pos>h-1&&(l.del=!0,u--);for(o=0;o=u);o++)if(l=t[o],l.pos=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(0>=u);o--)l=t[o],l.pos+l.dp+l.size>h&&(l.del=!0,u--)}}}for(var n,i,a,o,s,l,u,c=0,f=e._offset,h=e._offset+e._length,p=t.map(function(t,r){return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===e._id.charAt(0)?C:1)/2}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,o=0;o.01){for(s=g.length-1;s>=0;s--)g[s].dp+=i;for(d.push.apply(d,g),p.splice(o+1,1),u=0,s=d.length-1;s>=0;s--)u+=d[s].dp;for(a=u/d.length,s=d.length-1;s>=0;s--)d[s].dp-=a;n=!1}else o++}p.forEach(r)}for(o=p.length-1;o>=0;o--){var y=p[o];for(s=y.length-1;s>=0;s--){var b=y[s],x=t[b.i];x.offset=b.dp,x.del=b.del}}}function c(t,e){t.each(function(t){var r=x.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(R+j),s=o+a*(t.txwidth+j),l=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-z,l=t.offset*P),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*R+l)+","+(R+u)+"v"+(t.by/2-R)+"h"+n*t.bx+"v-"+t.by+"H"+(n*R+l)+"V"+(u-R)+"Z"),i.call(A.Drawing.setPosition,o+l,u+t.ty0-t.by/2+j).selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(A.Drawing.setPosition,s+a*j+l,u+t.ty0-t.by/2+j),r.select("rect").call(A.Drawing.setRect,s+(a-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function f(t,e,r){if(!e.target)return!1;if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}function h(t,e){var r=t._fullLayout;e||(e={}),e.target&&k.triggerHandler(t,"plotly_beforehover",e)===!1||(r._hoverlayer.selectAll("g").remove(),e.target&&t._hoverdata&&t.emit("plotly_unhover",{points:t._hoverdata}),t._hoverdata=void 0)}function p(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function d(t,e,r,n,i,a,o,s){function l(t,e){for(P=0;P.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",et+"Z"),at=e.plot.append("path").attr("class","zoombox-corners").style({fill:A.Color.background,stroke:A.Color.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),f(),P=0;Pi?(nt="",J.r=J.l,J.t=J.b,at.attr("d","M0,0Z")):(J.t=0,J.b=B,nt="x",at.attr("d","M"+(J.l-.5)+","+($-V-.5)+"h-3v"+(2*V+1)+"h3ZM"+(J.r+.5)+","+($-V-.5)+"h3v"+(2*V+1)+"h-3Z")):!G||i.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),at.transition().style("opacity",1).duration(200),rt=!0)}function d(t,e,r){var n,i,a;for(n=0;nzoom back out","long"),N=!1)))}function b(e,r){var n=1===(o+s).length;if(e)S();else if(2!==r||n)if(1===r&&n){var i=o?F[0]:O[0],a="s"===o||"w"===s?0:1,l=i._name+".range["+a+"]",u=g(i,a),c="left",f="middle";if(i.fixedrange)return;o?(f="n"===o?"top":"bottom","right"===i.side&&(c="right")):"e"===s&&(c="right"),W.call(A.util.makeEditable,null,{immediate:!0,background:j.paper_bgcolor,text:String(u),fill:i.tickfont?i.tickfont.color:"#444",horizontalAlign:c,verticalAlign:f}).on("edit",function(e){var r="category"===i.type?i.c2l(e):i.d2l(e);void 0!==r&&A.relayout(t,l,r)})}else m(t);else L()}function x(e){function r(t,e,r){if(!t.fixedrange){u(t.range);var n=t.range,i=n[0]+(n[1]-n[0])*e;t.range=[i+(n[0]-i)*r,i+(n[1]-i)*r]}}if(t._context.scrollZoom||j._enablescrollzoom){var n=t.querySelector(".plotly");if(!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(st);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void console.log("did not find wheel motion attributes",e);var a,l=Math.exp(-Math.min(Math.max(i,-20),20)/100),c=ut.draglayer.select(".nsewdrag").node().getBoundingClientRect(),f=(e.clientX-c.left)/c.width,h=ot[0]+ot[2]*f,p=(c.bottom-e.clientY)/c.height,d=ot[1]+ot[3]*(1-p);if(s){for(a=0;a=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function i(t,e,r){for(var i=1-e,a=0,o=0;ot._lastHoverTime+E.HOVERMINTIME?(o(t,e,r),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){o(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},E.HOVERMINTIME))},T.unhover=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),h(t,e,r)},T.getDistanceFunction=function(t,e,r,n){return"closest"===t?n||a(e,r):"x"===t?e:r},T.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.indexa?a:o>4/3-s?o:s};var F=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];T.dragCursors=function(t,e,r,n){return t="left"===r?0:"center"===r?1:"right"===r?2:A.Lib.constrain(Math.floor(3*t),0,2),e="bottom"===n?0:"middle"===n?1:"top"===n?2:A.Lib.constrain(Math.floor(3*e),0,2),F[e][t]},T.dragElement=function(t){function e(e){var h=document.querySelector(".plugin-editable");return h&&x.select(h).on("blur").call(h),u._dragged=!1,u._dragging=!0,i=e.clientX,a=e.clientY,l=e.target,o=(new Date).getTime(),o-u._mouseDownTimef&&(c=Math.max(c-1,1)),t.doneFn&&t.doneFn(u._dragged,c),!u._dragged){var r=document.createEvent("MouseEvents");r.initEvent("click",!0,!0),l.dispatchEvent(r)}return v(u),u._dragged=!1,A.Lib.pauseEvent(e)}var i,a,o,s,l,u=A.Lib.getPlotDiv(t.element)||{},c=1,f=E.DBLCLICKDELAY;u._mouseDownTime||(u._mouseDownTime=0),t.element.onmousedown=e,t.element.style.pointerEvents="all"},T.setCursor=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)},T.inbox=function(t,e){return 0>t*e||0===t?E.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"../../lib/events":1048,"../../plotly":1070,"./constants":1074,"./select":1078,d3:64,"fast-isnumeric":72,tinycolor2:998}],1076:[function(t,e,r){"use strict";t("../../plotly");r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.attributes=t("./attributes")},{"../../plotly":1070,"./attributes":1072}],1077:[function(t,e,r){var n=t("../../plotly"),i=t("../font_attributes"),a=t("../../components/color/attributes"),o=t("../../lib/extend").extendFlat;e.exports={title:{valType:"string"},titlefont:o({},i,{}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal"},range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},fixedrange:{valType:"boolean",dflt:!1},tickmode:{valType:"enumerated",values:["auto","linear","array"]},nticks:{valType:"integer",min:0,dflt:0},tick0:{valType:"number",dflt:0},dtick:{valType:"any",dflt:1},tickvals:{valType:"data_array"},ticktext:{valType:"data_array"},ticks:{valType:"enumerated",values:["outside","inside",""]},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1},ticklen:{valType:"number",min:0,dflt:5},tickwidth:{valType:"number",min:0,dflt:1},tickcolor:{valType:"color",dflt:a.defaultLine},showticklabels:{valType:"boolean",dflt:!0},tickfont:o({},i,{}),tickangle:{valType:"angle",dflt:"auto"},tickprefix:{valType:"string",dflt:""},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},ticksuffix:{valType:"string",dflt:""},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B"},tickformat:{valType:"string",dflt:""},hoverformat:{valType:"string",dflt:""},showline:{valType:"boolean",dflt:!1},linecolor:{valType:"color",dflt:a.defaultLine},linewidth:{valType:"number",min:0,dflt:1},showgrid:{valType:"boolean"},gridcolor:{valType:"color",dflt:a.lightLine},gridwidth:{valType:"number",min:0,dflt:1},zeroline:{valType:"boolean"},zerolinecolor:{valType:"color",dflt:a.defaultLine},zerolinewidth:{valType:"number",dflt:1},anchor:{valType:"enumerated",values:["free",n.Plots.subplotsRegistry.cartesian.idRegex.x.toString(),n.Plots.subplotsRegistry.cartesian.idRegex.y.toString()]},side:{valType:"enumerated",values:["top","bottom","left","right"]},overlaying:{valType:"enumerated",values:["free",n.Plots.subplotsRegistry.cartesian.idRegex.x.toString(),n.Plots.subplotsRegistry.cartesian.idRegex.y.toString()]},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},position:{valType:"number",min:0,max:1,dflt:0},_deprecated:{autotick:{valType:"boolean"}}}},{"../../components/color/attributes":1004,"../../lib/extend":1049,"../../plotly":1070,"../font_attributes":1079}],1078:[function(t,e,r){"use strict";function n(t){return t._id}var i=t("../../lib/polygon"),a=t("../../components/color"),o=t("./axes"),s=t("./constants"),l=i.filter,u=i.tester,c=s.MINSELECT;e.exports=function(t,e,r,i,f){function h(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function p(t,e){return t-e}var d=i.plotinfo.plot,g=i.element.getBoundingClientRect(),m=e-g.left,v=r-g.top,y=m,b=v,x="M"+m+","+v,_=i.xaxes[0]._length,w=i.yaxes[0]._length,A=i.xaxes.map(n),k=i.yaxes.map(n),M=i.xaxes.concat(i.yaxes);if("lasso"===f)var E=l([[m,v]],s.BENDPX);var T=d.selectAll("path.select-outline").data([1,2]);T.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("d",x+"Z");var L,S,C,P,z,R=d.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1}).attr("d","M0,0Z"),j=[],I=i.gd,O=[];for(L=0;L0&&g.plot(this,i),a.length>0&&m.plot(this,a,e),this.render()},x.makeProjection=function(t){var e,r=t.projection,n=r.type,i=null===this.projection||n!==this.projectionType;i?(this.projectionType=n,e=this.projection=c.geo[v.projNames[n]]()):e=this.projection,e.translate(r._translate0).precision(v.precision),t._isAlbersUsa||e.rotate(r._rotate).center(r._center),t._clipAngle?(this.clipAngle=t._clipAngle,e.clipAngle(t._clipAngle-v.clipPad)):this.clipAngle=null,r.parallels&&e.parallels(r.parallels),i&&this.setScale(e),e.translate(r._translate).scale(r._scale)},x.makePath=function(){this.path=c.geo.path().projection(this.projection)},x.makeFramework=function(){var t=this.geoDiv=c.select(this.container).append("div");t.attr("id",this.id).style("position","absolute");var e=this.hoverContainer=t.append("svg");e.attr({xmlns:"http://www.w3.org/2000/svg","xmlns:xmlns:xlink":"http://www.w3.org/1999/xlink"}).style({position:"absolute","z-index":20,"pointer-events":"none"});var r=this.framework=t.append("svg");r.attr({xmlns:"http://www.w3.org/2000/svg","xmlns:xmlns:xlink":"http://www.w3.org/1999/xlink",position:"absolute",preserveAspectRatio:"none"}),r.append("g").attr("class","bglayer").append("rect"),r.append("g").attr("class","baselayer"),r.append("g").attr("class","choroplethlayer"),r.append("g").attr("class","baselayeroverchoropleth"),r.append("g").attr("class","scattergeolayer"),r.on("dblclick.zoom",null)},x.adjustLayout=function(t,e){var r=t.domain;this.geoDiv.style({left:e.l+e.w*r.x[0]+t._marginX+"px",top:e.t+e.h*(1-r.y[1])+t._marginY+"px",width:t._width+"px",height:t._height+"px"}),this.hoverContainer.attr({width:t._width,height:t._height}),this.framework.attr({width:t._width,height:t._height}),this.framework.select(".bglayer").select("rect").attr({width:t._width,height:t._height}).style({fill:t.bgcolor,"stroke-width":0})},x.drawTopo=function(t,e,r){if(r["show"+e]===!0){var n=this.topojson,i="frame"===e?v.sphereSVG:b(n,n.objects[e]);t.append("g").datum(i).attr("class",e).append("path").attr("class","basepath")}},x.drawGraticule=function(t,e,r){var n=r[e];if(n.showgrid===!0){var a=v.scopeDefaults[r.scope],o=a.lonaxisRange,s=a.lataxisRange,l="lonaxis"===e?[n.dtick]:[0,n.dtick],u=i(o,s,l);t.append("g").datum(u).attr("class",e+"graticule").append("path").attr("class","graticulepath")}},x.drawLayout=function(t){var e,r=this.framework.select("g.baselayer"),n=v.baseLayers,i=v.axesNames;r.selectAll("*").remove();for(var a=0;an?"0":"1.0"}var r=this.framework,n=r.select("g.choroplethlayer"),i=r.select("g.scattergeolayer"),a=this.projection,o=this.path,s=this.clipAngle;r.selectAll("path.basepath").attr("d",o),r.selectAll("path.graticulepath").attr("d",o),n.selectAll("path.choroplethlocation").attr("d",o),n.selectAll("path.basepath").attr("d",o),i.selectAll("path.js-line").attr("d",o),null!==s?(i.selectAll("path.point").style("opacity",e).attr("transform",t),i.selectAll("text").style("opacity",e).attr("transform",t)):(i.selectAll("path.point").attr("transform",t),i.selectAll("text").attr("transform",t))}},{"../../constants/geo_constants":1039,"../../lib/topojson_utils":1065,"../../plotly":1070,"../../traces/choropleth/plot":1145,"../../traces/scattergeo/plot":1211,"./projections":1087,"./set_scale":1088,"./zoom":1089,"./zoom_reset":1090,d3:64,topojson:999}],1081:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("./geo"),a=n.Plots;r.name="geo",r.attr="geo",r.idRoot="geo",r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t._fullData,n=a.getSubplotIds(e,"geo");void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var o=0;ou;u++){var c=s[u],f=t[c]||{},h={};a("domain.x"),a("domain.y",[u/l,(u+1)/l]),n(f,h,a),e[c]=h}}},{"../../../constants/geo_constants":1039,"../../../plotly":1070,"./axis_defaults":1084,"./layout_attributes":1086}],1086:[function(t,e,r){var n=t("../../../components/color/attributes"),i=t("../../../constants/geo_constants"),a=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(i.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(i.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,max:10,dflt:1}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:i.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:i.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:i.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:i.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:a,lataxis:a}},{"../../../components/color/attributes":1004,"../../../constants/geo_constants":1039,"./axis_attributes":1083}],1087:[function(t,e,r){function n(){function t(t,r){return{type:"Feature",id:t.id,properties:t.properties,geometry:e(t.geometry,r)}}function e(t,r){if(!t)return null;if("GeometryCollection"===t.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return e(t,r)})};if(!k.hasOwnProperty(t.type))return null;var n=k[t.type];return i.geo.stream(t,r(n)),n.result()}function r(){}function n(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++r=n}function a(t,e){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length,s=o-1;o>a;s=a++){var l=t[a],u=l[0],c=l[1],f=t[s],h=f[0],p=f[1];c>n^p>n&&(h-u)*(n-c)/(p-c)+u>r&&(i=!i)}return i}function o(t){return t>1?L:-1>t?-L:Math.asin(t)}function s(t,e){var r=(2+L)*Math.sin(e);e/=2;for(var n=0,i=1/0;10>n&&Math.abs(i)>M;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(T*(4+T))*t*(1+Math.cos(e)),2*Math.sqrt(T/(4+T))*Math.sin(e)]}function l(t,e){function r(r,n){var i=R(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?R:e===1/0?c:(r.invert=function(r,n){var i=R.invert(r/t,n);return i[0]*=e,i},r)}function u(){var t=2,e=z(l),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function c(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function f(t,e){return[3*t/(2*T)*Math.sqrt(T*T/3-e*e),e]}function h(t,e){return[t,1.25*Math.log(Math.tan(T/4+.4*e))]}function p(t){return function(e){var r,n=t*Math.sin(e),i=30;do e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e));while(Math.abs(r)>M&&--i>0);return e/2}}function d(t,e,r){function n(r,n){return[t*r*Math.cos(n=i(n)),e*Math.sin(n)]}var i=p(r);return n.invert=function(n,i){var a=o(i/e);return[n/(t*Math.cos(a)),o((2*a+Math.sin(2*a))/r)]},n}function g(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(-.013791+n*(.003971*r-.001529*n))),e*(1.007226+r*(.015085+n*(-.044475+.028874*r-.005916*n)))]}function m(t,e){var r,n=Math.min(18,36*Math.abs(e)/T),i=Math.floor(n),a=n-i,o=(r=I[i])[0],s=r[1],l=(r=I[++i])[0],u=r[1],c=(r=I[Math.min(19,++i)])[0],f=r[1];return[t*(l+a*(c-o)/2+a*a*(c-2*l+o)/2),(e>0?L:-L)*(u+a*(f-s)/2+a*a*(f-2*u+s)/2)]}function v(t,e){return[t*Math.cos(e),e]}i.geo.project=function(t,r){var n=r.stream;if(!n)throw new Error("not yet supported");return(t&&y.hasOwnProperty(t.type)?y[t.type]:e)(t,n)};var y={Feature:t,FeatureCollection:function(e,r){return{type:"FeatureCollection",features:e.features.map(function(e){return t(e,r)})}}},b=[],x=[],_={point:function(t,e){b.push([t,e])},result:function(){var t=b.length?b.length<2?{type:"Point",coordinates:b[0]}:{type:"MultiPoint",coordinates:b}:null;return b=[],t}},w={lineStart:r,point:function(t,e){b.push([t,e])},lineEnd:function(){b.length&&(x.push(b),b=[])},result:function(){var t=x.length?x.length<2?{type:"LineString",coordinates:x[0]}:{type:"MultiLineString",coordinates:x}:null;return x=[],t}},A={polygonStart:r,lineStart:r,point:function(t,e){b.push([t,e])},lineEnd:function(){var t=b.length;if(t){do b.push(b[0].slice());while(++t<4);x.push(b),b=[]}},polygonEnd:r,result:function(){if(!x.length)return null;var t=[],e=[];return x.forEach(function(r){n(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){return a(t[0],r)?(t.push(e),!0):void 0})||t.push([e])}),x=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},k={Point:_,MultiPoint:_,LineString:w,MultiLineString:w,Polygon:A,MultiPolygon:A,Sphere:A},M=1e-6,E=M*M,T=Math.PI,L=T/2,S=(Math.sqrt(T),T/180),C=180/T,P=i.geo.projection,z=i.geo.projectionMutator;i.geo.interrupt=function(t){function e(e,r){for(var n=0>r?-1:1,i=l[+(0>r)],a=0,o=i.length-1;o>a&&e>i[a][2][0];++a);var s=t(e-i[a][1][0],r);return s[0]+=t(i[a][1][0],n*r>n*i[a][0][1]?i[a][0][1]:r)[0],s}function r(){s=l.map(function(e){return e.map(function(e){var r,n=t(e[0][0],e[0][1])[0],i=t(e[2][0],e[2][1])[0],a=t(e[1][0],e[0][1])[1],o=t(e[1][0],e[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})})}function n(){for(var t=1e-6,e=[],r=0,n=l[0].length;n>r;++r){var o=l[0][r],s=180*o[0][0]/T,u=180*o[0][1]/T,c=180*o[1][1]/T,f=180*o[2][0]/T,h=180*o[2][1]/T;e.push(a([[s+t,u+t],[s+t,c-t],[f-t,c-t],[f-t,h+t]],30))}for(var r=l[1].length-1;r>=0;--r){var o=l[1][r],s=180*o[0][0]/T,u=180*o[0][1]/T,c=180*o[1][1]/T,f=180*o[2][0]/T,h=180*o[2][1]/T;e.push(a([[f-t,h-t],[f-t,c+t],[s+t,c+t],[s+t,u-t]],30))}return{type:"Polygon",coordinates:[i.merge(e)]}}function a(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++au;++u)l.push([s[0]+u*n,s[1]+u*i]);s=r}return l.push(r),l}function o(t,e){return Math.abs(t[0]-e[0])n)],a=l[+(0>n)],u=0,c=i.length;c>u;++u){var f=i[u];if(f[0][0]<=r&&rM&&--i>0);return[t/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]},(i.geo.naturalEarth=function(){return P(g)}).raw=g;var I=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];I.forEach(function(t){t[1]*=1.0144}),m.invert=function(t,e){var r=e/L,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=I[a][1],s=I[a+1][1],l=I[Math.min(19,a+2)][1],u=l-o,c=l-2*s+o,f=2*(Math.abs(r)-s)/u,h=c/u,p=f*(1-h*f*(1-2*h*f));if(p>=0||1===a){n=(e>=0?5:-5)*(p+i);var d,g=50;do i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),p=i-a,o=I[a][1],s=I[a+1][1],l=I[Math.min(19,a+2)][1],n-=(d=(e>=0?L:-L)*(s+p*(l-o)/2+p*p*(l-2*s+o)/2)-e)*C;while(Math.abs(d)>E&&--g>0);break}}while(--a>=0);var m=I[a][0],v=I[a+1][0],y=I[Math.min(19,a+2)][0];return[t/(v+p*(y-m)/2+p*p*(y-2*v+m)/2),n*S]},(i.geo.robinson=function(){return P(m)}).raw=m,v.invert=function(t,e){return[t/Math.cos(e),e]},(i.geo.sinusoidal=function(){return P(v)}).raw=v}var i=t("d3");e.exports=n},{d3:64}],1088:[function(t,e,r){"use strict";function n(t,e){var r=t.projection,n=t.lonaxis,o=t.lataxis,l=t.domain,u=t.framewidth||0,c=e.w*(l.x[1]-l.x[0]),f=e.h*(l.y[1]-l.y[0]),h=n.range[0]+s,p=n.range[1]-s,d=o.range[0]+s,g=o.range[1]-s,m=n._fullRange[0]+s,v=n._fullRange[1]-s,y=o._fullRange[0]+s,b=o._fullRange[1]-s;r._translate0=[e.l+c/2,e.t+f/2];var x=p-h,_=g-d,w=[h+x/2,d+_/2],A=r._rotate;r._center=[w[0]+A[0],w[1]+A[1]];var k=function(e){function n(t){return Math.min(_*c/(t[1][0]-t[0][0]),_*f/(t[1][1]-t[0][1]))}var o,s,l,x,_=e.scale(),w=r._translate0,A=i(h,d,p,g),k=i(m,y,v,b);l=a(e,A),o=n(l),x=a(e,k),r._fullScale=n(x),e.scale(o),l=a(e,A),s=[w[0]-l[0][0]+u,w[1]-l[0][1]+u],r._translate=s,e.translate(s),l=a(e,A),t._isAlbersUsa||e.clipExtent(l),o=r.scale*o,r._scale=o,t._width=Math.round(l[1][0])+u,t._height=Math.round(l[1][1])+u,t._marginX=(c-Math.round(l[1][0]))/2,t._marginY=(f-Math.round(l[1][1]))/2};return k}function i(t,e,r,n){var i=(r-t)/4;return{type:"Polygon",coordinates:[[[t,e],[t,n],[t+i,n],[t+2*i,n],[t+3*i,n],[r,n],[r,e],[r-i,e],[r-2*i,e],[r-3*i,e],[t,e]]]}}function a(t,e){return o.geo.path().projection(t).bounds(e)}var o=t("d3"),s=t("../../constants/geo_constants").clipPad;e.exports=n},{"../../constants/geo_constants":1039,d3:64}],1089:[function(t,e,r){"use strict";function n(t,e){var r;return(r=e._isScoped?a:e._clipAngle?s:o)(t,e.projection)}function i(t,e){var r=e._fullScale;return _.behavior.zoom().translate(t.translate()).scale(t.scale()).scaleExtent([.5*r,100*r])}function a(t,e){function r(){_.select(this).style(k)}function n(){o.scale(_.event.scale).translate(_.event.translate),t.render()}function a(){_.select(this).style(M)}var o=t.projection,s=i(o,e);return s.on("zoomstart",r).on("zoom",n).on("zoomend",a),s}function o(t,e){function r(t){return m.invert(t)}function n(t){var e=m(r(t));return Math.abs(e[0]-t[0])>y||Math.abs(e[1]-t[1])>y}function a(){_.select(this).style(k),l=_.mouse(this),u=m.rotate(),c=m.translate(),f=u,h=r(l)}function o(){return p=_.mouse(this),n(l)?(v.scale(m.scale()),void v.translate(m.translate())):(m.scale(_.event.scale),m.translate([c[0],_.event.translate[1]]),h?r(p)&&(g=r(p),d=[f[0]+(g[0]-h[0]),u[1],u[2]],m.rotate(d),f=d):(l=p,h=r(l)),void t.render())}function s(){_.select(this).style(M)}var l,u,c,f,h,p,d,g,m=t.projection,v=i(m,e),y=2;return v.on("zoomstart",a).on("zoom",o).on("zoomend",s),v}function s(t,e){function r(t){v++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function a(t){--v||t({type:"zoomend"})}var o,s=t.projection,p={r:s.rotate(),k:s.scale()},d=i(s,e),g=x(d,"zoomstart","zoom","zoomend"),v=0,y=d.on;return d.on("zoomstart",function(){_.select(this).style(k);var t=_.mouse(this),e=s.rotate(),i=e,a=s.translate(),v=u(e);o=l(s,t),y.call(d,"zoom",function(){var r=_.mouse(this);if(s.scale(p.k=_.event.scale),o){if(l(s,r)){s.rotate(e).translate(a);var u=l(s,r),d=f(o,u),y=m(c(v,d)),b=p.r=h(y,o,i);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=i),s.rotate(b),i=b}}else t=r,o=l(s,t);n(g.of(this,arguments))}),r(g.of(this,arguments))}).on("zoomend",function(){_.select(this).style(M),y.call(d,"zoom",null),a(g.of(this,arguments))}).on("zoom.redraw",function(){t.render()}),_.rebind(d,g,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&v(r)}function u(t){var e=.5*t[0]*w,r=.5*t[1]*w,n=.5*t[2]*w,i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),s=Math.cos(r),l=Math.sin(n),u=Math.cos(n);return[a*s*u+i*o*l,i*s*u-a*o*l,a*o*u+i*s*l,a*s*l-i*o*u]}function c(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],u=e[3];return[r*o-n*s-i*l-a*u,r*s+n*o+i*u-a*l,r*l-n*u+i*o+a*s,r*u+n*l-i*s+a*o]}function f(t,e){if(t&&e){var r=b(t,e),n=Math.sqrt(y(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,y(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}function h(t,e,r){var n=g(e,2,t[0]);n=g(n,1,t[1]),n=g(n,0,t[2]-r[2]);var i,a,o=e[0],s=e[1],l=e[2],u=n[0],c=n[1],f=n[2],h=Math.atan2(s,o)*A,d=Math.sqrt(o*o+s*s);Math.abs(c)>d?(a=(c>0?90:-90)-h,i=0):(a=Math.asin(c/d)*A-h,i=Math.sqrt(d*d-c*c));var m=180-a-2*h,v=(Math.atan2(f,u)-Math.atan2(l,i))*A,y=(Math.atan2(f,u)-Math.atan2(l,-i))*A,b=p(r[0],r[1],a,v),x=p(r[0],r[1],m,y);return x>=b?[a,v,r[2]]:[m,y,r[2]]}function p(t,e,r,n){var i=d(r-t),a=d(n-e); -return Math.sqrt(i*i+a*a)}function d(t){return(t%360+540)%360-180}function g(t,e,r){var n=r*w,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function m(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*A,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*A,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*A]}function v(t){var e=t[0]*w,r=t[1]*w,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function y(t,e){for(var r=0,n=t.length,i=0;n>r;++r)i+=t[r]*e[r];return i}function b(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function x(t){for(var e=0,r=arguments.length,n=[];++ep;++p){for(e=u[p],r=t[this.scene[e]._name],n=/Click to enter .+ title/.test(r.title)?"":r.title,d=0;2>=d;d+=2)this.labelEnable[p+d]=!1,this.labels[p+d]=o(n),this.labelColor[p+d]=s(r.titlefont.color),this.labelFont[p+d]=r.titlefont.family,this.labelSize[p+d]=r.titlefont.size,this.labelPad[p+d]=this.getLabelPad(e,r),this.tickEnable[p+d]=!1,this.tickColor[p+d]=s((r.tickfont||{}).color),this.tickAngle[p+d]="auto"===r.tickangle?0:Math.PI*-r.tickangle/180,this.tickPad[p+d]=this.getTickPad(r),this.tickMarkLength[p+d]=0,this.tickMarkWidth[p+d]=r.tickwidth||0,this.tickMarkColor[p+d]=s(r.tickcolor),this.borderLineEnable[p+d]=!1,this.borderLineColor[p+d]=s(r.linecolor),this.borderLineWidth[p+d]=r.linewidth||0;c=this.hasSharedAxis(r),a=this.hasAxisInDfltPos(e,r)&&!c,l=this.hasAxisInAltrPos(e,r)&&!c,i=r.mirror||!1,f=c?-1!==String(i).indexOf("all"):!!i,h=c?"allticks"===i:-1!==String(i).indexOf("ticks"),a?this.labelEnable[p]=!0:l&&(this.labelEnable[p+2]=!0),a?this.tickEnable[p]=r.showticklabels:l&&(this.tickEnable[p+2]=r.showticklabels),(a||f)&&(this.borderLineEnable[p]=r.showline),(l||f)&&(this.borderLineEnable[p+2]=r.showline),(a||h)&&(this.tickMarkLength[p]=this.getTickMarkLength(r)),(l||h)&&(this.tickMarkLength[p+2]=this.getTickMarkLength(r)),this.gridLineEnable[p]=r.showgrid,this.gridLineColor[p]=s(r.gridcolor),this.gridLineWidth[p]=r.gridwidth,this.zeroLineEnable[p]=r.zeroline,this.zeroLineColor[p]=s(r.zerolinecolor),this.zeroLineWidth[p]=r.zerolinewidth}},l.hasSharedAxis=function(t){var e=this.scene,r=a.Plots.getSubplotIds(e.fullLayout,"gl2d"),n=a.Axes.findSubplotsWithAxis(r,t);return 0!==n.indexOf(e.id)},l.hasAxisInDfltPos=function(t,e){var r=e.side;return"xaxis"===t?"bottom"===r:"yaxis"===t?"left"===r:void 0},l.hasAxisInAltrPos=function(t,e){var r=e.side;return"xaxis"===t?"top"===r:"yaxis"===t?"right"===r:void 0},l.getLabelPad=function(t,e){var r=1.5,n=e.titlefont.size,i=e.showticklabels;return"xaxis"===t?"top"===e.side?-10+n*(r+(i?1:0)):-10+n*(r+(i?.5:0)):"yaxis"===t?"right"===e.side?10+n*(r+(i?1:.5)):10+n*(r+(i?.5:0)):void 0},l.getTickPad=function(t){return"outside"===t.ticks?10+t.ticklen:15},l.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=i},{"../../lib/html2unicode":1052,"../../lib/str2rgbarray":1063,"../../plotly":1070}],1093:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("./scene2d"),a=n.Plots;r.name="gl2d",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.attributes=t("../cartesian/attributes"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=a.getSubplotIds(e,"gl2d"),o=0;or;++r){var n=t[r],i=e[r];if(n.length!==i.length)return!0;for(var a=0;ao;++o,--s)for(var l=0;r>l;++l)for(var u=0;4>u;++u){var c=i[4*(r*o+l)+u];i[4*(r*o+l)+u]=i[4*(r*s+l)+u],i[4*(r*s+l)+u]=c}var f=document.createElement("canvas");f.width=r,f.height=n;var h=f.getContext("2d"),p=h.createImageData(r,n);p.data.set(i),h.putImageData(p,0,0);var d;switch(t){case"jpeg":d=f.toDataURL("image/jpeg");break;case"webp":d=f.toDataURL("image/webp");break;default:d=f.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(a),d},v.computeTickMarks=function(){this.xaxis._length=this.glplot.viewBox[2]-this.glplot.viewBox[0],this.yaxis._length=this.glplot.viewBox[3]-this.glplot.viewBox[1];for(var t=[s.Axes.calcTicks(this.xaxis),s.Axes.calcTicks(this.yaxis)],e=0;2>e;++e)for(var r=0;rw;++w)_[w]=Math.min(_[w],d.bounds[w]),_[w+2]=Math.max(_[w+2],d.bounds[w+2])}var A;for(r=0;2>r;++r)_[r]>_[r+2]&&(_[r]=-1,_[r+2]=1),A=this[m[r]],A._length=v.viewBox[r+2]-v.viewBox[r],s.Axes.doAutoRange(A);v.ticks=this.computeTickMarks();var k=this.xaxis.range,M=this.yaxis.range;v.dataBox=[k[0],M[0],k[1],M[1]],v.merge(e),i.update(v)},v.draw=function(){if(!this.stopped){requestAnimationFrame(this.redraw);var t=this.glplot,e=this.camera,r=e.mouseListener,n=this.fullLayout;this.cameraChanged();var i=r.x*t.pixelRatio,a=this.canvas.height-t.pixelRatio*r.y;if(e.boxEnabled&&"zoom"===n.dragmode)this.selectBox.enabled=!0,this.selectBox.selectBox=[Math.min(e.boxStart[0],e.boxEnd[0]),Math.min(e.boxStart[1],e.boxEnd[1]),Math.max(e.boxStart[0],e.boxEnd[0]),Math.max(e.boxStart[1],e.boxEnd[1])],t.setDirty();else{this.selectBox.enabled=!1;var o=n._size,l=this.xaxis.domain,u=this.yaxis.domain,c=t.pick(i/t.pixelRatio+o.l+l[0]*o.w,a/t.pixelRatio-(o.t+(1-u[1])*o.h));if(c&&n.hovermode){var f=c.object._trace.handlePick(c);if(f&&(!this.lastPickResult||this.lastPickResult.trace!==f.trace||this.lastPickResult.dataCoord[0]!==f.dataCoord[0]||this.lastPickResult.dataCoord[1]!==f.dataCoord[1])){var h=this.lastPickResult=f;this.spikes.update({center:c.dataCoord}),h.screenCoord=[((t.viewBox[2]-t.viewBox[0])*(c.dataCoord[0]-t.dataBox[0])/(t.dataBox[2]-t.dataBox[0])+t.viewBox[0])/t.pixelRatio,(this.canvas.height-(t.viewBox[3]-t.viewBox[1])*(c.dataCoord[1]-t.dataBox[1])/(t.dataBox[3]-t.dataBox[1])-t.viewBox[1])/t.pixelRatio];var p=h.hoverinfo;if("all"!==p){var d=p.split("+");-1===d.indexOf("x")&&(h.traceCoord[0]=void 0),-1===d.indexOf("y")&&(h.traceCoord[1]=void 0),-1===d.indexOf("text")&&(h.textLabel=void 0),-1===d.indexOf("name")&&(h.name=void 0)}s.Fx.loneHover({x:h.screenCoord[0],y:h.screenCoord[1],xLabel:this.hoverFormatter("xaxis",h.traceCoord[0]),yLabel:this.hoverFormatter("yaxis",h.traceCoord[1]),text:h.textLabel,name:h.name,color:h.color},{container:this.svgContainer}),this.lastPickResult={dataCoord:c.dataCoord}}}else!c&&this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,s.Fx.loneUnhover(this.svgContainer))}t.draw()}},v.hoverFormatter=function(t,e){if(void 0!==e){var r=this[t];return s.Axes.tickText(r,r.c2l(e),"hover").text}}},{"../../lib/html2unicode":1052,"../../lib/show_no_webgl_msg":1061,"../../plotly":1070,"../../traces/scattergl/convert":1213,"./camera":1091,"./convert":1092,"gl-plot2d":421,"gl-select-box":896,"gl-spikes2d":897}],1095:[function(t,e,r){"use strict";function n(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];"distanceLimits"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),"zoomMin"in e&&(r[0]=e.zoomMin),"zoomMax"in e&&(r[1]=e.zoomMax);var n=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0,c=t.clientWidth,f=t.clientHeight,h={keyBindingMode:"rotate",view:n,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:n.modes,tick:function(){var e=i(),r=this.delay,a=e-2*r;n.idle(e-r),n.recalcMatrix(a),n.flush(e-(100+2*r));for(var o=!0,s=n.computedMatrix,h=0;16>h;++h)o=o&&l[h]===s[h],l[h]=s[h];var p=t.clientWidth===c&&t.clientHeight===f;return c=t.clientWidth,f=t.clientHeight,o?!p:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(h,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){var e=n.computedUp.slice(),r=n.computedEye.slice(),a=n.computedCenter.slice();if(n.setMode(t),"turntable"===t){var o=i();n._active.lookAt(o,r,a,e),n._active.lookAt(o+500,r,a,[0,0,1]),n._active.flush(o)}return n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var p=0,d=0;return o(t,function(e,r,a,o){var s="rotate"===h.keyBindingMode,l="pan"===h.keyBindingMode,c="zoom"===h.keyBindingMode,f=!!o.control,g=!!o.alt,m=!!o.shift,v=!!(1&e),y=!!(2&e),b=!!(4&e),x=1/t.clientHeight,_=x*(r-p),w=x*(a-d),A=h.flipX?1:-1,k=h.flipY?1:-1,M=i(),E=Math.PI*h.rotateSpeed;if((s&&v&&!f&&!g&&!m||v&&!f&&!g&&m)&&n.rotate(M,A*E*_,-k*E*w,0),(l&&v&&!f&&!g&&!m||y||v&&f&&!g&&!m)&&n.pan(M,-h.translateSpeed*_*u,h.translateSpeed*w*u,0),c&&v&&!f&&!g&&!m||b||v&&!f&&g&&!m){var T=-h.zoomSpeed*w/window.innerHeight*(M-n.lastT())*100;n.pan(M,0,0,u*(Math.exp(T)-1))}return p=r,d=a,!0}),s(t,function(t,e){var r=h.flipX?1:-1,a=h.flipY?1:-1,o=i();if(Math.abs(t)>Math.abs(e))n.rotate(o,0,0,-t*r*Math.PI*h.rotateSpeed/window.innerWidth);else{var s=-h.zoomSpeed*a*e/window.innerHeight*(o-n.lastT())/100;n.pan(o,0,0,u*(Math.exp(s)-1))}},!0),h}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":28,"mouse-change":960,"mouse-wheel":964,"right-now":990}],1096:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("./scene"),a=n.Plots,o=["xaxis","yaxis","zaxis"];r.name="gl3d",r.attr="scene",r.idRoot="scene",r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t._fullData,n=a.getSubplotIds(e,"gl3d");e._paperdiv.style({width:e.width+"px",height:e.height+"px"}),t._context.setBackground(t,e.paper_bgcolor);for(var o=0;ol;++l){var u=o[l],c=s[u];c._td=t}}},{"../../plotly":1070,"./layout/attributes":1097,"./layout/defaults":1101,"./layout/layout_attributes":1102,"./scene":1106,"./set_convert":1107}],1097:[function(t,e,r){e.exports={scene:{valType:"sceneid",dflt:"scene"}}},{}],1098:[function(t,e,r){var n=t("../../cartesian/layout_attributes"),i=t("../../../lib/extend").extendFlat;e.exports={showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:"rgb(0,0,0)"},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},title:n.title,titlefont:n.titlefont,type:n.type,autorange:n.autorange,rangemode:n.rangemode,range:n.range,fixedrange:n.fixedrange,tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,mirror:n.mirror,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:n.tickfont,tickangle:n.tickangle,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,tickformat:n.tickformat,hoverformat:n.hoverformat,showline:n.showline,linecolor:n.linecolor,linewidth:n.linewidth,showgrid:n.showgrid,gridcolor:i({},n.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:n.gridwidth,zeroline:n.zeroline,zerolinecolor:n.zerolinecolor,zerolinewidth:n.zerolinewidth}},{"../../../lib/extend":1049,"../../cartesian/layout_attributes":1077}],1099:[function(t,e,r){"use strict";var n=t("../../../plotly"),i=t("./axis_attributes"),a=["xaxis","yaxis","zaxis"],o=function(){};e.exports=function(t,e,r){function s(t,e){return n.Lib.coerce(l,u,i,t,e)}for(var l,u,c=n.Axes,f=0;fr;++r){var n=t[u[r]];e.labels[r]=o(n.title),"titlefont"in n&&(n.titlefont.color&&(e.labelColor[r]=s(n.titlefont.color)),n.titlefont.family&&(e.labelFont[r]=n.titlefont.family),n.titlefont.size&&(e.labelSize[r]=n.titlefont.size)),"showline"in n&&(e.lineEnable[r]=n.showline),"linecolor"in n&&(e.lineColor[r]=s(n.linecolor)),"linewidth"in n&&(e.lineWidth[r]=n.linewidth),"showgrid"in n&&(e.gridEnable[r]=n.showgrid),"gridcolor"in n&&(e.gridColor[r]=s(n.gridcolor)),"gridwidth"in n&&(e.gridWidth[r]=n.gridwidth),"log"===n.type?e.zeroEnable[r]=!1:"zeroline"in n&&(e.zeroEnable[r]=n.zeroline),"zerolinecolor"in n&&(e.zeroLineColor[r]=s(n.zerolinecolor)),"zerolinewidth"in n&&(e.zeroLineWidth[r]=n.zerolinewidth),"ticks"in n&&n.ticks?e.lineTickEnable[r]=!0:e.lineTickEnable[r]=!1,"ticklen"in n&&(e.lineTickLength[r]=e._defaultLineTickLength[r]=n.ticklen),"tickcolor"in n&&(e.lineTickColor[r]=s(n.tickcolor)),"tickwidth"in n&&(e.lineTickWidth[r]=n.tickwidth),"tickangle"in n&&(e.tickAngle[r]="auto"===n.tickangle?0:Math.PI*-n.tickangle/180),"showticklabels"in n&&(e.tickEnable[r]=n.showticklabels),"tickfont"in n&&(n.tickfont.color&&(e.tickColor[r]=s(n.tickfont.color)),n.tickfont.family&&(e.tickFont[r]=n.tickfont.family),n.tickfont.size&&(e.tickSize[r]=n.tickfont.size)),"mirror"in n?-1!==["ticks","all","allticks"].indexOf(n.mirror)?(e.lineTickMirror[r]=!0,e.lineMirror[r]=!0):n.mirror===!0?(e.lineTickMirror[r]=!1,e.lineMirror[r]=!0):(e.lineTickMirror[r]=!1,e.lineMirror[r]=!1):e.lineMirror[r]=!1,"showbackground"in n&&n.showbackground!==!1?(e.backgroundEnable[r]=!0,e.backgroundColor[r]=s(n.backgroundcolor)):e.backgroundEnable[r]=!1}},e.exports=i},{"../../../lib/html2unicode":1052,"../../../lib/str2rgbarray":1063,arraytools:47}],1101:[function(t,e,r){"use strict";var n=t("../../../plotly"),i=t("./layout_attributes"),a=t("./axis_defaults");e.exports=function(t,e,r){function o(t,e){return n.Lib.coerce(c,h,i,t,e)}if(e._hasGL3D){var s,l=n.Plots.getSubplotIdsInData(r,"gl3d");delete e.xaxis,delete e.yaxis;var u=l.length;for(s=0;u>s;++s){var c,f=l[s];void 0!==t[f]?c=t[f]:t[f]=c={};var h=e[f]||{};o("bgcolor");for(var p=Object.keys(i.camera),d=0;de;++e){var r=t[o[e]];this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness}},e.exports=i},{"../../../lib/str2rgbarray":1063}],1104:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;3>r;++r){for(var n=t[r],i=new Array(n.length),a=0;ac;++c){var f=i[s[c]];if(f._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(f._length)===1/0)u[c]=[];else{f.range[0]=r[c].lo/t.dataScale[c],f.range[1]=r[c].hi/t.dataScale[c],f._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var h=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var p=f.nticks||a.Lib.constrain(f._length/40,4,9);a.Axes.autoTicks(f,Math.abs(f.range[1]-f.range[0])/p)}for(var d=a.Axes.calcTicks(f),g=0;gc;++c){l[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(var g=0;2>g;++g)e.bounds[g][c]=t.glplot.bounds[g][c]}t.contourLevels=n(u)}e.exports=i;var a=t("../../../plotly"),o=t("../../../lib/html2unicode"),s=["xaxis","yaxis","zaxis"],l=[0,0,0]},{"../../../lib/html2unicode":1052,"../../../plotly":1070}],1105:[function(t,e,r){"use strict";function n(t,e){var r,n,i=[0,0,0,0];for(r=0;4>r;++r)for(n=0;4>n;++n)i[n]+=t[4*r+n]*e[r];return i}function i(t,e){var r=n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])));return r}e.exports=i},{}],1106:[function(t,e,r){"use strict";function n(t){function e(e,r){if(void 0!==r){if("string"==typeof r)return r;var n=t.fullSceneLayout[e];return c.Axes.tickText(n,n.c2l(r),"hover").text}}var r=t.svgContainer,n=t.container.getBoundingClientRect(),i=n.width,a=n.height;r.setAttributeNS(null,"viewBox","0 0 "+i+" "+a),r.setAttributeNS(null,"width",i),r.setAttributeNS(null,"height",a),w(t),t.glplot.axes.update(t.axesOptions);for(var o=Object.keys(t.traces),s=null,l=null,u=t.glplot.selection,f=0;fa;++a){var c=l[k[a]];b(c)}t?Array.isArray(t)||(t=[t]):t=[];for(var f=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],a=0;ao;++o)f[0][o]>f[1][o]?m[o]=1:f[1][o]===f[0][o]?m[o]=1:m[o]=1/(f[1][o]-f[0][o]);this.dataScale=m;for(var a=0;aa;++a){var c=l[k[a]],w=c.type;if(w in _?(_[w].acc*=m[a],_[w].count+=1):_[w]={acc:m[a],count:1},c.autorange){for(y[0][a]=1/0,y[1][a]=-(1/0),o=0;oy[1][a])y[0][a]=-1,y[1][a]=1;else{var M=y[1][a]-y[0][a];y[0][a]-=M/32,y[1][a]+=M/32}}else{var E=l[k[a]].range;y[0][a]=E[0],y[1][a]=E[1]}y[0][a]===y[1][a]&&(y[0][a]-=1,y[1][a]+=1),x[a]=y[1][a]-y[0][a],this.glplot.bounds[0][a]=y[0][a]*m[a],this.glplot.bounds[1][a]=y[1][a]*m[a]}for(var T=[1,1,1],a=0;3>a;++a){var c=l[k[a]],w=c.type,L=_[w];T[a]=Math.pow(L.acc,1/L.count)/m[a]}var S,C=4;if("auto"===l.aspectmode)S=Math.max.apply(null,T)/Math.min.apply(null,T)<=C?T:[1,1,1];else if("cube"===l.aspectmode)S=[1,1,1];else if("data"===l.aspectmode)S=T;else{if("manual"!==l.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var P=l.aspectratio;S=[P.x,P.y,P.z]}l.aspectratio.x=u.aspectratio.x=S[0],l.aspectratio.y=u.aspectratio.y=S[1],l.aspectratio.z=u.aspectratio.z=S[2],this.glplot.aspect=S;var z=l.domain||null,R=e._size||null;if(z&&R){var j=this.container.style;j.position="absolute",j.left=R.l+z.x[0]*R.w+"px",j.top=R.t+(1-z.y[1])*R.h+"px",j.width=R.w*(z.x[1]-z.x[0])+"px",j.height=R.h*(z.y[1]-z.y[0])+"px"}}},A.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},A.setCameraToDefault=function(){this.glplot.camera.lookAt([1.25,1.25,1.25],[0,0,0],[0,0,1])},A.getCamera=function(){this.glplot.camera.view.recalcMatrix(this.camera.view.lastT());var t=this.glplot.camera.up,e=this.glplot.camera.center,r=this.glplot.camera.eye;return{up:{x:t[0],y:t[1],z:t[2]},center:{x:e[0],y:e[1],z:e[2]},eye:{x:r[0],y:r[1],z:r[2]}}},A.setCamera=function(t){var e=t.up,r=t.center,n=t.eye;this.glplot.camera.lookAt([n.x,n.y,n.z],[r.x,r.y,r.z],[e.x,e.y,e.z])},A.saveCamera=function(t){function e(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return t[i[r]][a[n]]===e[i[r]][a[n]]}var r=this.getCamera(),n=c.Lib.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;3>o;o++)for(var s=0;3>s;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},A.handleDragmode=function(t){var e=this.camera;e&&("orbit"===t?(e.mode="orbit",e.keyBindingMode="rotate"):"turntable"===t?(e.up=[0,0,1],e.mode="turntable",e.keyBindingMode="rotate"):e.keyBindingMode=t)},A.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(l),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;o>a;++a,--o)for(var s=0;r>s;++s)for(var u=0;4>u;++u){var c=i[4*(r*a+s)+u];i[4*(r*a+s)+u]=i[4*(r*o+s)+u],i[4*(r*o+s)+u]=c}var f=document.createElement("canvas");f.width=r,f.height=n;var h=f.getContext("2d"),p=h.createImageData(r,n);p.data.set(i),h.putImageData(p,0,0);var d;switch(t){case"jpeg":d=f.toDataURL("image/jpeg");break;case"webp":d=f.toDataURL("image/webp");break;default:d=f.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(l),d},e.exports=a},{"../../lib/show_no_webgl_msg":1061,"../../lib/str2rgbarray":1063,"../../plotly":1070,"../../traces/mesh3d/convert":1184,"../../traces/scatter3d/convert":1205,"../../traces/surface/convert":1218,"./camera":1095,"./layout/convert":1100,"./layout/spikes":1103,"./layout/tick_marks":1104,"./project":1105,"./set_convert":1107,"gl-plot3d":593}],1107:[function(t,e,r){"use strict";var n=t("../../plotly"),i=function(){};e.exports=function(t){n.Axes.setConvert(t),t.setScale=i}},{"../../plotly":1070}],1108:[function(t,e,r){var n=t("../plotly"),i=t("./font_attributes"),a=t("../components/color/attributes"),o=n.Lib.extendFlat;e.exports={font:{family:o({},i.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:o({},i.size,{dflt:12}),color:o({},i.color,{dflt:a.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:o({},i,{}),autosize:{valType:"enumerated",values:[!0,!1,"initial"]},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:a.background},plot_bgcolor:{valType:"color",dflt:a.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"},_hasCartesian:{valType:"boolean",dflt:!1},_hasGL3D:{valType:"boolean",dflt:!1},_hasGeo:{valType:"boolean",dflt:!1},_hasPie:{valType:"boolean",dflt:!1},_hasGL2D:{valType:"boolean",dflt:!1},_composedModules:{"*":"Fx"},_nestedModules:{xaxis:"Axes",yaxis:"Axes",scene:"gl3d",geo:"geo",legend:"Legend",annotations:"Annotations",shapes:"Shapes"}}},{"../components/color/attributes":1004,"../plotly":1070,"./font_attributes":1079}],1109:[function(t,e,r){"use strict";function n(t){return"object"==typeof t&&(t=t.type),t}function i(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#","class":"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){c.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}function a(t,e){for(var r,n=c.getSubplotIds(e,"gl3d"),i=0;i=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),u=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&i(t,o),u.text(o.text()&&c.text()?" - ":"")},c.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),i=n.append("input").attr({type:"text",name:"data"});return i.node().value=c.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},c.supplyDefaults=function(t){var e,r,n,i,l,u,f=t._fullLayout||{},h=t._fullLayout={},p=t.layout||{},d=t._fullData||[],g=t._fullData=[],m=t.data||[],v=t._modules=[];for(c.supplyLayoutGlobalDefaults(p,h),h._dataLength=m.length,e=0;ea&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),0>o&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},c.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var i=r.pad||12;r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];t._replotting||c.doAutoMargin(t)}},c.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),c=e._pushmargin;return e.margin.autoexpand!==!1&&(c.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:l}},Object.keys(c).forEach(function(t){var r=c[t].l||{},n=c[t].b||{},s=r.val,f=r.size,h=n.val,p=n.size;Object.keys(c).forEach(function(t){if(u(f)&&c[t].r){var r=c[t].r.val,n=c[t].r.size;if(r>s){var d=(f*r+(n-e.width)*s)/(r-s),g=(n*(1-s)+(f-e.width)*(1-r))/(r-s);d>=0&&g>=0&&d+g>i+a&&(i=d,a=g)}}if(u(p)&&c[t].t){var m=c[t].t.val,v=c[t].t.size;if(m>h){var y=(p*m+(v-e.height)*h)/(m-h),b=(v*(1-h)+(p-e.height)*(1-m))/(m-h);y>=0&&b>=0&&y+b>l+o&&(l=y,o=b)}}})})),r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(l),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,t._replotting||"{}"===n||n===JSON.stringify(e._size)?void 0:s.plot(t)},c.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(s.Lib.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0&&!s.Lib.isPlainObject(t.stream))continue}else if("keepall"!==r&&(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0))continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):t&&t.getTime?s.Lib.ms2DateTime(t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&c.supplyDefaults(t);var o=i?t._fullData:t.data,l=i?t._fullLayout:t.layout,u={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(u.layout=a(l)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),"object"===n?u:JSON.stringify(u)}},{"../plotly":1070,"./attributes":1071,"./font_attributes":1079,"./layout_attributes":1108,d3:64,"fast-isnumeric":72}],1110:[function(t,e,r){var n=t("../../traces/scatter/attributes"),i=n.marker;e.exports={r:n.r,t:n.t,marker:{color:i.color,size:i.size,symbol:i.symbol,opacity:i.opacity}}},{"../../traces/scatter/attributes":1197}],1111:[function(t,e,r){"use strict";function n(t,e){var r={showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}};return a({},e,r)}var i=t("../cartesian/layout_attributes"),a=t("../../lib/extend").extendFlat,o=a({},i.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:o,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:o}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":1049,"../cartesian/layout_attributes":1077}],1112:[function(t,e,r){var n=t("../../plotly"),i=t("d3"),a=e.exports={version:"0.2.2",manager:t("./micropolar_manager")},o=n.Lib.extendDeepAll;a.Axis=function(){function t(t){r=t||r;var u=l.data,f=l.layout;return("string"==typeof r||r.nodeName)&&(r=i.select(r)),r.datum(u).each(function(t,r){function l(t,e){return s(t)%360+f.orientation}var u=t.slice();c={data:a.util.cloneJson(u),layout:a.util.cloneJson(f)};var h=0;u.forEach(function(t,e){t.color||(t.color=f.defaultColorRange[h],h=(h+1)%f.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:i.rgb(t.color).darker().toString()),c.data[e].color=t.color,c.data[e].strokeColor=t.strokeColor,c.data[e].strokeDash=t.strokeDash,c.data[e].strokeSize=t.strokeSize});var p=u.filter(function(t,e){var r=t.visible;return"undefined"==typeof r||r===!0}),d=!1,g=p.map(function(t,e){return d=d||"undefined"!=typeof t.groupId,t});if(d){var m=i.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(g),v=[],y=m.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],v.push(r),r=a.util.sumArrays(t.r,r)}),t.values});p=i.merge(y)}p.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var b=Math.min(f.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2;b=Math.max(10,b);var x,_=[f.margin.left+b,f.margin.top+b];if(d){var w=i.max(a.util.sumArrays(a.util.arrayLast(p).r[0],a.util.arrayLast(v)));x=[0,w]}else x=i.extent(a.util.flattenArray(p.map(function(t,e){return t.r})));f.radialAxis.domain!=a.DATAEXTENT&&(x[0]=0),n=i.scale.linear().domain(f.radialAxis.domain!=a.DATAEXTENT&&f.radialAxis.domain?f.radialAxis.domain:x).range([0,b]),c.layout.radialAxis.domain=n.domain();var A,k=a.util.flattenArray(p.map(function(t,e){return t.t})),M="string"==typeof k[0];M&&(k=a.util.deduplicate(k),A=k.slice(),k=i.range(k.length),p=p.map(function(t,e){var r=t;return t.t=[k],d&&(r.yStack=t.yStack),r}));var E=p.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===p.length,T=null===f.needsEndSpacing?M||!E:f.needsEndSpacing,L=f.angularAxis.domain&&f.angularAxis.domain!=a.DATAEXTENT&&!M&&f.angularAxis.domain[0]>=0,S=L?f.angularAxis.domain:i.extent(k),C=Math.abs(k[1]-k[0]);E&&!M&&(C=0);var P=S.slice();T&&M&&(P[1]+=C);var z=f.angularAxis.ticksCount||4;z>8&&(z=z/(z/8)+z%8),f.angularAxis.ticksStep&&(z=(P[1]-P[0])/z);var R=f.angularAxis.ticksStep||(P[1]-P[0])/(z*(f.minorTicks+1));A&&(R=Math.max(Math.round(R),1)),P[2]||(P[2]=R);var j=i.range.apply(this,P);if(j=j.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=i.scale.linear().domain(P.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=T?C:0,e=i.select(this).select("svg.chart-root"),"undefined"==typeof e||e.empty()){var I="' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '",O=(new DOMParser).parseFromString(I,"application/xml"),N=this.appendChild(this.ownerDocument.importNode(O.documentElement,!0));e=i.select(N)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var F,D=e.select(".chart-group"),B={fill:"none",stroke:f.tickColor},U={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){F=e.select(".legend-group").attr({transform:"translate("+[b,f.margin.top]+")"}).style({display:"block"});var V=p.map(function(t,e){var r=a.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});a.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:o({},a.Legend.defaultConfig().legendConfig,{container:F,elements:V,reverseOrder:f.legend.reverseOrder})})();var q=F.node().getBBox();b=Math.min(f.width-q.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,b=Math.max(10,b),_=[f.margin.left+b,f.margin.top+b],n.range([0,b]),c.layout.radialAxis.domain=n.domain(),F.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else F=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),D.attr("transform","translate("+_+")").style({cursor:"crosshair"});var G=[(f.width-(f.margin.left+f.margin.right+2*b+(q?q.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*b))/2];if(G[0]=Math.max(0,G[0]),G[1]=Math.max(0,G[1]),e.select(".outer-group").attr("transform","translate("+G+")"),f.title){var H=e.select("g.title-group text").style(U).text(f.title),Y=H.node().getBBox();H.attr({x:_[0]-Y.width/2,y:_[1]-b-20})}var X=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var W=X.selectAll("circle.grid-circle").data(n.ticks(5));W.enter().append("circle").attr({"class":"grid-circle"}).style(B),W.attr("r",n),W.exit().remove()}X.select("circle.outside-circle").attr({r:b}).style(B);var Z=e.select("circle.background-circle").attr({r:b}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var Q=i.svg.axis().scale(n).ticks(5).tickSize(5);X.call(Q).attr({transform:"rotate("+f.radialAxis.orientation+")"}),X.selectAll(".domain").style(B),X.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(U).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,U["font-size"]]+")":"translate("+[0,U["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var K=e.select(".angular.axis-group").selectAll("g.angular-tick").data(j),$=K.enter().append("g").classed("angular-tick",!0);K.attr({transform:function(t,e){return"rotate("+l(t,e)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),K.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(B),$.selectAll(".minor").style({stroke:f.minorTickColor}),K.select("line.grid-line").attr({x1:f.tickLength?b-f.tickLength:0,x2:b}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(U);var J=K.select("text.axis-text").attr({x:b+f.labelOffset,dy:".35em",transform:function(t,e){var r=l(t,e),n=b+f.labelOffset,i=f.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?270>r&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(180>=r&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":A?A[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(U);f.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var tt=i.max(D.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));F.attr({transform:"translate("+[b+tt,f.margin.top]+")"});var et=e.select("g.geometry-group").selectAll("g").size()>0,rt=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(rt.enter().append("g").attr({"class":function(t,e){return"geometry geometry"+e}}),rt.exit().remove(),p[0]||et){var nt=[];p.forEach(function(t,e){var r={};r.radialScale=n,r.angularScale=s,r.container=rt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=f.orientation,r.direction=f.direction,r.index=e,nt.push({data:t,geometryConfig:r})});var it=i.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(nt),at=[];it.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return o(a[r].defaultConfig(),t)});a[r]().config(n)()})}var ot,st,lt=e.select(".guides-group"),ut=e.select(".tooltips-group"),ct=a.tooltipPanel().config({container:ut,fontSize:8})(),ft=a.tooltipPanel().config({container:ut,fontSize:8})(),ht=a.tooltipPanel().config({container:ut,hasTick:!0})();if(!M){var pt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});D.on("mousemove.angular-guide",function(t,e){var r=a.util.getMousePos(Z).angle;pt.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;ot=s.invert(n);var i=a.util.convertToCartesian(b+12,r+180);ct.text(a.util.round(ot)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var dt=lt.select("circle").style({stroke:"grey",fill:"none"});D.on("mousemove.radial-guide",function(t,e){var r=a.util.getMousePos(Z).radius;dt.attr({r:r}).style({opacity:.5}),st=n.invert(a.util.getMousePos(Z).radius);var i=a.util.convertToCartesian(r,f.radialAxis.orientation);ft.text(a.util.round(st)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ht.hide(),ct.hide(),ft.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var n=i.select(this),o=n.style("fill"),s="black",l=n.style("opacity")||1;if(n.attr({"data-opacity":l}),"none"!=o){n.attr({"data-fill":o}),s=i.hsl(o).darker().toString(),n.style({fill:s,opacity:1});var u={t:a.util.round(t[0]),r:a.util.round(t[1])};M&&(u.t=A[t[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=e.node().getBoundingClientRect(),p=[f.left+f.width/2-G[0]-h.left,f.top+f.height/2-G[1]-h.top];ht.config({color:s}).text(c),ht.move(p)}else o=n.style("stroke"),n.attr({"data-stroke":o}),s=i.hsl(o).darker().toString(),n.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){return 0!=i.event.which?!1:void(i.select(this).attr("data-fill")&&ht.show())}).on("mouseout.tooltip",function(t,e){ht.hide();var r=i.select(this),n=r.attr("data-fill");n?r.style({fill:n,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),h}var e,r,n,s,l={data:[],layout:{}},u={},c={},f=i.dispatch("hover"),h={};return h.render=function(e){return t(e),this},h.config=function(t){if(!arguments.length)return l;var e=a.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),o(l.data[e],a.Axis.defaultConfig().data[0]),o(l.data[e],t)}),o(l.layout,a.Axis.defaultConfig().layout),o(l.layout,e.layout),this},h.getLiveConfig=function(){return c},h.getinputConfig=function(){return u},h.radialScale=function(t){return n},h.angularScale=function(t){return s},h.svg=function(){return e},i.rebind(h,f,"on"),h},a.Axis.defaultConfig=function(t,e){var r={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:i.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return r},a.util={},a.DATAEXTENT="dataExtent",a.AREA="AreaChart",a.LINE="LinePlot",a.DOT="DotPlot",a.BAR="BarChart",a.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},a.util._extend=function(t,e){for(var r in t)e[r]=t[r]},a.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},a.util.dataFromEquation2=function(t,e){var r=e||6,n=i.range(0,360+r,r).map(function(e,r){ -var n=e*Math.PI/180,i=t(n);return[e,i]});return n},a.util.dataFromEquation=function(t,e,r){var n=e||6,a=[],o=[];i.range(0,360+n,n).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},a.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return i.range(e).map(function(t,e){return r[e]||r[0]})},a.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=a.util.ensureArray(t[e],r)}),t},a.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},a.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},a.util.sumArrays=function(t,e){return i.zip(t,e).map(function(t,e){return i.sum(t)})},a.util.arrayLast=function(t){return t[t.length-1]},a.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},a.util.flattenArray=function(t){for(var e=[];!a.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},a.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},a.util.convertToCartesian=function(t,e){var r=e*Math.PI/180,n=t*Math.cos(r),i=t*Math.sin(r);return[n,i]},a.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},a.util.getMousePos=function(t){var e=i.mouse(t.node()),r=e[0],n=e[1],a={};return a.x=r,a.y=n,a.pos=e,a.angle=180*(Math.atan2(n,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+n*n),a},a.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;a>i;i++)e=t[i],e in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},a.util.duplicates=function(t){return Object.keys(a.util.duplicatesCount(t))},a.util.translator=function(t,e,r,n){if(n){var i=r.slice();r=e,e=i}var a=e.reduce(function(t,e){return"undefined"!=typeof t?t[e]:void 0},t);"undefined"!=typeof a&&(e.reduce(function(t,r,n){return"undefined"!=typeof t?(n===e.length-1&&delete t[r],t[r]):void 0},t),r.reduce(function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=a),t[e]},t))},a.PolyChart=function(){function t(){var t=r[0].geometryConfig,e=t.container;"string"==typeof e&&(e=i.select(e)),e.datum(r).each(function(e,r){function n(e,r){var n=t.radialScale(e[1]),i=(t.angularScale(e[0])+t.orientation)*Math.PI/180;return{r:n,t:i}}function a(t){var e=t.r*Math.cos(t.t),r=t.r*Math.sin(t.t);return{x:e,y:r}}var o=!!e[0].data.yStack,l=e.map(function(t,e){return o?i.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):i.zip(t.data.t[0],t.data.r[0])}),u=t.angularScale,c=t.radialScale.domain()[0],f={};f.bar=function(r,n,a){var o=e[a].data,s=t.radialScale(r[1])-t.radialScale(0),l=t.radialScale(r[2]||0),c=o.barWidth;i.select(this).attr({"class":"mark bar",d:"M"+[[s+l,-c/2],[s+l,c/2],[l,c/2],[l,-c/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+u(e[0]))+")"}})},f.dot=function(t,r,o){var s=t[2]?[t[0],t[1]+t[2]]:t,l=i.svg.symbol().size(e[o].data.dotSize).type(e[o].data.dotType)(t,r);i.select(this).attr({"class":"mark dot",d:l,transform:function(t,e){var r=a(n(s));return"translate("+[r.x,r.y]+")"}})};var h=i.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});f.line=function(r,n,a){var o=r[2]?l[a].map(function(t,e){return[t[0],t[1]+t[2]]}):l[a];if(i.select(this).each(f.dot).style({opacity:function(t,r){return+e[a].data.dotVisible},fill:m.stroke(r,n,a)}).attr({"class":"mark dot"}),!(n>0)){var s=i.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({"class":"line",d:h(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return m.fill(r,n,a)},"fill-opacity":0,stroke:function(t,e){return m.stroke(r,n,a)},"stroke-width":function(t,e){return m["stroke-width"](r,n,a)},"stroke-dasharray":function(t,e){return m["stroke-dasharray"](r,n,a)},opacity:function(t,e){return m.opacity(r,n,a)},display:function(t,e){return m.display(r,n,a)}})}};var p=t.angularScale.range(),d=Math.abs(p[1]-p[0])/l[0].length*Math.PI/180,g=i.svg.arc().startAngle(function(t){return-d/2}).endAngle(function(t){return d/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,r,n){i.select(this).attr({"class":"mark arc",d:g,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var m={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return s[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return"undefined"==typeof e[n].data.visible||e[n].data.visible?"block":"none"}},v=i.select(this).selectAll("g.layer").data(l);v.enter().append("g").attr({"class":"layer"});var y=v.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({"class":"mark"}),y.style(m).each(f[t.geometryType]),y.exit().remove(),v.exit().remove()})}var e,r=[a.PolyChart.defaultConfig()],n=i.dispatch("hover"),s={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){r[e]||(r[e]={}),o(r[e],a.PolyChart.defaultConfig()),o(r[e],t)}),this):r},t.getColorScale=function(){return e},i.rebind(t,n,"on"),t},a.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:i.scale.category20()}};return t},a.BarChart=function(){return a.PolyChart()},a.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},a.AreaChart=function(){return a.PolyChart()},a.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},a.DotPlot=function(){return a.PolyChart()},a.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},a.LinePlot=function(){return a.PolyChart()},a.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},a.Legend=function(){function t(){var r=e.legendConfig,n=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=o({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),a=i.merge(n);a=a.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||"undefined"==typeof r.elements[e].visibleInLegend)}),r.reverseOrder&&(a=a.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=i.select(s));var l=a.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof a[0]:r.isContinuous,f=c?r.height:u*a.length,h=s.classed("legend-group",!0),p=h.selectAll("svg").data([0]),d=p.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var g=i.range(a.length),m=i.scale[c?"linear":"ordinal"]().domain(g).range(l),v=i.scale[c?"linear":"ordinal"]().domain(g)[c?"range":"rangePoints"]([0,f]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=i.svg.symbolTypes.indexOf(t)?i.svg.symbol().type(t).size(r)():i.svg.symbol().type("square").size(r)()};if(c){var b=p.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);b.enter().append("stop"),b.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),p.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var x=p.select(".legend-marks").selectAll("path.legend-mark").data(a);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return m(e)}}),x.exit().remove()}var _=i.svg.axis().scale(v).orient("right"),w=p.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return a[e].name}),t}var e=a.Legend.defaultConfig(),r=i.dispatch("hover");return t.config=function(t){return arguments.length?(o(e,t),this):e},i.rebind(t,r,"on"),t},a.Legend.defaultConfig=function(t,e){var r={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return r},a.tooltipPanel=function(){var t,e,r,n={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+a.tooltipPanel.uid++,l=10,u=function(){t=n.container.selectAll("g."+s).data([0]);var i=t.enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=i.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=i.append("text").attr({dx:n.padding+l,dy:.3*+n.fontSize}),u};return u.text=function(a){var o=i.hsl(n.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",f=a||"";e.style({fill:c,"font-size":n.fontSize+"px"}).text(f);var h=n.padding,p=e.node().getBBox(),d={fill:n.color,stroke:s,"stroke-width":"2px"},g=p.width+2*h+l,m=p.height+2*h;return r.attr({d:"M"+[[l,-m/2],[l,-m/4],[n.hasTick?0:l,0],[l,m/4],[l,m/2],[g,m/2],[g,-m/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[l,-m/2+2*h]+")"}),t.style({display:"block"}),u},u.move=function(e){return t?(t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u):void 0},u.hide=function(){return t?(t.style({display:"none"}),u):void 0},u.show=function(){return t?(t.style({display:"block"}),u):void 0},u.config=function(t){return o(n,t),u},u},a.tooltipPanel.uid=1,a.adapter={},a.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=o({},t),i=[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]];return i.forEach(function(t,r){a.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var n=a.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var i=n.indexOf(t.geometry);-1!=i&&(r.data[e].groupId=i)})}if(t.layout){var s=o({},t.layout),l=[[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]];if(l.forEach(function(t,r){a.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var u=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],f={};i.entries(s.margin).forEach(function(t,e){f[c[u.indexOf(t.key)]]=t.value}),s.margin=f}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../plotly":1070,"./micropolar_manager":1113,d3:64}],1113:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("d3"),a=t("./undo_manager"),o=e.exports={},s=n.Lib.extendDeepAll;o.framework=function(t){function e(e,a){return a&&(f=a),i.select(i.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?s(r,e):e,u||(u=n.micropolar.Axis()),c=n.micropolar.adapter.plotly().convert(r),u.config(c).render(f),t.data=r.data,t.layout=r.layout,o.fillLayout(t),r}var r,l,u,c,f,h=new a;return e.isPolar=!0,e.svg=function(){return u.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return n.micropolar.adapter.plotly().convert(u.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:u.angularScale(),r:u.radialScale()}},e.setUndoPoint=function(){var t=this,e=n.micropolar.util.cloneJson(r);!function(e,r){h.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,l),l=n.micropolar.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},o.fillLayout=function(t){var e=i.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:n.Color.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(o,t.layout)}},{"../../plotly":1070,"./undo_manager":1114,d3:64}],1114:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n-1}var a=t("../plotly"),o=a.Lib.extendFlat,s=a.Lib.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,l=t.data,u=t.layout,c=s([],l),f=s({},u,n(e.tileClass));if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var h=Object.keys(f);for(r=0;rl;l++)n(r[l])&&n(s[l])&&p.push({p:r[l],s:s[l],b:0});return a(e,"marker")&&o(e,e.marker.color,"marker","c"),a(e,"marker.line")&&o(e,e.marker.line.color,"marker.line","c"),p}},{"../../components/colorscale/calc":1012,"../../components/colorscale/has_colorscale":1017,"../../plotly":1070,"fast-isnumeric":72}],1123:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../scatter/xy_defaults"),o=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}var f=a(t,e,c);return f?(c("orientation",e.x&&!e.y?"h":"v"),c("text"),o(t,e,c,r,u),s(t,e,i.defaultLine,{axis:"y"}),void s(t,e,i.defaultLine,{axis:"x",inherit:"y"})):void(e.visible=!1)}},{"../../components/color":1005,"../../components/errorbars/defaults":1028,"../../lib":1053,"../bar/style_defaults":1131,"../scatter/xy_defaults":1202,"./attributes":1121}],1124:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("../../components/color");e.exports=function(t,e,r,a){var o,s=t.cd,l=s[0].trace,u=s[0].t,c=t.xa,f=t.ya,h="closest"===a?u.barwidth/2:u.dbar*(1-c._td._fullLayout.bargap)/2;o="closest"!==a?function(t){return t.p}:"h"===l.orientation?function(t){return t.y}:function(t){return t.x};var p,d;"h"===l.orientation?(p=function(t){return n.Fx.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},d=function(t){var e=o(t)-r;return n.Fx.inbox(e-h,e+h)}):(d=function(t){return n.Fx.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},p=function(t){var r=o(t)-e;return n.Fx.inbox(r-h,r+h)});var g=n.Fx.getDistanceFunction(a,p,d);if(n.Fx.getClosest(s,g,t),t.index!==!1){var m=s[t.index],v=m.mcc||l.marker.color,y=m.mlcc||l.marker.line.color,b=m.mlw||l.marker.line.width;return i.opacity(v)?t.color=v:i.opacity(y)&&b&&(t.color=y),"h"===l.orientation?(t.x0=t.x1=c.c2p(m.x,!0),t.xLabelVal=m.s,t.y0=f.c2p(o(m)-h,!0),t.y1=f.c2p(o(m)+h,!0),t.yLabelVal=m.p):(t.y0=t.y1=f.c2p(m.y,!0),t.yLabelVal=m.s,t.x0=c.c2p(o(m)-h,!0),t.x1=c.c2p(o(m)+h,!0),t.xLabelVal=m.p),m.tx&&(t.text=m.tx),n.ErrorBars.hoverInfo(m,l,t),[t]}}},{"../../components/color":1005,"../../plotly":1070}],1125:[function(t,e,r){"use strict";var n=t("../../plotly");n.Plots.register(r,"bar",["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],{}),r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.supplyDefaults=t("./defaults"),r.supplyLayoutDefaults=t("./layout_defaults"),r.calc=t("./calc"),r.setPositions=t("./set_positions"),r.colorbar=t("../scatter/colorbar"),r.arraysToCalcdata=t("./arrays_to_calcdata"),r.plot=t("./plot"),r.style=t("./style"),r.hoverPoints=t("./hover")},{"../../plotly":1070,"../scatter/colorbar":1198,"./arrays_to_calcdata":1120,"./attributes":1121,"./calc":1122,"./defaults":1123,"./hover":1124,"./layout_attributes":1126,"./layout_defaults":1127,"./plot":1128,"./set_positions":1129,"./style":1130}],1126:[function(t,e,r){e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],1127:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function o(r,n){return i.coerce(t,e,a,r,n)}var s,l,u,c=!1,f=!1,h=!1,p={};for(s=0;s=2?a(t):t>e?Math.ceil(t):Math.floor(t)}var h,p,d,g;if("h"===f.orientation?(d=u.c2p(r.poffset+e.p,!0),g=u.c2p(r.poffset+e.p+r.barwidth,!0),h=l.c2p(e.b,!0),p=l.c2p(e.s+e.b,!0)):(h=l.c2p(r.poffset+e.p,!0),p=l.c2p(r.poffset+e.p+r.barwidth,!0),g=u.c2p(e.s+e.b,!0),d=u.c2p(e.b,!0)),!(i(h)&&i(p)&&i(d)&&i(g)&&h!==p&&d!==g))return void n.select(this).remove();var m=(e.mlw+1||f.marker.line.width+1||(e.trace?e.trace.marker.line.width:0)+1)-1,v=n.round(m/2%1,2);if(!t._context.staticPlot){var y=o.opacity(e.mc||f.marker.color),b=1>y||m>.01?a:s;h=b(h,p),p=b(p,h),d=b(d,g),g=b(g,d)}n.select(this).attr("d","M"+h+","+d+"V"+g+"H"+p+"V"+d+"Z")})})}},{"../../components/color":1005,"../../lib":1053,"./arrays_to_calcdata":1120,d3:64,"fast-isnumeric":72}],1129:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plotly"),a=t("../../lib");e.exports=function(t,e){var r,o,s=t._fullLayout,l=e.x(),u=e.y();["v","h"].forEach(function(c){function f(e){function r(t){t[p]=t.p+d}var n=[];e.forEach(function(e){t.calcdata[e].forEach(function(t){n.push(t.p)})});var o=a.distinctVals(n),l=o.vals,u=o.minDiff,c=!1,f=[];"group"===s.barmode&&e.forEach(function(e){c||(t.calcdata[e].forEach(function(t){c||f.forEach(function(e){Math.abs(t.p-e)b&&(T=!0,A=b),b>w+C&&(T=!0,w=b))}i.Axes.expand(m,[A,w],{tozero:!0,padded:T})}else{var P=function(t){return t[d]=t.s,t.s};for(r=0;r1||0===o.bargap&&0===o.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,o=r.line,s=(e._input||{}).marker||{},l=i.Drawing.tryColorscale(r,s,""),u=i.Drawing.tryColorscale(r,s,"line.");n.select(this).selectAll("path").each(function(t){var e,i,s=(t.mlw+1||o.width+1)-1,c=n.select(this);e="mc"in t?t.mcc=l(t.mc):Array.isArray(r.color)?a.defaultLine:r.color,c.style("stroke-width",s+"px").call(a.fill,e),s&&(i="mlc"in t?t.mlcc=u(t.mlc):Array.isArray(o.color)?a.defaultLine:o.color,c.call(a.stroke,i))})})}},{"../../components/color":1005,"../../plotly":1070,d3:64}],1131:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"); -e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":1005,"../../components/colorscale/defaults":1014,"../../components/colorscale/has_colorscale":1017}],1132:[function(t,e,r){var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:a({},o.symbol,{arrayOk:!1}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1}),size:a({},o.size,{arrayOk:!1}),color:a({},o.color,{arrayOk:!1}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine}),width:a({},s.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:n.fillcolor}},{"../../components/color/attributes":1004,"../../lib/extend":1049,"../scatter/attributes":1197}],1133:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plotly"),a=t("../../lib");e.exports=function(t,e){function r(t,e,r,i,o){var s;return r in e?d=i.makeCalcdata(e,r):(s=r+"0"in e?e[r+"0"]:"name"in e&&("category"===i.type||n(e.name)&&-1!==["linear","log"].indexOf(i.type)||a.isDateTime(e.name)&&"date"===i.type)?e.name:t.numboxes,s=i.d2c(s),d=o.map(function(){return s})),d}function o(t,e,r,i,o){var s,l,u,c,f=i.length,h=e.length,p=[],d=[];for(s=0;f>s;++s)l=i[s],t[s]={pos:l},d[s]=l-o,p[s]=[];for(d.push(i[f-1]+o),s=0;h>s;++s)c=e[s],n(c)&&(u=a.findBin(r[s],d),u>=0&&h>u&&p[u].push(c));return p}function s(t,e){var r,n,i,o;for(o=0;o1,v=r.dPos*(1-h.boxgap)*(1-h.boxgroupgap)/(m?t.numboxes:1),y=m?2*r.dPos*(-.5+(r.boxnum+.5)/t.numboxes)*(1-h.boxgap):0,b=v*g.whiskerwidth;return g.visible!==!0||r.emptybox?void a.select(this).remove():("h"===g.orientation?(l=d,f=p):(l=p,f=d),r.bPos=y,r.bdPos=v,n(),a.select(this).selectAll("path.box").data(s.identity).enter().append("path").attr("class","box").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-v,!0),n=l.c2p(t.pos+y+v,!0),i=l.c2p(t.pos+y-b,!0),o=l.c2p(t.pos+y+b,!0),u=f.c2p(t.q1,!0),c=f.c2p(t.q3,!0),h=s.constrain(f.c2p(t.med,!0),Math.min(u,c)+1,Math.max(u,c)-1),p=f.c2p(g.boxpoints===!1?t.min:t.lf,!0),d=f.c2p(g.boxpoints===!1?t.max:t.uf,!0);"h"===g.orientation?a.select(this).attr("d","M"+h+","+r+"V"+n+"M"+u+","+r+"V"+n+"H"+c+"V"+r+"ZM"+u+","+e+"H"+p+"M"+c+","+e+"H"+d+(0===g.whiskerwidth?"":"M"+p+","+i+"V"+o+"M"+d+","+i+"V"+o)):a.select(this).attr("d","M"+r+","+h+"H"+n+"M"+r+","+u+"H"+n+"V"+c+"H"+r+"ZM"+e+","+u+"V"+p+"M"+e+","+c+"V"+d+(0===g.whiskerwidth?"":"M"+i+","+p+"H"+o+"M"+i+","+d+"H"+o))}),g.boxpoints&&a.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=g}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,a,o,l,f,h="all"===g.boxpoints?t.val:t.val.filter(function(e){return et.uf}),p=(t.q3-t.q1)*c,d=[],m=0;if(g.jitter){for(e=0;et.lo&&(n.so=!0),n})}).enter().append("path").call(o.Drawing.translatePoints,p,d),void(g.boxmean&&a.select(this).selectAll("path.mean").data(s.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-v,!0),n=l.c2p(t.pos+y+v,!0),i=f.c2p(t.mean,!0),o=f.c2p(t.mean-t.sd,!0),s=f.c2p(t.mean+t.sd,!0);"h"===g.orientation?a.select(this).attr("d","M"+i+","+r+"V"+n+("sd"!==g.boxmean?"":"m0,0L"+o+","+e+"L"+i+","+r+"L"+s+","+e+"Z")):a.select(this).attr("d","M"+r+","+i+"H"+n+("sd"!==g.boxmean?"":"m0,0L"+e+","+o+"L"+r+","+i+"L"+e+","+s+"Z"))})))})}},{"../../lib":1053,"../../plotly":1070,d3:64}],1140:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("../../plots/plots"),a=t("../../lib");e.exports=function(t,e){var r,o,s,l,u=t._fullLayout,c=e.x(),f=e.y(),h=["v","h"];for(o=0;ol&&(e.z=c.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),i(t,e,o,s,{prefix:"",cLetter:"z"}),void s("hoverinfo",1===o._dataLength?"location+z+text":void 0)):void(e.visible=!1)}},{"../../components/colorscale/defaults":1014,"../../lib":1053,"./attributes":1142}],1144:[function(t,e,r){"use strict";var n=t("../../plots/plots");n.register(r,"choropleth",["geo","noOpacity"],{}),r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.colorbar=t("../heatmap/colorbar"),r.calc=t("../surface/calc")},{"../../plots/plots":1109,"../heatmap/colorbar":1157,"../surface/calc":1217,"./attributes":1142,"./defaults":1143}],1145:[function(t,e,r){"use strict";function n(t,e){function r(e){var r=t.mockAxis;return i.Axes.tickText(r,r.c2l(e),"hover").text}var n=e.hoverinfo;if("none"===n)return function(t){delete t.nameLabel,delete t.textLabel};var a="all"===n?d.hoverinfo.flags:n.split("+"),o=-1!==a.indexOf("name"),s=-1!==a.indexOf("location"),l=-1!==a.indexOf("z"),u=-1!==a.indexOf("text"),c=!o&&s;return function(t){var n=[];c?t.nameLabel=t.id:(o&&(t.nameLabel=e.name),s&&n.push(t.id)),l&&n.push(r(t.z)),u&&n.push(t.tx),t.textLabel=n.join("
")}}var i=t("../../plotly"),a=t("d3"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("../../components/colorscale/get_scale"),u=t("../../components/colorscale/make_scale_function"),c=t("../../lib/topojson_utils").getTopojsonFeatures,f=t("../../lib/geo_location_utils").locationToFeature,h=t("../../lib/array_to_calc_item"),p=t("../../constants/geo_constants"),d=t("./attributes"),g=e.exports={};g.calcGeoJSON=function(t,e){for(var r,n=[],i=t.locations,a=i.length,o=c(t,e),s=(t.marker||{}).line||{},l=0;a>l;l++)r=f(t.locationmode,i[l],o),void 0!==r&&(r.z=t.z[l],void 0!==t.text&&(r.tx=t.text[l]),h(s.color,r,"mlc",l),h(s.width,r,"mlw",l),n.push(r));return n.length>0&&(n[0].trace=t),n},g.plot=function(t,e,r){var o,s=t.framework,l=t.topojson,u=s.select("g.choroplethlayer"),c=s.select("g.baselayer"),f=s.select("g.baselayeroverchoropleth"),h=p.baseLayersOverChoropleth;u.selectAll("*").remove(),f.selectAll("*").remove();var d=u.selectAll("g.trace.scatter").data(e);d.enter().append("g").attr("class","trace choropleth"),d.each(function(e){function r(e){if(t.showHover){var r=t.projection(e.properties.ct);s(e),i.Fx.loneHover({x:r[0],y:r[1],name:e.nameLabel,text:e.textLabel},{container:t.hoverContainer.node()})}}if(e.visible===!0){var o=g.calcGeoJSON(e,l),s=n(t,e);a.select(this).selectAll("path.choroplethlocation").data(o).enter().append("path").attr("class","choroplethlocation").on("mouseover",r).on("mouseout",function(){i.Fx.loneUnhover(t.hoverContainer)}).on("mousedown",function(){i.Fx.loneUnhover(t.hoverContainer)}).on("mouseup",r)}});for(var m=0;mt?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){var n=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>n?5===r?713:1114:5===r?104:208}return 15===r?0:r}function o(t){var e,r,n,i,o,s,l,u,c,f=t[0].z,h=f.length,p=f[0].length,d=2===h||2===p;for(r=0;h-1>r;r++)for(i=[],0===r&&(i=i.concat(k)),r===h-2&&(i=i.concat(M)),e=0;p-1>e;e++)for(n=i.slice(),0===e&&(n=n.concat(E)),e===p-2&&(n=n.concat(T)),o=e+","+r,s=[[f[r][e],f[r][e+1]],[f[r+1][e],f[r+1][e+1]]],c=0;cm;m++){if(o>20?(o=S[o][(s[0]||s[1])<0?0:1],t.crossings[a]=C[o]):delete t.crossings[a],s=L[o],!s){console.log("found bad marching index",o,e,t.level);break}if(l.push(h(t,e,s)),e[0]+=s[0],e[1]+=s[1],c(l[l.length-1],l[l.length-2])&&l.pop(),a=e.join(","),a===i&&s.join(",")===p||r&&(s[0]&&(e[0]<0||e[0]>g-2)||s[1]&&(e[1]<0||e[1]>d-2)))break;o=t.crossings[a]}1e4===m&&console.log("Infinite loop in contour?");var v,y,b,x,_,w,A,k=c(l[0],l[l.length-1]),M=0,E=.2*t.smoothing,T=[],P=0;for(m=1;m=P;m--)if(v=T[m],z>v){for(b=0,y=m-1;y>=P&&v+T[y]b&&v+T[b]e;)e++,r=Object.keys(i.crossings)[0].split(",").map(Number),s(i,r);1e4===e&&console.log("Infinite loop in contour?")}}function u(t,e,r){var n=0,i=0;return t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==k.indexOf(t)?i=1:-1!==E.indexOf(t)?n=1:-1!==M.indexOf(t)?i=-1:n=-1,[n,i]}function c(t,e){return Math.abs(t[0]-e[0])<.01&&Math.abs(t[1]-e[1])<.01}function f(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function h(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a);return[o.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0)]}var u=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0)]}function p(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n}function d(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function g(t,e,r,n){var i=t.selectAll("g.contourfill").data([0]);i.enter().append("g").classed("contourfill",!0);var a=i.selectAll("path").data("fill"===n.coloring?e:[]);a.enter().append("path"),a.exit().remove(),a.each(function(t){var e=m(t,r);e?x.select(this).attr("d",e).style("stroke","none"):x.select(this).remove()})}function m(t,e){function r(t){return Math.abs(t[1]-e[0][1])<.01}function n(t){return Math.abs(t[1]-e[2][1])<.01}function i(t){return Math.abs(t[0]-e[0][0])<.01}function a(t){return Math.abs(t[0]-e[2][0])<.01}for(var o,s,l,u,c,f,h=t.edgepaths.length||t.z[0][0]l;l++){if(!o){console.log("missing end?",p,t);break}for(r(o)&&!a(o)?s=e[1]:i(o)?s=e[0]:n(o)?s=e[3]:a(o)&&(s=e[2]),c=0;c=0&&(s=m,u=c):Math.abs(o[1]-s[1])<.01?Math.abs(o[1]-m[1])<.01&&(m[0]-o[0])*(s[0]-m[0])>=0&&(s=m,u=c):console.log("endpt to newendpt is not vert. or horz.",o,s,m)}if(o=s,u>=0)break;h+="L"+s}if(u===t.edgepaths.length){console.log("unclosed perimeter path");break}p=u,g=-1===d.indexOf(p),g&&(p=d[0],h+="Z")}for(p=0;pe;e++)s.push(1);for(e=0;a>e;e++)i.push(s.slice());for(e=0;eo;o++)for(n=i(l,o),c[o]=new Array(n),s=0;n>s;s++)c[o][s]=e(a(l,o,s));return c}function i(t,e,r,n,i,a){var o,s,l,u=[],f=c.Plots.traceIs(t,"contour"),h=c.Plots.traceIs(t,"histogram");if(Array.isArray(e)&&!h&&"category"!==a.type){e=e.map(a.d2c);var p=e.length;if(!(i>=p))return f?e.slice(0,i):e.slice(0,i+1);if(f)u=e.slice(0,i);else if(1===i)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],l=1;p>l;l++)u.push(.5*(e[l-1]+e[l]));u.push(1.5*e[p-1]-.5*e[p-2])}if(i>p){var d=u[u.length-1],g=d-u[u.length-2];for(l=p;i>l;l++)d+=g,u.push(d)}}else for(s=n||1,o=void 0===r?0:h||"category"===a.type?r:a.d2c(r),l=f?0:-.5;i>l;l++)u.push(o+s*l);return u}function a(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,i,o=1;if(Array.isArray(r))for(n=0;nn&&o>v;n++)o=l(t,e,a(o));return o>v&&console.log("interp2d didn't converge quickly",o),t}function s(t){var e,r,n,i,a,o,s,l,u=[],c={},f=[],h=t[0],p=[],d=[0,0,0],g=m(t);for(r=0;rn;n++)void 0===p[n]&&(o=(void 0!==p[n-1]?1:0)+(void 0!==p[n+1]?1:0)+(void 0!==e[n]?1:0)+(void 0!==h[n]?1:0),o?(0===r&&o++,0===n&&o++,r===t.length-1&&o++,n===p.length-1&&o++,4>o&&(c[[r,n]]=[r,n,o]),u.push([r,n,o])):f.push([r,n]));for(;f.length;){for(s={},l=!1,a=f.length-1;a>=0;a--)i=f[a],r=i[0],n=i[1],o=((c[[r-1,n]]||d)[2]+(c[[r+1,n]]||d)[2]+(c[[r,n-1]]||d)[2]+(c[[r,n+1]]||d)[2])/20,o&&(s[i]=[r,n,o],f.splice(a,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(i in s)c[i]=s[i],u.push(s[i])}return u.sort(function(t,e){return e[2]-t[2]})}function l(t,e,r){var n,i,a,o,s,l,u,c,f,h,p,d,g,m=0;for(o=0;os;s++)l=y[s],u=t[i+l[0]],u&&(c=u[a+l[1]],void 0!==c&&(0===h?d=g=c:(d=Math.min(d,c), -g=Math.max(g,c)),f++,h+=c));if(0===f)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][a]=h/f,void 0===p?4>f&&(m=1):(t[i][a]=(1+r)*t[i][a]-r*p,g>d&&(m=Math.max(m,Math.abs(t[i][a]-p)/(g-d))))}return m}var u=t("fast-isnumeric"),c=t("../../plotly"),f=t("../../lib"),h=t("../histogram2d/calc"),p=t("../../components/colorscale/calc"),d=t("./has_columns"),g=t("./convert_column_xyz"),m=t("./max_row_length");e.exports=function(t,e){function r(t){E=e._input.zsmooth=e.zsmooth=!1,f.notifier("cannot fast-zsmooth: "+t)}f.markTime("start convert x&y");var a,l,u,v,y,b,x,_,w=c.Axes.getFromId(t,e.xaxis||"x"),A=c.Axes.getFromId(t,e.yaxis||"y"),k=c.Plots.traceIs(e,"contour"),M=c.Plots.traceIs(e,"histogram"),E=k?"best":e.zsmooth;if(w._minDtick=0,A._minDtick=0,f.markTime("done convert x&y"),M){var T=h(t,e);a=T.x,l=T.x0,u=T.dx,v=T.y,y=T.y0,b=T.dy,x=T.z}else d(e)&&g(e,w,A),a=e.x?w.makeCalcdata(e,"x"):[],v=e.y?A.makeCalcdata(e,"y"):[],l=e.x0||0,u=e.dx||1,y=e.y0||0,b=e.dy||1,x=n(e),(k||e.connectgaps)&&(e._emptypoints=s(x),e._interpz=o(x,e._emptypoints,e._interpz));if("fast"===E)if("log"===w.type||"log"===A.type)r("log axis found");else if(!M){if(a.length){var L=(a[a.length-1]-a[0])/(a.length-1),S=Math.abs(L/100);for(_=0;_S){r("x scale is not linear");break}}if(v.length&&"fast"===E){var C=(v[v.length-1]-v[0])/(v.length-1),P=Math.abs(C/100);for(_=0;_P){r("y scale is not linear");break}}}var z=m(x),R="scaled"===e.xtype?"":e.x,j=i(e,R,l,u,z,w),I="scaled"===e.ytype?"":e.y,O=i(e,I,y,b,x.length,A);c.Axes.expand(w,j),c.Axes.expand(A,O);var N={x:j,y:O,z:x};if(p(e,x,"","z"),k&&e.contours&&"heatmap"===e.contours.coloring){var F="contour"===e.type?"heatmap":"histogram2d";N.xfill=i(F,R,l,u,z,w),N.yfill=i(F,I,y,b,x.length,A)}return[N]};var v=.01,y=[[-1,0],[1,0],[0,-1],[0,1]]},{"../../components/colorscale/calc":1012,"../../lib":1053,"../../plotly":1070,"../histogram2d/calc":1176,"./convert_column_xyz":1158,"./has_columns":1160,"./max_row_length":1163,"fast-isnumeric":72}],1157:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plotly"),o=t("../../lib"),s=t("../../components/colorscale/get_scale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,u="cb"+r.uid,c=s(r.colorscale),f=r.zmin,h=r.zmax;if(i(f)||(f=o.aggNums(Math.min,null,r.z)),i(h)||(h=o.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll("."+u).remove(),!r.showscale)return void a.Plots.autoMargin(t,u);var p=e[0].t.cb=l(t,u);p.fillcolor(n.scale.linear().domain(c.map(function(t){return f+t[0]*(h-f)})).range(c.map(function(t){return t[1]}))).filllevels({start:f,end:h,size:(h-f)/254}).options(r.colorbar)(),o.markTime("done colorbar")}},{"../../components/colorbar/draw":1008,"../../components/colorscale/get_scale":1016,"../../lib":1053,"../../plotly":1070,d3:64,"fast-isnumeric":72}],1158:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a=t.x.slice(),o=t.y.slice(),s=t.z,l=t.text,u=Math.min(a.length,o.length,s.length),c=void 0!==l&&!Array.isArray(l[0]);for(ui;i++)a[i]=e.d2c(a[i]),o[i]=r.d2c(o[i]);var f,h,p,d=n.distinctVals(a),g=d.vals,m=n.distinctVals(o),v=m.vals,y=n.init2dArray(v.length,g.length);for(c&&(p=n.init2dArray(v.length,g.length)),i=0;u>i;i++)f=n.findBin(a[i]+d.minDiff/2,g),h=n.findBin(o[i]+m.minDiff/2,v),y[h][f]=s[i],c&&(p[h][f]=l[i]);t.x=g,t.y=v,t.z=y,c&&(t.text=p)}},{"../../lib":1053}],1159:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./has_columns"),a=t("./xyz_defaults"),o=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,i){return n.coerce(t,e,s,r,i)}var c=a(t,e,u);return c?(u("text"),u("zsmooth"),u("connectgaps",i(e)&&e.zsmooth!==!1),void o(t,e,l,u,{prefix:"",cLetter:"z"})):void(e.visible=!1)}},{"../../components/colorscale/defaults":1014,"../../lib":1053,"./attributes":1155,"./has_columns":1160,"./xyz_defaults":1166}],1160:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],1161:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("../../lib");e.exports=function(t,e,r,a,o){if(!(t.distanceu||u>=v[0].length||0>c||c>v.length)return}else{if(n.Fx.inbox(e-g[0],e-g[g.length-1])>n.Fx.MAXDIST||n.Fx.inbox(r-m[0],r-m[m.length-1])>n.Fx.MAXDIST)return;if(o){b=[2*g[0]-g[1]];for(var w=1;w0;)_=g.c2p(C[M]),M--;for(x>_&&(w=_,_=x,x=w,O=!0),M=0;void 0===A&&M0;)k=m.c2p(P[M]),M--;if(A>k&&(w=A,A=k,k=w,N=!0),z&&(C=r[0].xfill,P=r[0].yfill),"fast"!==R){var F="best"===R?0:.5;x=Math.max(-F*g._length,x),_=Math.min((1+F)*g._length,_),A=Math.max(-F*m._length,A),k=Math.min((1+F)*m._length,k)}var D=Math.round(_-x),B=Math.round(k-A);if(!(0>=D||0>=B)){var U,V;"fast"===R?(U=I,V=j):(U=D,V=B);var q=document.createElement("canvas");q.width=U,q.height=V;var G,H,Y=q.getContext("2d"),X=i.scale.linear().domain(S.map(function(t){return t[0]})).range(S.map(function(t){var e=a(t[1]).toRgb();return[e.r,e.g,e.b,e.a]})).clamp(!0);"fast"===R?(G=O?function(t){return I-1-t}:s.identity,H=N?function(t){return j-1-t}:s.identity):(G=function(t){return s.constrain(Math.round(g.c2p(C[t])-x),0,D)},H=function(t){return s.constrain(Math.round(m.c2p(P[t])-A),0,B)}),s.markTime("done init png");var W,Z,Q,K,$,J,tt=H(0),et=[tt,tt],rt=O?0:1,nt=N?0:1,it=0,at=0,ot=0,st=0;if(R){var lt=0,ut=new Uint8Array(D*B*4);if("best"===R){var ct,ft,ht,pt=new Array(C.length),dt=new Array(P.length),gt=new Array(D);for(M=0;MM;M++)gt[M]=n(M,pt);for(Z=0;B>Z;Z++)for(ct=n(Z,dt),ft=E[ct.bin0],ht=E[ct.bin1],M=0;D>M;M++,lt+=4)J=h(ft,ht,gt[M],ct),f(ut,lt,J)}else for(Z=0;j>Z;Z++)for($=E[Z],et=H(Z),M=0;I>M;M++)J=c($[M],1),lt=4*(et*D+G(M)),f(ut,lt,J);var mt=Y.createImageData(D,B);mt.data.set(ut),Y.putImageData(mt,0,0)}else for(Z=0;j>Z;Z++)if($=E[Z],et.reverse(),et[nt]=H(Z+1),et[0]!==et[1]&&void 0!==et[0]&&void 0!==et[1])for(Q=G(0),W=[Q,Q],M=0;I>M;M++)W.reverse(),W[rt]=G(M+1),W[0]!==W[1]&&void 0!==W[0]&&void 0!==W[1]&&(K=$[M],J=c(K,(W[1]-W[0])*(et[1]-et[0])),Y.fillStyle="rgba("+J.join(",")+")",Y.fillRect(W[0],et[0],W[1]-W[0],et[1]-et[0]));s.markTime("done filling png"),at=Math.round(at/it),ot=Math.round(ot/it),st=Math.round(st/it);var vt=a("rgb("+at+","+ot+","+st+")");t._hmpixcount=(t._hmpixcount||0)+it,t._hmlumcount=(t._hmlumcount||0)+it*vt.getLuminance(),v._paper.selectAll("."+y).remove(),e.plot.select(".maplayer").append("svg:image").classed(y,!0).datum(r[0]).attr({xmlns:"http://www.w3.org/2000/svg","xlink:xlink:href":q.toDataURL("image/png"),height:B,width:D,x:x,y:A,preserveAspectRatio:"none"}),s.markTime("done showing png")}}var i=t("d3"),a=t("tinycolor2"),o=t("../../plotly"),s=t("../../lib"),l=t("../../components/colorscale/get_scale"),u=t("./max_row_length");e.exports=function(t,e,r){r.forEach(function(r){n(t,e,r)})}},{"../../components/colorscale/get_scale":1016,"../../lib":1053,"../../plotly":1070,"./max_row_length":1163,d3:64,tinycolor2:998}],1165:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t){n.select(t).selectAll("image").style("opacity",function(t){return t.trace.opacity})}},{d3:64}],1166:[function(t,e,r){"use strict";function n(t,e){var r=e(t),n=r?e(t+"type","array"):"scaled";return"scaled"===n&&(e(t+"0"),e("d"+t)),r}function i(t){for(var e,r=!0,n=!1,i=!1,o=0;o0&&(n=!0);for(var s=0;si;i++)e[i]?(t[i]/=e[i],n+=t[i]):t[i]=null;return n}},{}],1169:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){return r("histnorm"),n.forEach(function(t){var e=r(t+"bins.start"),n=r(t+"bins.end"),i=r("autobin"+t,!(e&&n));r(i?"nbins"+t:t+"bins.size")}),e}},{}],1170:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,i){var a=i[e];return n(a)?(a=Number(a),r[t]+=a,a):0},avg:function(t,e,r,i,a){var o=i[e];return n(o)&&(o=Number(o),r[t]+=o,a[t]++),0},min:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]>a)return r[t]=a,a-r[t]}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]r&&u.length<5e3;)g=i.Axes.tickIncrement(r,b.size),u.push((r+g)/2),c.push(S),x&&_.push(r),T&&w.push(1/(g-r)),z&&A.push(0),r=g;var R=c.length;for(r=0;r=0&&R>v&&(k+=C(v,r,c,y,A));z&&(k=l(c,A)),P&&P(c,k,w);var j=Math.min(u.length,c.length),I=[],O=0,N=j-1;for(r=0;j>r;r++)if(c[r]){O=r;break}for(r=j-1;r>O;r--)if(c[r]){N=r;break}for(r=O;N>=r;r++)n(u[r])&&n(c[r])&&I.push({p:u[r],s:c[r],b:0});return I}}},{"../../lib":1053,"../../plotly":1070,"./average":1168,"./bin_functions":1170,"./norm_functions":1174,"fast-isnumeric":72}],1172:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("./bin_defaults"),o=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}var f=c("x"),h=c("y");c("text");var p=c("orientation",h&&!f?"h":"v"),d=e["v"===p?"x":"y"];if(!d||!d.length)return void(e.visible=!1);var g=e["h"===p?"x":"y"];g&&c("histfunc");var m="h"===p?["y"]:["x"];a(t,e,c,m),o(t,e,c,r,u),s(t,e,i.defaultLine,{axis:"y"}),s(t,e,i.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":1005,"../../components/errorbars/defaults":1028,"../../lib":1053,"../bar/style_defaults":1131,"./attributes":1167,"./bin_defaults":1169}],1173:[function(t,e,r){"use strict";var n=t("../../plotly");n.Plots.register(r,"histogram",["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],{}),r.attributes=t("./attributes"),r.layoutAttributes=t("../bar/layout_attributes"),r.supplyDefaults=t("./defaults"),r.supplyLayoutDefaults=t("../bar/layout_defaults"),r.calc=t("./calc"),r.setPositions=t("../bar/set_positions"),r.plot=t("../bar/plot"),r.style=t("../bar/style"),r.colorbar=t("../scatter/colorbar"),r.hoverPoints=t("../bar/hover")},{"../../plotly":1070,"../bar/hover":1124,"../bar/layout_attributes":1126,"../bar/layout_defaults":1127,"../bar/plot":1128,"../bar/set_positions":1129,"../bar/style":1130,"../scatter/colorbar":1198,"./attributes":1167,"./calc":1171,"./defaults":1172}],1174:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;r>i;i++)t[i]*=n},probability:function(t,e){for(var r=t.length,n=0;r>n;n++)t[n]/=e},density:function(t,e,r,n){var i=t.length;n=n||1;for(var a=0;i>a;a++)t[a]*=r[a]*n},"probability density":function(t,e,r,n){var i=t.length;n&&(e/=n);for(var a=0;i>a;a++)t[a]*=r[a]/e}}},{}],1175:[function(t,e,r){var n=t("../histogram/attributes"),i=t("../heatmap/attributes");e.exports={x:n.x,y:n.y,z:{valType:"data_array"},marker:{color:{valType:"data_array"}},histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,zauto:i.zauto,zmin:i.zmin,zmax:i.zmax,colorscale:i.colorscale,autocolorscale:i.autocolorscale,reversescale:i.reversescale,showscale:i.showscale,zsmooth:i.zsmooth,_nestedModules:{colorbar:"Colorbar"}}},{"../heatmap/attributes":1155,"../histogram/attributes":1167}],1176:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("../../lib"),a=t("../histogram/bin_functions"),o=t("../histogram/norm_functions"),s=t("../histogram/average");e.exports=function(t,e){var r,l,u,c,f,h,p=n.Axes.getFromId(t,e.xaxis||"x"),d=e.x?p.makeCalcdata(e,"x"):[],g=n.Axes.getFromId(t,e.yaxis||"y"),m=e.y?g.makeCalcdata(e,"y"):[],v=Math.min(d.length,m.length);d.length>v&&d.splice(v,d.length-v),m.length>v&&m.splice(v,m.length-v),i.markTime("done convert data"),!e.autobinx&&"xbins"in e||(e.xbins=n.Axes.autoBin(d,p,e.nbinsx,"2d"),"histogram2dcontour"===e.type&&(e.xbins.start-=e.xbins.size,e.xbins.end+=e.xbins.size),e._input.xbins=e.xbins),!e.autobiny&&"ybins"in e||(e.ybins=n.Axes.autoBin(m,g,e.nbinsy,"2d"),"histogram2dcontour"===e.type&&(e.ybins.start-=e.ybins.size,e.ybins.end+=e.ybins.size),e._input.ybins=e.ybins),i.markTime("done autoBin"),f=[];var y,b,x=[],_=[],w="string"==typeof e.xbins.size?[]:e.xbins,A="string"==typeof e.xbins.size?[]:e.ybins,k=0,M=[],E=e.histnorm,T=e.histfunc,L=-1!==E.indexOf("density"),S="max"===T||"min"===T,C=S?null:0,P=a.count,z=o[E],R=!1,j=[],I=[],O="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";O&&"count"!==T&&(R="avg"===T,P=a[T]);var N=e.xbins,F=N.end+(N.start-n.Axes.tickIncrement(N.start,N.size))/1e6;for(h=N.start;F>h;h=n.Axes.tickIncrement(h,N.size))x.push(C),Array.isArray(w)&&w.push(h),R&&_.push(0);Array.isArray(w)&&w.push(h);var D=x.length;for(r=e.xbins.start,l=(h-r)/D,r+=l/2,N=e.ybins,F=N.end+(N.start-n.Axes.tickIncrement(N.start,N.size))/1e6,h=N.start;F>h;h=n.Axes.tickIncrement(h,N.size))f.push(x.concat()),Array.isArray(A)&&A.push(h),R&&M.push(_.concat());Array.isArray(A)&&A.push(h);var B=f.length;for(u=e.ybins.start,c=(h-u)/B,u+=c/2,L&&(j=x.map(function(t,e){return Array.isArray(w)?1/(w[e+1]-w[e]):1/l}),I=f.map(function(t,e){return Array.isArray(A)?1/(A[e+1]-A[e]):1/c})),i.markTime("done making bins"),h=0;v>h;h++)y=i.findBin(d[h],w),b=i.findBin(m[h],A),y>=0&&D>y&&b>=0&&B>b&&(k+=P(y,h,f[b],O,M[b]));if(R)for(b=0;B>b;b++)k+=s(f[b],M[b]);if(z)for(b=0;B>b;b++)z(f[b],k,j,I[b]);return i.markTime("done binning"),{x:d,x0:r,dx:l,y:m,y0:u,dy:c,z:f}}},{"../../lib":1053,"../../plotly":1070,"../histogram/average":1168,"../histogram/bin_functions":1170,"../histogram/norm_functions":1174}],1177:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./sample_defaults"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r){function s(r,i){return n.coerce(t,e,o,r,i)}i(t,e,s),s("zsmooth"),a(t,e,r,s,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":1014,"../../lib":1053,"./attributes":1175,"./sample_defaults":1179}],1178:[function(t,e,r){"use strict";var n=t("../../plotly");n.Plots.register(r,"histogram2d",["cartesian","2dMap","histogram"],{}),r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.calc=t("../heatmap/calc"),r.plot=t("../heatmap/plot"),r.colorbar=t("../heatmap/colorbar"),r.style=t("../heatmap/style"),r.hoverPoints=t("../heatmap/hover")},{"../../plotly":1070,"../heatmap/calc":1156,"../heatmap/colorbar":1157,"../heatmap/hover":1161,"../heatmap/plot":1164,"../heatmap/style":1165,"./attributes":1175,"./defaults":1177}],1179:[function(t,e,r){"use strict";var n=t("../histogram/bin_defaults");e.exports=function(t,e,r){var i=r("x"),a=r("y");if(!(i&&i.length&&a&&a.length))return void(e.visible=!1);var o=r("z")||r("marker.color");o&&r("histfunc");var s=["x","y"];n(t,e,r,s)}},{"../histogram/bin_defaults":1169}],1180:[function(t,e,r){var n=t("../histogram2d/attributes"),i=t("../contour/attributes");e.exports={x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,zauto:i.zauto,zmin:i.zmin,zmax:i.zmax,colorscale:i.colorscale,autocolorscale:i.autocolorscale,reversescale:i.reversescale,showscale:i.showscale,autocontour:i.autocontour,ncontours:i.ncontours,contours:i.contours,line:i.line,_nestedModules:{colorbar:"Colorbar"}}},{"../contour/attributes":1146,"../histogram2d/attributes":1175}],1181:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../histogram2d/sample_defaults"),a=t("../contour/style_defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}i(t,e,l);var u=n.coerce2(t,e,o,"contours.start"),c=n.coerce2(t,e,o,"contours.end"),f=l("autocontour",!(u&&c));l(f?"ncontours":"contours.size"),a(t,e,l,s)}},{"../../lib":1053,"../contour/style_defaults":1154,"../histogram2d/sample_defaults":1179,"./attributes":1180}],1182:[function(t,e,r){"use strict";var n=t("../../plotly");n.Plots.register(r,"histogram2dcontour",["cartesian","2dMap","contour","histogram"],{}),r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.calc=t("../contour/calc"),r.plot=t("../contour/plot"),r.style=t("../contour/style"),r.colorbar=t("../contour/colorbar"),r.hoverPoints=t("../contour/hover")},{"../../plotly":1070,"../contour/calc":1147,"../contour/colorbar":1148,"../contour/hover":1150,"../contour/plot":1152,"../contour/style":1153,"./attributes":1180,"./defaults":1181}],1183:[function(t,e,r){var n=t("../../components/colorscale/attributes"),i=t("../surface/attributes"),a=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},i:{valType:"data_array"},j:{valType:"data_array"},k:{valType:"data_array"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z"},alphahull:{valType:"number",dflt:-1},intensity:{valType:"data_array"},color:{valType:"color"},vertexcolor:{valType:"data_array"},facecolor:{valType:"data_array"},opacity:a({},i.opacity),flatshading:{valType:"boolean",dflt:!1},contour:{show:a({},i.contours.x.show,{}),color:a({},i.contours.x.color),width:a({},i.contours.x.width)},colorscale:n.colorscale,reversescale:n.reversescale,showscale:n.showscale,lighting:a({},i.lighting),_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":1011,"../../lib/extend":1049,"../surface/attributes":1216}],1184:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function i(t){return t.map(function(t){var e=t[0],r=u(t[1]),n=r.toRgb();return{index:e,rgb:[n.r,n.g,n.b,1]}})}function a(t){return t.map(p)}function o(t,e,r){for(var n=new Array(t.length),i=0;i0)s=f(t.alphahull,l);else{var u=["x","y","z"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var d={positions:l,cells:s,ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,opacity:t.opacity,contourEnable:t.contour.show,contourColor:p(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",d.vertexIntensity=t.intensity,d.colormap=i(t.colorscale)):t.vertexColor?(this.color=t.vertexColor[0],d.vertexColors=a(t.vertexColor)):t.faceColor?(this.color=t.faceColor[0],d.cellColors=a(t.faceColor)):(this.color=t.color,d.meshColor=p(t.color)),this.mesh.update(d)},d.dispose=function(){this.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":1063,"alpha-shape":29,"convex-hull":54,"delaunay-triangulate":70,"gl-mesh3d":227,tinycolor2:998}],1185:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("./");e.exports=function(t,e,r,a){function o(r,a){return n.Lib.coerce(t,e,i.attributes,r,a)}function s(t){var e=t.map(function(t){var e=o(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var l=s(["x","y","z"]),u=s(["i","j","k"]);return l?(u&&u.forEach(function(t){for(var e=0;el||(u=d[r],(void 0===u||""===u)&&(u=r),u=String(u),void 0===y[u]&&(y[u]=!0,c=a(e.marker.colors[r]),c.isValid()?(c=o.addOpacity(c,c.getAlpha()),v[u]||(v[u]=c)):v[u]?c=v[u]:(c=!1,b=!0),f=-1!==_.indexOf(u),f||(x+=l),g.push({v:l,label:u,color:c,i:r,hidden:f}))));if(e.sort&&g.sort(function(t,e){return e.v-t.v}),b)for(r=0;r")}return g};var l},{"../../components/color":1005,"./helpers":1190,"fast-isnumeric":72,tinycolor2:998}],1189:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values");if(!Array.isArray(l)||!l.length)return void(e.visible=!1);var u=o("labels");Array.isArray(u)||(o("label0"),o("dlabel"));var c=o("marker.line.width");c&&o("marker.line.color");var f=o("marker.colors");Array.isArray(f)||(e.marker.colors=[]),o("scalegroup");var h=o("text"),p=o("textinfo",Array.isArray(h)?"text+percent":"percent");if(o("hoverinfo",1===a._dataLength?"label+text+value+percent":void 0),p&&"none"!==p){var d=o("textposition"),g=Array.isArray(d)||"auto"===d,m=g||"inside"===d,v=g||"outside"===d;if(m||v){var y=s(o,"textfont",a.font);m&&s(o,"insidetextfont",y),v&&s(o,"outsidetextfont",y)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":1053,"./attributes":1187}],1190:[function(t,e,r){"use strict";r.formatPiePercent=function(t){var e=(100*t).toPrecision(3);return-1!==e.indexOf(".")?e.replace(/[.]?0+$/,"")+"%":e+"%"},r.formatPieValue=function(t){var e=t.toPrecision(10);return-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}},{}],1191:[function(t,e,r){"use strict";var n=t("../../plotly");n.Plots.register(r,"pie",["pie","showLegend"],{}),r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.supplyLayoutDefaults=t("./layout_defaults"),r.layoutAttributes=t("./layout_attributes"),r.calc=t("./calc"),r.plot=t("./plot"),r.style=t("./style"),r.styleOne=t("./style_one")},{"../../plotly":1070,"./attributes":1187,"./calc":1188,"./defaults":1189,"./layout_attributes":1192,"./layout_defaults":1193,"./plot":1194,"./style":1195,"./style_one":1196}],1192:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],1193:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("hiddenlabels")}},{"../../lib":1053,"./layout_attributes":1192}],1194:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=i(e,r),u={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(u.scale>=1)return u;var c=a+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),s/(Math.sqrt(a*a+s/2)+a)),h={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/a,d=p+1/(2*Math.tan(o)),g=r.r*Math.min(1/(Math.sqrt(d*d+.5)+d),s/(Math.sqrt(p*p+s/2)+p)),m={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=m.scale>h.scale?m:h;return u.scale<1&&v.scale>u.scale?v:u}function i(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5); -return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function a(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return 0>r&&(i*=-1),0>n&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,a,s,h,p,g=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),m=o?t.yLabelMin:t.yLabelMax,v=o?t.yLabelMax:t.yLabelMin,y=t.cyFinal+u(t.px0[1],t.px1[1]),b=g-m;if(b*f>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(i=0;i=e.pull[a.i]||((t.pxmid[1]-a.pxmid[1])*f>0?(s=a.cyFinal+u(a.px0[1],a.px1[1]),b=s-m-t.labelExtraY,b*f>0&&(t.labelExtraY+=b)):(v+t.labelExtraY-y)*f>0&&(n=3*c*Math.abs(i-d.indexOf(t)),h=a.cxFinal+l(a.px0[0],a.px1[0]),p=h+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX,p*c>0&&(t.labelExtraX+=p)))}var a,o,s,l,u,c,f,h,p,d,g,m,v;for(o=0;2>o;o++)for(s=o?r:n,u=o?Math.max:Math.min,f=o?1:-1,a=0;2>a;a++){for(l=a?Math.max:Math.min,c=a?1:-1,h=t[o][a],h.sort(s),p=t[1-o][a],d=p.concat(h),m=[],g=0;gc&&(c=s.pull[a]);o.r=Math.min(r/u(s.tilt,Math.sin(l),s.depth),n/u(s.tilt,Math.cos(l),s.depth))/(2+2*c),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===p.indexOf(s.scalegroup)&&p.push(s.scalegroup)}for(a=0;af.vTotal/2?1:0)}function u(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var c=t("d3"),f=t("../../plotly"),h=t("../../components/color"),p=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;s(e,r._size);var u=r._pielayer.selectAll("g.trace").data(e);u.enter().append("g").attr({"stroke-linejoin":"round","class":"trace"}),u.exit().remove(),u.order(),u.each(function(e){var s=c.select(this),u=e[0],d=u.trace,g=0,m=(d.depth||0)*u.r*Math.sin(g)/2,v=d.tiltaxis||0,y=v*Math.PI/180,b=[m*Math.sin(y),m*Math.cos(y)],x=u.r*Math.cos(g),_=s.selectAll("g.part").data(d.tilt?["top","sides"]:["top"]);_.enter().append("g").attr("class",function(t){return t+" part"}),_.exit().remove(),_.order(),l(e),s.selectAll(".top").each(function(){var s=c.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove();var l=[[[],[]],[[],[]]],g=!1;s.each(function(o){function s(e){var r=t._fullLayout,n=t._fullData[d.index],a=n.hoverinfo;if("all"===a&&(a="label+text+value+percent+name"),!t._dragging&&r.hovermode!==!1&&"none"!==a&&a){var s=i(o,u),l=_+o.pxmid[0]*(1-s),c=w+o.pxmid[1]*(1-s),h=[];-1!==a.indexOf("label")&&h.push(o.label),n.text&&n.text[o.i]&&-1!==a.indexOf("text")&&h.push(n.text[o.i]),-1!==a.indexOf("value")&&h.push(p.formatPieValue(o.v)),-1!==a.indexOf("percent")&&h.push(p.formatPiePercent(o.v/u.vTotal)),f.Fx.loneHover({x0:l-s*u.r,x1:l+s*u.r,y:c,text:h.join("
"),name:-1!==a.indexOf("name")?n.name:void 0,color:o.color,idealAlign:o.pxmid[0]<0?"left":"right"},{container:r._hoverlayer.node(),outerContainer:r._paper.node()}),f.Fx.hover(t,e,"pie"),M=!0}}function h(){M&&(f.Fx.loneUnhover(r._hoverlayer.node()),M=!1)}function m(){t._hoverdata=[o],t._hoverdata.trace=e.trace,f.Fx.click(t,{target:!0})}function y(t,e,r,n){return"a"+n*u.r+","+n*x+" "+v+" "+o.largeArc+(r?" 1 ":" 0 ")+n*(e[0]-t[0])+","+n*(e[1]-t[1])}if(o.hidden)return void c.select(this).selectAll("path,g").remove();l[o.pxmid[1]<0?0:1][o.pxmid[0]<0?0:1].push(o);var _=u.cx+b[0],w=u.cy+b[1],A=c.select(this),k=A.selectAll("path.surface").data([o]),M=!1;if(k.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),A.select("path.textline").remove(),A.on("mouseover",s).on("mouseout",h).on("click",m),d.pull){var E=+(Array.isArray(d.pull)?d.pull[o.i]:d.pull)||0;E>0&&(_+=E*o.pxmid[0],w+=E*o.pxmid[1])}o.cxFinal=_,o.cyFinal=w;var T=d.hole;if(o.v===u.vTotal){var L="M"+(_+o.px0[0])+","+(w+o.px0[1])+y(o.px0,o.pxmid,!0,1)+y(o.pxmid,o.px0,!0,1)+"Z";T?k.attr("d","M"+(_+T*o.px0[0])+","+(w+T*o.px0[1])+y(o.px0,o.pxmid,!1,T)+y(o.pxmid,o.px0,!1,T)+"Z"+L):k.attr("d",L)}else{var S=y(o.px0,o.px1,!0,1);if(T){var C=1-T;k.attr("d","M"+(_+T*o.px1[0])+","+(w+T*o.px1[1])+y(o.px1,o.px0,!1,T)+"l"+C*o.px0[0]+","+C*o.px0[1]+S+"Z")}else k.attr("d","M"+_+","+w+"l"+o.px0[0]+","+o.px0[1]+S+"Z")}var P=Array.isArray(d.textposition)?d.textposition[o.i]:d.textposition,z=A.selectAll("g.slicetext").data(o.text&&"none"!==P?[0]:[]);z.enter().append("g").classed("slicetext",!0),z.exit().remove(),z.each(function(){var t=c.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(o.text).attr({"class":"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(f.Drawing.font,"outside"===P?d.outsidetextfont:d.insidetextfont).call(f.util.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var e,r=f.Drawing.bBox(t.node());"outside"===P?e=a(r,o):(e=n(r,o,u),"auto"===P&&e.scale<1&&(t.call(f.Drawing.font,d.outsidetextfont),(d.outsidetextfont.family!==d.insidetextfont.family||d.outsidetextfont.size!==d.insidetextfont.size)&&(t.attr({"data-bb":""}),r=f.Drawing.bBox(t.node())),e=a(r,o)));var i=_+o.pxmid[0]*e.rCenter+(e.x||0),s=w+o.pxmid[1]*e.rCenter+(e.y||0);e.outside&&(o.yLabelMin=s-r.height/2,o.yLabelMid=s,o.yLabelMax=s+r.height/2,o.labelExtraX=0,o.labelExtraY=0,g=!0),t.attr("transform","translate("+i+","+s+")"+(e.scale<1?"scale("+e.scale+")":"")+(e.rotate?"rotate("+e.rotate+")":"")+"translate("+-(r.left+r.right)/2+","+-(r.top+r.bottom)/2+")")})}),g&&o(l,d),s.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=c.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],i=t.cyFinal+t.pxmid[1],a="M"+n+","+i,o=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],l=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);a+=Math.abs(s)>Math.abs(l)?"l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+o):"l"+t.labelExtraX+","+s+"v"+(l-s)+"h"+o}else a+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(h.stroke,d.outsidetextfont.color).attr({"stroke-width":Math.min(2,d.outsidetextfont.size/8),d:a,fill:"none"})}})})}),setTimeout(function(){u.selectAll("tspan").each(function(){var t=c.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":1005,"../../plotly":1070,"./helpers":1190,d3:64}],1195:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll(".top path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"./style_one":1196,d3:64}],1196:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var i=r.marker.line.color;Array.isArray(i)&&(i=i[e.i]||n.defaultLine);var a=r.marker.line.width||0;Array.isArray(a)&&(a=a[e.i]||0),t.style({"stroke-width":a,fill:e.color}).call(n.stroke,i)}},{"../../components/color":1005}],1197:[function(t,e,r){var n=t("../../components/drawing");e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx"],dflt:"none"},fillcolor:{valType:"color"},marker:{symbol:{valType:"enumerated",values:n.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},color:{valType:"color",arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},colorscale:{valType:"colorscale"},cauto:{valType:"boolean",dflt:!0},cmax:{valType:"number",dflt:null},cmin:{valType:"number",dflt:null},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!1},line:{color:{valType:"color",arrayOk:!0},width:{valType:"number",min:0,arrayOk:!0},colorscale:{valType:"colorscale"},cauto:{valType:"boolean",dflt:!0},cmax:{valType:"number",dflt:null},cmin:{valType:"number",dflt:null},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1}}},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/drawing":1023}],1198:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plotly"),o=t("../../lib"),s=t("../../components/colorscale/get_scale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,u=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0===u||!u.showscale)return void a.Plots.autoMargin(t,c);var f=s(u.colorscale),h=u.color,p=u.cmin,d=u.cmax;i(p)||(p=a.Lib.aggNums(Math.min,null,h)),i(d)||(d=a.Lib.aggNums(Math.max,null,h));var g=e[0].t.cb=l(t,c);g.fillcolor(n.scale.linear().domain(f.map(function(t){return p+t[0]*(d-p)})).range(f.map(function(t){return t[1]}))).filllevels({start:p,end:d,size:(d-p)/254}).options(u.colorbar)(),o.markTime("done colorbar")}},{"../../components/colorbar/draw":1008,"../../components/colorscale/get_scale":1016,"../../lib":1053,"../../plotly":1070,d3:64,"fast-isnumeric":72}],1199:[function(t,e,r){"use strict";function n(t,e,r){var n=r("line.shape");"spline"===n&&r("line.smoothing")}var i=t("d3"),a=t("fast-isnumeric"),o=t("../../plotly"),s=t("./subtypes"),l=e.exports={};l.hasLines=s.hasLines,l.hasMarkers=s.hasMarkers,l.hasText=s.hasText,l.isBubble=s.isBubble,l.selectPoints=t("./select"),o.Plots.register(l,"scatter",["cartesian","symbols","markerColorscale","errorBarsOK","showLegend"],{}),l.PTS_LINESONLY=20,l.attributes=t("./attributes");var u=t("./xy_defaults");l.supplyDefaults=function(t,e,r,i){function a(r,n){return o.Lib.coerce(t,e,l.attributes,r,n)}var s=u(t,e,a),c=s=0;i--)if(a=t[i],"scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}},l.colorbar=t("./colorbar"),l.getBubbleSizeFn=function(t){var e=t.marker,r=e.sizeref||1,n=e.sizemin||0,i="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=i(t/2);return a(e)&&e>0?Math.max(e,n):0}},l.calc=function(t,e){var r=o.Axes.getFromId(t,e.xaxis||"x"),n=o.Axes.getFromId(t,e.yaxis||"y");o.Lib.markTime("in Scatter.calc");var i=r.makeCalcdata(e,"x");o.Lib.markTime("finished convert x");var s=n.makeCalcdata(e,"y");o.Lib.markTime("finished convert y");var u,c,f,h=Math.min(i.length,s.length);r._minDtick=0,n._minDtick=0,i.length>h&&i.splice(h,i.length-h),s.length>h&&s.splice(h,s.length-h);var p={padded:!0},d={padded:!0};if(l.hasMarkers(e)){if(u=e.marker,c=u.size,Array.isArray(c)){var g={type:"linear"};o.Axes.setConvert(g),c=g.makeCalcdata(e.marker,"size"),c.length>h&&c.splice(h,c.length-h)}var m,v=1.6*(e.marker.sizeref||1);m="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/v),3)}:function(t){return Math.max((t||0)/v,3)},p.ppad=d.ppad=Array.isArray(c)?c.map(m):m(c)}l.calcMarkerColorscales(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||i[0]===i[h-1]&&s[0]===s[h-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(l.hasMarkers(e)||l.hasText(e))||(p.padded=!1,p.ppad=0):p.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||i[0]===i[h-1]&&s[0]===s[h-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(d.padded=!1):d.tozero=!0,o.Lib.markTime("ready for Axes.expand"),o.Axes.expand(r,i,p),o.Lib.markTime("done expand x"),o.Axes.expand(n,s,d),o.Lib.markTime("done expand y");var y=new Array(h);for(f=0;h>f;f++)y[f]=a(i[f])&&a(s[f])?{x:i[f],y:s[f]}:{x:!1,y:!1};return void 0!==typeof c&&o.Lib.mergeArray(c,y,"ms"),t.firstscatter=!1,y},l.calcMarkerColorscales=function(t){if(l.hasMarkers(t)){var e=t.marker;o.Colorscale.hasColorscale(t,"marker")&&o.Colorscale.calc(t,e.color,"marker","c"),o.Colorscale.hasColorscale(t,"marker.line")&&o.Colorscale.calc(t,e.line.color,"marker.line","c")}},l.selectMarkers=function(t,e,r){var n=e.x(),a=e.y(),o=i.extent(n.range.map(n.l2c)),s=i.extent(a.range.map(a.l2c));r.forEach(function(t,e){var n=t[0].trace;if(l.hasMarkers(n)){var i=n.marker.maxdisplayed;if(0!==i){var a=t.filter(function(t){return t.x>=o[0]&&t.x<=o[1]&&t.y>=s[0]&&t.y<=s[1]}),u=Math.ceil(a.length/i),c=0;r.forEach(function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&e>r&&c++});var f=Math.round(c*u/3+Math.floor(c/3)*u/7.1);t.forEach(function(t){delete t.vis}),a.forEach(function(t,e){0===Math.round((e+f)%u)&&(t.vis=!0)})}}})},l.arraysToCalcdata=function(t){var e=t[0].trace,r=e.marker;if(o.Lib.mergeArray(e.text,t,"tx"),o.Lib.mergeArray(e.textposition,t,"tp"),e.textfont&&(o.Lib.mergeArray(e.textfont.size,t,"ts"),o.Lib.mergeArray(e.textfont.color,t,"tc"),o.Lib.mergeArray(e.textfont.family,t,"tf")),r&&r.line){var n=r.line;o.Lib.mergeArray(r.opacity,t,"mo"),o.Lib.mergeArray(r.symbol,t,"mx"),o.Lib.mergeArray(r.color,t,"mc"),o.Lib.mergeArray(n.color,t,"mlc"),o.Lib.mergeArray(n.width,t,"mlw")}},l.plot=function(t,e,r){function n(t){return t.filter(function(t){return t.vis})}l.selectMarkers(t,e,r);var a=e.x(),s=e.y(),u=e.plot.select(".scatterlayer").selectAll("g.trace.scatter").data(r);u.enter().append("g").attr("class","trace scatter").style("stroke-miterlimit",2);var c,f,h,p="";u.each(function(t){var e=t[0].trace,r=e.line,n=i.select(this);if(e.visible===!0&&(t[0].node3=n,l.arraysToCalcdata(t),l.hasLines(e)||"none"!==e.fill)){var u,d,g,m,v="",y="";c="tozero"===e.fill.substr(0,6)||"to"===e.fill.substr(0,2)&&!p?n.append("path").classed("js-fill",!0):null,h&&(f=h.datum(t)),h=n.append("path").classed("js-fill",!0),-1!==["hv","vh","hvh","vhv"].indexOf(r.shape)?(d=o.Drawing.steps(r.shape),g=o.Drawing.steps(r.shape.split("").reverse().join(""))):d=g="spline"===r.shape?function(t){return o.Drawing.smoothopen(t,r.smoothing)}:function(t){return"M"+t.join("L")},m=function(t){return"L"+g(t.reverse()).substr(1)};var b=l.linePoints(t,{xaxis:a,yaxis:s,connectGaps:e.connectgaps,baseTolerance:Math.max(r.width||1,3)/4,linear:"linear"===r.shape});if(b.length){for(var x=b[0][0],_=b[b.length-1],w=_[_.length-1],A=0;A1&&n.append("path").classed("js-line",!0).attr("d",u)}c?x&&w&&("y"===e.fill.charAt(e.fill.length-1)?x[1]=w[1]=s.c2p(0,!0):x[0]=w[0]=a.c2p(0,!0),c.attr("d",v+"L"+w+"L"+x+"Z")):"tonext"===e.fill.substr(0,6)&&v&&p&&f.attr("d",v+p+"Z"),p=y}}}),u.selectAll("path:not([d])").remove(),u.append("g").attr("class","points").each(function(t){var e=t[0].trace,r=i.select(this),u=l.hasMarkers(e),c=l.hasText(e);!u&&!c||e.visible!==!0?r.remove():(u&&r.selectAll("path.point").data(e.marker.maxdisplayed?n:o.Lib.identity).enter().append("path").classed("point",!0).call(o.Drawing.translatePoints,a,s),c&&r.selectAll("g").data(e.marker.maxdisplayed?n:o.Lib.identity).enter().append("g").append("text").call(o.Drawing.translatePoints,a,s))})},l.linePoints=function(t,e){function r(e){var r=w.c2p(t[e].x),n=A.c2p(t[e].y);return r===L||n===L?!1:[r,n]}function n(t){var e=t[0]/w._length,r=t[1]/A._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*M}function i(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var a,s,l,u,c,f,h,p,d,g,m,v,y,b,x,_,w=e.xaxis,A=e.yaxis,k=e.connectGaps,M=e.baseTolerance,E=e.linear,T=[],L=o.Axes.BADNUM,S=.2,C=new Array(t.length),P=0;for(a=0;an(f))break;l=f,y=g[0]*d[0]+g[1]*d[1],y>m?(m=y,u=f,p=!1):v>y&&(v=y,c=f,p=!0)}if(p?(C[P++]=u,l!==c&&(C[P++]=c)):(c!==s&&(C[P++]=c),l!==u&&(C[P++]=u)),C[P++]=l,a>=t.length||!f)break;C[P++]=f,s=f}}else C[P++]=u}T.push(C.slice(0,P))}return T},l.style=function(t){var e=i.select(t).selectAll("g.trace.scatter");e.style("opacity",function(t){return t[0].trace.opacity}),e.selectAll("g.points").each(function(t){i.select(this).selectAll("path.point").call(o.Drawing.pointStyle,t.trace||t[0].trace),i.select(this).selectAll("text").call(o.Drawing.textPointStyle,t.trace||t[0].trace)}),e.selectAll("g.trace path.js-line").call(o.Drawing.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(o.Drawing.fillGroupStyle)},l.getTraceColor=function(t,e){var r,n;if("lines"===t.mode)return r=t.line.color,r&&o.Color.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var i=e.mcc||(t.marker||{}).color,a=e.mlcc||((t.marker||{}).line||{}).color;return n=i&&o.Color.opacity(i)?i:a&&o.Color.opacity(a)&&(e.mlw||((t.marker||{}).line||{}).width)?a:"",n?o.Color.opacity(n)<.3?o.Color.addOpacity(n,.3):n:(r=(t.line||{}).color,r&&o.Color.opacity(r)&&l.hasLines(t)&&t.line.width?r:t.fillcolor)},l.hoverPoints=function(t,e,r,n){var i=t.cd,a=i[0].trace,s=t.xa,u=t.ya,c=function(t){var r=Math.max(3,t.mrc||0);return Math.max(Math.abs(s.c2p(t.x)-s.c2p(e))-r,1-3/r)},f=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(u.c2p(t.y)-u.c2p(r))-e,1-3/e)},h=function(t){var n=Math.max(3,t.mrc||0),i=Math.abs(s.c2p(t.x)-s.c2p(e)),a=Math.abs(u.c2p(t.y)-u.c2p(r));return Math.max(Math.sqrt(i*i+a*a)-n,1-3/n)},p=o.Fx.getDistanceFunction(n,c,f,h);if(o.Fx.getClosest(i,p,t),t.index!==!1){var d=i[t.index],g=s.c2p(d.x,!0),m=u.c2p(d.y,!0),v=d.mrc||1;return t.color=l.getTraceColor(a,d),t.x0=g-v,t.x1=g+v,t.xLabelVal=d.x,t.y0=m-v,t.y1=m+v,t.yLabelVal=d.y,d.tx?t.text=d.tx:a.text&&(t.text=a.text),o.ErrorBars.hoverInfo(d,a,t),[t]}}},{"../../plotly":1070,"./attributes":1197,"./colorbar":1198,"./select":1200,"./subtypes":1201,"./xy_defaults":1202,d3:64,"fast-isnumeric":72}],1200:[function(t,e,r){"use strict";var n=t("./subtypes"),i=.2;e.exports=function(t,e){var r,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,f=[],h=l[0].trace,p=h.index,d=h.marker;if(n.hasMarkers(h)||n.hasText(h)){var g=Array.isArray(d.opacity)?1:d.opacity;if(e===!1)for(r=0;rs;s++){for(var l=[[0,0,0],[0,0,0]],u=0;3>u;u++)if(r[u])for(var c=0;2>c;c++)l[c][u]=r[u][s][c];o[s]=l}return o}var o=t("../../components/errorbars/compute_error");e.exports=a},{"../../components/errorbars/compute_error":1027}],1205:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function i(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;ni;i++){var a=t[i];a&&a.copy_zstyle!==!1&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=b(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}function o(t){var e=[0,0];return Array.isArray(t)?[0,-1]:(t.indexOf("bottom")>=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return w[t]}function u(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;e>o;o++)void 0===t[o]?a[o]=n:a[o]=r(t[o],i)}else a=r(t,p.Lib.identity);return a}function c(t,e){var r,n,i,c,f,h,d=[],g=t.fullSceneLayout,m=t.dataScale,v=g.xaxis,y=g.yaxis,_=g.zaxis,w=e.marker,k=e.line,M=e.x||[],E=e.y||[],T=e.z||[],L=M.length;for(n=0;L>n;n++)i=v.d2l(M[n])*m[0],c=y.d2l(E[n])*m[1],f=_.d2l(T[n])*m[2],d[n]=[i,c,f];if(Array.isArray(e.text))h=e.text;else if(void 0!==e.text)for(h=new Array(L),n=0;L>n;n++)h[n]=e.text;if(r={position:d,mode:e.mode,text:h},"line"in e&&(r.lineColor=b(k.color),r.lineWidth=k.width,r.lineDashes=k.dash),"marker"in e){var S=p.Scatter.getBubbleSizeFn(e);r.scatterColor=x(w,1,L),r.scatterSize=u(w.size,L,s,20,S),r.scatterMarker=u(w.symbol,L,l,"\u25cf"),r.scatterLineWidth=w.line.width,r.scatterLineColor=x(w.line,1,L),r.scatterAngle=0}"textposition"in e&&(r.textOffset=o(e.textposition),r.textColor=x(e.textfont,1,L),r.textSize=u(e.textfont.size,L,p.Lib.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var C=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;3>n;++n){var P=e.projection[C[n]];(r.project[n]=P.show)&&(r.projectOpacity[n]=P.opacity,r.projectScale[n]=P.scale)}r.errorBounds=A(e,m);var z=a([e.error_x,e.error_y,e.error_z]);return r.errorColor=z.color,r.errorLineWidth=z.lineWidth,r.errorCapSize=z.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=b(e.surfacecolor),r}function f(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}function h(t,e){var r=new n(t,e.uid);return r.update(e),r}var p=t("../../plotly"),d=t("gl-line3d"),g=t("gl-scatter3d"),m=t("gl-error3d"),v=t("gl-mesh3d"),y=t("delaunay-triangulate"),b=t("../../lib/str2rgbarray"),x=t("../../lib/gl_format_color"),_=t("../../constants/gl3d_dashes.json"),w=t("../../constants/gl_markers.json"),A=t("./calc_errors"),k=n.prototype;k.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels&&void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel="";var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},k.update=function(t){var e,r,n,a,o=this.scene.glplot.gl,s=_.solid;this.data=t;var l=c(this.scene,t);"mode"in l&&(this.mode=l.mode),"lineDashes"in l&&l.lineDashes in _&&(s=_[l.lineDashes]),this.color=f(l.scatterColor)||f(l.lineColor),this.dataPoints=l.position,e={gl:o,position:l.position,color:l.lineColor,lineWidth:l.lineWidth||1,dashes:s[0],dashScale:s[1],opacity:t.opacity},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=d(e),this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var u=t.opacity;if(t.marker&&t.marker.opacity&&(u*=t.marker.opacity),r={gl:o,position:l.position,color:l.scatterColor,size:l.scatterSize,glyph:l.scatterMarker,opacity:u,orthographic:!0,lineWidth:l.scatterLineWidth,lineColor:l.scatterLineColor,project:l.project,projectScale:l.projectScale,projectOpacity:l.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=g(r),this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),a={gl:o,position:l.position,glyph:l.text,color:l.textColor,size:l.textSize,angle:l.textAngle,alignment:l.textOffset,font:l.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=l.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(a):(this.textMarkers=g(a),this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:o,position:l.position,color:l.errorColor,error:l.errorBounds,lineWidth:l.errorLineWidth,capSize:l.errorCapSize,opacity:t.opacity},this.errorBars?l.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):l.errorBounds&&(this.errorBars=m(n),this.scene.glplot.add(this.errorBars)),l.delaunayAxis>=0){var h=i(l.position,l.delaunayColor,l.delaunayAxis);this.delaunayMesh?this.delaunayMesh.update(h):(h.gl=o,this.delaunayMesh=v(h),this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},k.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.textMarkers),this.delaunayMesh.dispose())},e.exports=h},{"../../constants/gl3d_dashes.json":1041,"../../constants/gl_markers.json":1042,"../../lib/gl_format_color":1051,"../../lib/str2rgbarray":1063,"../../plotly":1070,"./calc_errors":1204,"delaunay-triangulate":70,"gl-error3d":103,"gl-line3d":169,"gl-mesh3d":227,"gl-scatter3d":866}],1206:[function(t,e,r){"use strict";function n(t,e,r){var n=0,i=r("x"),a=r("y"),o=r("z");return i&&a&&o&&(n=Math.min(i.length,a.length,o.length),n=0&&s("surfacecolor",c||f);for(var h=["x","y","z"],p=0;3>p;++p){var d="projection."+h[p];s(d+".show")&&(s(d+".opacity"),s(d+".scale"))}i.ErrorBars.supplyDefaults(t,e,r,{axis:"z"}),i.ErrorBars.supplyDefaults(t,e,r,{axis:"y",inherit:"z"}),i.ErrorBars.supplyDefaults(t,e,r,{axis:"x",inherit:"z"})}},{"../../plotly":1070,"./":1207}],1207:[function(t,e,r){"use strict";var n=t("../../plotly"),i=e.exports={};n.Plots.register(i,"scatter3d",["gl3d","symbols","markerColorscale","showLegend"],{}),i.attributes=t("./attributes"),i.markerSymbols=t("../../constants/gl_markers.json"),i.supplyDefaults=t("./defaults"),i.colorbar=n.Scatter.colorbar,i.calc=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n.Scatter.arraysToCalcdata(r),n.Scatter.calcMarkerColorscales(e),r}},{"../../constants/gl_markers.json":1042,"../../plotly":1070,"./attributes":1203,"./defaults":1206}],1208:[function(t,e,r){var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=n.line,l=o.line;e.exports={lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names"],dflt:"ISO-3"},mode:a({},n.mode,{dflt:"markers"}),text:a({},n.text,{}),line:{color:s.color,width:s.width,dash:s.dash},marker:{symbol:o.symbol,opacity:o.opacity,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,color:o.color,colorscale:o.colorscale,cauto:o.cauto,cmax:o.cmax,cmin:o.cmin,autocolorscale:o.autocolorscale,reversescale:o.reversescale,showscale:o.showscale,line:{color:l.color,width:l.width,colorscale:l.colorscale,cauto:l.cauto,cmax:l.cmax,cmin:l.cmin,autocolorscale:l.autocolorscale,reversescale:l.reversescale}},textfont:n.textfont,textposition:n.textposition,hoverinfo:a({},i.hoverinfo,{flags:["lon","lat","location","text","name"]}),_nestedModules:{"marker.colorbar":"Colorbar"}}},{"../../lib/extend":1049,"../../plots/attributes":1071,"../scatter/attributes":1197}],1209:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=0,o=r("locations");return o?(r("locationmode"),a=o.length):(n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length),an;n++)r[n]=[t.lon[n],t.lat[n]];return{type:"LineString",coordinates:r,trace:t}}function a(t,e){function r(e){var r=t.mockAxis;return o.Axes.tickText(r,r.c2l(e),"hover").text+"\xb0"}var n=e.hoverinfo;if("none"===n)return function(t){delete t.textLabel};var i="all"===n?o.ScatterGeo.attributes.hoverinfo.flags:n.split("+"),a=-1!==i.indexOf("location")&&Array.isArray(e.locations),s=-1!==i.indexOf("lon"),l=-1!==i.indexOf("lat"),u=-1!==i.indexOf("text");return function(t){var n=[];a?n.push(t.location):s&&l?n.push("("+r(t.lon)+", "+r(t.lat)+")"):s?n.push("lon: "+r(t.lon)):l&&n.push("lat: "+r(t.lat)),u&&n.push(t.tx||e.text),t.textLabel=n.join("
")}}var o=t("../../plotly"),s=t("d3"),l=t("../../lib/topojson_utils").getTopojsonFeatures,u=t("../../lib/geo_location_utils").locationToFeature,c=t("../../lib/array_to_calc_item"),f=e.exports={};f.calcGeoJSON=function(t,e){var r,i,a,o,s,c,f=[],h=Array.isArray(t.locations);h?(s=t.locations,r=s.length,i=l(t,e),a=function(t,e){var r=u(t.locationmode,s[e],i);return void 0!==r?r.properties.ct:void 0}):(r=t.lon.length,a=function(t,e){return[t.lon[e],t.lat[e]]});for(var p=0;r>p;p++)o=a(t,p),o&&(c={lon:o[0],lat:o[1],location:h?t.locations[p]:null},n(t,c,p),f.push(c));return f.length>0&&(f[0].trace=t),f},f.plot=function(t,e){var r=t.framework.select("g.scattergeolayer"),n=o.Scatter,l=t.topojson;r.selectAll("*").remove();var u=r.selectAll("g.trace.scatter").data(e);u.enter().append("g").attr("class","trace scattergeo"),u.each(function(t){n.hasLines(t)&&t.visible===!0&&s.select(this).append("path").datum(i(t)).attr("class","js-line")}),u.append("g").attr("class","points").each(function(e){function r(r){if(t.showHover){var n=t.projection([r.lon,r.lat]);p(r),o.Fx.loneHover({x:n[0],y:n[1],name:g?e.name:void 0,text:r.textLabel,color:r.mc||(e.marker||{}).color},{container:t.hoverContainer.node()})}}var i=s.select(this),u=n.hasMarkers(e),c=n.hasText(e);if(!u&&!c||e.visible!==!0)return void i.remove();var h=f.calcGeoJSON(e,l),p=a(t,e),d=e.hoverinfo,g="all"===d||-1!==d.indexOf("name");u&&i.selectAll("path.point").data(h).enter().append("path").attr("class","point").on("mouseover",r).on("mouseout",function(){o.Fx.loneUnhover(t.hoverContainer)}).on("mousedown",function(){o.Fx.loneUnhover(t.hoverContainer)}).on("mouseup",r),c&&i.selectAll("g").data(h).enter().append("g").append("text")}),f.style(t)},f.style=function(t){var e=t.framework.selectAll("g.trace.scattergeo");e.style("opacity",function(t){return t.opacity}),e.selectAll("g.points").each(function(t){s.select(this).selectAll("path.point").call(o.Drawing.pointStyle,t),s.select(this).selectAll("text").call(o.Drawing.textPointStyle,t)}),e.selectAll("path.js-line").style("fill","none").each(function(t){var e=t.trace,r=e.line||{};s.select(this).call(o.Color.stroke,r.color).call(o.Drawing.dashLine,r.dash||"",r.width||0)})}},{"../../lib/array_to_calc_item":1045,"../../lib/geo_location_utils":1050,"../../lib/topojson_utils":1065,"../../plotly":1070,d3:64}],1212:[function(t,e,r){var n=t("../scatter/attributes"),i=t("../../constants/gl2d_dashes.json"),a=t("../../constants/gl_markers.json"),o=t("../../lib/extend").extendFlat,s=n.line,l=n.marker,u=l.line;e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:o({},n.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:s.color,width:s.width,dash:{valType:"enumerated",values:Object.keys(i),dflt:"solid"}},marker:{color:l.color,symbol:{valType:"enumerated",values:Object.keys(a),dflt:"circle",arrayOk:!0},size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,opacity:l.opacity,colorscale:l.colorscale,cauto:l.cauto,cmax:l.cmax,cmin:l.cmin,autocolorscale:l.autocolorscale,reversescale:l.reversescale,showscale:l.showscale,line:{color:u.color,width:u.width,colorscale:u.colorscale,cauto:u.cauto,cmax:u.cmax,cmin:u.cmin,autocolorscale:u.autocolorscale,reversescale:u.reversescale}},fill:o({},n.fill,{values:["none","tozeroy","tozerox"]}),fillcolor:n.fillcolor,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../constants/gl2d_dashes.json":1040,"../../constants/gl_markers.json":1042,"../../lib/extend":1049,"../scatter/attributes":1197}],1213:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=[],this.bounds=[0,0,0,0],this.hasLines=!1,this.lineOptions={positions:new Float32Array,color:[0,0,0,1],width:1,fill:[!1,!1,!1,!1],fillColor:[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],dashes:[1]},this.line=d(t.glplot,this.lineOptions),this.line._trace=this,this.hasErrorX=!1,this.errorXOptions={positions:new Float32Array,errors:new Float32Array,lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorX=g(t.glplot,this.errorXOptions),this.errorX._trace=this,this.hasErrorY=!1,this.errorYOptions={positions:new Float32Array,errors:new Float32Array,lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorY=g(t.glplot,this.errorYOptions),this.errorY._trace=this,this.hasMarkers=!1,this.scatterOptions={positions:new Float32Array,sizes:[],colors:[],glyphs:[],borderWidths:[],borderColors:[],size:12,color:[0,0,0,1],borderSize:1,borderColor:[0,0,0,1]},this.scatter=h(t.glplot,this.scatterOptions),this.scatter._trace=this,this.fancyScatter=p(t.glplot,this.scatterOptions),this.fancyScatter._trace=this}function i(t,e,r){return Array.isArray(e)||(e=[e]),a(t,e,r)}function a(t,e,r){for(var n=new Array(r),i=e[0],a=0;r>a;++a)n[a]=t(a>=e.length?i:e[a]);return n}function o(t,e,r){return l(k(t,r),A(e,r),r)}function s(t,e,r,n){var i=y(t,e,n);return i=Array.isArray(i[0])?i:a(f.Lib.identity,[i],n),l(i,A(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;r>i;++i){for(var a=0;3>a;++a)n[4*i+a]=t[i][a];n[4*i+3]=t[i][a]*e[i]}return n}function u(t,e){if(void 0===Float32Array.slice){for(var r=new Float32Array(e),n=0;e>n;n++)r[n]=t[n];return r}return t.slice(0,e)}function c(t,e){var r=new n(t,e.uid);return r.update(e),r}var f=t("../../plotly"),h=t("gl-scatter2d"),p=t("gl-scatter2d-fancy"),d=t("gl-line2d"),g=t("gl-error2d"),m=t("fast-isnumeric"),v=t("../../lib/str2rgbarray"),y=t("../../lib/gl_format_color"),b=t("../../constants/gl_markers.json"),x=t("../../constants/gl2d_dashes.json"),_=["xaxis","yaxis"],w=n.prototype;w.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:[this.xData[e],this.yData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:Array.isArray(this.color)?this.color[e]:this.color,name:this.name,hoverinfo:this.hoverinfo}},w.isFancy=function(t){if("linear"!==this.scene.xaxis.type)return!0;if("linear"!==this.scene.yaxis.type)return!0;if(!t.x||!t.y)return!0;var e=t.marker||{};if(Array.isArray(e.symbol)||"circle"!==e.symbol||Array.isArray(e.size)||Array.isArray(e.line.width)||Array.isArray(e.opacity))return!0;var r=e.color;if(Array.isArray(r))return!0;var n=Array.isArray(e.line.color);return Array.isArray(n)?!0:this.hasErrorX?!0:this.hasErrorY?!0:!1};var A=i.bind(null,function(t){return+t}),k=i.bind(null,v),M=i.bind(null,function(t){return b[t]||"\u25cf"});w.update=function(t){t.visible!==!0?(this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1):(this.hasLines=f.Scatter.hasLines(t),this.hasErrorX=t.error_x.visible===!0,this.hasErrorY=t.error_y.visible===!0,this.hasMarkers=f.Scatter.hasMarkers(t)),this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.isFancy(t)?this.updateFancy(t):this.updateFast(t),this.color=f.Scatter.getTraceColor(t,{})},w.updateFast=function(t){for(var e,r,n=this.xData=t.x,i=this.yData=t.y,a=n.length,o=new Array(a),s=new Float32Array(2*a),l=this.bounds,c=0,f=0,h=0;a>h;++h)e=n[h],r=i[h],m(e)&&m(r)&&(o[c++]=h,s[f++]=e,s[f++]=r,l[0]=Math.min(l[0],e),l[1]=Math.min(l[1],r),l[2]=Math.max(l[2],e),l[3]=Math.max(l[3],r));s=u(s,f),this.idToIndex=o,this.updateLines(t,s),this.updateError("X",t),this.updateError("Y",t);var p;if(this.hasMarkers){this.scatterOptions.positions=s;var d=v(t.marker.color),g=v(t.marker.line.color),y=t.opacity*t.marker.opacity;d[3]*=y,this.scatterOptions.color=d,g[3]*=y,this.scatterOptions.borderColor=g,p=t.marker.size,this.scatterOptions.size=p,this.scatterOptions.borderSize=t.marker.line.width,this.scatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions),this.expandAxesFast(l,p)},w.updateFancy=function(t){var e,r,n,a,o,l,c,h,p=this.scene,d=p.xaxis,g=p.yaxis,m=this.bounds,v=this.xData=d.makeCalcdata(t,"x"),y=this.yData=g.makeCalcdata(t,"y"),b=f.ErrorBars.calcFromTrace(t,p.fullLayout),x=v.length,_=new Array(x),w=new Float32Array(2*x),k=new Float32Array(4*x),E=new Float32Array(4*x),T=0,L=0,S=0,C=0,P="log"===d.type?function(t){return d.d2l(t)}:function(t){return t},z="log"===g.type?function(t){return g.d2l(t)}:function(t){return t};for(e=0;x>e;++e)n=P(v[e]),a=z(y[e]),isNaN(n)||isNaN(a)||(_[T++]=e,w[L++]=n,w[L++]=a,o=k[S++]=n-b[e].xs||0,l=k[S++]=b[e].xh-n||0,k[S++]=0,k[S++]=0,E[C++]=0,E[C++]=0,c=E[C++]=a-b[e].ys||0,h=E[C++]=b[e].yh-a||0,m[0]=Math.min(m[0],n-o),m[1]=Math.min(m[1],a-c),m[2]=Math.max(m[2],n+l),m[3]=Math.max(m[3],a+h));w=u(w,L),this.idToIndex=_,this.updateLines(t,w),this.updateError("X",t,w,k),this.updateError("Y",t,w,E);var R;if(this.hasMarkers){this.scatterOptions.positions=w,this.scatterOptions.sizes=new Array(T),this.scatterOptions.glyphs=new Array(T),this.scatterOptions.borderWidths=new Array(T),this.scatterOptions.colors=new Array(4*T),this.scatterOptions.borderColors=new Array(4*T);var j,I=f.Scatter.getBubbleSizeFn(t),O=t.marker,N=O.opacity,F=t.opacity,D=s(O,N,F,x),B=M(O.symbol,x),U=A(O.line.width,x),V=s(O.line,N,F,x);for(R=i(I,O.size,x),e=0;T>e;++e)for(j=_[e],this.scatterOptions.sizes[e]=4*R[j],this.scatterOptions.glyphs[e]=B[j],this.scatterOptions.borderWidths[e]=.5*U[j],r=0;4>r;++r)this.scatterOptions.colors[4*e+r]=D[4*j+r],this.scatterOptions.borderColors[4*e+r]=V[4*j+r];this.fancyScatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions),this.expandAxesFancy(v,y,R)},w.updateLines=function(t,e){if(this.hasLines){this.lineOptions.positions=e;var r=v(t.line.color);this.hasMarkers&&(r[3]*=t.marker.opacity);for(var n=Math.round(.5*this.lineOptions.width),i=(x[t.line.dash]||[1]).slice(),a=0;ao;o++)r=this.scene[_[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:a}),i=r._max,i||(i=[]),i.push({val:t[o+2],pad:a})},w.expandAxesFancy=function(t,e,r){var n=this.scene,i={padded:!0,ppad:r};f.Axes.expand(n.xaxis,t,i),f.Axes.expand(n.yaxis,e,i)},w.dispose=function(){this.line.dispose(),this.errorX.dispose(),this.errorY.dispose(),this.scatter.dispose(),this.fancyScatter.dispose()},e.exports=c},{"../../constants/gl2d_dashes.json":1040,"../../constants/gl_markers.json":1042,"../../lib/gl_format_color":1051,"../../lib/str2rgbarray":1063,"../../plotly":1070,"fast-isnumeric":72,"gl-error2d":73,"gl-line2d":138,"gl-scatter2d":744,"gl-scatter2d-fancy":711}],1214:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter"),a=t("../scatter/xy_defaults"),o=t("../../components/errorbars/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,i){return n.coerce(t,e,s,r,i)}var c=a(t,e,u);return c?(u("text"),u("mode",ce){for(var r=g/e,n=[0|Math.floor(t[0].shape[0]*r+1),0|Math.floor(t[0].shape[1]*r+1)],i=n[0]*n[1],o=0;3>o;++o){var s=a(t[o]),l=u(new Float32Array(i),n);c(l,s,[r,0,0,0,r,0,0,0,1]),t[o]=l}return r}return 1}function s(t,e){var r=t.glplot.gl,i=l({gl:r}),a=new n(t,i,e.uid);return a.update(e),t.glplot.add(i),a}var l=t("gl-surface3d"),u=t("ndarray"),c=t("ndarray-homography"),f=t("ndarray-fill"),h=t("ndarray-ops"),p=t("tinycolor2"),d=t("../../lib/str2rgbarray"),g=128,m=n.prototype;m.handlePick=function(t){if(t.object===this.surface){var e=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]],Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0])*this.scene.dataScale[0],n.yaxis.d2l(r[1])*this.scene.dataScale[1],n.zaxis.d2l(r[2])*this.scene.dataScale[2]];var i=this.data.text;return i&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel="",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},m.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;3>r;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},m.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,a=this.surface,s=t.opacity,l=i(t.colorscale,s),c=t.z,h=t.x,p=t.y,g=n.xaxis,m=n.yaxis,v=n.zaxis,y=r.dataScale,b=c[0].length,x=c.length,_=[u(new Float32Array(b*x),[b,x]),u(new Float32Array(b*x),[b,x]),u(new Float32Array(b*x),[b,x])],w=_[0],A=_[1],k=r.contourLevels;this.data=t,f(_[2],function(t,e){return v.d2l(c[e][t])*y[2]}),Array.isArray(h[0])?f(w,function(t,e){return g.d2l(h[e][t])*y[0]}):f(w,function(t){return g.d2l(h[t])*y[0]}),Array.isArray(p[0])?f(A,function(t,e){return m.d2l(p[e][t])*y[1]}):f(A,function(t,e){return m.d2l(p[e])*y[1]}),this.dataScale=o(_);var M={colormap:l,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:1,colorBounds:[t.zmin*y[2],t.zmax*y[2]]};"opacity"in t&&t.opacity<1&&(M.opacity=.25*t.opacity);var E=[!0,!0,!0],T=[!0,!0,!0],L=["x","y","z"];for(e=0;3>e;++e){var S=t.contours[L[e]];E[e]=S.highlight,T[e]=S.show,M.showContour[e]=S.show||S.highlight,M.showContour[e]&&(M.contourProject[e]=[S.project.x,S.project.y,S.project.z],S.show?(this.showContour[e]=!0,M.levels[e]=k[e],a.highlightColor[e]=M.contourColor[e]=d(S.color),S.usecolormap?a.highlightTint[e]=M.contourTint[e]=0:a.highlightTint[e]=M.contourTint[e]=1,M.contourWidth[e]=S.width):this.showContour[e]=!1,S.highlight&&(M.dynamicColor[e]=d(S.highlightColor),M.dynamicWidth[e]=S.highlightWidth))}M.coords=_,a.update(M),a.highlightEnable=E,a.contourEnable=T,a.visible=t.visible,a.snapToData=!0,"lighting"in t&&(a.ambientLight=t.lighting.ambient,a.diffuseLight=t.lighting.diffuse,a.specularLight=t.lighting.specular,a.roughness=t.lighting.roughness,a.fresnel=t.lighting.fresnel),s&&1>s&&(a.supportsTransparency=!0)},m.dispose=function(){this.glplot.remove(this.surface),this.surface.dispose()},e.exports=s},{"../../lib/str2rgbarray":1063,"gl-surface3d":959,ndarray:987,"ndarray-fill":965,"ndarray-homography":981,"ndarray-ops":982,tinycolor2:998}],1219:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}var l,u,c=s("z");if(!c)return void(e.visible=!1);var f=c[0].length,h=c.length;if(s("x"),s("y"),!Array.isArray(e.x))for(e.x=[],l=0;f>l;++l)e.x[l]=l;if(s("text"),!Array.isArray(e.y))for(e.y=[],l=0;h>l;++l)e.y[l]=l;s("lighting.ambient"),s("lighting.diffuse"),s("lighting.specular"),s("lighting.roughness"),s("lighting.fresnel"),s("hidesurface"),s("opacity"),s("colorscale");var p=["x","y","z"];for(l=0;3>l;++l){var d="contours."+p[l],g=s(d+".show"),m=s(d+".highlight");if(g||m)for(u=0;3>u;++u)s(d+".project."+p[u]);g&&(s(d+".color"),s(d+".width"),s(d+".usecolormap")),m&&(s(d+".highlightColor"),s(d+".highlightWidth"))}i(t,e,o,s,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":1014,"../../lib":1053,"./attributes":1216}],1220:[function(t,e,r){"use strict";var n=t("../../plotly"),i=e.exports={};n.Plots.register(i,"surface",["gl3d","noOpacity"],{}),i.attributes=t("./attributes"),i.supplyDefaults=t("./defaults"),i.colorbar=t("../heatmap/colorbar"),i.calc=t("./calc")},{"../../plotly":1070,"../heatmap/colorbar":1157,"./attributes":1216,"./calc":1217,"./defaults":1219}]},{},[1044])(1044)}); \ No newline at end of file +/*! For license information please see plotly.min.js.LICENSE.txt */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Plotly=e():t.Plotly=e()}(self,function(){return function(){var t={22:function(t,e,r){"use strict";t.exports={attributes:r(74349),layoutAttributes:r(13800),supplyDefaults:r(41562).supplyDefaults,crossTraceDefaults:r(41562).crossTraceDefaults,supplyLayoutDefaults:r(2463),calc:r(6561),crossTraceCalc:r(27050).crossTraceCalc,colorbar:r(23814),arraysToCalcdata:r(3970),plot:r(3095).plot,style:r(18095).style,styleOnSelect:r(18095).styleOnSelect,hoverPoints:r(19260).hoverPoints,eventData:r(71649),selectPoints:r(40668),moduleType:"trace",name:"bar",basePlotModule:r(29435),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},134:function(t,e,r){"use strict";var n=r(5159),i=r(78945).BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;t.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},348:function(t,e,r){"use strict";var n=r(16534),i=r(69562),a=r(54113),o=r(15181),s=o.strScale,l=o.strRotate,u=o.strTranslate;t.exports=function(t,e,r){var o,c,f,h,p=t.node(),d=a[r.arrowhead||0],v=a[r.startarrowhead||0],g=(r.arrowwidth||1)*(r.arrowsize||1),y=(r.arrowwidth||1)*(r.startarrowsize||1),m=e.indexOf("start")>=0,x=e.indexOf("end")>=0,b=d.backoff*g+r.standoff,_=v.backoff*y+r.startstandoff;if("line"===p.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-c.x,T=o.y-c.y;if(h=(f=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void D();if(b){if(b*b>w*w+T*T)return void D();var A=b*Math.cos(f),k=b*Math.sin(f);c.x+=A,c.y+=k,t.attr({x2:c.x,y2:c.y})}if(_){if(_*_>w*w+T*T)return void D();var M=_*Math.cos(f),S=_*Math.sin(f);o.x-=M,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var E=p.getTotalLength(),L="";if(E=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}function _(t){var r,i,s,l,f,v,g=t._fullLayout,y=g._size,m=y.p,x=p.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),e.drawMainTitle(t),h.manage(t),!g._has("cartesian"))return a.previousPromises(t);function _(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-m-n:e._offset+e._length+m+n:y.t+y.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+m+n:e._offset-m-n:y.l+y.w*(t.position||0)+n%1}for(r=0;r.5?"t":"b",o=t._fullLayout.margin[a],s=0;return"paper"===e.yref?s=r+e.pad.t+e.pad.b:"container"===e.yref&&(s=function(t,e,r,n,i){var a=0;return"middle"===r&&(a+=i/2),"t"===t?("top"===r&&(a+=i),a+=n-e*n):("bottom"===r&&(a+=i),a+=e*n),a}(a,n,i,t._fullLayout.height,r)+e.pad.t+e.pad.b),s>o?s:0}(t,r,g);y>0&&(function(t,e,r,n){var i="title.automargin",s=t._fullLayout.title,l=s.y>.5?"t":"b",u={x:s.x,y:s.y,t:0,b:0},c={};"paper"===s.yref&&function(t,e,r,n,i){var a="paper"===e.yref?t._fullLayout._size.h:t._fullLayout.height,s=o.isTopAnchor(e)?n:n-i,l="b"===r?a-s:s;return!(o.isTopAnchor(e)&&"t"===r||o.isBottomAnchor(e)&&"b"===r)&&l=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(h.c2p(t.x)-d);return a=Math.min(e,r)&&v<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(p.c2p(t.y)-v);return aW!=(N=D[O][1])>=W&&(R=D[O-1][0],F=D[O][0],N-B&&(z=R+(F-R)*(W-B)/(N-B),H=Math.min(H,z),q=Math.max(q,z)));H=Math.max(H,0),q=Math.min(q,h._length);var Z=s.defaultLine;return s.opacity(f.fillcolor)?Z=f.fillcolor:s.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:H,x1:q,y0:W,y1:W,color:Z,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},639:function(t,e,r){"use strict";r.r(e);var n=2*Math.PI,i=function(t,e,r,n,i,a,o){var s=t.x,l=t.y;return{x:n*(s*=e)-i*(l*=r)+a,y:i*s+n*l+o}},a=function(t,e){var r=1.5707963267948966===e?.551915024494:-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),a=Math.cos(t+e),o=Math.sin(t+e);return[{x:n-i*r,y:i+n*r},{x:a+o*r,y:o-a*r},{x:a,y:o}]},o=function(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};e.default=function(t){var e=t.px,r=t.py,s=t.cx,l=t.cy,u=t.rx,c=t.ry,f=t.xAxisRotation,h=void 0===f?0:f,p=t.largeArcFlag,d=void 0===p?0:p,v=t.sweepFlag,g=void 0===v?0:v,y=[];if(0===u||0===c)return[];var m=Math.sin(h*n/360),x=Math.cos(h*n/360),b=x*(e-s)/2+m*(r-l)/2,_=-m*(e-s)/2+x*(r-l)/2;if(0===b&&0===_)return[];u=Math.abs(u),c=Math.abs(c);var w=Math.pow(b,2)/Math.pow(u,2)+Math.pow(_,2)/Math.pow(c,2);w>1&&(u*=Math.sqrt(w),c*=Math.sqrt(w));var T=function(t,e,r,i,a,s,l,u,c,f,h,p){var d=Math.pow(a,2),v=Math.pow(s,2),g=Math.pow(h,2),y=Math.pow(p,2),m=d*v-d*y-v*g;m<0&&(m=0),m/=d*y+v*g;var x=(m=Math.sqrt(m)*(l===u?-1:1))*a/s*p,b=m*-s/a*h,_=f*x-c*b+(t+r)/2,w=c*x+f*b+(e+i)/2,T=(h-x)/a,A=(p-b)/s,k=(-h-x)/a,M=(-p-b)/s,S=o(1,0,T,A),E=o(T,A,k,M);return 0===u&&E>0&&(E-=n),1===u&&E<0&&(E+=n),[_,w,S,E]}(e,r,s,l,u,c,d,g,m,x,b,_),A=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(T,4),k=A[0],M=A[1],S=A[2],E=A[3],L=Math.abs(E)/(n/4);Math.abs(1-L)<1e-7&&(L=1);var C=Math.max(Math.ceil(L),1);E/=C;for(var P=0;Po.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,u=-1/0,c=1/0;for(r=0;r":p>u&&(n.prefixBoundary=!0);break;case"<":(pu||n.starts.length&&h===c)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),h=Math.max(p[0],p[1]),fu&&(n.prefixBoundary=!0)}}}},879:function(t){"use strict";t.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},913:function(t){"use strict";function e(t){return 32===t||9===t||13===t||10===t}function r(t){return"number"==typeof t&&isFinite(t)&&t>0}var n=/<[-_.:a-zA-Z0-9][^>]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,a=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,o=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,s=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,l=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(t){return l.test(t)?t.match(l)[0]:"px"}t.exports=function(t){if(function(t){var r=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(r=3);r-1}},1105:function(t,e,r){"use strict";var n=r(74697).hasColorscale,i=r(31751),a=r(3970),o=r(27050).setGroupPositions,s=r(64433),l=r(46982).traceIs,u=r(15181).extendFlat;t.exports={calc:function(t,e){for(var r=t._fullLayout,o=e.subplot,l=r[o].radialaxis,u=r[o].angularaxis,c=l.makeCalcdata(e,"r"),f=u.makeCalcdata(e,"theta"),h=e._length,p=new Array(h),d=c,v=f,g=0;gw,k=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,S=d,E=g+y;E+M>u&&(E=u-M);var L=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),A?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:E,width:k,height:M}),this._hbarXMin=S+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=y>T,P=s.barWidth+2*s.barPad,O=s.barLength+2*s.barPad,I=d+v,D=g;I+P>l&&(I=l-P);var z=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),C?(this.vbar=z.attr({rx:s.barRadius,ry:s.barRadius,x:I,y:D,width:P,height:O}),this._vbarYMin=D+O/2,this._vbarTranslateMax=T-O):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=c-.5,B=C?f+P+.5:f+.5,N=h-.5,j=A?p+M+.5:p+.5,U=o._topdefs.selectAll("#"+R).data(A||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),A||C?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(a.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:v,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),A||C){var V=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var H=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(H),C&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},1798:function(t,e,r){"use strict";var n=r(20042),i=r(23276),a=r(79335),o=r(99012).axisHoverFormat,s=r(8357).extendFlat;t.exports=s({x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,nbinsx:n.nbinsx,xbins:n.xbins,nbinsy:n.nbinsy,ybins:n.ybins,autobinx:n.autobinx,autobiny:n.autobiny,bingroup:n.bingroup,xbingroup:n.xbingroup,ybingroup:n.ybingroup,autocontour:i.autocontour,ncontours:i.ncontours,contours:i.contours,line:{color:i.line.color,width:s({},i.line.width,{dflt:.5}),dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:n.hovertemplate,texttemplate:i.texttemplate,textfont:i.textfont},a("",{cLetter:"z",editTypeOverride:"calc"}))},1810:function(t,e,r){"use strict";var n=r(62290),i=r(37101).Dj,a=r(16534),o=r(14714),s=r(54485),l=r(43481),u=r(25623),c=r(69562),f=r(88191),h=r(15181),p=h.strTranslate,d=h.strRotate,v=r(51257),g=v.keyFun,y=v.repeat,m=v.unwrap,x=r(3071),b=r(46982),_=r(5126),w=_.CAP_SHIFT,T=_.LINE_SPACING;function A(t,e,r){var n,i=m(e),a=i.trace,c=a.domain,f="h"===a.orientation,p=a.node.pad,d=a.node.thickness,v=t.width*(c.x[1]-c.x[0]),g=t.height*(c.y[1]-c.y[0]),y=i._nodes,x=i._links,b=i.circular;(n=b?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(f?[v,g]:[g,v]).nodeWidth(d).nodePadding(p).nodeId(function(t){return t.pointNumber}).nodes(y).links(x);var _,w,T,A=n();for(var k in n.nodePadding()o+d&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i}(y=A.nodes).forEach(function(t){var e,r,n,i=0,a=t.length;for(t.sort(function(t,e){return t.y0-e.y0}),n=0;n=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+p}),n.update(A)}return{circular:b,key:r,trace:a,guid:h.randstr(),horizontal:f,width:v,height:g,nodePad:a.node.pad,nodeLineColor:a.node.line.color,nodeLineWidth:a.node.line.width,linkLineColor:a.link.line.color,linkLineWidth:a.link.line.width,linkArrowLength:a.link.arrowlen,valueFormat:a.valueformat,valueSuffix:a.valuesuffix,textFont:a.textfont,translateX:c.x[0]*t.width+t.margin.l,translateY:t.height-c.y[1]*t.height+t.margin.t,dragParallel:f?g:v,dragPerpendicular:f?v:g,arrangement:a.arrangement,sankey:n,graph:A,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function k(t,e,r){var n=u(e.color),i=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:i,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:c.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:M,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,linkArrowLength:t.linkArrowLength,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function M(){return function(t){var e=t.linkArrowLength;if(t.link.circular)return function(t,e){var r=t.width/2,n=t.circularPathData;return"top"===t.circularLinkType?"M "+(n.targetX-e)+" "+(n.targetY+r)+" L"+(n.rightInnerExtent-e)+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r-e)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-e)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r-e)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-e)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+(n.rightInnerExtent-e)+" "+(n.targetY-r)+"L"+(n.targetX-e)+" "+(n.targetY-r)+(e>0?"L"+n.targetX+" "+n.targetY:"")+"Z":"M "+(n.targetX-e)+" "+(n.targetY-r)+" L"+(n.rightInnerExtent-e)+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r-e)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-e)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r-e)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-e)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+(n.rightInnerExtent-e)+" "+(n.targetY+r)+"L"+(n.targetX-e)+" "+(n.targetY+r)+(e>0?"L"+n.targetX+" "+n.targetY:"")+"Z"}(t.link,e);var r=Math.abs((t.link.target.x0-t.link.source.x1)/2);e>r&&(e=r);var n=t.link.source.x1,a=t.link.target.x0-e,o=i(n,a),s=o(.5),l=o(.5),u=t.link.y0-t.link.width/2,c=t.link.y0+t.link.width/2,f=t.link.y1-t.link.width/2,h=t.link.y1+t.link.width/2,p="M"+n+","+u,d="C"+s+","+u+" "+l+","+f+" "+a+","+f,v="C"+l+","+h+" "+s+","+c+" "+n+","+c,g=e>0?"L"+(a+e)+","+(f+t.link.width/2):"";return p+d+(g+="L"+a+","+h)+v+"Z"}}function S(t,e){var r=u(e.color),n=l.nodePadAcross,i=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var a=e.dx,o=Math.max(.5,e.dy),s="node_"+e.pointNumber;return e.group&&(s=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:s,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:c.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,s].join("_"),interactionState:t.interactionState,figure:t}}function E(t){t.attr("transform",function(t){return p(t.node.x0.toFixed(3),t.node.y0.toFixed(3))})}function L(t){t.call(E)}function C(t,e){t.call(L),e.attr("d",M())}function P(t){t.attr("width",function(t){return t.node.x1-t.node.x0}).attr("height",function(t){return t.visibleHeight})}function O(t){return t.link.width>1||t.linkLineWidth>0}function I(t){return p(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function D(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)})}function z(t,e,r,i){var o=a.behavior.drag().origin(function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}}).on("dragstart",function(a){if("fixed"!==a.arrangement&&(h.ensureSingle(i._fullLayout._infolayer,"g","dragcover",function(t){i._fullLayout._dragCover=t}),h.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r){!function(t){for(var e=0;e0&&n.forceLayouts[e].alpha(0)}}(0,e,i,r)).stop()}(0,o,a),function(t,e,r,n,i){window.requestAnimationFrame(function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,R(r,i)}})}(t,e,a,o,i)}}).on("drag",function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),C(t.filter(B(r)),e))}}).on("dragend",function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;e0?(0,n.A)(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,r){e.setFullYear(e.getFullYear()+r*t)}):null},e.A=i;var a=i.range},2040:function(t){"use strict";t.exports=Math.min},2086:function(t,e,r){"use strict";var n=r(46982);t.exports=function(t,e){for(var r=t._context.locale,i=0;i<2;i++){for(var a=t._context.locales,o=0;o<2;o++){var s=(a[r]||{}).dictionary;if(s){var l=s[e];if(l)return l}a=n.localeRegistry}var u=r.split("-")[0];if(u===r)break;r=u}return e}},2257:function(t,e,r){"use strict";var n=r(31751);t.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,u=0;u")),c.color=function(t,e){var r=t[e.dir].marker,n=r.color,a=r.line.color,o=r.line.width;return i(n)?n:i(a)&&o?a:void 0}(h,g),[c]}function A(t){return n(v,t,h[d+"hoverformat"])}}},2290:function(t,e,r){"use strict";var n=r(16534),i=r(96221),a=r(37101).GW,o=r(88191),s=r(15181),l=r(3071),u=r(70394),c=u.recordMinTextSize,f=u.clearMinTextSize,h=r(98354),p=r(10088).getRotationAngle,d=h.computeTransform,v=h.transformInsideText,g=r(50928).styleOne,y=r(18095).resizeText,m=r(96303),x=r(23748),b=r(95304);function _(t,r,u,f){var h=t._context.staticPlot,y=t._fullLayout,_=!y.uniformtext.mode&&b.hasTransition(f),T=n.select(u).selectAll("g.slice"),A=r[0],k=A.trace,M=A.hierarchy,S=b.findEntryWithLevel(M,k.level),E=b.getMaxDepth(k),L=y._size,C=k.domain,P=L.w*(C.x[1]-C.x[0]),O=L.h*(C.y[1]-C.y[0]),I=.5*Math.min(P,O),D=A.cx=L.l+L.w*(C.x[1]+C.x[0])/2,z=A.cy=L.t+L.h*(1-C.y[0])-O/2;if(!S)return T.remove();var R=null,F={};_&&T.each(function(t){F[b.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!R&&b.isEntry(t)&&(R=t)});var B=function(t){return i.partition().size([2*Math.PI,t.height+1])(t)}(S).descendants(),N=S.height+1,j=0,U=E;A.hasMultipleRoots&&b.isHierarchyRoot(S)&&(B=B.slice(1),N-=1,j=1,U+=1),B=B.filter(function(t){return t.y1<=U});var V=p(k.rotation);V&&B.forEach(function(t){t.x0+=V,t.x1+=V});var H=Math.min(N,E),q=function(t){return(t-j)/H*I},G=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},Y=function(t){return s.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,D,z)},W=function(t){return D+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},Z=function(t){return z+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(T=T.data(B,b.getPtId)).enter().append("g").classed("slice",!0),_?T.exit().transition().each(function(){var t=n.select(this);t.select("path.surface").transition().attrTween("d",function(t){var e=function(t){var e,r=b.getPtId(t),n=F[r],i=F[b.getPtId(S)];if(i){var o=(t.x1>i.x1?2*Math.PI:0)+V;e=t.rpx1X?2*Math.PI:0)+V;e={x0:i,x1:i}}else e={rpx0:I,rpx1:I},s.extendFlat(e,$(t));else e={rpx0:0,rpx1:0};else e={x0:V,x1:V};return a(e,n)}(t);return function(t){return Y(e(t))}}):f.attr("d",Y),u.call(m,S,t,r,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,t,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:t._transitioning}),f.call(g,i,k,t);var p=s.ensureSingle(u,"g","slicetext"),w=s.ensureSingle(p,"text","",function(t){t.attr("data-notex",1)}),T=s.ensureUniformFontSize(t,b.determineTextFont(k,i,y.font));w.text(e.formatSliceLabel(i,S,k,r,y)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,T).call(l.convertToTspans,t);var M=o.bBox(w.node());i.transform=v(M,i,A),i.transform.targetX=W(i),i.transform.targetY=Z(i);var E=function(t,e){var r=t.transform;return d(r,e),r.fontSize=T.size,c(k.type,r,y),s.getTextTransform(r)};_?w.transition().attrTween("transform",function(t){var e=function(t){var e,r=F[b.getPtId(t)],n=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},R)if(t.parent)if(X){var i=t.x1>X?2*Math.PI:0;e.x0=e.x1=i}else s.extendFlat(e,$(t));else e.x0=e.x1=V;else e.x0=e.x1=V;var o=a(e.transform.textPosAngle,t.transform.textPosAngle),l=a(e.rpx1,t.rpx1),u=a(e.x0,t.x0),f=a(e.x1,t.x1),h=a(e.transform.scale,n.scale),p=a(e.transform.rotate,n.rotate),d=0===n.rCenter?3:0===e.transform.rCenter?1/3:1,v=a(e.transform.rCenter,n.rCenter);return function(t){var e=l(t),r=u(t),i=f(t),a=function(t){return v(Math.pow(t,d))}(t),s={pxmid:G(e,(r+i)/2),rpx1:e,transform:{textPosAngle:o(t),rCenter:a,x:n.x,y:n.y}};return c(k.type,n,y),{transform:{targetX:W(s),targetY:Z(s),scale:h(t),rotate:p(t),rCenter:a}}}}(t);return function(t){return E(e(t),M)}}):w.attr("transform",E(i,M))})}function w(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}e.plot=function(t,e,r,i){var a,o,s=t._fullLayout,l=s._sunburstlayer,u=!r,c=!s.uniformtext.mode&&b.hasTransition(r);f("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(e,function(t){return t[0].trace.uid})).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),c?(i&&(o=i()),n.transition().duration(r.duration).ease(r.easing).each("end",function(){o&&o()}).each("interrupt",function(){o&&o()}).each(function(){l.selectAll("g.trace").each(function(e){_(t,e,this,r)})})):(a.each(function(e){_(t,e,this,r)}),s.uniformtext.mode&&y(t,s._sunburstlayer.selectAll(".trace"),"sunburst")),u&&a.exit().remove()},e.formatSliceLabel=function(t,e,r,n,i){var a=r.texttemplate,o=r.textinfo;if(!(a||o&&"none"!==o))return"";var l=i.separators,u=n[0],c=t.data.data,f=u.hierarchy,h=b.isHierarchyRoot(t),p=b.getParent(f,t),d=b.getValue(t);if(!a){var v,g=o.split("+"),y=function(t){return-1!==g.indexOf(t)},m=[];if(y("label")&&c.label&&m.push(c.label),c.hasOwnProperty("v")&&y("value")&&m.push(b.formatValue(c.v,l)),!h){y("current path")&&m.push(b.getPath(t.data));var x=0;y("percent parent")&&x++,y("percent entry")&&x++,y("percent root")&&x++;var _=x>1;if(x){var w,T=function(t){v=b.formatPercent(w,l),_&&(v+=" of "+t),m.push(v)};y("percent parent")&&!h&&(w=d/b.getValue(p),T("parent")),y("percent entry")&&(w=d/b.getValue(e),T("entry")),y("percent root")&&(w=d/b.getValue(f),T("root"))}}return y("text")&&(v=s.castOption(r,c.i,"text"),s.isValidTextValue(v)&&m.push(v)),m.join("
")}var A=s.castOption(r,c.i,"texttemplate");if(!A)return"";var k={};c.label&&(k.label=c.label),c.hasOwnProperty("v")&&(k.value=c.v,k.valueLabel=b.formatValue(c.v,l)),k.currentPath=b.getPath(t.data),h||(k.percentParent=d/b.getValue(p),k.percentParentLabel=b.formatPercent(k.percentParent,l),k.parent=b.getPtLabel(p)),k.percentEntry=d/b.getValue(e),k.percentEntryLabel=b.formatPercent(k.percentEntry,l),k.entry=b.getPtLabel(e),k.percentRoot=d/b.getValue(f),k.percentRootLabel=b.formatPercent(k.percentRoot,l),k.root=b.getPtLabel(f),c.hasOwnProperty("color")&&(k.color=c.color);var M=s.castOption(r,c.i,"text");return(s.isValidTextValue(M)||""===M)&&(k.text=M),k.customdata=s.castOption(r,c.i,"customdata"),s.texttemplateString(A,k,i._d3locale,k,r._meta||{})}},2362:function(t){"use strict";t.exports=JSON.parse('["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]')},2378:function(t,e,r){"use strict";var n=r(6624);e._doPlot=n._doPlot,e.newPlot=n.newPlot,e.restyle=n.restyle,e.relayout=n.relayout,e.redraw=n.redraw,e.update=n.update,e._guiRestyle=n._guiRestyle,e._guiRelayout=n._guiRelayout,e._guiUpdate=n._guiUpdate,e._storeDirectGUIEdit=n._storeDirectGUIEdit,e.react=n.react,e.extendTraces=n.extendTraces,e.prependTraces=n.prependTraces,e.addTraces=n.addTraces,e.deleteTraces=n.deleteTraces,e.moveTraces=n.moveTraces,e.purge=n.purge,e.addFrames=n.addFrames,e.deleteFrames=n.deleteFrames,e.animate=n.animate,e.setPlotConfig=n.setPlotConfig;var i=r(72565).getGraphDiv,a=r(87099).eraseActiveShape;e.deleteActiveShape=function(t){return a(i(t))},e.toImage=r(25103),e.validate=r(51326),e.downloadImage=r(68552);var o=r(46745);e.makeTemplate=o.makeTemplate,e.validateTemplate=o.validateTemplate},2463:function(t,e,r){"use strict";var n=r(46982),i=r(26446),a=r(15181),o=r(13800);t.exports=function(t,e,r){function s(r,n){return a.coerce(t,e,o,r,n)}for(var l=!1,u=!1,c=!1,f={},h=s("barmode"),p=0;pl&&C[y].gap;)y--;for(x=C[y].s,v=C.length-1;v>y;v--)C[v].s=x;for(;lu||v>c)&&(s.style("overflow","hidden"),d=(p=s.node().getBoundingClientRect()).width,v=p.height);var y=+t.attr("x"),m=+t.attr("y"),x=-(r||t.node().getBoundingClientRect().height)/4;if("y"===O[0])l.attr({transform:"rotate("+[-90,y,m]+")"+a(-d/2,x-v/2)});else if("l"===O[0])m=x-v/2;else if("a"===O[0]&&0!==O.indexOf("atitle"))y=0,m=x;else{var b=t.attr("text-anchor");y-=d*("middle"===b?.5:"end"===b?1:0),m=m+x-v/2}s.attr({x:y,y:m}),g&&g.call(t,l),e(l)})})):I(),t}function I(){P.empty()||(O=t.attr("class")+"-math",P.select("svg."+O).remove()),t.text("").style("white-space","pre");var r=function(t,e){e=e.replace(y," ");var r,a=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:u*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}b.test(e)?c():(r=t,l=[{node:t}]);for(var E=e.split(m),P=0;P|>|>)/g,f=[["$","$"],["\\(","\\)"]],h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},v="​",g=["http:","https:","mailto:","",void 0,":"],y=e.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,x=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;e.BR_TAG_ALL=//gi;var _=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,w=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,T=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,A=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&L(n)}var M=/(^|;)\s*color:/;e.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i=t.split(m),a=[],o="",s=0,l=0;l3?a.push(u.substr(0,p-3)+"..."):a.push(u.substr(0,p));break}o=""}}return a.join("")};var S={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},E=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(t){return t.replace(E,function(t,e){return("#"===e.charAt(0)?function(t){if(!(t>1114111)){var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):S[e])||t})}function C(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==g.indexOf(i)&&-1!==g.indexOf(a)?e:""}function P(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",u=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var t=o()-c.left,e=a()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}e.convertEntities=L,e.sanitizeHTML=function(t){t=t.replace(y," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(m),o=0;o0}function S(t){return"auto"===t?0:t}function E(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*n,y:t.width*n+t.height*i}}function L(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,u=a.anchor||"end",c="end"===u,f="start"===u,h=((a.leftToRight||0)+1)/2,p=1-h,d=i.width,v=i.height,g=Math.abs(e-t),y=Math.abs(n-r),m=g>2*_&&y>2*_?_:0;g-=2*m,y-=2*m;var x=S(l);"auto"!==l||d<=g&&v<=y||!(d>g||v>y)||(d>y||v>g)&&d.01?G:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?G(t):t>e?Math.ceil(t):Math.floor(t)};N=Y(N,j,R),j=Y(j,N,R),U=Y(U,V,!R),V=Y(V,U,!R)}var W=k(a.ensureSingle(I,"path"),P,g,y);if(W.style("vector-effect",O?"none":"non-scaling-stroke").attr("d",isNaN((j-N)*(V-U))||H&&t._context.staticPlot?"M0,0Z":"M"+N+","+U+"V"+V+"H"+j+"V"+U+"Z").call(l.setClipUrl,e.layerClipId,t),!P.uniformtext.mode&&F){var Z=l.makePointStyleFns(f);l.singlePointStyle(u,W,f,Z,t)}!function(t,e,r,n,i,s,u,f,p,g,y){var w,T=e.xaxis,M=e.yaxis,C=t._fullLayout;function P(e,r,n){return a.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var O=n[0].trace,I="h"===O.orientation,D=function(t,e,r,n,i){var o,s=e[0].trace;return o=s.texttemplate?function(t,e,r,n,i){var o=e[0].trace,s=a.castOption(o,r,"texttemplate");if(!s)return"";var l,u,f,h,p="histogram"===o.type,d="waterfall"===o.type,v="funnel"===o.type,g="h"===o.orientation;function y(t){return c(h,h.c2l(t),!0).text}g?(l="y",u=i,f="x",h=n):(l="x",u=n,f="y",h=i);var m,x=e[r],_={};_.label=x.p,_.labelLabel=_[l+"Label"]=(m=x.p,c(u,u.c2l(m),!0).text);var w=a.castOption(o,x.i,"text");(0===w||w)&&(_.text=w),_.value=x.s,_.valueLabel=_[f+"Label"]=y(x.s);var T={};b(T,o,x.i),(p||void 0===T.x)&&(T.x=g?_.value:_.label),(p||void 0===T.y)&&(T.y=g?_.label:_.value),(p||void 0===T.xLabel)&&(T.xLabel=g?_.valueLabel:_.labelLabel),(p||void 0===T.yLabel)&&(T.yLabel=g?_.labelLabel:_.valueLabel),d&&(_.delta=+x.rawS||x.s,_.deltaLabel=y(_.delta),_.final=x.v,_.finalLabel=y(_.final),_.initial=_.final-_.delta,_.initialLabel=y(_.initial)),v&&(_.value=x.s,_.valueLabel=y(_.value),_.percentInitial=x.begR,_.percentInitialLabel=a.formatPercent(x.begR),_.percentPrevious=x.difR,_.percentPreviousLabel=a.formatPercent(x.difR),_.percentTotal=x.sumR,_.percenTotalLabel=a.formatPercent(x.sumR));var A=a.castOption(o,x.i,"customdata");return A&&(_.customdata=A),a.texttemplateString(s,_,t._d3locale,T,_,o._meta||{})}(t,e,r,n,i):s.textinfo?function(t,e,r,n){var i=t[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function u(t){return c(o?r:n,+t,!0).text}var f,h,p=i.textinfo,d=t[e],v=p.split("+"),g=[],y=function(t){return-1!==v.indexOf(t)};if(y("label")&&g.push((h=t[e].p,c(o?n:r,h,!0).text)),y("text")&&(0===(f=a.castOption(i,d.i,"text"))||f)&&g.push(f),s){var m=+d.rawS||d.s,x=d.v,b=x-m;y("initial")&&g.push(u(b)),y("delta")&&g.push(u(m)),y("final")&&g.push(u(x))}if(l){y("value")&&g.push(u(d.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var w=_>1;y("percent initial")&&(f=a.formatPercent(d.begR),w&&(f+=" of initial"),g.push(f)),y("percent previous")&&(f=a.formatPercent(d.difR),w&&(f+=" of previous"),g.push(f)),y("percent total")&&(f=a.formatPercent(d.sumR),w&&(f+=" of total"),g.push(f))}return g.join("
")}(e,r,n,i):v.getValue(s.text,r),v.coerceString(m,o)}(C,n,i,T,M);w=function(t,e){var r=v.getValue(t.textposition,e);return v.coerceEnumerated(x,r)}(O,i);var z="stack"===g.mode||"relative"===g.mode,R=n[i],F=!z||R._outmost;if(D&&"none"!==w&&(!R.isBlank&&s!==u&&f!==p||"auto"!==w&&"inside"!==w)){var B=C.font,N=d.getBarColor(n[i],O),j=d.getInsideTextFont(O,i,B,N),U=d.getOutsideTextFont(O,i,B),V=r.datum();I?"log"===T.type&&V.s0<=0&&(s=T.range[0]0&&Y>0&&(G<=Z&&Y<=X||G<=X&&Y<=Z||(I?Z>=G*(X/Y):X>=Y*(Z/G)))?w="inside":(w="outside",H.remove(),H=null)):w="inside"),!H){var J=(H=P(r,D,W=a.ensureUniformFontSize(t,"outside"===w?U:j))).attr("transform");if(H.attr("transform",""),G=(q=l.bBox(H.node())).width,Y=q.height,H.attr("transform",J),G<=0||Y<=0)return void H.remove()}var K,$=O.textangle;K="outside"===w?function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,u=a.angle||0,c=i.width,f=i.height,h=Math.abs(e-t),p=Math.abs(n-r);o=s?p>2*_?_:0:h>2*_?_:0;var d=1;l&&(d=s?Math.min(1,p/f):Math.min(1,h/c));var v=S(u),g=E(i,v),y=(s?g.x:g.y)/2,m=(i.left+i.right)/2,x=(i.top+i.bottom)/2,b=(t+e)/2,w=(r+n)/2,T=0,k=0,M=s?A(e,t):A(r,n);return s?(b=e-M*o,T=M*y):(w=n+M*o,k=-M*y),{textX:m,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:k,scale:d,rotate:v}}(s,u,f,p,q,{isHorizontal:I,constrained:"both"===O.constraintext||"outside"===O.constraintext,angle:$}):L(s,u,f,p,q,{isHorizontal:I,constrained:"both"===O.constraintext||"inside"===O.constraintext,angle:$,anchor:O.insidetextanchor}),K.fontSize=W.size,h("histogram"===O.type?"bar":O.type,K,C),R.transform=K;var Q=k(H,C,g,y);a.setTransormAndDisplay(Q,K)}else r.select("text").remove()}(t,e,I,r,p,N,j,U,V,g,y),e.layerClipId&&l.hideOutsideRangePoint(u,I.select("text"),w,C,f.xcalendar,f.ycalendar)});var U=!1===f.cliponaxis;l.setClipUrl(u,U?null:e.layerClipId,t)});u.getComponentMethod("errorbars","plot")(t,I,e,g)},toMoveInsideBar:L}},3115:function(t,e,r){"use strict";var n=r(15181),i=r(40243),a=r(93003).id2name,o=r(94257),s=r(44559),l=r(18687),u=r(78945).ALMOST_EQUAL,c=r(5126).FROM_BL;function f(t,e,r){var i=r.axIds,s=r.layoutOut,l=r.hasImage,u=s._axisConstraintGroups,c=s._axisMatchGroups,f=e._id,v=f.charAt(0),g=((s._splomAxes||{})[v]||{})[f]||{},y=e._id,m="x"===y.charAt(0);function x(r,i){return n.coerce(t,e,o,r,i)}e._matchGroup=null,e._constraintGroup=null,x("constrain",l?"domain":"range"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:m?["left","center","right"]:["bottom","middle","top"],dflt:m?"center":"middle"}},"constraintoward");var b,_,w=e.type,T=[];for(b=0;bn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function g(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;ou*x)||T)for(r=0;rI&&FP&&(P=F);h/=(P-C)/(2*O),C=l.l2r(C),P=l.l2r(P),l.range=l._input.range=S=0;i--)a[c-i]=t[f][i],o[c-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:u}),s}},3539:function(t,e,r){"use strict";t.exports=r(96180)},3658:function(t,e,r){"use strict";var n=r(26446);t.exports=function(t,e,r){var i={},a={_fullLayout:r},o=n.getFromTrace(a,e,"x"),s=n.getFromTrace(a,e,"y"),l=t.orig_x;void 0===l&&(l=t.x);var u=t.orig_y;return void 0===u&&(u=t.y),i.xLabel=n.tickText(o,o.c2l(l),!0).text,i.yLabel=n.tickText(s,s.c2l(u),!0).text,i}},3970:function(t,e,r){"use strict";var n=r(15181);t.exports=function(t,e){for(var r=0;rE*b?i=(a=b)*E:a=(i=x)/E,o=y*i/x,l=m*a/b,r=e.l+e.w*v-i/2,n=e.t+e.h*(1-g)-a/2,p.x0=r,p.y0=n,p.w=i,p.h=a,p.sum=_,p.xaxis={type:"linear",range:[w+2*A-_,_-w-2*T],domain:[v-o/2,v+o/2],_id:"x"},f(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(t){return t.a>=p.aaxis.range[0]&&t.a<=p.aaxis.range[1]&&t.b>=p.baxis.range[1]&&t.b<=p.baxis.range[0]&&t.c>=p.caxis.range[1]&&t.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,_-T-A],domain:[g-l/2,g+l/2],_id:"y"},f(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var k=p.yaxis.domain[0],M=p.aaxis=h({},t.aaxis,{range:[w,_-T-A],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[k,k+l*E],anchor:"free",position:0,_id:"y",_length:i});f(M,p.graphDiv._fullLayout),M.setScale();var S=p.baxis=h({},t.baxis,{range:[_-w-A,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});f(S,p.graphDiv._fullLayout),S.setScale();var L=p.caxis=h({},t.caxis,{range:[_-w-T,A],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[k,k+l*E],anchor:"free",position:0,_id:"y",_length:i});f(L,p.graphDiv._fullLayout),L.setScale();var C="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDef.select("path").attr("d",C),p.layers.plotbg.select("path").attr("d",C);var P="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDefRelative.select("path").attr("d",P);var O=s(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",O),p.clipDefRelative.select("path").attr("transform",null);var I=s(r-S._offset,n+a);p.layers.baxis.attr("transform",I),p.layers.bgrid.attr("transform",I);var D=s(r+i/2,n)+"rotate(30)"+s(0,-M._offset);p.layers.aaxis.attr("transform",D),p.layers.agrid.attr("transform",D);var z=s(r+i/2,n)+"rotate(-30)"+s(0,-L._offset);p.layers.caxis.attr("transform",z),p.layers.cgrid.attr("transform",z),p.drawAxes(!0),p.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",L.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),c.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},S.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.layers,a=e.aaxis,o=e.baxis,s=e.caxis;if(e.drawAx(a),e.drawAx(o),e.drawAx(s),t){var u=Math.max(a.showticklabels?a.tickfont.size/2:0,(s.showticklabels?.75*s.tickfont.size:0)+("outside"===s.ticks?.87*s.ticklen:0)),c=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;i["a-title"]=b.draw(r,"a"+n,{propContainer:a,propName:e.id+".aaxis.title",placeholder:l(r,"Click to enter Component A title"),attributes:{x:e.x0+e.w/2,y:e.y0-a.title.font.size/3-u,"text-anchor":"middle"}}),i["b-title"]=b.draw(r,"b"+n,{propContainer:o,propName:e.id+".baxis.title",placeholder:l(r,"Click to enter Component B title"),attributes:{x:e.x0-c,y:e.y0+e.h+.83*o.title.font.size+c,"text-anchor":"middle"}}),i["c-title"]=b.draw(r,"c"+n,{propContainer:s,propName:e.id+".caxis.title",placeholder:l(r,"Click to enter Component C title"),attributes:{x:e.x0+e.w+c,y:e.y0+e.h+.83*s.title.font.size+c,"text-anchor":"middle"}})}},S.drawAx=function(t){var e,r=this,n=r.graphDiv,i=t._name,a=i.charAt(0),s=t._id,l=r.layers[i],u=a+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);r[u]!==c&&(l.selectAll("."+s+"tick").remove(),r[u]=c),t.setScale();var f=d.calcTicks(t),h=d.clipEnds(t,f),p=d.makeTransTickFn(t),v=d.getTickSigns(t)[2],g=o.deg2rad(30),y=v*(t.linewidth||1)/2,m=v*t.ticklen,x=r.w,b=r.h,_="b"===a?"M0,"+y+"l"+Math.sin(g)*m+","+Math.cos(g)*m:"M"+y+",0l"+Math.cos(g)*m+","+-Math.sin(g)*m,w={a:"M0,0l"+b+",-"+x/2,b:"M0,0l-"+x/2+",-"+b,c:"M0,0l-"+b+","+x/2}[a];d.drawTicks(n,t,{vals:"inside"===t.ticks?h:f,layer:l,path:_,transFn:p,crisp:!1}),d.drawGrid(n,t,{vals:h,layer:r.layers[a+"grid"],path:w,transFn:p,crisp:!1}),d.drawLabels(n,t,{vals:f,layer:l,transFn:p,labelFns:d.makeLabelFns(t,0,30)})};var L=k.MINZOOM/2+.87,C="m-0.87,.5h"+L+"v3h-"+(L+5.2)+"l"+(L/2+2.6)+",-"+(.87*L+4.5)+"l2.6,1.5l-"+L/2+","+.87*L+"Z",P="m0.87,.5h-"+L+"v3h"+(L+5.2)+"l-"+(L/2+2.6)+",-"+(.87*L+4.5)+"l-2.6,1.5l"+L/2+","+.87*L+"Z",O="m0,1l"+L/2+","+.87*L+"l2.6,-1.5l-"+(L/2+2.6)+",-"+(.87*L+4.5)+"l-"+(L/2+2.6)+","+(.87*L+4.5)+"l2.6,1.5l"+L/2+",-"+.87*L+"Z",I=!0;function D(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearOutline=function(){A(this.dragOptions),T(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,n,f,h,p,d,y,b,T,A,M=this,S=M.layers.plotbg.select("path").node(),L=M.graphDiv,z=L._fullLayout._zoomlayer;function R(t){var e={};return e[M.id+".aaxis.min"]=t.a,e[M.id+".baxis.min"]=t.b,e[M.id+".caxis.min"]=t.c,e}function F(t,e){var r=L._fullLayout.clickmode;D(L),2===t&&(L.emit("plotly_doubleclick",null),a.call("_guiRelayout",L,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,L,[M.xaxis],[M.yaxis],M.id,M.dragOptions),r.indexOf("event")>-1&&g.click(L,e,M.id)}function B(t,e){return 1-e/M.h}function N(t,e){return 1-(t+(M.h-e)/Math.sqrt(3))/M.w}function j(t,e){return(t-(M.h-e)/Math.sqrt(3))/M.w}function U(i,a){var o=r+i*t,s=n+a*e,l=Math.max(0,Math.min(1,B(0,n),B(0,s))),u=Math.max(0,Math.min(1,N(r,n),N(o,s))),c=Math.max(0,Math.min(1,j(r,n),j(o,s))),v=(l/2+c)*M.w,g=(1-l/2-u)*M.w,m=(v+g)/2,x=g-v,_=(1-l)*M.h,w=_-x/E;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),A.transition().style("opacity",1).duration(200),b=!0),L.emit("plotly_relayouting",R(p))}function V(){D(L),p!==f&&(a.call("_guiRelayout",L,R(p)),I&&L.data&&L._context.showTips&&(o.notifier(l(L,"Double-click to zoom back out"),"long"),I=!1))}function H(t,e){var r=t/M.xaxis._m,n=e/M.yaxis._m,i=[(p={a:f.a-n,b:f.b+(r+n)/2,c:f.c-(r-n)/2}).a,p.b,p.c].sort(o.sorterAsc),a=i.indexOf(p.a),l=i.indexOf(p.b),u=i.indexOf(p.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),p={a:i[a],b:i[l],c:i[u]},e=(f.a-p.a)*M.yaxis._m,t=(f.c-p.c-f.b+p.b)*M.xaxis._m);var h=s(M.x0+t,M.y0+e);M.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",h);var d=s(-t,-e);M.clipDefRelative.select("path").attr("transform",d),M.aaxis.range=[p.a,M.sum-p.b-p.c],M.baxis.range=[M.sum-p.a-p.c,p.b],M.caxis.range=[M.sum-p.a-p.b,p.c],M.drawAxes(!1),M._hasClipOnAxisFalse&&M.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,M),L.emit("plotly_relayouting",R(p))}function q(){a.call("_guiRelayout",L,R(p))}this.dragOptions={element:S,gd:L,plotinfo:{id:M.id,domain:L._fullLayout[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis},subplot:M.id,prepFn:function(a,l,c){M.dragOptions.xaxes=[M.xaxis],M.dragOptions.yaxes=[M.yaxis],t=L._fullLayout._invScaleX,e=L._fullLayout._invScaleY;var v=M.dragOptions.dragmode=L._fullLayout.dragmode;m(v)?M.dragOptions.minDrag=1:M.dragOptions.minDrag=void 0,"zoom"===v?(M.dragOptions.moveFn=U,M.dragOptions.clickFn=F,M.dragOptions.doneFn=V,function(t,e,a){var l=S.getBoundingClientRect();r=e-l.left,n=a-l.top,L._fullLayout._calcInverseTransform(L);var c=L._fullLayout._invTransform,v=o.apply3DTransform(c)(r,n);r=v[0],n=v[1],f={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=f,h=M.aaxis.range[1]-f.a,d=i(M.graphDiv._fullLayout[M.id].bgcolor).getLuminance(),y="M0,"+M.h+"L"+M.w/2+", 0L"+M.w+","+M.h+"Z",b=!1,T=z.append("path").attr("class","zoombox").attr("transform",s(M.x0,M.y0)).style({fill:d>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",y),A=z.append("path").attr("class","zoombox-corners").attr("transform",s(M.x0,M.y0)).style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),M.clearOutline(L)}(0,l,c)):"pan"===v?(M.dragOptions.moveFn=H,M.dragOptions.clickFn=F,M.dragOptions.doneFn=q,f={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=f,M.clearOutline(L)):(x(v)||m(v))&&_(a,l,c,M.dragOptions,v)}},S.onmousemove=function(t){g.hover(L,t,M.id),L._fullLayout._lasthover=S,L._fullLayout._hoversubplot=M.id},S.onmouseout=function(t){L._dragging||v.unhover(L,t)},v.init(this.dragOptions)}},4161:function(t,e,r){"use strict";var n=r(16534),i=r(69562),a=r(26100).stylePoints;t.exports=function(t){var e=n.select(t).selectAll("g.trace.violins");e.style("opacity",function(t){return t[0].trace.opacity}),e.each(function(e){var r=e[0].trace,o=n.select(this),s=r.box||{},l=s.line||{},u=r.meanline||{},c=u.width;o.selectAll("path.violin").style("stroke-width",r.line.width+"px").call(i.stroke,r.line.color).call(i.fill,r.fillcolor),o.selectAll("path.box").style("stroke-width",l.width+"px").call(i.stroke,l.color).call(i.fill,s.fillcolor);var f={"stroke-width":c+"px","stroke-dasharray":2*c+"px,"+c+"px"};o.selectAll("path.mean").style(f).call(i.stroke,u.color),o.selectAll("path.meanline").style(f).call(i.stroke,u.color),a(o,r,t)})}},4536:function(t,e,r){"use strict";var n=r(15181),i=r(69562),a=r(92444),o=r(13516),s=r(60609).KO,l=r(5005),u=r(31357),c=r(14736),f=r(25124),h=r(98333),p=r(16361),d=r(50446),v=r(40223),g=r(71045),y=r(29888),m=y.axisNames;function x(t,e,r,o){var d=r("bgcolor");o.bgColor=i.combine(d,o.paper_bgcolor);var x=r("sector");r("hole");var _,w=s(o.fullData,y.name,o.id),T=o.layoutOut;function A(t,e){return r(_+"."+t,e)}for(var k=0;k")}}t.exports={hoverPoints:function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,u=s.cd[s.index],c=s.trace;if(l.isPtInside(u))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(u,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:i}},4562:function(t,e,r){"use strict";var n=r(7458).overrideAll,i=r(39420),a=r(76892),o=r(60432),s=r(29278),l=r(29435),u=r(34535),c=r(60609).KO;e.name="gl2d",e.attr=["xaxis","yaxis"],e.idRoot=["x","y"],e.idRegex=s.idRegex,e.attrRegex=s.attrRegex,e.attributes=r(32002),e.supplyLayoutDefaults=function(t,e,r){e._has("cartesian")||l.supplyLayoutDefaults(t,e,r)},e.layoutAttrOverrides=n(l.layoutAttributes,"plot","from-root"),e.baseLayoutAttrOverrides=n({plot_bgcolor:a.plot_bgcolor,hoverlabel:u.hoverlabel},"plot","nested"),e.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl2d,a=0;a0?n>=l:n<=l));i++)n>c&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var pt=Math.pow(10,Math.floor(Math.log(ht)/Math.LN10));ct*=pt*u.roundUp(ht/pt,[2,5,10]),(Math.abs(Y.start)/Y.size+1e-6)%1<2e-6&&(lt.tick0=0)}lt.dtick=ct}lt.domain=o?[ot+O/B.h,ot+Q-O/B.h]:[ot+P/B.w,ot+Q-P/B.w],lt.setScale(),t.attr("transform",c(Math.round(B.l),Math.round(B.t)));var dt,vt=t.select("."+k.cbtitleunshift).attr("transform",c(-Math.round(B.l),-Math.round(B.t))),gt=lt.ticklabelposition,yt=lt.title.font.size,mt=t.select("."+k.cbaxis),xt=0,bt=0;function _t(n,i){var a={propContainer:lt,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:F._dfltTitle.colorbar,containerGroup:t.select("."+k.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+o+",."+o+"-math-group").remove(),v.draw(r,n,f(a,i||{}))}return u.syncOrAsync([a.previousPromises,function(){var t,e;(o&&ut||!o&&!ut)&&("top"===V&&(t=P+B.l+tt*I,e=O+B.t+et*(1-ot-Q)+3+.75*yt),"bottom"===V&&(t=P+B.l+tt*I,e=O+B.t+et*(1-ot)-3-.25*yt),"right"===V&&(e=O+B.t+et*D+3+.75*yt,t=P+B.l+tt*ot),_t(lt._id+"title",{attributes:{x:t,y:e,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!ut||o&&ut){var a,l=t.select("."+k.cbtitle),f=l.select("text"),h=[-M/2,M/2],d=l.select(".h"+lt._id+"title-math-group").node(),v=15.6;if(f.node()&&(v=parseInt(f.node().style.fontSize,10)*w),d?(a=p.bBox(d),bt=a.width,(xt=a.height)>v&&(h[1]-=(xt-v)/2)):f.node()&&!f.classed(k.jsPlaceholder)&&(a=p.bBox(f.node()),bt=a.width,xt=a.height),o){if(xt){if(xt+=5,"top"===V)lt.domain[1]-=xt/B.h,h[1]*=-1;else{lt.domain[0]+=xt/B.h;var y=g.lineCount(f);h[1]+=(1-y)*v}l.attr("transform",c(h[0],h[1])),lt.setScale()}}else bt&&("right"===V&&(lt.domain[0]+=(bt+yt/2)/B.w),l.attr("transform",c(h[0],h[1])),lt.setScale())}t.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",o?c(0,Math.round(B.h*(1-lt.domain[1]))):c(Math.round(B.w*lt.domain[0]),0)),mt.attr("transform",o?c(0,Math.round(-B.t)):c(Math.round(-B.l),0));var m=t.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(Z);m.enter().append("rect").classed(k.cbfill,!0).attr("style",""),m.exit().remove();var x=H.map(lt.c2p).map(Math.round).sort(function(t,e){return t-e});m.each(function(t,a){var s=[0===a?H[0]:(Z[a]+Z[a-1])/2,a===Z.length-1?H[1]:(Z[a]+Z[a+1])/2].map(lt.c2p).map(Math.round);o&&(s[1]=u.constrain(s[1]+(s[1]>s[0])?1:-1,x[0],x[1]));var l=n.select(this).attr(o?"x":"y",rt).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(J,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)p.gradient(l,r,e._id,o?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var c=G(t).replace("e-","");l.attr("fill",i(c).toHexString())}});var b=t.select("."+k.cblines).selectAll("path."+k.cbline).data(j.color&&j.width?X:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each(function(t){var e=rt,r=Math.round(lt.c2p(t))+j.width/2%1;n.select(this).attr("d","M"+(o?e+","+r:r+","+e)+(o?"h":"v")+J).call(p.lineGroupStyle,j.width,q(t),j.dash)}),mt.selectAll("g."+lt._id+"tick,path").remove();var _=rt+J+(M||0)/2-("outside"===e.ticks?1:0),T=s.calcTicks(lt),A=s.getTickSigns(lt)[2];return s.drawTicks(r,lt,{vals:"inside"===lt.ticks?s.clipEnds(lt,T):T,layer:mt,path:s.makeTickPath(lt,_,A),transFn:s.makeTransTickFn(lt)}),s.drawLabels(r,lt,{vals:T,layer:mt,transFn:s.makeTransTickLabelFn(lt),labelFns:s.makeLabelFns(lt,_)})},function(){if(o&&!ut||!o&&ut){var t,i,a=lt.position||0,s=lt._offset+lt._length/2;if("right"===V)i=s,t=B.l+tt*a+10+yt*(lt.showticklabels?1:.5);else if(t=s,"bottom"===V&&(i=B.t+et*a+10+(-1===gt.indexOf("inside")?lt.tickfont.size:0)+("intside"!==lt.ticks&&e.ticklen||0)),"top"===V){var l=U.text.split("
").length;i=B.t+et*a+10-J-w*yt*l}_t((o?"h":"v")+lt._id+"title",{avoid:{selection:n.select(r).selectAll("g."+lt._id+"tick"),side:V,offsetTop:o?0:B.t,offsetLeft:o?B.l:0,maxShift:o?F.width:F.height},attributes:{x:t,y:i,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},a.previousPromises,function(){var n,s=J+M/2;-1===gt.indexOf("inside")&&(n=p.bBox(mt.node()),s+=o?n.width:n.height),dt=vt.select("text");var u=0,f=o&&"top"===V,v=!o&&"right"===V,g=0;if(dt.node()&&!dt.classed(k.jsPlaceholder)){var m,x=vt.select(".h"+lt._id+"title-math-group").node();x&&(o&&ut||!o&&!ut)?(u=(n=p.bBox(x)).width,m=n.height):(u=(n=p.bBox(vt.node())).right-B.l-(o?rt:st),m=n.bottom-B.t-(o?st:rt),o||"top"!==V||(s+=n.height,g=n.height)),v&&(dt.attr("transform",c(u/2+yt/2,0)),u*=2),s=Math.max(s,o?u:m)}var b=2*(o?P:O)+s+S+M/2,w=0;!o&&U.text&&"bottom"===C&&D<=0&&(b+=w=b/2,g+=w),F._hColorbarMoveTitle=w,F._hColorbarMoveCBTitle=g;var N=S+M,j=(o?rt:st)-N/2-(o?P:0),H=(o?st:rt)-(o?$:O+g-w);t.select("."+k.cbbg).attr("x",j).attr("y",H).attr(o?"width":"height",Math.max(b-w,2)).attr(o?"height":"width",Math.max($+N,2)).call(d.fill,E).call(d.stroke,e.bordercolor).style("stroke-width",S);var q=v?Math.max(u-10,0):0;t.selectAll("."+k.cboutline).attr("x",(o?rt:st+P)+q).attr("y",(o?st+O-$:rt)+(f?xt:0)).attr(o?"width":"height",Math.max(J,2)).attr(o?"height":"width",Math.max($-(o?2*O+xt:2*P+q),2)).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":M});var G=o?nt*b:0,Y=o?0:(1-it)*b-g;if(G=R?B.l-G:-G,Y=z?B.t-Y:-Y,t.attr("transform",c(G,Y)),!o&&(S||i(E).getAlpha()&&!i.equals(F.paper_bgcolor,E))){var W=mt.selectAll("text"),Z=W[0].length,X=t.select("."+k.cbbg).node(),K=p.bBox(X),Q=p.getTranslate(t);W.each(function(t,e){var r=Z-1;if(0===e||e===r){var n,i=p.bBox(this),a=p.getTranslate(this);if(e===r){var o=i.right+a.x;(n=K.right+Q.x+st-S-2+I-o)>0&&(n=0)}else if(0===e){var s=i.left+a.x;(n=K.left+Q.x+st+S+2-s)<0&&(n=0)}n&&(Z<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var tt={},et=T[L],at=A[L],ot=T[C],ct=A[C],ft=b-J;o?("pixels"===h?(tt.y=D,tt.t=$*ot,tt.b=$*ct):(tt.t=tt.b=0,tt.yt=D+l*ot,tt.yb=D-l*ct),"pixels"===_?(tt.x=I,tt.l=b*et,tt.r=b*at):(tt.l=ft*et,tt.r=ft*at,tt.xl=I-y*et,tt.xr=I+y*at)):("pixels"===h?(tt.x=I,tt.l=$*et,tt.r=$*at):(tt.l=tt.r=0,tt.xl=I+l*et,tt.xr=I-l*at),"pixels"===_?(tt.y=1-D,tt.t=b*ot,tt.b=b*ct):(tt.t=ft*ot,tt.b=ft*ct,tt.yt=D-y*ot,tt.yb=D+y*ct));var ht=e.y<.5?"b":"t",pt=e.x<.5?"l":"r";r._fullLayout._reservedMargin[e._id]={};var bt={r:F.width-j-G,l:j+tt.r,b:F.height-H-Y,t:H+tt.b};R&&z?a.autoMargin(r,e._id,tt):R?r._fullLayout._reservedMargin[e._id][ht]=bt[ht]:z||o?r._fullLayout._reservedMargin[e._id][pt]=bt[pt]:r._fullLayout._reservedMargin[e._id][ht]=bt[ht]}],r)}(r,e,t);y&&y.then&&(t._promises||[]).push(y),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s="v"===e.orientation,u=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+c(r,o)),i=l.align((s?e._uFrac:e._vFrac)+r/u.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),a=l.align((s?e._vFrac:1-e._uFrac)-o/u.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var f=l.getCursor(i,a,e.xanchor,e.yanchor);h(t,f)},doneFn:function(){if(h(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)}),e.exit().each(function(e){a.autoMargin(t,e._id)}).remove(),e.order()}}},4630:function(t){t.exports=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}},4814:function(t,e,r){"use strict";var n=r(20454);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not an Object");return t}},4824:function(t,e,r){"use strict";var n=r(16534),i=r(15181);t.exports=function(t,e,r,a){var o=e.yaxis,s=e.xaxis,l=!!s.rangebreaks;i.makeTraceGroups(a,r,"trace ohlc").each(function(t){var e=n.select(this),r=t[0],a=r.t;if(!0!==r.trace.visible||a.empty)e.remove();else{var u=a.tickLen,c=e.selectAll("path").data(i.identity);c.enter().append("path"),c.exit().remove(),c.attr("d",function(t){if(t.empty)return"M0,0Z";var e=s.c2p(t.pos-u,!0),r=s.c2p(t.pos+u,!0),n=l?(e+r)/2:s.c2p(t.pos,!0);return"M"+e+","+o.c2p(t.o,!0)+"H"+n+"M"+n+","+o.c2p(t.h,!0)+"V"+o.c2p(t.l,!0)+"M"+r+","+o.c2p(t.c,!0)+"H"+n})}})}},4840:function(t){t.exports=function(t,e,r){var n=[],i=[];return t.forEach(function(t){var a=t.start,o=t.end;if(e.pointsSame(a,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(t);for(var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},u=s,c=0;c0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}t.exports=e,e.canvas=document.createElement("canvas"),e.cache={}},5159:function(t,e,r){"use strict";var n=r(26116);t.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},5182:function(t,e,r){"use strict";var n=r(21534);n.plot=r(43775),t.exports=n},5271:function(t,e,r){"use strict";t.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:r(16665),categories:["polar","symbols","showLegend","scatter-like"],attributes:r(73990),supplyDefaults:r(73553).supplyDefaults,colorbar:r(23814),formatLabels:r(90812),calc:r(13218),plot:r(10272),style:r(26100).style,styleOnSelect:r(26100).styleOnSelect,hoverPoints:r(4537).hoverPoints,selectPoints:r(64061),meta:{}}},5395:function(t){t.exports=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}},5651:function(t){"use strict";t.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},5675:function(t,e,r){"use strict";t.exports=r(30252)},5763:function(t){t.exports=function(t){var i=[];return t.replace(r,function(t,r,a){var o=r.toLowerCase();for(a=function(t){var e=t.match(n);return e?e.map(Number):[]}(a),"m"==o&&a.length>2&&(i.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==e[o])return a.unshift(r),i.push(a);if(a.length=0?l=p:(l=p=h,h++),l2?arguments[2]:{},a=n(e);i&&(a=o.call(a,Object.getOwnPropertySymbols(e)));for(var s=0;s0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}})}e.manageCommandObserver=function(t,r,n,o){var s={},l=!0;r&&r._commandObserver&&(s=r._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=e.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(r&&r._commandObserver){if(u)return s;if(r._commandObserver.remove)return r._commandObserver.remove(),r._commandObserver=null,s}if(u){a(t,u,s.cache),s.check=function(){if(l){var e=a(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function O(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&P(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in P(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,u,c,f,h=o.isPlainObject(n),p=[];for(var d in Array.isArray(r)||(r=[r]),r=C(r,t.data.length-1),e)for(var v=0;v-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=W(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(V(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(w.doLegend),a.layoutstyle&&s.push(w.layoutStyles),a.axrange&&H(s,i.rangesAltered),a.ticks&&s.push(w.doTicksRelayout),a.modebar&&s.push(w.doModeBar),a.camera&&s.push(w.doCamera),a.colorbars&&s.push(w.doColorBars),s.push(M)),s.push(h.rehover,h.redrag,h.reselect),u.add(t,U,[t,i.undoit],U,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then(function(){return t.emit("plotly_relayout",i.eventData),t})}function V(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=p.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==a){var c=n[p.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function H(t,e){var r=e?function(t){var r=[];for(var n in e){var i=p.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)e[a]||r.push(a)}return p.draw(t,r,{skipTitle:!0})}:function(t){return p.draw(t,"redraw")};t.push(m,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var q=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,i,a=t.layout,l=t._fullLayout,u=l._guiEditing,h=F(l._preGUI,u),d=Object.keys(e),v=p.list(t),g=o.extendDeepAll({},e),y={};for(j(e),d=Object.keys(e),n=0;n0&&"string"!=typeof I.parts[z];)z--;var B=I.parts[z],N=I.parts[z-1]+"."+B,U=I.parts.slice(0,z).join("."),V=s(t.layout,U).get(),H=s(l,U).get(),W=I.get();if(void 0!==D){M[O]=D,S[O]="reverse"===B?D:R(W);var X=f.getLayoutValObject(l,I.parts);if(X&&X.impliedEdits&&null!==D)for(var J in X.impliedEdits)E(o.relativeAttr(O,J),X.impliedEdits[J]);if(-1!==["width","height"].indexOf(O))if(D){E("autosize",null);var K="height"===O?"width":"height";E(K,l[K])}else l[O]=t._initialAutoSize[O];else if("autosize"===O)E("width",D?null:l.width),E("height",D?null:l.height);else if(N.match(q))P(N),s(l,U+"._inputRange").set(null);else if(N.match(G)){P(N),s(l,U+"._inputRange").set(null);var $=s(l,U).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else N.match(Y)&&s(l,U+"._inputDomain").set(null);if("type"===B){L=V;var Q="linear"===H.type&&"log"===D,tt="log"===H.type&&"linear"===D;if(Q||tt){if(L&&L.range)if(H.autorange)Q&&(L.range=L.range[1]>L.range[0]?[1,2]:[2,1]);else{var et=L.range[0],rt=L.range[1];Q?(et<=0&&rt<=0&&E(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),E(U+".range[0]",Math.log(et)/Math.LN10),E(U+".range[1]",Math.log(rt)/Math.LN10)):(E(U+".range[0]",Math.pow(10,et)),E(U+".range[1]",Math.pow(10,rt)))}else E(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[I.parts[0]]&&"radialaxis"===I.parts[1]&&delete l[I.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,H,D,E),c.getComponentMethod("images","convertCoords")(t,H,D,E)}else E(U+".autorange",!0),E(U+".range",null);s(l,U+"._inputRange").set(null)}else if(B.match(A)){var nt=s(l,O).get(),it=(D||{}).type;it&&"-"!==it||(it="linear"),c.getComponentMethod("annotations","convertCoords")(t,nt,it,E),c.getComponentMethod("images","convertCoords")(t,nt,it,E)}var at=b.containerArrayMatch(O);if(at){r=at.array,n=at.index;var ot=at.property,st=X||{editType:"calc"};""!==n&&""===ot&&(b.isAddVal(D)?S[O]=null:b.isRemoveVal(D)?S[O]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(k,st),y[r]||(y[r]={});var lt=y[r][n];lt||(lt=y[r][n]={}),lt[ot]=D,delete e[O]}else"reverse"===B?(V.range?V.range.reverse():(E(U+".autorange",!0),V.range=[1,0]),H.autorange?k.calc=!0:k.plot=!0):("dragmode"===O&&(!1===D&&!1!==W||!1!==D&&!1===W)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===O&&("lasso"===D||"select"===D)&&"lasso"!==W&&"select"!==W||l._has("gl2d")?k.plot=!0:X?T.update(k,X):k.calc=!0,I.set(D))}}for(r in y)b.applyContainerArrayChanges(t,h(a,r),y[r],k,h)||(k.plot=!0);for(var ut in C){var ct=(L=p.getFromId(t,ut))&&L._constraintGroup;if(ct)for(var ft in k.calc=!0,ct)C[ft]||(p.getFromId(t,ft)._constraintShrinkable=!0)}(Z(t)||e.height||e.width)&&(k.plot=!0);var ht=l.shapes;for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise(function(a,c){function f(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,_.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};e()}var p,d,v=0;function g(t){return Array.isArray(i)?v>=i.length?t.transitionOpts=i[v]:t.transitionOpts=i[0]:t.transitionOpts=i,v++,t}var y=[],m=null==e,x=Array.isArray(e);if(m||x||!o.isPlainObject(e)){if(m||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&TT)&&A.push(d);y=A}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var v=e[n].name,g=(c[v]||d[v]||{}).name,y=e[n].name,m=c[g]||d[g];g&&y&&"number"==typeof y&&m&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(c[g]||d[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[v]={name:v},p.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort(function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,c=h.modifyFrames,f=[t,s],p=[t,a];return u&&u.add(t,l,f,c,p),h.modifyFrames(t,a)},e.addTraces=function t(r,n,i){r=o.getGraphDiv(r);var a,s,l=[],c=e.deleteTraces,f=t,h=[r,l],p=[r,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=m)&&(r<=y&&(r=y),o>=m&&(o=m),l=Math.floor((o-r)/s)+1,u=0),h=0;hy&&(v.unshift(y),g.unshift(g[0])),v[v.length-1]i&&(i=c,o=u)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o4))}},8374:function(t){"use strict";var e=Object.prototype.toString,r=e.call("");t.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||e.call(t)===r)||!1}},8377:function(t,e,r){"use strict";var n=r(31164),i=r(28209),a=r(38532).rb,o=r(38532).ay,s=r(79335),l=r(8357).extendFlat,u=n.marker,c=n.line,f=u.line;t.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:c.color,width:c.width,dash:c.dash,backoff:c.backoff,shape:l({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:l({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,angle:u.angle,angleref:u.angleref,standoff:u.standoff,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:l({width:f.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a()}},8383:function(t,e,r){"use strict";var n=r(5159),i=r(79095);t.exports=function(t,e,r,a){e=e||{};var o="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(o||s)for(var l,u,c=t._fullLayout.images,f=e._id.charAt(0),h=0;h=3&&(o=r),s=t,"[object Array]"===i.call(s)?function(t,e,r){for(var n=0,i=t.length;n0?i.pi:-i.pi,u=(0,i.tn)(o-r);(0,i.tn)(u-i.pi)0?i.TW:-i.TW),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),t.point(o,n),e=0):a!==l&&u>=i.pi&&((0,i.tn)(r-a)i.Ni?(0,i.rY)(((0,i.F8)(e)*(o=(0,i.gn)(n))*(0,i.F8)(r)-(0,i.F8)(n)*(a=(0,i.gn)(e))*(0,i.F8)(t))/(a*o*s)):(e+n)/2}(r,n,o,s),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),e=0),t.point(r=o,n=s),a=l},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var a;if(null==t)a=r*i.TW,n.point(-i.pi,a),n.point(0,a),n.point(i.pi,a),n.point(i.pi,0),n.point(i.pi,-a),n.point(0,-a),n.point(-i.pi,-a),n.point(-i.pi,0),n.point(-i.pi,a);else if((0,i.tn)(t[0]-e[0])>i.Ni){var o=t[0]S[f]&&f path").each(function(t){if(!t.isBlank){var e=s[t.dir].marker;n.select(this).call(a.fill,e.color).call(a.stroke,e.line.color).call(i.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}}),u(r,s,t),r.selectAll(".lines").each(function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)})})}}},8972:function(t,e,r){"use strict";t.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==i||c!==a||l(s))&&(r=0|t,i=u||0,a=c||0,e&&e(r,i,a,o))}function c(t){u(0,t)}function f(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function h(t){l(t)&&e&&e(r,i,a,o)}function p(t){0===n.buttons(t)?u(0,t):u(r,t)}function d(t){u(r|n.buttons(t),t)}function v(t){u(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",d),t.addEventListener("mouseup",v),t.addEventListener("mouseleave",c),t.addEventListener("mouseenter",c),t.addEventListener("mouseout",c),t.addEventListener("mouseover",c),t.addEventListener("blur",f),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}g();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(e){e?g():s&&(s=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",d),t.removeEventListener("mouseup",v),t.removeEventListener("mouseleave",c),t.removeEventListener("mouseenter",c),t.removeEventListener("mouseout",c),t.removeEventListener("mouseover",c),t.removeEventListener("blur",f),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(98492)},8987:function(t,e,r){"use strict";var n=r(15181),i=r(41993),a=r(41562).handleText,o=r(72639),s=r(63457),l=r(82988),u=r(69562),c=r(11881),f=c.INCREASING.COLOR,h=c.DECREASING.COLOR;function p(t,e,r){t(e+".marker.color",r),t(e+".marker.line.color",u.defaultLine),t(e+".marker.line.width")}t.exports={supplyDefaults:function(t,e,r,i){function u(r,i){return n.coerce(t,e,l,r,i)}if(o(t,e,i,u)){s(t,e,i,u),u("xhoverformat"),u("yhoverformat"),u("measure"),u("orientation",e.x&&!e.y?"h":"v"),u("base"),u("offset"),u("width"),u("text"),u("hovertext"),u("hovertemplate");var c=u("textposition");a(t,e,i,u,c,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==e.textposition&&(u("texttemplate"),e.texttemplate||u("textinfo")),p(u,"increasing",f),p(u,"decreasing",h),p(u,"totals","#4499FF"),u("connector.visible")&&(u("connector.mode"),u("connector.line.width")&&(u("connector.line.color"),u("connector.line.dash")))}else e.visible=!1},crossTraceDefaults:function(t,e){var r,a;function o(t){return n.coerce(a._input,a,l,t)}if("group"===e.waterfallmode)for(var s=0;s0;)A=k.c2p(N[C]),C--;for(A0;)L=M.c2p(j[C]),C--;L=k._length||A<=0||E>=M._length||L<=0)return I.selectAll("image").data([]).exit().remove(),void b(I);"fast"===X?(K=Y,$=G):(K=Q,$=tt);var et=document.createElement("canvas");et.width=K,et.height=$;var rt,nt,it=et.getContext("2d"),at=p(z,{noNumericCheck:!0,returnArray:!0});"fast"===X?(rt=W?function(t){return Y-1-t}:l.identity,nt=Z?function(t){return G-1-t}:l.identity):(rt=function(t){return l.constrain(Math.round(k.c2p(N[t])-r),0,Q)},nt=function(t){return l.constrain(Math.round(M.c2p(j[t])-E),0,tt)});var ot,st,lt,ut,ct=nt(0),ft=[ct,ct],ht=W?0:1,pt=Z?0:1,dt=0,vt=0,gt=0,yt=0;function mt(t,e){if(void 0!==t){var r=at(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),dt+=e,vt+=r[0]*e,gt+=r[1]*e,yt+=r[2]*e,r}return[0,0,0,0]}function xt(t,e,r,n){var i=t[r.bin0];if(void 0===i)return mt(void 0,1);var a,o=t[r.bin1],s=e[r.bin0],l=e[r.bin1],u=o-i||0,c=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,mt(i+r.frac*u+n.frac*(c+r.frac*a))}if("default"!==X){var bt,_t=0;try{bt=new Uint8Array(K*$*4)}catch(t){bt=new Array(K*$*4)}if("smooth"===X){var wt,Tt,At,kt=U||N,Mt=V||j,St=new Array(kt.length),Et=new Array(Mt.length),Lt=new Array(Q),Ct=U?w:_,Pt=V?w:_;for(C=0;CXt||Xt>M._length))for(P=Gt;PKt||Kt>k._length)){var $t=c({x:Jt,y:Zt},z,t._fullLayout);$t.x=Jt,$t.y=Zt;var Qt=D.z[C][P];void 0===Qt?($t.z="",$t.zLabel=""):($t.z=Qt,$t.zLabel=s.tickText(Ut,Qt,"hover").text);var te=D.text&&D.text[C]&&D.text[C][P];void 0!==te&&!1!==te||(te=""),$t.text=te;var ee=l.texttemplateString(Nt,$t,t._fullLayout._d3locale,$t,z._meta||{});if(ee){var re=ee.split("
"),ne=re.length,ie=0;for(O=0;O0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===l.prototype||(e=function(t){return l.from(t)}(e)),n)s.endEmitted?w(t,new _):S(t,s,e,!0);else if(s.ended)w(t,new x);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?S(t,s,e,!1):O(t,s)):S(t,s,e,!1)}else n||(s.reading=!1,O(t,s));return!s.ended&&(s.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=E?t=E:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function C(t){var e=t._readableState;a("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(a("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(P,t))}function P(t){var e=t._readableState;a("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,F(t)}function O(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(I,t,e))}function I(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function z(t){a("readable nexttick read 0"),t.read(0)}function R(t,e){a("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),F(t),e.flowing&&!e.reading&&t.read(0)}function F(t){var e=t._readableState;for(a("flow",e.flowing);e.flowing&&null!==t.read(););}function B(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function N(t){var e=t._readableState;a("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(j,e,t))}function j(t,e){if(a("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function U(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return a("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?N(this):C(this),null;if(0===(t=L(t,e))&&e.ended)return 0===e.length&&N(this),null;var n,i=e.needReadable;return a("need readable",i),(0===e.length||e.length-t0?B(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&N(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(t){w(this,new b("_read()"))},k.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,e);var s=e&&!1===e.end||t===i.stdout||t===i.stderr?v:l;function l(){a("onend"),t.end()}n.endEmitted?i.nextTick(s):r.once("end",s),t.on("unpipe",function e(i,o){a("onunpipe"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,a("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",l),r.removeListener("end",v),r.removeListener("data",f),c=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||u())});var u=function(t){return function(){var e=t._readableState;a("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,F(t))}}(r);t.on("drain",u);var c=!1;function f(e){a("ondata");var i=t.write(e);a("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==U(n.pipes,t))&&!c&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){a("onerror",e),v(),t.removeListener("error",h),0===o(t,"error")&&w(t,e)}function p(){t.removeListener("finish",d),v()}function d(){a("onfinish"),t.removeListener("close",p),v()}function v(){a("unpipe"),r.unpipe(t)}return r.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",h),t.once("close",p),t.once("finish",d),t.emit("pipe",r),n.flowing||(a("pipe resume"),r.resume()),t},k.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,a("on readable",n.length,n.reading),n.length?C(this):n.reading||i.nextTick(z,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(D,this),r},k.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(D,this),e},k.prototype.resume=function(){var t=this._readableState;return t.flowing||(a("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(R,t,e))}(this,t)),t.paused=!1,this},k.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o=n&&t<=i?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=_(r),y=t.charAt(0);!u||"G"!==y&&"g"!==y||(t=t.substr(1),r="");var w=u&&"chinese"===r.substr(0,7),T=t.match(w?x:m);if(!T)return c;var A=T[1],k=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),L=Number(T[11]||0);if(u){if(2===A.length)return c;var C;A=Number(A);try{var P=g.getComponentMethod("calendars","getCal")(r);if(w){var O="i"===k.charAt(k.length-1);k=parseInt(k,10),C=P.newDate(A,P.toMonthIndex(A,k,O),M)}else C=P.newDate(A,Number(k),M)}catch(t){return c}return C?(C.toJD()-v)*f+S*h+E*p+L*d:c}A=2===A.length?(Number(A)+2e3-b)%100+b:Number(A),k-=1;var I=new Date(Date.UTC(2e3,k,M,S,E));return I.setUTCFullYear(A),I.getUTCMonth()!==k||I.getUTCDate()!==M?c:I.getTime()+L*d},n=e.MIN_MS=e.dateTime2ms("-9999"),i=e.MAX_MS=e.dateTime2ms("9999-12-31 23:59:59.9999"),e.isDateTime=function(t,r){return e.dateTime2ms(t,r)!==c};var T=90*f,A=3*h,k=5*p;function M(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}e.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return c;e||(e=0);var a,o,s,u,m,x,b=Math.floor(10*l(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var S=Math.floor(w/f)+v,E=Math.floor(l(t,f));try{a=g.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=y("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(a("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},e.cleanDate=function(t,r,n){if(t===c)return r;if(e.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),r;if(!(t=e.ms2DateTimeLocal(+t))&&void 0!==r)return r}else if(!e.isDateTime(t,n))return s.error("unrecognized date",t),r;return t};var S=/%\d?f/g,E=/%h/g,L={1:"1",2:"1",3:"2",4:"2"};function C(t,e,r,n){t=t.replace(S,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var i=new Date(Math.floor(e+.05));if(t=t.replace(E,function(){return L[r("%q")(i)]}),_(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var P=[59,59.9,59.99,59.999,59.9999];e.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),P[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+C(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return C(e,t,n,i)};var O=3*f;e.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+v,a=g.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-v)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+O);return u.setUTCMonth(u.getUTCMonth()+e)+n-O},e.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,u=_(e)&&g.getComponentMethod("calendars","getCal")(e),c=0;c0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(a.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day(),"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=t.exports=new i;u.cdate=a,u.baseCalendar=s,u.calendars.gregorian=l},10017:function(t,e,r){"use strict";var n,i=r(78030),a=r(22138)(),o=r(16423),s=r(94693);if(a){var l=i("RegExp.prototype.exec"),u={},c=function(){throw u},f={toString:c,valueOf:c};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=c),n=function(t){if(!t||"object"!=typeof t)return!1;var e=s(t,"lastIndex");if(!e||!o(e,"value"))return!1;try{l(t,f)}catch(t){return t===u}}}else{var h=i("Object.prototype.toString");n=function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===h(t)}}t.exports=n},10088:function(t,e,r){"use strict";var n=r(15181);function i(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}e.formatPiePercent=function(t,e){var r=i((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},e.formatPieValue=function(t,e){var r=i(t.toPrecision(10));return n.numSeparate(r,e)},e.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r1)for(r=0;r-1&&g(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&u.click(n,e.originalEvent)}}},b.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[u([r.xmin,r.ymin]),u([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(u)};var s=e.dragOptions;e.dragOptions=i.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||f(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){p(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function u(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},b.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},b.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),h),x={},b={},_=0;d?(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},y=function(t,e){var r=x[t.astr][e];t.get()[e]=r}):(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set([])},y=function(t,e){var r=x[t.astr][e];t.get().push(r)}),A(g);for(var w=o(e.transforms,r),T=0;Tt.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),g&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}b.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},b.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},b.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=c(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var h={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(h):e.elements=o.elements(h)}var p=y.float32(t);return i({data:p,usage:"dynamic"}),a({data:y.fract32(t,p),usage:"dynamic"}),s({data:new Uint8Array(u),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach(function(t){return t&&t.destroy&&t.destroy()}),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},b.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},12017:function(t,e,r){"use strict";var n=r(28418);t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:r(31164),layoutAttributes:r(52919),supplyDefaults:r(66571),crossTraceDefaults:r(18352),supplyLayoutDefaults:r(80784),calc:r(2524).calc,crossTraceCalc:r(8663),arraysToCalcdata:r(66335),plot:r(79758),colorbar:r(23814),formatLabels:r(3658),style:r(26100).style,styleOnSelect:r(26100).styleOnSelect,hoverPoints:r(619),selectPoints:r(64061),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:r(29435),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},12053:function(t,e,r){"use strict";r.d(e,{By:function(){return s},KP:function(){return d},Q$:function(){return y},Sh:function(){return f},dt:function(){return c},eQ:function(){return l},fz:function(){return o},gf:function(){return g},kS:function(){return h},l3:function(){return u},se:function(){return p},t$:function(){return x},tz:function(){return m},yW:function(){return v}});var n=r(15824),i=r(21365);function a(t){return(0,n.A)(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*i.rR)/i.Fq})}var o=a(0),s=a(1),l=a(2),u=a(3),c=a(4),f=a(5),h=a(6),p=o.range,d=s.range,v=l.range,g=u.range,y=c.range,m=f.range,x=h.range},12116:function(t,e,r){"use strict";r.d(e,{A:function(){return l}});var n=r(73125),i=r(29752),a=r(18901),o=r(39913),s=r(69030);function l(t){var e=(0,a.gn)(t),r=6*a.F2,l=e>0,u=(0,a.tn)(e)>a.Ni;function c(t,r){return(0,a.gn)(t)*(0,a.gn)(r)>e}function f(t,r,i){var o=(0,n.jf)(t),s=(0,n.jf)(r),l=[1,0,0],u=(0,n.r8)(o,s),c=(0,n.W8)(u,u),f=u[0],h=c-f*f;if(!h)return!i&&t;var p=e*c/h,d=-e*f/h,v=(0,n.r8)(l,u),g=(0,n.ly)(l,p),y=(0,n.ly)(u,d);(0,n.ep)(g,y);var m=v,x=(0,n.W8)(g,m),b=(0,n.W8)(m,m),_=x*x-b*((0,n.W8)(g,g)-1);if(!(_<0)){var w=(0,a.RZ)(_),T=(0,n.ly)(m,(-x-w)/b);if((0,n.ep)(T,g),T=(0,n.EV)(T),!i)return T;var A,k=t[0],M=r[0],S=t[1],E=r[1];M0^T[1]<((0,a.tn)(T[0]-k)a.pi^(k<=T[0]&&T[0]<=M)){var P=(0,n.ly)(m,(-x+w)/b);return(0,n.ep)(P,g),[T,(0,n.EV)(P)]}}}function h(e,r){var n=l?t:a.pi-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}return(0,s.A)(c,function(t){var e,r,n,i,s;return{lineStart:function(){i=n=!1,s=1},point:function(p,d){var v,g=[p,d],y=c(p,d),m=l?y?0:h(p,d):y?h(p+(p<0?a.pi:-a.pi),d):0;if(!e&&(i=n=y)&&t.lineStart(),y!==n&&(!(v=f(e,g))||(0,o.A)(e,v)||(0,o.A)(g,v))&&(g[2]=1),y!==n)s=0,y?(t.lineStart(),v=f(g,e),t.point(v[0],v[1])):(v=f(e,g),t.point(v[0],v[1],2),t.lineEnd()),e=v;else if(u&&e&&l^y){var x;m&r||!(x=f(g,e,!0))||(s=0,l?(t.lineStart(),t.point(x[0][0],x[0][1]),t.point(x[1][0],x[1][1]),t.lineEnd()):(t.point(x[1][0],x[1][1]),t.lineEnd(),t.lineStart(),t.point(x[0][0],x[0][1],3)))}!y||e&&(0,o.A)(e,g)||t.point(g[0],g[1]),e=g,n=y,r=m},lineEnd:function(){n&&t.lineEnd(),e=null},clean:function(){return s|(i&&n)<<1}}},function(e,n,a,o){(0,i.J)(o,t,r,a,e,n)},l?[0,-t]:[-a.pi,t-a.pi])}},12203:function(t,e,r){"use strict";var n=r(5159),i=r(15181),a=r(78945),o=a.ONEDAY,s=a.ONEWEEK;e.dtick=function(t,e){var r="log"===e,i="date"===e,a="category"===e,s=i?o:1;if(!t)return s;if(n(t))return(t=Number(t))<=0?s:a?Math.max(1,Math.round(t)):i?Math.max(.1,t):t;if("string"!=typeof t||!i&&!r)return s;var l=t.charAt(0),u=t.substr(1);return(u=n(u)?Number(u):0)<=0||!(i&&"M"===l&&u===Math.round(u)||r&&"L"===l||r&&"D"===l&&(1===u||2===u))?s:t},e.tick0=function(t,e,r,a){return"date"===e?i.cleanDate(t,i.dateTick0(r,a%s===0?1:0)):"D1"!==a&&"D2"!==a?n(t)?Number(t):0:void 0}},12240:function(t,e,r){"use strict";var n=r(36557).drawRaw,i=r(77494),a=["x","y","z"];t.exports=function(t){for(var e=t.fullSceneLayout,r=t.dataScale,o=e.annotations,s=0;s1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},12261:function(t,e,r){"use strict";var n=r(31164),i=r(79335),a=r(99012).axisHoverFormat,o=r(38532).rb,s=r(73317),l=r(29278).idRegex,u=r(92444).templatedArray,c=r(8357).extendFlat,f=n.marker,h=f.line,p=c(i("marker.line",{editTypeOverride:"calc"}),{width:c({},h.width,{editType:"calc"}),editType:"calc"}),d=c(i("marker"),{symbol:f.symbol,angle:f.angle,size:c({},f.size,{editType:"markerSize"}),sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode,opacity:f.opacity,colorbar:f.colorbar,line:p,editType:"calc"});function v(t){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:l[t],editType:"plot"}}}d.color.editType=d.cmin.editType=d.cmax.editType="style",t.exports={dimensions:u("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:c({},s.text,{}),hovertext:c({},s.hovertext,{}),hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),marker:d,xaxes:v("x"),yaxes:v("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:s.selected.marker,editType:"calc"},unselected:{marker:s.unselected.marker,editType:"calc"},opacity:s.opacity}},12358:function(t,e,r){"use strict";var n=r(93335),i={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:r(58328),toSVG:r(65479),svgToImg:r(69982),toImage:r(59884),downloadImage:r(68552)};t.exports=i},12367:function(t){"use strict";function e(t,e){return e?e.d2l(t):t}function r(t,e){return e?e.l2d(t):t}function n(t,r){return e(t.x1,r)-e(t.x0,r)}function i(t,r,n){return e(t.y1,n)-e(t.y0,n)}t.exports={x0:function(t){return t.x0},x1:function(t){return t.x1},y0:function(t){return t.y0},y1:function(t){return t.y1},slope:function(t,e,r){return"line"!==t.type?void 0:i(t,0,r)/n(t,e)},dx:n,dy:i,width:function(t,e){return Math.abs(n(t,e))},height:function(t,e,r){return Math.abs(i(t,0,r))},length:function(t,e,r){return"line"!==t.type?void 0:Math.sqrt(Math.pow(n(t,e),2)+Math.pow(i(t,0,r),2))},xcenter:function(t,n){return r((e(t.x1,n)+e(t.x0,n))/2,n)},ycenter:function(t,n,i){return r((e(t.y1,i)+e(t.y0,i))/2,i)}}},12409:function(t,e,r){"use strict";var n=r(31164),i=r(79335),a=r(99012).axisHoverFormat,o=r(38532).rb,s=r(38532).ay,l=r(28209),u=r(31790),c=r(5935),f=r(8357).extendFlat,h=r(7458).overrideAll,p=r(72198),d=n.line,v=n.marker,g=v.line,y=f({width:d.width,dash:{valType:"enumerated",values:p(u),dflt:"solid"}},i("line")),m=t.exports=h({x:n.x,y:n.y,z:{valType:"data_array"},text:f({},n.text,{}),texttemplate:s({},{}),hovertext:f({},n.hovertext,{}),hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),mode:f({},n.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},y:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},z:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}},connectgaps:n.connectgaps,line:y,marker:f({symbol:{valType:"enumerated",values:p(c),dflt:"circle",arrayOk:!0},size:f({},v.size,{dflt:8}),sizeref:v.sizeref,sizemin:v.sizemin,sizemode:v.sizemode,opacity:f({},v.opacity,{arrayOk:!1}),colorbar:v.colorbar,line:f({width:f({},g.width,{arrayOk:!1})},i("marker.line"))},i("marker")),textposition:f({},n.textposition,{dflt:"top center"}),textfont:{color:n.textfont.color,size:n.textfont.size,family:f({},n.textfont.family,{arrayOk:!1})},opacity:l.opacity,hoverinfo:f({},l.hoverinfo)},"calc","nested");m.x.editType=m.y.editType=m.z.editType="calc+clearAxisTypes"},12819:function(t){"use strict";t.exports=function(t,e,r){!1===r("zsmooth")&&(r("xgap"),r("ygap")),r("zhoverformat")}},13115:function(t,e,r){"use strict";var n=r(15181).isTypedArray;e.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},e.isOrdinal=function(t){return!!t.tickvals},e.isVisible=function(t){return t.visible||!("visible"in t)}},13218:function(t,e,r){"use strict";var n=r(5159),i=r(78945).BADNUM,a=r(26446),o=r(80924),s=r(66335),l=r(64433),u=r(2524).calcMarkerSize;t.exports=function(t,e){for(var r=t._fullLayout,c=e.subplot,f=r[c].radialaxis,h=r[c].angularaxis,p=f.makeCalcdata(e,"r"),d=h.makeCalcdata(e,"theta"),v=e._length,g=new Array(v),y=0;y-1?-1:t.indexOf("right")>-1?1:0}function b(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return p[t]}function T(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var E=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},13621:function(t,e,r){"use strict";t.exports=r(34758)},13625:function(t){"use strict";t.exports=function(t,e,n){var i,a,o={};if("string"==typeof e&&(e=r(e)),Array.isArray(e)){var s={};for(a=0;a-1?C+I:-(O+I):0,z={x0:P,x1:P,y0:D,y1:D+O},R=function(t,e,r){var n=y.tiling.pad,i=function(t){return t-n<=e.x0},a=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:i(t.x0-n)?0:a(t.x0-n)?r[0]:t.x0,x1:i(t.x1+n)?0:a(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,B={},N={},j=null,U=function(t,e){return e?B[h(t)]:N[h(t)]};g.hasMultipleRoots&&A&&M++,y._maxDepth=M,y._backgroundColor=v.paper_bgcolor,y._entryDepth=b.data.depth,y._atRootLevel=A;var V=-L/2+S.l+S.w*(E.x[1]+E.x[0])/2,H=-C/2+S.t+S.h*(1-(E.y[1]+E.y[0])/2),q=function(t){return V+t},G=function(t){return H+t},Y=G(0),W=q(0),Z=function(t){return W+t},X=function(t){return Y+t};function J(t,e){return t+","+e}var K=Z(0),$=function(t){t.x=Math.max(K,t.x)},Q=y.pathbar.edgeshape,tt=y[m?"tiling":"marker"].pad,et=function(t){return-1!==y.textposition.indexOf(t)},rt=et("top"),nt=et("left"),it=et("right"),at=et("bottom"),ot=function(t,e){var r=t.x0,n=t.x1,i=t.y0,a=t.y1,o=t.textBB,c=rt||e.isHeader&&!at?"start":at?"end":"middle",f=et("right"),h=et("left")||e.onPathbar?-1:f?1:0;if(e.isHeader){if((r+=(m?tt:tt.l)-s)>=(n-=(m?tt:tt.r)-s)){var p=(r+n)/2;r=p,n=p}var d;at?i<(d=a-(m?tt:tt.b))&&d"===Q?(l.x-=a,u.x-=a,c.x-=a,f.x-=a):"/"===Q?(c.x-=a,f.x-=a,o.x-=a/2,s.x-=a/2):"\\"===Q?(l.x-=a,u.x-=a,o.x-=a/2,s.x-=a/2):"<"===Q&&(o.x-=a,s.x-=a),$(l),$(f),$(o),$(u),$(c),$(s),"M"+J(l.x,l.y)+"L"+J(u.x,u.y)+"L"+J(s.x,s.y)+"L"+J(c.x,c.y)+"L"+J(f.x,f.y)+"L"+J(o.x,o.y)+"Z"},toMoveInsideSlice:ot,makeUpdateSliceInterpolator:lt,makeUpdateTextInterpolator:ut,handleSlicesExit:ct,hasTransition:k,strTransform:ft}):w.remove()}},14083:function(t,e,r){"use strict";var n=r(5159),i=r(15181),a=r(44236),o=r(88191),s=r(93024).makeBlank,l=r(90438);function u(t){var e,r=t[0].trace,n=r._opts;if(r.selectedpoints){for(var a=o.makeSelectedPointStyleFns(r),s=0;s1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;ih.range[1]&&(x+=Math.PI),n.getClosest(u,function(t){return v(m,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/y)-1+(t.rp1-m)/(t.rp1-t.rp0)-1:1/0},t),!1!==t.index){var b=u[t.index];t.x0=t.x1=b.ct[0],t.y0=t.y1=b.ct[1];var _=i.extendFlat({},b,{r:b.s,theta:b.p});return o(b,c,t),s(_,c,f,t),t.hovertemplate=c.hovertemplate,t.color=a(c,b),t.xLabelVal=t.yLabelVal=void 0,b.s<0&&(t.idealAlign="left"),[t]}}},14511:function(t,e,r){"use strict";var n=r(26446);t.exports=function(t,e,r){var i={},a=r[e.subplot]._subplot;return i.realLabel=n.tickText(a.radialAxis,t.real,!0).text,i.imagLabel=n.tickText(a.angularAxis,t.imag,!0).text,i}},14617:function(t,e,r){"use strict";var n=r(72198),i="1.10.1",a='©
OpenStreetMap contributors',o=['© Carto',a].join(" "),s=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),l={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:a,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:o,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:o,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:s,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:s,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},u=n(l);t.exports={requiredVersion:i,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:l,styleValuesNonMapbox:u,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@"+i+"."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",u.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},14665:function(t,e,r){"use strict";var n=r(46982);t.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;so&&(s=o);var l=(0,n.jk)(r,function(t){return(a-e-(t.length-1)*s)/(0,n.cz)(t,d)});r.forEach(function(t){t.forEach(function(t,e){t.y1=(t.y0=e)+t.value*l})}),t.links.forEach(function(t){t.width=t.value*l})})(),f();for(var o=1,l=k;l>0;--l)c(o*=.99),f(),u(o),f();function u(t){r.forEach(function(e){e.forEach(function(e){if(e.targetLinks.length){var r=((0,n.cz)(e.targetLinks,g)/(0,n.cz)(e.targetLinks,d)-v(e))*t;e.y0+=r,e.y1+=r}})})}function c(t){r.slice().reverse().forEach(function(e){e.forEach(function(e){if(e.sourceLinks.length){var r=((0,n.cz)(e.sourceLinks,y)/(0,n.cz)(e.sourceLinks,d)-v(e))*t;e.y0+=r,e.y1+=r}})})}function f(){r.forEach(function(t){var r,n,i,o=e,l=t.length;for(t.sort(p),i=0;i0&&(r.y0+=n,r.y1+=n),o=r.y1+s;if((n=o-s-a)>0)for(o=r.y0-=n,r.y1-=n,i=l-2;i>=0;--i)(n=(r=t[i]).y1+s-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0})}}(l),E(l),l}function E(t){t.nodes.forEach(function(t){t.sourceLinks.sort(h),t.targetLinks.sort(f)}),t.nodes.forEach(function(t){var e=t.y0,r=e;t.sourceLinks.forEach(function(t){t.y0=e+t.width/2,e+=t.width}),t.targetLinks.forEach(function(t){t.y1=r+t.width/2,r+=t.width})})}return S.update=function(t){return E(t),t},S.nodeId=function(t){return arguments.length?(u="function"==typeof t?t:c(t),S):u},S.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:c(t),S):w},S.nodeWidth=function(t){return arguments.length?(o=+t,S):o},S.nodePadding=function(t){return arguments.length?(s=+t,S):s},S.nodes=function(t){return arguments.length?(T="function"==typeof t?t:c(t),S):T},S.links=function(t){return arguments.length?(A="function"==typeof t?t:c(t),S):A},S.size=function(n){return arguments.length?(t=e=0,r=+n[0],a=+n[1],S):[r-t,a-e]},S.extent=function(n){return arguments.length?(t=+n[0][0],r=+n[1][0],e=+n[0][1],a=+n[1][1],S):[[t,e],[r,a]]},S.iterations=function(t){return arguments.length?(k=+t,S):k},S}var T=r(63919);function A(t){return[t.source.x1,t.y0]}function k(t){return[t.target.x0,t.y1]}function M(){return(0,T.pq)().source(A).target(k)}},14736:function(t,e,r){"use strict";var n=r(15181),i=r(69562).contrast,a=r(94257),o=r(33643),s=r(46716);function l(t,e){function r(r,i){return n.coerce(t,e,a.tickformatstops,r,i)}r("enabled")&&(r("dtickrange"),r("value"))}t.exports=function(t,e,r,u,c){c||(c={});var f=r("labelalias");n.isPlainObject(f)||delete e.labelalias;var h=o(t);if(r("showticklabels")){var p=c.font||{},d=e.color,v=-1!==(e.ticklabelposition||"").indexOf("inside")?i(c.bgColor):d&&d!==a.color.dflt?d:p.color;if(n.coerceFont(r,"tickfont",{family:p.family,size:p.size,color:v}),c.noTicklabelstep||"multicategory"===u||"log"===u||r("ticklabelstep"),c.noAng||r("tickangle"),"category"!==u){var g=r("tickformat");s(t,e,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:l}),e.tickformatstops.length||delete e.tickformatstops,c.noExp||g||"date"===u||(r("showexponent",h),r("exponentformat"),r("minexponent"),r("separatethousands"))}}}},14751:function(t,e,r){"use strict";var n=r(41199),i=r(15181),a=r(51257).wrap,o=i.isArrayOrTypedArray,s=i.isIndex,l=r(44236);t.exports=function(t,e){var r=function(t){var e,r=t.node,a=t.link,u=[],c=o(a.color),f=o(a.customdata),h={},p={},d=a.colorscales.length;for(e=0;em&&(m=a.source[e]),a.target[e]>m&&(m=a.target[e]);var x,b=m+1;t.node._count=b;var _=t.node.groups,w={};for(e=0;e<_.length;e++){var T=_[e];for(x=0;x0&&s(E,b)&&s(L,b)&&(!w.hasOwnProperty(E)||!w.hasOwnProperty(L)||w[E]!==w[L])){w.hasOwnProperty(L)&&(L=w[L]),w.hasOwnProperty(E)&&(E=w[E]),L=+L,h[E=+E]=h[L]=!0;var C="";a.label&&a.label[e]&&(C=a.label[e]);var P=null;C&&p.hasOwnProperty(C)&&(P=p[C]),u.push({pointNumber:e,label:C,color:c?a.color[e]:a.color,customdata:f?a.customdata[e]:a.customdata,concentrationscale:P,source:E,target:L,value:+S}),M.source.push(E),M.target.push(L)}}var O=b+_.length,I=o(r.color),D=o(r.customdata),z=[];for(e=0;eb-1,childrenNodes:[],pointNumber:e,label:R,color:I?r.color[e]:r.color,customdata:D?r.customdata[e]:r.customdata})}var F=!1;return function(t,e,r){for(var a=i.init2dArray(t,0),o=0;o1})}(O,M.source,M.target)&&(F=!0),{circular:F,links:u,nodes:z,groups:_,groupLookup:w}}(e);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},14827:function(t,e,r){"use strict";var n=r(5159),i=r(46982),a=r(15181),o=r(92444),s=r(68572);t.exports=function(t,e,r,l){var u="error_"+l.axis,c=o.newContainer(e,u),f=t[u]||{};function h(t,e){return a.coerce(f,c,s,t,e)}if(!1!==h("visible",void 0!==f.array||void 0!==f.value||"sqrt"===f.type)){var p=h("type","array"in f?"data":"percent"),d=!0;"sqrt"!==p&&(d=h("symmetric",!(("data"===p?"arrayminus":"valueminus")in f))),"data"===p?(h("array"),h("traceref"),d||(h("arrayminus"),h("tracerefminus"))):"percent"!==p&&"constant"!==p||(h("value"),d||h("valueminus"));var v="copy_"+l.inherit+"style";l.inherit&&(e["error_"+l.inherit]||{}).visible&&h(v,!(f.color||n(f.thickness)||n(f.width))),l.inherit&&c[v]||(h("color",r),h("thickness"),h("width",i.traceIs(e,"gl3d")?0:4))}}},14994:function(t,e,r){"use strict";var n=r(31751);t.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},15095:function(t,e,r){"use strict";var n=r(26446),i=r(8357).extendFlat;t.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;r=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(i())},15181:function(t,e,r){"use strict";var n=r(16534),i=r(99146).aL,a=r(54718).GP,o=r(5159),s=r(78945),l=s.FP_SAFE,u=-l,c=s.BADNUM,f=t.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=a(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=r(23716),f.keyedContainer=r(75563),f.relativeAttr=r(42699),f.isPlainObject=r(10194),f.toLogRange=r(79095),f.relinkPrivateKeys=r(43288);var p=r(80740);f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var d=r(82797);f.mod=d.mod,f.modHalf=d.modHalf;var v=r(33064);f.valObjectMeta=v.valObjectMeta,f.coerce=v.coerce,f.coerce2=v.coerce2,f.coerceFont=v.coerceFont,f.coercePattern=v.coercePattern,f.coerceHoverinfo=v.coerceHoverinfo,f.coerceSelectionMarkerOpacity=v.coerceSelectionMarkerOpacity,f.validate=v.validate;var g=r(9752);f.dateTime2ms=g.dateTime2ms,f.isDateTime=g.isDateTime,f.ms2DateTime=g.ms2DateTime,f.ms2DateTimeLocal=g.ms2DateTimeLocal,f.cleanDate=g.cleanDate,f.isJSDate=g.isJSDate,f.formatDate=g.formatDate,f.incrementMonth=g.incrementMonth,f.dateTick0=g.dateTick0,f.dfltRange=g.dfltRange,f.findExactDates=g.findExactDates,f.MIN_MS=g.MIN_MS,f.MAX_MS=g.MAX_MS;var y=r(46329);f.findBin=y.findBin,f.sorterAsc=y.sorterAsc,f.sorterDes=y.sorterDes,f.distinctVals=y.distinctVals,f.roundUp=y.roundUp,f.sort=y.sort,f.findIndexOfMin=y.findIndexOfMin,f.sortObjectKeys=r(72198);var m=r(94153);f.aggNums=m.aggNums,f.len=m.len,f.mean=m.mean,f.median=m.median,f.midRange=m.midRange,f.variance=m.variance,f.stdev=m.stdev,f.interp=m.interp;var x=r(33240);f.init2dArray=x.init2dArray,f.transposeRagged=x.transposeRagged,f.dot=x.dot,f.translationMatrix=x.translationMatrix,f.rotationMatrix=x.rotationMatrix,f.rotationXYMatrix=x.rotationXYMatrix,f.apply3DTransform=x.apply3DTransform,f.apply2DTransform=x.apply2DTransform,f.apply2DTransform2=x.apply2DTransform2,f.convertCssMatrix=x.convertCssMatrix,f.inverseTransformMatrix=x.inverseTransformMatrix;var b=r(37629);f.deg2rad=b.deg2rad,f.rad2deg=b.rad2deg,f.angleDelta=b.angleDelta,f.angleDist=b.angleDist,f.isFullCircle=b.isFullCircle,f.isAngleInsideSector=b.isAngleInsideSector,f.isPtInsideSector=b.isPtInsideSector,f.pathArc=b.pathArc,f.pathSector=b.pathSector,f.pathAnnulus=b.pathAnnulus;var _=r(51958);f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=r(17875);f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var T=r(8357);f.extendFlat=T.extendFlat,f.extendDeep=T.extendDeep,f.extendDeepAll=T.extendDeepAll,f.extendDeepNoArrays=T.extendDeepNoArrays;var A=r(13616);f.log=A.log,f.warn=A.warn,f.error=A.error;var k=r(90778);f.counterRegex=k.counter;var M=r(57341);f.throttle=M.throttle,f.throttleDone=M.done,f.clearThrottle=M.clear;var S=r(72565);function E(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&o(t)&&t>=0&&t%1==0},f.noop=r(32021),f.identity=r(94963),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},f.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},f.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},f.syncOrAsync=function(t,e,r){var n;function i(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0})},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var z=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,function(t,n){var i;return z.test(n)?i=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,i=r[n]()),f.isValidTextValue(i)?i:""})};var R={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return U.apply(R,arguments)};var F={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return U.apply(F,arguments)};var B=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,N={max:10,count:0,name:"texttemplate",parseMultDiv:!0};f.texttemplateStringForShapes=function(){return U.apply(N,arguments)};var j=/^[:|\|]/;function U(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,function(t,s,l){var u="_xother"===s||"_yother"===s,c="_xother_"===s||"_yother_"===s,h="xother_"===s||"yother_"===s,p="xother"===s||"yother"===s||u||h||c,d=s;(u||c)&&(d=d.substring(1)),(h||c)&&(d=d.substring(0,d.length-1));var v,g,y,m=null,x=null;if(n.parseMultDiv){var b=function(t){var e=t.match(B);return e?{key:e[1],op:e[2],number:Number(e[3])}:{key:t,op:null,number:null}}(d);d=b.key,m=b.op,x=b.number}if(p){if(void 0===(v=e[d]))return""}else for(y=3;y=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var V=2e9;f.seedPseudoRandom=function(){V=2e9},f.pseudoRandom=function(){var t=V;return V=(69069*V+1)%4294967296,Math.abs(V-t)<429496729?f.pseudoRandom():V/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(i))return n(i);var a=f.extractOption(t,e,"tx","text");return f.isValidTextValue(a)?n(a):void 0},f.isValidTextValue=function(t){return t||0===t},f.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,f.strTranslate(i-u*(r+o),a-u*(n+s))+f.strScale(u)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(t,e){t.attr("transform",f.getTextTransform(e)),t.style("display",e.scale?null:"none")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},f.bigFont=function(t){return Math.round(1.2*t)};var H=f.getFirefoxVersion(),q=null!==H&&H<86;f.getPositionFromD3Event=function(){return q?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},15236:function(t,e,r){"use strict";var n=r(7809),i=[32,126];t.exports=function(t){var e=(t=t||{}).shape?t.shape:t.canvas?[t.canvas.width,t.canvas.height]:[512,512],r=t.canvas||document.createElement("canvas"),a=t.font,o="number"==typeof t.step?[t.step,t.step]:t.step||[32,32],s=t.chars||i;if(a&&"string"!=typeof a&&(a=n(a)),Array.isArray(s)){if(2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1]){for(var l=[],u=s[0],c=0;u<=s[1];u++)l[c++]=String.fromCharCode(u);s=l}}else s=String(s).split("");e=e.slice(),r.width=e[0],r.height=e[1];var f=r.getContext("2d");f.fillStyle="#000",f.fillRect(0,0,r.width,r.height),f.font=a,f.textAlign="center",f.textBaseline="middle",f.fillStyle="#fff";var h=o[0]/2,p=o[1]/2;for(u=0;ue[0]-o[0]/2&&(h=o[0]/2,p+=o[1]);return r}},15291:function(t,e,r){"use strict";var n=r(5159),i=r(84538),a=r(46982),o=r(15181),s=r(37070),l=r(93003),u=r(69562),c=l.cleanId,f=l.getFromTrace,h=a.traceIs;function p(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=c(r,n,!0))}function d(t){function e(e,r){var n=t[e],i=t.title&&t.title[r];n&&!i&&(t.title||(t.title={}),t.title[r]=t[e],delete t[e])}t&&("string"!=typeof t.title&&"number"!=typeof t.title||(t.title={text:t.title}),e("titlefont","font"),e("titleposition","position"),e("titleside","side"),e("titleoffset","offset"))}function v(t){if(!o.isPlainObject(t))return!1;var e=t.name;return delete t.name,delete t.showlegend,("string"==typeof e||"number"==typeof e)&&String(e)}function g(t,e,r,n){if(r&&!n)return t;if(n&&!r)return e;if(!t.trim())return e;if(!e.trim())return t;var i,a=Math.min(t.length,e.length);for(i=0;i0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},e.cleanLayout=function(t){var r,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,v=Object.keys(t);for(r=0;r3?(I.x=1.02,I.xanchor="left"):I.x<-2&&(I.x=-.02,I.xanchor="right"),I.y>3?(I.y=1.02,I.yanchor="bottom"):I.y<-2&&(I.y=-.02,I.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&e.cleanLayout(t.template.layout),t},e.cleanData=function(t){for(var r=0;r0)return t.substr(0,e)}e.hasParent=function(t,e){for(var r=b(e);r;){if(r in t)return!0;r=b(r)}return!1};var _=["x","y","z"];e.clearAxisTypes=function(t,e,r){for(var n=0;n("legend"===t?1:0));if(!1===M&&(r[t]=void 0),(!1!==M||f.uirevision)&&(p("uirevision",r.uirevision),!1!==M)){p("borderwidth");var S,E,L,C="h"===p("orientation"),P="paper"===p("yref"),O="paper"===p("xref"),I="left";if(C?(S=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?P?(E=1.1,L="bottom"):(E=1,L="top"):P?(E=-.1,L="top"):(E=0,L="bottom")):(E=1,L="auto",O?S=1.02:(S=1,I="right")),i.coerce(f,h,{x:{valType:"number",editType:"legend",min:O?-2:0,max:O?3:1,dflt:S}},"x"),i.coerce(f,h,{y:{valType:"number",editType:"legend",min:P?-2:0,max:P?3:1,dflt:E}},"y"),p("traceorder",_),u.isGrouped(r[t])&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("xanchor",I),p("yanchor",L),p("valign"),i.noneOrAll(f,h,["x","y"]),p("title.text")){p("title.side",C?"left":"top");var D=i.extendFlat({},d,{size:i.bigFont(d.size)});i.coerceFont(p,"title.font",D)}}}}t.exports=function(t,e,r){var n,a=r.slice(),o=e.shapes;if(o)for(n=0;n0))return o;do{o.push(a=new Date(+r)),e(r,i),t(r)}while(a=e)for(;t(e),!r(e);)e.setTime(e-1)},function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););})},r&&(s.count=function(e,a){return n.setTime(+e),i.setTime(+a),t(n),t(i),Math.floor(r(n,i))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t===0}:function(e){return s.count(0,e)%t===0}):s:null}),s}},16009:function(t,e,r){"use strict";t.exports={attributes:r(44708),layoutAttributes:r(13800),supplyDefaults:r(23571),crossTraceDefaults:r(61608),supplyLayoutDefaults:r(2463),calc:r(92356).calc,crossTraceCalc:r(27050).crossTraceCalc,plot:r(3095).plot,layerName:"barlayer",style:r(18095).style,styleOnSelect:r(18095).styleOnSelect,colorbar:r(23814),hoverPoints:r(54707),selectPoints:r(40668),eventData:r(99256),moduleType:"trace",name:"histogram",basePlotModule:r(29435),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}},16010:function(t,e,r){var n=r(47718),i=r(81611),a={M:"moveTo",C:"bezierCurveTo"};t.exports=function(t,e){t.beginPath(),i(n(e)).forEach(function(e){var r=e[0],n=e.slice(1);t[a[r]].apply(t,n)}),t.closePath()}},16040:function(t,e,r){"use strict";var n=r(54222),i=r(8357).extendFlat,a=r(5159);function o(t){if(Array.isArray(t)){for(var e=0,r=0;r=e||u===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=u,o=p(),i+=a,s=u+1,a=0);return n}function p(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}t.exports=function(t,e){var r=l(e.cells.values),p=function(t){return t.slice(e.header.values.length,t.length)},d=l(e.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var v=d.concat(p(r).map(function(){return u((d[0]||[""]).length)})),g=e.domain,y=Math.floor(t._fullLayout._size.w*(g.x[1]-g.x[0])),m=Math.floor(t._fullLayout._size.h*(g.y[1]-g.y[0])),x=e.header.values.length?v[0].map(function(){return e.header.height}):[n.emptyHeaderHeight],b=r.length?r[0].map(function(){return e.cells.height}):[],_=x.reduce(s,0),w=h(b,m-_+n.uplift),T=f(h(x,_),[]),A=f(w,T),k={},M=e._fullInput.columnorder.concat(p(r.map(function(t,e){return e}))),S=v.map(function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return a(n)?Number(n):1}),E=S.reduce(s,0);S=S.map(function(t){return t/E*y});var L=Math.max(o(e.header.line.width),o(e.cells.line.width)),C={key:e.uid+t._context.staticPlot,translateX:g.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-g.y[1]),size:t._fullLayout._size,width:y,maxLineWidth:L,height:m,columnOrder:M,groupHeight:m,rowBlocks:A,headerRowBlocks:T,scrollY:0,cells:i({},e.cells,{values:r}),headerCells:i({},e.header,{values:v}),gdColumns:v.map(function(t){return t[0]}),gdColumnsOriginalOrder:v.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:v.map(function(t,e){var r=k[t];return k[t]=(r||0)+1,{key:t+"__"+k[t],label:t,specIndex:e,xIndex:M[e],xScale:c,x:void 0,calcdata:void 0,columnWidth:S[e]}})};return C.columns.forEach(function(t){t.calcdata=C,t.x=c(t)}),C}},16053:function(t,e,r){"use strict";t.exports=r(88022)},16212:function(t,e,r){"use strict";t.exports={moduleType:"trace",name:"scattersmith",basePlotModule:r(99026),categories:["smith","symbols","showLegend","scatter-like"],attributes:r(95231),supplyDefaults:r(76600),colorbar:r(23814),formatLabels:r(14511),calc:r(86047),plot:r(22745),style:r(26100).style,styleOnSelect:r(26100).styleOnSelect,hoverPoints:r(39442).hoverPoints,selectPoints:r(64061),meta:{}}},16232:function(t,e,r){"use strict";var n=r(34726);function i(t,e){null==e&&(e=!0);var r=t[0],i=t[1],a=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,i*=255,a*=255,o*=255),16777216*(r=255&n(r,0,255))+((i=255&n(i,0,255))<<16)+((a=255&n(a,0,255))<<8)+(255&n(o,0,255))}t.exports=i,t.exports.to=i,t.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},16320:function(t,e,r){"use strict";var n=r(15181),i=r(7143);t.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;sS&&T.splice(S,T.length-S),M.length>S&&M.splice(S,M.length-S);var E=[],L=[],C=[],P="string"==typeof w.size,O="string"==typeof k.size,I=[],D=[],z=P?I:w,R=O?D:k,F=0,B=[],N=[],j=e.histnorm,U=e.histfunc,V=-1!==j.indexOf("density"),H="max"===U||"min"===U?null:0,q=a.count,G=o[j],Y=!1,W=[],Z=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==U&&(Y="avg"===U,q=a[U]);var J=w.size,K=x(w.start),$=x(w.end)+(K-i.tickIncrement(K,J,!1,y))/1e6;for(r=K;r<$;r=i.tickIncrement(r,J,!1,y))L.push(H),I.push(r),Y&&C.push(0);I.push(r);var Q,tt=L.length,et=(r-K)/tt,rt=(Q=K+et/2,v.c2r(Q,0,y)),nt=k.size,it=b(k.start),at=b(k.end)+(it-i.tickIncrement(it,nt,!1,m))/1e6;for(r=it;r=0&&p=0&&de?1:t>=e?0:NaN}function y(t){return null===t?NaN:+t}function m(t){return!isNaN(t)}function x(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}a.ascending=g,a.descending=function(t,e){return et?1:e>=t?0:NaN},a.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},a.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},a.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},a.deviation=function(){var t=a.variance.apply(this,arguments);return t?Math.sqrt(t):t};var b=x(g);function _(t){return t.length}a.bisectLeft=b.left,a.bisect=a.bisectRight=b.right,a.bisector=function(t){return x(1===t.length?function(e,r){return g(t(e),r)}:t)},a.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},a.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},a.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var w=Math.abs;function T(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function A(){this._=Object.create(null)}function k(t){return"__proto__"==(t+="")||"\0"===t[0]?"\0"+t:t}function M(t){return"\0"===(t+="")[0]?t.slice(1):t}function S(t){return k(t)in this._}function E(t){return(t=k(t))in this._&&delete this._[t]}function L(){var t=[];for(var e in this._)t.push(M(e));return t}function C(){var t=0;for(var e in this._)++t;return t}function P(){for(var t in this._)return!1;return!0}function O(){this._=Object.create(null)}function I(t){return t}function D(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function z(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=R.length;re;)i.push(n/a);else for(;(n=t+r*++o)=n.length)return e?e.call(r,a):t?a.sort(t):a;for(var l,u,c,f,h=-1,p=a.length,d=n[s++],v=new A;++h=n.length)return t;var r=[],a=i[e++];return t.forEach(function(t,n){r.push({key:t,values:s(n,e)})}),a?r.sort(function(t,e){return a(t.key,e.key)}):r}return r.map=function(t,e){return o(e,t,0)},r.entries=function(t){return s(o(a.map,t,0),0)},r.key=function(t){return n.push(t),r},r.sortKeys=function(t){return i[n.length-1]=t,r},r.sortValues=function(e){return t=e,r},r.rollup=function(t){return e=t,r},r},a.set=function(t){var e=new O;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},a.event=null,a.requote=function(t){return t.replace(H,"\\$&")};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,q={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function G(t){return q(t,X),t}var Y=function(t,e){return e.querySelector(t)},W=function(t,e){return e.querySelectorAll(t)},Z=function(t,e){var r=t.matches||t[z(t,"matchesSelector")];return Z=function(t,e){return r.call(t,e)},Z(t,e)};"function"==typeof Sizzle&&(Y=function(t,e){return Sizzle(t,e)[0]||null},W=Sizzle,Z=Sizzle.matchesSelector),a.selection=function(){return a.select(l.documentElement)};var X=a.selection.prototype=[];function J(t){return"function"==typeof t?t:function(){return Y(t,this)}}function K(t){return"function"==typeof t?t:function(){return W(t,this)}}X.select=function(t){var e,r,n,i,a=[];t=J(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Q.hasOwnProperty(r)?{space:Q[r],local:t}:t}},X.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=a.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(tt(e,t[e]));return this}return this.each(tt(t,e))},X.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=nt(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},X.sort=function(t){t=ht.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(t=t.slice(0,i));var l=yt.get(t);function u(){var e=this[n];e&&(this.removeEventListener(t,e,e.$),delete this[n])}return l&&(t=l,o=xt),i?e?function(){var i=o(e,s(arguments));u.call(this),this.addEventListener(t,this[n]=i,i.$=r),i._=e}:u:e?F:function(){var e,r=new RegExp("^__on([^.]+)"+a.requote(t)+"$");for(var n in this)if(e=n.match(r)){var i=this[n];this.removeEventListener(e[1],i,i.$),delete this[n]}}}a.selection.enter=dt,a.selection.enter.prototype=vt,vt.append=X.append,vt.empty=X.empty,vt.node=X.node,vt.call=X.call,vt.size=X.size,vt.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s=n&&(n=e+1);!(o=s[n])&&++n1?Pt:t<-1?-Pt:Math.asin(t)}function Rt(t){return((t=Math.exp(t))+1/t)/2}var Ft=Math.SQRT2;a.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-i,f=l-a,h=c*c+f*f;if(h0&&(t=t.transition().duration(v)),t.call(w.event)}function S(){s&&s.domain(o.range().map(function(t){return(t-h.x)/h.k}).map(o.invert)),f&&f.domain(u.range().map(function(t){return(t-h.y)/h.k}).map(u.invert))}function E(t){g++||t({type:"zoomstart"})}function L(t){S(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function C(t){--g||(t({type:"zoomend"}),e=null)}function P(){var t=this,e=_.of(t,arguments),r=0,n=a.select(c(t)).on(m,function(){r=1,k(a.mouse(t),i),L(e)}).on(x,function(){n.on(m,null).on(x,null),o(r),C(e)}),i=T(a.mouse(t)),o=wt(t);Ki.call(t),E(e)}function O(){var t,e=this,r=_.of(e,arguments),n={},o=0,s=".zoom-"+a.event.changedTouches[0].identifier,l="touchmove"+s,u="touchend"+s,c=[],f=a.select(e),p=wt(e);function d(){var r=a.touches(e);return t=h.k,r.forEach(function(t){t.identifier in n&&(n[t.identifier]=T(t))}),r}function v(){var t=a.event.target;a.select(t).on(l,g).on(u,m),c.push(t);for(var r=a.event.changedTouches,s=0,f=r.length;s1){y=p[0];var x=p[1],b=y[0]-x[0],_=y[1]-x[1];o=b*b+_*_}}function g(){var s,l,u,c,f=a.touches(e);Ki.call(e);for(var h=0,p=f.length;h360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ie(a(t+120),a(t),a(t-120))}function Gt(t,e,r){return this instanceof Gt?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof Gt?new Gt(t.h,t.c,t.l):function(t,e,r){return t>0?new Gt(Math.atan2(r,e)*It,Math.sqrt(e*e+r*r),t):new Gt(NaN,NaN,t)}(t instanceof Zt?t.l:(t=fe((t=a.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Gt(t,e,r)}Ht.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,this.l/t)},Ht.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,t*this.l)},Ht.rgb=function(){return qt(this.h,this.s,this.l)},a.hcl=Gt;var Yt=Gt.prototype=new Ut;function Wt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Zt(r,Math.cos(t*=Ot)*e,Math.sin(t)*e)}function Zt(t,e,r){return this instanceof Zt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Zt?new Zt(t.l,t.a,t.b):t instanceof Gt?Wt(t.h,t.c,t.l):fe((t=ie(t)).r,t.g,t.b):new Zt(t,e,r)}Yt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Xt*(arguments.length?t:1)))},Yt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Xt*(arguments.length?t:1)))},Yt.rgb=function(){return Wt(this.h,this.c,this.l).rgb()},a.lab=Zt;var Xt=18,Jt=.95047,Kt=1,$t=1.08883,Qt=Zt.prototype=new Ut;function te(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new ie(ne(3.2404542*(i=ee(i)*Jt)-1.5371385*(n=ee(n)*Kt)-.4985314*(a=ee(a)*$t)),ne(-.969266*i+1.8760108*n+.041556*a),ne(.0556434*i-.2040259*n+1.0572252*a))}function ee(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function re(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ne(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ie(t,e,r){return this instanceof ie?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ie?new ie(t.r,t.g,t.b):ue(""+t,ie,qt):new ie(t,e,r)}function ae(t){return new ie(t>>16,t>>8&255,255&t)}function oe(t){return ae(t)+""}Qt.brighter=function(t){return new Zt(Math.min(100,this.l+Xt*(arguments.length?t:1)),this.a,this.b)},Qt.darker=function(t){return new Zt(Math.max(0,this.l-Xt*(arguments.length?t:1)),this.a,this.b)},Qt.rgb=function(){return te(this.l,this.a,this.b)},a.rgb=ie;var se=ie.prototype=new Ut;function le(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ue(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(pe(i[0]),pe(i[1]),pe(i[2]))}return(a=de.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function ce(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Vt(n,i,l)}function fe(t,e,r){var n=re((.4124564*(t=he(t))+.3575761*(e=he(e))+.1804375*(r=he(r)))/Jt),i=re((.2126729*t+.7151522*e+.072175*r)/Kt);return Zt(116*i-16,500*(n-i),200*(i-re((.0193339*t+.119192*e+.9503041*r)/$t)))}function he(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pe(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}se.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=r.call(i,u)}catch(t){return void o.error.call(i,t)}o.load.call(i,t)}else o.error.call(i,u)}return self.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(t)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=f:u.onreadystatechange=function(){u.readyState>3&&f()},u.onprogress=function(t){var e=a.event;a.event=t;try{o.progress.call(i,u)}finally{a.event=e}},i.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",i)},i.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",i):e},i.responseType=function(t){return arguments.length?(c=t,i):c},i.response=function(t){return r=t,i},["get","post"].forEach(function(t){i[t]=function(){return i.send.apply(i,[t].concat(s(arguments)))}}),i.send=function(r,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),u.open(r,t,!0),null==e||"accept"in l||(l.accept=e+",*/*"),u.setRequestHeader)for(var s in l)u.setRequestHeader(s,l[s]);return null!=e&&u.overrideMimeType&&u.overrideMimeType(e),null!=c&&(u.responseType=c),null!=a&&i.on("error",a).on("load",function(t){a(null,t)}),o.beforesend.call(i,u),u.send(null==n?null:n),i},i.abort=function(){return u.abort(),i},a.rebind(i,o,"on"),null==n?i:i.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(n))}de.forEach(function(t,e){de.set(t,ae(e))}),a.functor=ve,a.xhr=ge(I),a.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=ye(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=function(e){for(var r={},n=t.length,i=0;i=l)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(_e),_e=setTimeout(Ae,e)),be=0):(be=1,we(Ae))}function ke(){for(var t=Date.now(),e=me;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Me(){for(var t,e=me,r=1/0;e;)e.c?(e.t1&&Dt(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function Ce(t,e){return t[0]-e[0]||t[1]-e[1]}a.timer=function(){Te.apply(this,arguments)},a.timer.flush=function(){ke(),Me()},a.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},a.geom={},a.geom.hull=function(t){var e=Se,r=Ee;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ve(e),a=ve(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)p.push(t[s[u[n]][2]]);for(n=+f;nMt)s=s.L;else{if(!((i=a-Ze(s,o))>Mt)){n>-Mt?(e=s.P,r=s):i>-Mt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=He(t);if(Fe.insert(e,l),e||r){if(e===r)return Qe(e),r=He(e.site),Fe.insert(l,r),l.edge=r.edge=rr(e.site,l.site),$e(e),void $e(r);if(r){Qe(e),Qe(r);var u=e.site,c=u.x,f=u.y,h=t.x-c,p=t.y-f,d=r.site,v=d.x-c,g=d.y-f,y=2*(h*g-p*v),m=h*h+p*p,x=v*v+g*g,b={x:(g*m-p*x)/y+c,y:(h*x-v*m)/y+f};ir(r.edge,u,d,b),l.edge=rr(u,t,null,b),r.edge=rr(t,d,null,b),$e(e),$e(r)}else l.edge=rr(e.site,l.site)}}function We(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,f=1/a-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+i-a/2)))/f+n:(n+s)/2}function Ze(t,e){var r=t.N;if(r)return We(r,e);var n=t.site;return n.y===e?n.x:1/0}function Xe(t){this.site=t,this.edges=[]}function Je(t,e){return e.angle-t.angle}function Ke(){sr(this),this.x=this.y=this.arc=this.site=this.cy=null}function $e(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,f=2*(l*(g=a.y-s)-u*c);if(!(f>=-St)){var h=l*l+u*u,p=c*c+g*g,d=(g*h-u*p)/f,v=(l*p-c*h)/f,g=v+s,y=Ue.pop()||new Ke;y.arc=t,y.site=i,y.x=d+o,y.y=g+Math.sqrt(d*d+v*v),y.cy=g,t.circle=y;for(var m=null,x=Ne._;x;)if(y.y=s)return;if(h>d){if(a){if(a.y>=u)return}else a={x:g,y:l};r={x:g,y:u}}else{if(a){if(a.y1)if(h>d){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x0)){if(e/=h,h<0){if(e0){if(e>f)return;e>c&&(c=e)}if(e=i-l,h||!(e<0)){if(e/=h,h<0){if(e>f)return;e>c&&(c=e)}else if(h>0){if(e0)){if(e/=p,p<0){if(e0){if(e>f)return;e>c&&(c=e)}if(e=a-u,p||!(e<0)){if(e/=p,p<0){if(e>f)return;e>c&&(c=e)}else if(p>0){if(e0&&(t.a={x:l+c*h,y:u+c*p}),f<1&&(t.b={x:l+f*h,y:u+f*p}),t}}}}}),l=o.length;l--;)(!tr(e=o[l],t)||!s(e)||w(e.a.x-e.b.x)Mt||w(i-r)>Mt)&&(s.splice(o,0,new ar(nr(a.site,c,w(n-f)Mt?{x:f,y:w(e-f)Mt?{x:w(r-d)Mt?{x:h,y:w(e-h)Mt?{x:w(r-p)=r&&u.x<=i&&u.y>=n&&u.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]}),e}function s(t){return t.map(function(t,e){return{x:Math.round(n(t,e)/Mt)*Mt,y:Math.round(i(t,e)/Mt)*Mt,i:e}})}return o.links=function(t){return fr(s(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},o.triangles=function(t){var e=[];return fr(s(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(Je),s=-1,l=o.length,u=o[l-1].edge,c=u.l===a?u.r:u.l;++sa&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:br(r,n)})),a=Tr.lastIndex;return av&&(v=l.x),l.y>g&&(g=l.y),u.push(l.x),c.push(l.y);else for(f=0;fv&&(v=x),b>g&&(g=b),u.push(x),c.push(b)}var _=v-p,T=g-d;function A(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(w(l-r)+w(u-n)<.01)k(t,e,r,n,i,a,o,s);else{var c=t.point;t.x=t.y=t.point=null,k(t,c,l,u,i,a,o,s),k(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else k(t,e,r,n,i,a,o,s)}function k(t,e,r,n,i,a,o,s){var l=.5*(i+o),u=.5*(a+s),c=r>=l,f=n>=u,h=f<<1|c;t.leaf=!1,c?i=l:o=l,f?a=u:s=u,A(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}_>T?g=d+_:v=p+T;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){A(M,t,+y(t,++f),+m(t,f),p,d,v,g)}};if(M.visit=function(t){yr(t,M,p,d,v,g)},M.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,f,h,p){if(!(c>a||f>o||h=_)<<1|e>=b,T=w+4;w=0&&!(r=a.interpolators[n](t,e)););return r}function kr(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Dr(t){return 1-Math.cos(t*Pt)}function zr(t){return Math.pow(2,10*(t-1))}function Rr(t){return 1-Math.sqrt(1-t*t)}function Fr(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Br(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Nr(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=Ur(i),s=jr(i,a),l=Ur(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]=0?t.slice(0,r):t,i=r>=0?t.slice(r+1):"in";return n=Sr.get(n)||Mr,i=Er.get(i)||I,e=i(n.apply(null,o.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},a.interpolateHcl=function(t,e){t=a.hcl(t),e=a.hcl(e);var r=t.h,n=t.c,i=t.l,o=e.h-r,s=e.c-n,l=e.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?e.c:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360),function(t){return Wt(r+o*t,n+s*t,i+l*t)+""}},a.interpolateHsl=function(t,e){t=a.hsl(t),e=a.hsl(e);var r=t.h,n=t.s,i=t.l,o=e.h-r,s=e.s-n,l=e.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?e.s:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360),function(t){return qt(r+o*t,n+s*t,i+l*t)+""}},a.interpolateLab=function(t,e){t=a.lab(t),e=a.lab(e);var r=t.l,n=t.a,i=t.b,o=e.l-r,s=e.a-n,l=e.b-i;return function(t){return te(r+o*t,n+s*t,i+l*t)+""}},a.interpolateRound=Br,a.transform=function(t){var e=l.createElementNS(a.ns.prefix.svg,"g");return(a.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Nr(r?r.matrix:Vr)})(t)},Nr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Vr={a:1,b:0,c:0,d:1,e:0,f:0};function Hr(t){return t.length?t.pop()+",":""}function qr(t,e){var r=[],n=[];return t=a.transform(t),e=a.transform(e),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:br(t[0],e[0])},{i:i-2,x:br(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(t.translate,e.translate,r,n),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Hr(r)+"rotate(",null,")")-2,x:br(t,e)})):e&&r.push(Hr(r)+"rotate("+e+")")}(t.rotate,e.rotate,r,n),function(t,e,r,n){t!==e?n.push({i:r.push(Hr(r)+"skewX(",null,")")-2,x:br(t,e)}):e&&r.push(Hr(r)+"skewX("+e+")")}(t.skew,e.skew,r,n),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Hr(r)+"scale(",null,",",null,")");n.push({i:i-4,x:br(t[0],e[0])},{i:i-2,x:br(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Hr(r)+"scale("+e+")")}(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i0?r=e:(t.c=null,t.t=NaN,t=null,l.end({type:"end",alpha:r=0})):e>0&&(l.start({type:"start",alpha:r=e}),t=Te(s.tick)),s):r},s.start=function(){var t,e,r,a=y.length,l=m.length,c=u[0],d=u[1];for(t=0;t=0;)r.push(i[n])}function on(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=u}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return on(i,function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)}),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(an(t,function(t){t.children&&(t.value=0)}),on(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},a.layout.partition=function(){var t=a.layout.hierarchy(),e=[1,1];function r(t,e,n,i){var a=t.children;if(t.x=e,t.y=t.depth*i,t.dx=n,t.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=t.value?n/t.value:0;++us&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=e);return n}function bn(t){return t.reduce(_n,0)}function _n(t,e){return t+e[1]}function wn(t,e){return Tn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Tn(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function An(t){return[a.min(t),a.max(t)]}function kn(t,e){return t.value-e.value}function Mn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Sn(t,e){t._pack_next=e,e._pack_prev=t}function En(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Ln(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,u=1/0,c=-1/0,f=1/0,h=-1/0;if(e.forEach(Cn),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(In(r,n,i=e[2]),x(i),Mn(r,i),r._pack_prev=i,Mn(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=u[a.bisect(h,l,1,d)-1]).y+=v,s.push(i[o]));return u}return i.value=function(t){return arguments.length?(e=t,i):e},i.range=function(t){return arguments.length?(r=ve(t),i):r},i.bins=function(t){return arguments.length?(n="number"==typeof t?function(e){return Tn(e,t)}:ve(t),i):n},i.frequency=function(e){return arguments.length?(t=!!e,i):t},i},a.layout.pack=function(){var t,e=a.layout.hierarchy().sort(kn),r=0,n=[1,1];function i(i,a){var o=e.call(this,i,a),s=o[0],l=n[0],u=n[1],c=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(s.x=s.y=0,on(s,function(t){t.r=+c(t.value)}),on(s,Ln),r){var f=r*(t?1:Math.max(2*s.r/l,2*s.r/u))/2;on(s,function(t){t.r+=f}),on(s,Ln),on(s,function(t){t.r-=f})}return On(s,l/2,u/2,t?1:1/Math.max(2*s.r/l,2*s.r/u)),o}return i.size=function(t){return arguments.length?(n=t,i):n},i.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,i):t},i.padding=function(t){return arguments.length?(r=+t,i):r},nn(i,e)},a.layout.tree=function(){var t=a.layout.hierarchy().sort(null).value(null),e=Dn,r=[1,1],n=null;function i(i,a){var u=t.call(this,i,a),c=u[0],f=function(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;op.x&&(p=t),t.depth>d.depth&&(d=t)});var v=e(h,p)/2-h.x,g=r[0]/(p.x+e(p,h)/2+v),y=r[1]/(d.depth||1);an(c,function(t){t.x=(t.x+v)*g,t.y=t.depth*y})}return u}function o(t){var r=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(r.length){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(r[0].z+r[r.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,r,n){if(r){for(var i,a=t,o=t,s=r,l=a.parent.children[0],u=a.m,c=o.m,f=s.m,h=l.m;s=Rn(s),a=zn(a),s&&a;)l=zn(l),(o=Rn(o)).a=t,(i=s.z+f-a.z-u+e(s._,a._))>0&&(Fn(Bn(s,t,n),t,i),u+=i,c+=i),f+=s.m,u+=a.m,h+=l.m,c+=o.m;s&&!Rn(o)&&(o.t=s,o.m+=f-c),a&&!zn(l)&&(l.t=a,l.m+=u-h,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=r[0],t.y=t.depth*r[1]}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(t){return arguments.length?(n=null==(r=t)?l:null,i):n?null:r},i.nodeSize=function(t){return arguments.length?(n=null==(r=t)?null:l,i):n?r:null},nn(i,t)},a.layout.cluster=function(){var t=a.layout.hierarchy().sort(null).value(null),e=Dn,r=[1,1],n=!1;function i(i,o){var s,l=t.call(this,i,o),u=l[0],c=0;on(u,function(t){var r=t.children;r&&r.length?(t.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(r),t.y=function(t){return 1+a.max(t,function(t){return t.y})}(r)):(t.x=s?c+=e(t,s):0,t.y=0,s=t)});var f=Nn(u),h=jn(u),p=f.x-e(f,h)/2,d=h.x+e(h,f)/2;return on(u,n?function(t){t.x=(t.x-u.x)*r[0],t.y=(u.y-t.y)*r[1]}:function(t){t.x=(t.x-p)/(d-p)*r[0],t.y=(1-(u.y?t.y/u.y:1))*r[1]}),l}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(t){return arguments.length?(n=null==(r=t),i):n?null:r},i.nodeSize=function(t){return arguments.length?(n=null!=(r=t),i):n?r:null},nn(i,t)},a.layout.treemap=function(){var t,e=a.layout.hierarchy(),r=Math.round,n=[1,1],i=null,o=Un,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,i=-1,a=t.length;++i0;)s.push(r=u[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,v))<=h?(u.pop(),h=n):(s.area-=s.pop().area,d(s,v,a,!1),v=Math.min(a.dx,a.dy),s.length=s.area=0,h=1/0);s.length&&(d(s,v,a,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(c(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(h)}}function p(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return e*=e,(n*=n)?Math.max(e*i*u/n,n/(e*a*u)):1/0}function d(t,e,n,i){var a,o=-1,s=t.length,l=n.x,u=n.y,c=e?r(t.area/e):0;if(e==n.dx){for((i||c>n.dy)&&(c=n.dy);++on.dx)&&(c=n.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=a.random.normal.apply(a,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=a.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?Xn:Gn,l=n?Yr:Gr;return i=o(t,e,l,r),a=o(e,t,l,Ar),s}function s(t){return i(t)}return s.invert=function(t){return a(t)},s.domain=function(e){return arguments.length?(t=e.map(Number),o()):t},s.range=function(t){return arguments.length?(e=t,o()):e},s.rangeRound=function(t){return s.range(t).interpolate(Br)},s.clamp=function(t){return arguments.length?(n=t,o()):n},s.interpolate=function(t){return arguments.length?(r=t,o()):r},s.ticks=function(e){return ti(t,e)},s.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},s.nice=function(e){return $n(t,e),o()},s.copy=function(){return Jn(t,e,r,n)},o()}function Kn(t,e){return a.rebind(t,e,"range","rangeRound","interpolate","clamp")}function $n(t,e){return Yn(t,Wn(Qn(t,e)[2])),Yn(t,Wn(Qn(t,e)[2])),t}function Qn(t,e){null==e&&(e=10);var r=Hn(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function ti(t,e){return a.range.apply(a,Qn(t,e))}function ei(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Yn(n.map(i),r?Math:ri);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Hn(n),o=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(c-u)){if(r){for(;u0;h--)o.push(a(u)*h);for(u=0;o[u]l;c--);o=o.slice(u,c)}return o},o.copy=function(){return ei(t.copy(),e,r,n)},Kn(o,t)}a.scale.linear=function(){return Jn([0,1],[0,1],Ar,!1)},a.scale.log=function(){return ei(a.scale.linear().domain([0,1]),10,!0,[1,10])};var ri={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function ni(t,e,r){var n=ii(e),i=ii(1/e);function a(e){return t(n(e))}return a.invert=function(e){return i(t.invert(e))},a.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(n)),a):r},a.ticks=function(t){return ti(r,t)},a.tickFormat=function(t,e){return d3_scale_linearTickFormat(r,t,e)},a.nice=function(t){return a.domain($n(r,t))},a.exponent=function(o){return arguments.length?(n=ii(e=o),i=ii(1/e),t.domain(r.map(n)),a):e},a.copy=function(){return ni(t.copy(),e,r)},Kn(a,t)}function ii(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ai(t,e){var r,n,i;function o(i){return n[((r.get(i)||("range"===e.t?r.set(i,t.push(i)):NaN))-1)%n.length]}function s(e,r){return a.range(t.length).map(function(t){return e+r*t})}return o.domain=function(n){if(!arguments.length)return t;t=[],r=new A;for(var i,a=-1,s=n.length;++a0?r[n-1]:t[0],nf?0:1;if(u=Ct)return l(u,p)+(s?l(s,1-p):"")+"Z";var d,v,g,y,m,x,b,_,w,T,A,k,M=0,S=0,E=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=n===vi?Math.sqrt(s*s+u*u):+n.apply(this,arguments),p||(S*=-1),u&&(S=zt(g/u*Math.sin(y))),s&&(M=zt(g/s*Math.sin(y)))),u){m=u*Math.cos(c+S),x=u*Math.sin(c+S),b=u*Math.cos(f-S),_=u*Math.sin(f-S);var L=Math.abs(f-c-2*S)<=Et?0:1;if(S&&_i(m,x,b,_)===p^L){var C=(c+f)/2;m=u*Math.cos(C),x=u*Math.sin(C),b=_=null}}else m=x=0;if(s){w=s*Math.cos(f-M),T=s*Math.sin(f-M),A=s*Math.cos(c+M),k=s*Math.sin(c+M);var P=Math.abs(c-f+2*M)<=Et?0:1;if(M&&_i(w,T,A,k)===1-p^P){var O=(c+f)/2;w=s*Math.cos(O),T=s*Math.sin(O),A=k=null}}else w=T=0;if(h>Mt&&(d=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){v=s0?0:1}function wi(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,f=t[1]+u,h=e[0]+l,p=e[1]+u,d=(c+h)/2,v=(f+p)/2,g=h-c,y=p-f,m=g*g+y*y,x=r-n,b=c*p-h*f,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*m-b*b)),w=(b*y-g*_)/m,T=(-b*g-y*_)/m,A=(b*y+g*_)/m,k=(-b*g+y*_)/m,M=w-d,S=T-v,E=A-d,L=k-v;return M*M+S*S>E*E+L*L&&(w=A,T=k),[[w-l,T-u],[w*r/x,T*r/x]]}function Ti(){return!0}function Ai(t){var e=Se,r=Ee,n=Ti,i=Mi,a=i.key,o=.7;function s(a){var s,l=[],u=[],c=-1,f=a.length,h=ve(e),p=ve(r);function d(){l.push("M",i(t(u),o))}for(;++c1&&i.push("H",n[0]),i.join("")},"step-before":Ei,"step-after":Li,basis:Oi,"basis-open":function(t){if(t.length<4)return Mi(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Ii(Ri,a)+","+Ii(Ri,o)),--n;++n9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function Mi(t){return t.length>1?t.join("L"):t+"Z"}function Si(t){return t.join("L")+"Z"}function Ei(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;uEt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=ve(t),a):r},a.source=function(e){return arguments.length?(t=ve(e),a):t},a.target=function(t){return arguments.length?(e=ve(t),a):e},a.startAngle=function(t){return arguments.length?(n=ve(t),a):n},a.endAngle=function(t){return arguments.length?(i=ve(t),a):i},a},a.svg.diagonal=function(){var t=Ui,e=Vi,r=qi;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ve(e),n):t},n.target=function(t){return arguments.length?(e=ve(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},a.svg.diagonal.radial=function(){var t=a.svg.diagonal(),e=qi,r=t.projection;return t.projection=function(t){return arguments.length?r(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Pt;return[r*Math.cos(n),r*Math.sin(n)]}}(e=t)):e},t},a.svg.symbol=function(){var t=Yi,e=Gi;function r(r,n){return(Zi.get(t.call(this,r,n))||Wi)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ve(e),r):t},r.size=function(t){return arguments.length?(e=ve(t),r):e},r};var Zi=a.map({circle:Wi,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Ji)),r=e*Ji;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Xi),r=e*Xi/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Xi),r=e*Xi/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});a.svg.symbolTypes=Zi.keys();var Xi=Math.sqrt(3),Ji=Math.tan(30*Ot);X.transition=function(t){for(var e,r,n=ta||++na,i=oa(t),a=[],o=ea||{time:Date.now(),ease:Ir,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--h].call(t,o);if(a>=1)return f.event&&f.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}f||(a=i.time,o=Te(function(t){var e=f.delay;if(o.t=e+a,e<=t)return h(t-e);o.c=h},0,a),f=c[n]={tween:new A,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++c.count)}ra.call=X.call,ra.empty=X.empty,ra.node=X.node,ra.size=X.size,a.transition=function(t,e){return t&&t.transition?ta?t.transition(e):t:a.selection().transition(t)},a.transition.prototype=ra,ra.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=J(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",o[1]-o[0])}function v(t){t.select(".extent").attr("y",s[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function g(){var f,g,y=this,m=a.select(a.event.target),x=r.of(y,arguments),b=a.select(y),_=m.datum(),w=!/^(n|s)$/.test(_)&&n,T=!/^(e|w)$/.test(_)&&i,A=m.classed("extent"),k=wt(y),M=a.mouse(y),S=a.select(c(y)).on("keydown.brush",function(){32==a.event.keyCode&&(A||(f=null,M[0]-=o[1],M[1]-=s[1],A=2),j())}).on("keyup.brush",function(){32==a.event.keyCode&&2==A&&(M[0]+=o[1],M[1]+=s[1],A=0,j())});if(a.event.changedTouches?S.on("touchmove.brush",C).on("touchend.brush",O):S.on("mousemove.brush",C).on("mouseup.brush",O),b.interrupt().selectAll("*").interrupt(),A)M[0]=o[0]-M[0],M[1]=s[0]-M[1];else if(_){var E=+/w$/.test(_),L=+/^n/.test(_);g=[o[1-E]-M[0],s[1-L]-M[1]],M[0]=o[E],M[1]=s[L]}else a.event.altKey&&(f=M.slice());function C(){var t=a.mouse(y),e=!1;g&&(t[0]+=g[0],t[1]+=g[1]),A||(a.event.altKey?(f||(f=[(o[0]+o[1])/2,(s[0]+s[1])/2]),M[0]=o[+(t[0]=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},16665:function(t,e,r){"use strict";var n=r(60609).fX,i=r(15181).counterRegex,a=r(47341),o=r(29888),s=o.attr,l=o.name,u=i(l),c={};c[s]={valType:"subplotid",dflt:l,editType:"calc"},t.exports={attr:s,name:l,idRoot:l,idRegex:u,attrRegex:u,attributes:c,layoutAttributes:r(40223),supplyLayoutDefaults:r(4536),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,i=e._subplots[l],o=0;o-1,flipY:C.tiling.flip.indexOf("y")>-1,pad:{inner:C.tiling.pad,top:C.marker.pad.t,left:C.marker.pad.l,right:C.marker.pad.r,bottom:C.marker.pad.b}}).descendants(),R=1/0,F=-1/0;z.forEach(function(t){var e=t.depth;e>=C._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(R=Math.min(R,e),F=Math.max(F,e))}),d=d.data(z,c.getPtId),C._maxVisibleLayers=isFinite(F)?F-R+1:0,d.enter().append("g").classed("slice",!0),A(d,p,{},[g,y],b),d.order();var B=null;if(T&&S){var N=c.getPtId(S);d.each(function(t){null===B&&c.getPtId(t)===N&&(B={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})})}var j=function(){return B||{x0:0,x1:g,y0:0,y1:y}},U=d;return T&&(U=U.transition().each("end",function(){var e=n.select(this);c.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),U.each(function(s){var d=c.isHeader(s,C);s._x0=m(s.x0),s._x1=m(s.x1),s._y0=x(s.y0),s._y1=x(s.y1),s._hoverX=m(s.x1-C.marker.pad.r),s._hoverY=x(I?s.y1-C.marker.pad.b/2:s.y0+C.marker.pad.t/2);var v=n.select(this),A=i.ensureSingle(v,"path","surface",function(t){t.style("pointer-events",E?"none":"all")});T?A.transition().attrTween("d",function(t){var e=k(t,p,j(),[g,y]);return function(t){return b(e(t))}}):A.attr("d",b),v.call(f,r,t,e,{styleOne:l,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{isTransitioning:t._transitioning}),A.call(l,s,C,t,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=d?D?"":c.getPtLabel(s)||"":h(s,r,C,e,L)||"";var S=i.ensureSingle(v,"g","slicetext"),z=i.ensureSingle(S,"text","",function(t){t.attr("data-notex",1)}),R=i.ensureUniformFontSize(t,c.determineTextFont(C,s,L.font));z.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",O?"end":P||d?"start":"middle").call(a.font,R).call(o.convertToTspans,t),s.textBB=a.bBox(z.node()),s.transform=_(s,{fontSize:R.size,isHeader:d}),s.transform.fontSize=R.size,T?z.transition().attrTween("transform",function(t){var e=M(t,p,j(),[g,y]);return function(t){return w(e(t))}}):z.attr("transform",w(s))}),B}},16787:function(t,e,r){"use strict";var n=r(93003).list,i=r(40243).getAutoRange,a=r(17984);t.exports=function(t){for(var e=n(t,"x",!0),r=0;r0)){var v=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;a1||v<0||v>1?null:{x:t+l*v,y:e+f*v}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}e.segmentsIntersect=s,e.segmentDistance=function(t,e,r,n,i,a,o,u){if(s(t,e,r,n,i,a,o,u))return 0;var c=r-t,f=n-e,h=o-i,p=u-a,d=c*c+f*f,v=h*h+p*p,g=Math.min(l(c,f,d,i-t,a-e),l(c,f,d,o-t,u-e),l(h,p,v,t-i,e-a),l(h,p,v,r-i,n-a));return Math.sqrt(g)},e.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=h,h},e.clearLocationCache=function(){i=null},e.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var p=h(u);p;){if((u+=p+r)>f)return;p=h(u)}for(p=h(f);p;){if(u>(f-=p+r))return;p=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},e.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,p=s;f0?p=i:h=i,f++}return a}},17880:function(t,e,r){"use strict";var n=r(15181),i=r(86431),a=r(69562),o=r(25623),s=r(79444).N,l=r(76802),u=r(92444),c=r(46716);function f(t,e){function r(r,a){return n.coerce(t,e,i.link.colorscales,r,a)}r("label"),r("cmin"),r("cmax"),r("colorscale")}t.exports=function(t,e,r,h){function p(r,a){return n.coerce(t,e,i,r,a)}var d=n.extendDeep(h.hoverlabel,t.hoverlabel),v=t.node,g=u.newContainer(e,"node");function y(t,e){return n.coerce(v,g,i.node,t,e)}y("label"),y("groups"),y("x"),y("y"),y("pad"),y("thickness"),y("line.color"),y("line.width"),y("hoverinfo",t.hoverinfo),l(v,g,y,d),y("hovertemplate");var m=h.colorway;y("color",g.label.map(function(t,e){return a.addOpacity(function(t){return m[t%m.length]}(e),.8)})),y("customdata");var x=t.link||{},b=u.newContainer(e,"link");function _(t,e){return n.coerce(x,b,i.link,t,e)}_("label"),_("arrowlen"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),l(x,b,_,d),_("hovertemplate");var w,T=o(h.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(T,b.value.length)),_("customdata"),c(x,b,{name:"colorscales",handleItemDefaults:f}),s(e,h,p),p("orientation"),p("valueformat"),p("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),p("arrangement",w),n.coerceFont(p,"textfont",n.extendFlat({},h.font)),e._length=null}},17888:function(t,e,r){"use strict";var n=r(52237),i=r(35331),a=Object.prototype.toString;t.exports=function(t){if(!n(t))return null;if(i(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===a)return null}try{return""+t}catch(t){return null}}},17896:function(t){"use strict";t.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}},17956:function(t,e,r){"use strict";var n=r(46474),i=r(92444);t.exports=function(t,e,r,a,o){a("a")||(a("da"),a("a0")),a("b")||(a("db"),a("b0")),function(t,e,r,a){["aaxis","baxis"].forEach(function(o){var s=o.charAt(0),l=t[o]||{},u=i.newContainer(e,o),c={noTicklabelstep:!0,tickfont:"x",id:s+"axis",letter:s,font:e.font,name:o,data:t[s],calendar:e.calendar,dfltColor:a,bgColor:r.paper_bgcolor,autotypenumbersDflt:r.autotypenumbers,fullLayout:r};n(l,u,c),u._categories=u._categories||[],t[o]||"-"===l.type||(t[o]={type:l.type})})}(t,e,r,o)}},17984:function(t){"use strict";t.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},18008:function(t,e,r){"use strict";t.exports={moduleType:"trace",name:"candlestick",basePlotModule:r(29435),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:r(33691),layoutAttributes:r(17896),supplyLayoutDefaults:r(80671).supplyLayoutDefaults,crossTraceCalc:r(23530).crossTraceCalc,supplyDefaults:r(43484),calc:r(17307),plot:r(68343).plot,layerName:"boxlayer",style:r(89743).style,hoverPoints:r(65409).hoverPoints,selectPoints:r(44483)}},18030:function(t,e,r){"use strict";var n=r(15181),i=r(24181),a=r(26761),o=r(22203),s=r(5651),l=r(53125);t.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,a,r,i)}if(c("carpet"),t.a&&t.b){if(!i(t,e,c,u,"a","b"))return void(e.visible=!1);c("text"),"constraint"===c("contours.type")?o(t,e,c,u,r,{hasHover:!1}):(s(t,e,c,function(r){return n.coerce2(t,e,a,r)}),l(t,e,c,u,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},18049:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],v=e[13],g=e[14],y=e[15],m=r*s-n*o,x=r*l-i*o,b=r*u-a*o,_=n*l-i*s,w=n*u-a*s,T=i*u-a*l,A=c*v-f*d,k=c*g-h*d,M=c*y-p*d,S=f*g-h*v,E=f*y-p*v,L=h*y-p*g,C=m*L-x*E+b*S+_*M-w*k+T*A;return C?(C=1/C,t[0]=(s*L-l*E+u*S)*C,t[1]=(i*E-n*L-a*S)*C,t[2]=(v*T-g*w+y*_)*C,t[3]=(h*w-f*T-p*_)*C,t[4]=(l*M-o*L-u*k)*C,t[5]=(r*L-i*M+a*k)*C,t[6]=(g*b-d*T-y*x)*C,t[7]=(c*T-h*b+p*x)*C,t[8]=(o*E-s*M+u*A)*C,t[9]=(n*M-r*E-a*A)*C,t[10]=(d*w-v*b+y*m)*C,t[11]=(f*b-c*w-p*m)*C,t[12]=(s*k-o*S-l*A)*C,t[13]=(r*S-n*k+i*A)*C,t[14]=(v*x-d*_-g*m)*C,t[15]=(c*_-f*x+h*m)*C,t):null}},18095:function(t,e,r){"use strict";var n=r(16534),i=r(69562),a=r(88191),o=r(15181),s=r(46982),l=r(70394).resizeText,u=r(74349),c=u.textfont,f=u.insidetextfont,h=u.outsidetextfont,p=r(54791);function d(t,e,r){a.pointStyle(t.selectAll("path"),e,r),v(t,e,r)}function v(t,e,r){t.selectAll("text").each(function(t){var i=n.select(this),s=o.ensureUniformFontSize(r,g(i,t,e,r));a.font(i,s)})}function g(t,e,r,n){var i=n._fullLayout.font,a=r.textfont;if(t.classed("bartext-inside")){var o=_(e,r);a=m(r,e.i,i,o)}else t.classed("bartext-outside")&&(a=x(r,e.i,i));return a}function y(t,e,r){return b(c,t.textfont,e,r)}function m(t,e,r,n){var a=y(t,e,r);return(void 0===t._input.textfont||void 0===t._input.textfont.color||Array.isArray(t.textfont.color)&&void 0===t.textfont.color[e])&&(a={color:i.contrast(n),family:a.family,size:a.size}),b(f,t.insidetextfont,e,a)}function x(t,e,r){var n=y(t,e,r);return b(h,t.outsidetextfont,e,n)}function b(t,e,r,n){e=e||{};var i=p.getValue(e.family,r),a=p.getValue(e.size,r),o=p.getValue(e.color,r);return{family:p.coerceString(t.family,i,n.family),size:p.coerceNumber(t.size,a,n.size),color:p.coerceColor(t.color,o,n.color)}}function _(t,e){return"waterfall"===e.type?e[t.dir].marker.color:t.mcc||t.mc||e.marker.color}t.exports={style:function(t){var e=n.select(t).selectAll("g.barlayer").selectAll("g.trace");l(t,e,"bar");var r=e.size(),i=t._fullLayout;e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===i.barmode&&r>1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(e){d(n.select(this),e[0].trace,t)}),s.getComponentMethod("errorbars","style")(e)},styleTextPoints:v,styleOnSelect:function(t,e,r){var i=e[0].trace;i.selectedpoints?function(t,e,r){a.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each(function(t){var i,s=n.select(this);if(t.selected){i=o.ensureUniformFontSize(r,g(s,t,e,r));var l=e.selected.textfont&&e.selected.textfont.color;l&&(i.color=l),a.font(s,i)}else a.selectedTextStyle(s,e)})}(t.selectAll("text"),e,r)}(r,i,t):(d(r,i,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:m,getOutsideTextFont:x,getBarColor:_,resizeText:l}},18352:function(t,e,r){"use strict";var n=r(15181),i=r(41993),a=r(31164);t.exports=function(t,e){var r,o,s;function l(t){return n.coerce(o._input,o,a,t)}if("group"===e.scattermode)for(s=0;s=0;f--){var h=t[f];if("scatter"===h.type&&h.xaxis===u.xaxis&&h.yaxis===u.yaxis){h.opacity=void 0;break}}}}}},18435:function(t,e,r){"use strict";var n=r(15181),i=r(26446),a=r(71809),o=r(94573),s=r(78945).BADNUM;function l(t,e,r){var i=e.max-e.min;if(!i)return t.bandwidth?t.bandwidth:0;if(t.bandwidth)return Math.max(t.bandwidth,i/1e4);var a=r.length,o=n.stdev(r,a-1,e.mean);return Math.max(function(t,e,r){return 1.059*Math.min(e,r/1.349)*Math.pow(t,-.2)}(a,o,e.q3-e.q1),i/100)}function u(t,e,r,n){var a,o=t.spanmode,l=t.span||[],u=[e.min,e.max],c=[e.min-2*n,e.max+2*n];function f(n){var i=l[n],a="multicategory"===r.type?r.r2c(i):r.d2c(i,0,t[e.valLetter+"calendar"]);return a===s?c[n]:a}var h={type:"linear",range:a="soft"===o?c:"hard"===o?u:[f(0),f(1)]};return i.setConvert(h),h.cleanRange(),a}t.exports=function(t,e){var r=a(t,e);if(r[0].t.empty)return r;for(var s=t._fullLayout,c=i.getFromId(t,e["h"===e.orientation?"xaxis":"yaxis"]),f=1/0,h=-1/0,p=0,d=0,v=0;v0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*g*Math.abs(n-i))}return v}function L(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=c(e,n||t.calendar);if(o===v){if(!s(e))return v;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),u=Math.round(e-l/10);o=c(new Date(u))+l/10}return o}function C(e,r,n){return u(e,r,n||t.calendar)}function P(e){return t._categories[Math.round(e)]}function O(e){if(S(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return v}function I(e){if(t._categoriesMap)return t._categoriesMap[e]}function D(t){var e=I(t);return void 0!==e?e:s(t)?+t:void 0}function z(t){return s(t)?+t:I(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return s(e)?R(e,t._m,t._b):v},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===p;B=function(e){if(!s(e))return v;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lc)){o=a<(u+c)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?R(e,t._m2,f):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?E:f,t.l2c="log"===t.type?M:f,t.l2p=B,t.p2l=N,t.c2p="log"===t.type?function(t,e){return B(E(t,e))}:B,t.p2c="log"===t.type?function(t){return M(N(t))}:N,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return E(l(t),e)},t.r2d=t.r2c=function(t){return M(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=E,t.l2d=M,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return M(N(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=N,t.cleanPos=f):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=L,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(e,r,n){return t.l2p(L(e,0,n))},t.p2d=t.p2r=function(t,e,r){return C(N(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,v,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=O,t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=D,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=D,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=I,t.l2r=t.c2r=f,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var u in l)if(u!==r){var c=e[w.id2name(u)];s=s.concat(c._traceIndices)}var f=[[0,{}],[0,{}]],d=[];for(i=0;id&&(o[n]=d),o[0]===o[1]){var u=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=u,o[1]+=u}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,u=t.r2l(t[a][0],o),c=t.r2l(t[a][1],o),f="y"===p;if(f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(h=!h),h&&t._rangebreaks.reverse();var d=h?-1:1;for(t._m2=d*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(f?c:u)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&u.push({min:t,max:n})}};for(n=0;n0?1:t<0?-1:0},_=Math.sqrt,w=Math.tan;function T(t){return t>1?0:t<-1?a:Math.acos(t)}function A(t){return t>1?o:t<-1?-o:Math.asin(t)}function k(t){return(t=x(t/2))*t}},19005:function(t,e,r){"use strict";t.exports={moduleType:"component",name:"modebar",layoutAttributes:r(58496),supplyLayoutDefaults:r(44535),manage:r(88326)}},19014:function(t,e,r){"use strict";var n=r(70666),i=r(66031),a=r(46982),o=r(88191).dashStyle,s=r(69562),l=r(93441),u=r(51676).makeEventData,c=r(7514),f=c.freeMode,h=c.rectMode,p=c.drawMode,d=c.openMode,v=c.selectMode,g=r(53812),y=r(65552),m=r(96989),x=r(7826).clearOutline,b=r(99603),_=b.handleEllipse,w=b.readPaths,T=r(1414).newShapes,A=r(53373),k=r(74160).activateLastSelection,M=r(15181),S=M.sorterAsc,E=r(23255),L=r(57341),C=r(93003).getFromId,P=r(91371),O=r(357).redrawReglTraces,I=r(37453),D=I.MINSELECT,z=E.filter,R=E.tester,F=r(28229),B=F.p2r,N=F.axValue,j=F.getTransform;function U(t){return void 0!==t.subplot}function V(t,e,r,n,i,a,o){var s,l,u,c,f,h,p,v,g,y=e._hoverdata,x=e._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){Y(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((n+=e.selectedpoints.length)>1)return!1}return 1===n}(s)&&(h=K(_))){for(o&&o.remove(),g=0;g=0})(i)&&i._fullLayout._deactivateShape(i),function(t){return t._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var o=i._fullLayout._zoomlayer,s=p(r),l=v(r);if(s||l){var u,c,f=o.selectAll(".select-outline-"+n.id);f&&i._fullLayout._outlining&&(s&&(u=T(f,t)),u&&a.call("_guiRelayout",i,{shapes:u}),l&&!U(t)&&(c=A(f,t)),c&&(i._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",i,{selections:c}).then(function(){e&&k(i)})),i._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function Z(t){return t._id}function X(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(Z),u=r.map(Z);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function $(t,e,r){var n,i;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,pt=et[0].yref;if(nt&&pt){var dt=ut(et);ct([C(t,nt,"x"),C(t,pt,"y")])(Q,dt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ft(t,Q),h._reselect=!1}if(!a&&h._deselect){var vt=h._deselect;(function(t,e,r){for(var n=0;n=0)A._fullLayout._deactivateShape(A);else if(!x){var r=k.clickmode;L.done(Mt).then(function(){if(L.clear(Mt),2===t){for(bt.remove(),K=0;K-1&&V(e,A,n.xaxes,n.yaxes,n.subplot,n,bt),"event"===r&&ft(A,void 0);l.click(A,e)}).catch(M.error)}},n.doneFn=function(){At.remove(),L.done(Mt).then(function(){L.clear(Mt),!S&&J&&n.selectionDefs&&(J.subtract=xt,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Z)),(S||x)&&W(n,S),n.doneFnCompleted&&n.doneFnCompleted(St),b&&ft(A,at)}).catch(M.error)}},clearOutline:x,clearSelectionsCache:W,selectOnClick:V}},19070:function(t,e,r){"use strict";var n=r(15181),i=r(6680),a=r(28418),o=r(52948),s=r(4868),l=r(68478),u=r(54563),c=r(46190),f=r(8377);t.exports=function(t,e,r,h){function p(r,i){return n.coerce(t,e,f,r,i)}p("carpet"),e.xaxis="x",e.yaxis="y";var d=p("a"),v=p("b"),g=Math.min(d.length,v.length);if(g){e._length=g,p("text"),p("texttemplate"),p("hovertext"),p("mode",g>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function h(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<t.length)){for(;e+8=10?r=r||c(t,e+8):"VP8L"===p&&d>=9?r=r||f(t,e+8):"VP8X"===p&&d>=10?r=r||h(t,e+8):"EXIF"===p&&(n=s.get_orientation(t.slice(e+8,e+8+d)),e=1/0),e+=8+d}else e++;if(r)return n>0&&(r.orientation=n),r}}}},19260:function(t,e,r){"use strict";var n=r(93441),i=r(46982),a=r(69562),o=r(15181).fillText,s=r(54791).getLineWidth,l=r(26446).hoverLabelText,u=r(78945).BADNUM;function c(t,e,r,i,a){var s,c,f,h,p,d,v,g=t.cd,y=g[0].trace,m=g[0].t,x="closest"===i,b="waterfall"===y.type,_=t.maxHoverDistance,w=t.maxSpikeDistance;"h"===y.orientation?(s=r,c=e,f="y",h="x",p=D,d=O):(s=e,c=r,f="x",h="y",d=D,p=O);var T=y[f+"period"],A=x||T;function k(t){return S(t,-1)}function M(t){return S(t,1)}function S(t,e){var r=t.w;return t[f]+e*r/2}function E(t){return t[f+"End"]-t[f+"Start"]}var L=x?k:T?function(t){return t.p-E(t)/2}:function(t){return Math.min(k(t),t.p-m.bardelta/2)},C=x?M:T?function(t){return t.p+E(t)/2}:function(t){return Math.max(M(t),t.p+m.bardelta/2)};function P(t,e,r){return a.finiteRange&&(r=0),n.inbox(t-s,e-s,r+Math.min(1,Math.abs(e-t)/v)-1)}function O(t){return P(L(t),C(t),_)}function I(t){var e=t[h];if(b){var r=Math.abs(t.rawS)||0;c>0?e+=r:c<0&&(e-=r)}return e}function D(t){var e=c,r=t.b,i=I(t);return n.inbox(r-e,i-e,_+(i-e)/(i-r)-1)}var z=t[f+"a"],R=t[h+"a"];v=Math.abs(z.r2c(z.range[1])-z.r2c(z.range[0]));var F=n.getDistanceFunction(i,p,d,function(t){return(p(t)+d(t))/2});if(n.getClosest(g,F,t),!1!==t.index&&g[t.index].p!==u){A||(L=function(t){return Math.min(k(t),t.p-m.bargroupwidth/2)},C=function(t){return Math.max(M(t),t.p+m.bargroupwidth/2)});var B=g[t.index],N=y.base?B.b+B.s:B.s;t[h+"0"]=t[h+"1"]=R.c2p(B[h],!0),t[h+"LabelVal"]=N;var j=m.extents[m.extents.round(B.p)];t[f+"0"]=z.c2p(x?L(B):j[0],!0),t[f+"1"]=z.c2p(x?C(B):j[1],!0);var U=void 0!==B.orig_p;return t[f+"LabelVal"]=U?B.orig_p:B.p,t.labelLabel=l(z,t[f+"LabelVal"],y[f+"hoverformat"]),t.valueLabel=l(R,t[h+"LabelVal"],y[h+"hoverformat"]),t.baseLabel=l(R,B.b,y[h+"hoverformat"]),t.spikeDistance=(function(t){var e=c,r=t.b,i=I(t);return n.inbox(r-e,i-e,w+(i-e)/(i-r)-1)}(B)+function(t){return P(k(t),M(t),w)}(B))/2,t[f+"Spike"]=z.c2p(B.p,!0),o(B,y,t),t.hovertemplate=y.hovertemplate,t}}function f(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,i=s(t,e);return a.opacity(r)?r:a.opacity(n)&&i?n:void 0}t.exports={hoverPoints:function(t,e,r,n,a){var o=c(t,e,r,n,a);if(o){var s=o.cd,l=s[0].trace,u=s[o.index];return o.color=f(l,u),i.getComponentMethod("errorbars","hoverInfo")(u,l,o),[o]}},hoverOnBars:c,getTraceColor:f}},19372:function(t){"use strict";t.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}},19389:function(t,e,r){"use strict";var n=r(25623),i={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},a=i.RdBu;function o(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!==+t[0][0]||1!==+t[t.length-1][0])return!1;for(var r=0;r",'""',"''","``","“”","«»"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map(function(t){return 1===t.length&&(t+=t),t}));var i=n.parse(t,{flat:!0,brackets:r.ignore}),a=i[0].split(e);if(r.escape){for(var o=[],s=0;s0?(0,n.A)(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)}):null},e.A=i;var a=i.range},21669:function(t,e,r){"use strict";for(var n=r(28209),i=r(38532).rb,a=r(8357).extendFlat,o=r(76591).colormodel,s=["rgb","rgba","rgba256","hsl","hsla"],l=[],u=[],c=0;c2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,v),"="===g?h=v.showlines=!0:(h=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),h&&(p=r("line.color",d&&s(d)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash")),r("line.smoothing"),i(r,a,p,f)}},22208:function(t,e,r){"use strict";function n(t,e){return te?1:t>=e?0:NaN}r.d(e,{V_:function(){return n},T9:function(){return s},i2:function(){return u},Am:function(){return c},jk:function(){return f},y1:function(){return h},cz:function(){return p}}),1===(i=n).length&&(a=i,i=function(t,e){return n(a(t),e)});var i,a,o=Array.prototype;function s(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n}function l(t){return null===t?NaN:+t}function u(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r}function f(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n}function h(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((e-t)/r)),a=new Array(i);++nu||p>c||d>f)return l=i,u=r,c=p,f=d,void(o=0);var v=n.lineString([l,i],t.properties);if(!1===e(v,r,a,d,o))return!1;o++,l=i})&&void 0}}})}function c(t,e){if(!t)throw new Error("geojson is required");l(t,function(t,r,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===e(t,r,i,0,0))return!1;break;case"Polygon":for(var s=0;s0){r=d[n];break}return r}function m(t,e){if(!(t<1||e<1)){for(var r=g(t),n=g(e),i=1,a=0;a_;)r--,r/=y(r),++r1?n:1},p.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+n+1,u=1+a+1,c=i(new Float32Array(l*u),[l,u]),f=[1/e,0,0,0,1/r,0,0,0,1],h=0;h0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e]=10&&a(t,e,s)&&(i=o.get_orientation(t.slice(e+6,e+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(t.length-e0&&(u.orientation=i),u}e+=r}}},22886:function(t,e,r){"use strict";var n=r(75671),i=r(46329).findBin,a=r(95663),o=r(74176),s=r(77828),l=r(32443);t.exports=function(t){var e=t._a,r=t._b,u=e.length,c=r.length,f=t.aaxis,h=t.baxis,p=e[0],d=e[u-1],v=r[0],g=r[c-1],y=e[e.length-1]-e[0],m=r[r.length-1]-r[0],x=y*n.RELATIVE_CULL_TOLERANCE,b=m*n.RELATIVE_CULL_TOLERANCE;p-=x,d+=x,v-=b,g+=b,t.isVisible=function(t,e){return t>p&&tv&&ed||eg},t.setScale=function(){var e=t._x,r=t._y,n=a(t._xctrl,t._yctrl,e,r,f.smoothing,h.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],u,c,f.smoothing,h.smoothing),t.dxydi=s([t._xctrl,t._yctrl],f.smoothing,h.smoothing),t.dxydj=l([t._xctrl,t._yctrl],f.smoothing,h.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),u-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),u-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),u-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(u-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),c-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(c-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[u-1]|ir[c-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,h,p,d,v=0,g=0,y=[];ne[u-1]?(f=u-2,h=1,v=(n-e[u-1])/(e[u-1]-e[u-2])):h=o-(f=Math.max(0,Math.min(u-2,Math.floor(o)))),ir[c-1]?(p=c-2,d=1,g=(i-r[c-1])/(r[c-1]-r[c-2])):d=s-(p=Math.max(0,Math.min(c-2,Math.floor(s)))),v&&(t.dxydi(y,f,p,h,d),l[0]+=y[0]*v,l[1]+=y[1]*v),g&&(t.dxydj(y,f,p,h,d),l[0]+=y[0]*g,l[1]+=y[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=m*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},22925:function(t,e,r){"use strict";var n=r(16534),i=r(15181),a=r(88191),o=r(3071),s=r(11952),l=r(6343).styleOne,u=r(93952),c=r(95304),f=r(96303),h=r(2290).formatSliceLabel,p=!1;t.exports=function(t,e,r,d,v){var g=v.width,y=v.height,m=v.viewX,x=v.viewY,b=v.pathSlice,_=v.toMoveInsideSlice,w=v.strTransform,T=v.hasTransition,A=v.handleSlicesExit,k=v.makeUpdateSliceInterpolator,M=v.makeUpdateTextInterpolator,S=v.prevEntry,E=t._context.staticPlot,L=t._fullLayout,C=e[0].trace,P=-1!==C.textposition.indexOf("left"),O=-1!==C.textposition.indexOf("right"),I=-1!==C.textposition.indexOf("bottom"),D=s(r,[g,y],{flipX:C.tiling.flip.indexOf("x")>-1,flipY:C.tiling.flip.indexOf("y")>-1,orientation:C.tiling.orientation,pad:{inner:C.tiling.pad},maxDepth:C._maxDepth}).descendants(),z=1/0,R=-1/0;D.forEach(function(t){var e=t.depth;e>=C._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(z=Math.min(z,e),R=Math.max(R,e))}),d=d.data(D,c.getPtId),C._maxVisibleLayers=isFinite(R)?R-z+1:0,d.enter().append("g").classed("slice",!0),A(d,p,{},[g,y],b),d.order();var F=null;if(T&&S){var B=c.getPtId(S);d.each(function(t){null===F&&c.getPtId(t)===B&&(F={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})})}var N=function(){return F||{x0:0,x1:g,y0:0,y1:y}},j=d;return T&&(j=j.transition().each("end",function(){var e=n.select(this);c.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),j.each(function(s){s._x0=m(s.x0),s._x1=m(s.x1),s._y0=x(s.y0),s._y1=x(s.y1),s._hoverX=m(s.x1-C.tiling.pad),s._hoverY=x(I?s.y1-C.tiling.pad/2:s.y0+C.tiling.pad/2);var d=n.select(this),v=i.ensureSingle(d,"path","surface",function(t){t.style("pointer-events",E?"none":"all")});T?v.transition().attrTween("d",function(t){var e=k(t,p,N(),[g,y],{orientation:C.tiling.orientation,flipX:C.tiling.flip.indexOf("x")>-1,flipY:C.tiling.flip.indexOf("y")>-1});return function(t){return b(e(t))}}):v.attr("d",b),d.call(f,r,t,e,{styleOne:l,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{isTransitioning:t._transitioning}),v.call(l,s,C,t,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h(s,r,C,e,L)||"";var A=i.ensureSingle(d,"g","slicetext"),S=i.ensureSingle(A,"text","",function(t){t.attr("data-notex",1)}),D=i.ensureUniformFontSize(t,c.determineTextFont(C,s,L.font));S.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",O?"end":P?"start":"middle").call(a.font,D).call(o.convertToTspans,t),s.textBB=a.bBox(S.node()),s.transform=_(s,{fontSize:D.size}),s.transform.fontSize=D.size,T?S.transition().attrTween("transform",function(t){var e=M(t,p,N(),[g,y]);return function(t){return w(e(t))}}):S.attr("transform",w(s))}),F}},22951:function(t){"use strict";t.exports=function(t,e,r,n,i,a){var o=i[0]*t.dpdx(e),s=i[1]*t.dpdy(r),l=1,u=1;if(a){var c=Math.sqrt(i[0]*i[0]+i[1]*i[1]),f=Math.sqrt(a[0]*a[0]+a[1]*a[1]),h=(i[0]*a[0]+i[1]*a[1])/c/f;u=Math.max(0,h)}var p=180*Math.atan2(s,o)/Math.PI;return p<-90?(p+=180,l=-l):p>90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:u}}},22994:function(t,e,r){"use strict";var n=r(54113),i=r(37565),a=r(29278),o=r(92444).templatedArray;r(85669),t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},23068:function(t,e,r){"use strict";var n=r(13625);function i(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*r.g.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*r.g.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function a(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function o(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}t.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},(t=a(t)||"string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:n(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(t.pixelRatio=r.g.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var s=document.querySelector(t.container);if(!s)throw Error("Element "+t.container+" is not found");t.container=s}a(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=o(),t.container.appendChild(t.canvas),i(t))}else if(!t.canvas){if("undefined"==typeof document)throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=o(),t.container.appendChild(t.canvas),i(t)}return t.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(e){try{t.gl=t.canvas.getContext(e,t.attrs)}catch(t){}return t.gl}),t.gl}},23120:function(t,e,r){"use strict";var n=r(49369);n.register([r(80213),r(16053),r(16696),r(56786),r(69508),r(34824),r(96858),r(8851),r(32095),r(78290),r(65738),r(24573),r(43030),r(67590),r(82706),r(70685),r(31095),r(41545),r(82339),r(13582),r(22620),r(84136),r(46165),r(82012),r(89049),r(66072),r(87629),r(37133),r(41837),r(42319),r(77497),r(1454),r(48333),r(58219),r(5675),r(3539),r(37537),r(25612),r(13621),r(40937),r(4969),r(72096),r(18599),r(71416),r(91727),r(83157),r(23251),r(65743),r(92548),r(51698),r(29930),r(83699)]),t.exports=n},23251:function(t,e,r){"use strict";t.exports=r(16212)},23255:function(t,e,r){"use strict";var n=r(33240).dot,i=r(78945).BADNUM,a=t.exports={};a.tester=function(t){var e,r=t.slice(),n=r[0][0],a=n,o=r[0][1],s=o;for(r[r.length-1][0]===r[0][0]&&r[r.length-1][1]===r[0][1]||r.push(r[0]),e=1;ea||u===i||us||e&&l(t))}:function(t,e){var l=t[0],u=t[1];if(l===i||la||u===i||us)return!1;var c,f,h,p,d,v=r.length,g=r[0][0],y=r[0][1],m=0;for(c=1;cMath.max(f,g)||u>Math.max(h,y)))if(uc||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var u=l+1;u1&&o(t.pop()),{addPt:o,raw:t,filtered:r}}},23276:function(t,e,r){"use strict";var n=r(48246),i=r(31164),a=r(99012),o=a.axisHoverFormat,s=a.descriptionOnlyNumbers,l=r(79335),u=r(30430).T,c=r(37565),f=r(8357).extendFlat,h=r(77546),p=h.COMPARISON_OPS2,d=h.INTERVAL_OPS,v=i.line;t.exports=f({z:n.z,x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:i.xperiod0,yperiod0:i.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,text:n.text,hovertext:n.hovertext,transpose:n.transpose,xtype:n.xtype,ytype:n.ytype,xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:n.hovertemplate,texttemplate:f({},n.texttemplate,{}),textfont:f({},n.textfont,{}),hoverongaps:n.hoverongaps,connectgaps:f({},n.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:c({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:s("contour label")},operation:{valType:"enumerated",values:[].concat(p).concat(d),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:f({},v.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:u,smoothing:f({},v.smoothing,{}),editType:"plot"}},l("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))},23453:function(t,e,r){"use strict";var n=r(5159),i=r(80924),a=r(66335),o=r(64433),s=r(2524).calcMarkerSize,l=r(71351);t.exports=function(t,e){var r=e._carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var u;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var c,f,h=e._length,p=new Array(h),d=!1;for(u=0;u1,b=1-f[t+"gap"],_=1-f[t+"groupgap"];for(s=0;s0){var q=E.pointpos,G=E.jitter,Y=E.marker.size/2,W=0;q+G>=0&&((W=V*(q+G))>M?(H=!0,j=Y,B=W):W>R&&(j=Y,B=M)),W<=M&&(B=M);var Z=0;q-G<=0&&((Z=-V*(q-G))>S?(H=!0,U=Y,N=Z):Z>F&&(U=Y,N=S)),Z<=S&&(N=S)}else B=M,N=S;var X=new Array(u.length);for(l=0;l=0&&"[object Array]"!==i(t)&&"callee"in t&&"[object Function]"===i(t.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,t.exports=s?a:o},23814:function(t){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},23850:function(t,e,r){"use strict";var n=r(15181),i=n._,a=r(26446),o=r(89196),s=r(78945).BADNUM;function l(t,e,r,n){return{o:t,h:e,l:r,c:n}}function u(t,e,r,o,l,u){for(var c=l.makeCalcdata(e,"open"),f=l.makeCalcdata(e,"high"),h=l.makeCalcdata(e,"low"),p=l.makeCalcdata(e,"close"),d=Array.isArray(e.text),v=Array.isArray(e.hovertext),g=!0,y=null,m=!!e.xperiodalignment,x=[],b=0;by):g=k>w,y=k;var M=u(w,T,A,k);M.pos=_,M.yc=(w+k)/2,M.i=b,M.dir=g?"increasing":"decreasing",M.x=M.pos,M.y=[A,T],m&&(M.orig_p=r[b]),d&&(M.tx=e.text[b]),v&&(M.htx=e.hovertext[b]),x.push(M)}else x.push({pos:_,empty:!0})}return e._extremes[l._id]=a.findExtremes(l,n.concat(h,f),{padded:!0}),x.length&&(x[0].t={labels:{open:i(t,"open:")+" ",high:i(t,"high:")+" ",low:i(t,"low:")+" ",close:i(t,"close:")+" "}}),x}t.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis),i=a.getFromId(t,e.yaxis),s=function(t,e,r){var i=r._minDiff;if(!i){var a,s=t._fullData,l=[];for(i=1/0,a=0;a0;)g=f.c2p(w+b*M),b--;for(b=0;void 0===m&&b0;)x=h.c2p(T+b*S),b--;gI[0];if(D||z){var R=v+E/2,F=m+L/2;P+="transform:"+a(R+"px",F+"px")+"scale("+(D?-1:1)+","+(z?-1:1)+")"+a(-R+"px",-F+"px")+";"}}C.attr("style",P);var B=new Promise(function(t){if(c._hasZ)t();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===A&&c._canvas.el.height===k&&c._canvas.source===c.source)t();else{var e=document.createElement("canvas");e.width=A,e.height=k;var r=e.getContext("2d",{willReadFrequently:!0});c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:e,source:c.source},t()},n.setAttribute("src",c.source)}}).then(function(){var t,e;if(c._hasZ)e=N(function(t,e){return _[e][t]}),t=e.toDataURL("image/png");else if(c._hasSource)if(d)t=c.source;else{var r=c._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,A,k).data;e=N(function(t,e){var n=4*(e*A+t);return[r[n],r[n+1],r[n+2],r[n+3]]}),t=e.toDataURL("image/png")}C.attr({"xlink:href":t,height:L,width:E,x:v,y:m})});t._promises.push(B)}function N(t){var e=document.createElement("canvas");e.width=E,e.height=L;var r,n=e.getContext("2d",{willReadFrequently:!0}),a=function(t){return i.constrain(Math.round(f.c2p(w+t*M)-v),0,E)},o=function(t){return i.constrain(Math.round(h.c2p(T+t*S)-m),0,L)},u=s.colormodel[c.colormodel],p=u.colormodel||c.colormodel,d=u.fmt;for(b=0;b0&&(a=!0);for(var l=0;lb[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s),"sync"===e.tickmode&&(e.tickmode="auto")}return r("layer"),e}},24418:function(t,e,r){"use strict";var n=r(23648);t.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==n.indexOf(t)}}},24438:function(t){t.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width),"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;ol&&(e.isomin=null,e.isomax=null);var u=a("x"),c=a("y"),f=a("z"),h=a("value");u&&u.length&&c&&c.length&&f&&f.length&&h&&h.length?(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach(function(t){a(t+"hoverformat");var e="caps."+t;a(e+".show")&&a(e+".fill");var r="slices."+t;a(r+".show")&&(a(r+".fill"),a(r+".locations"))}),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(t){a(t)}),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}t.exports={supplyDefaults:function(t,e,r,i){s(t,e,0,i,function(r,i){return n.coerce(t,e,a,r,i)})},supplyIsoDefaults:s}},25420:function(t,e,r){"use strict";var n=r(69562),i=function(){};t.exports=function(t){for(var e in t)"function"==typeof t[e]&&(t[e]=i);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var r=document.createElement("div");r.className="no-webgl",r.style.cursor="pointer",r.style.fontSize="24px",r.style.color=n.defaults[0],r.style.position="absolute",r.style.left=r.style.top="0px",r.style.width=r.style.height="100%",r.style["background-color"]=n.lightLine,r.style["z-index"]=30;var a=document.createElement("p");return a.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",a.style.position="relative",a.style.top="50%",a.style.left="50%",a.style.height="30%",a.style.width="50%",a.style.margin="-15% 0 0 -25%",r.appendChild(a),t.container.appendChild(r),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("https://get.webgl.org")},!1}},25441:function(t,e,r){"use strict";var n=r(15181),i=r(86877),a=r(37070),o=r(79130).z;function s(t,e){var r,s,l,u,c,f,h,p,d,v,g=e.transform,y=e.transformIndex,m=t.transforms[y].groups,x=o(t.transforms,g);if(!n.isArrayOrTypedArray(m)||0===m.length)return[t];var b=n.filterUnique(m),_=new Array(b.length),w=m.length,T=i.findArrayAttributes(t),A=g.styles||[],k={};for(r=0;r1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=o.styles=[];if(l)for(a=0;a1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=T(t,360),e=T(e,100),r=T(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(n.h,o,l),u=!0,c="hsl"),n.hasOwnProperty("a")&&(a=n.a)),a=w(a),{ok:u,format:n.format||c,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:a};var f,h,p}(i);this._originalInput=i,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=a.format||o.format,this._gradientType=a.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o.ok}function i(t,e,r){t=T(t,255),e=T(e,255),r=T(r,255);var n,i,a=Math.max(t,e,r),o=Math.min(t,e,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(e>1)+720)%360;--e;)i.h=(i.h+a)%360,o.push(n(i));return o}function x(t,e){e=e||6;for(var r=n(t).toHsv(),i=r.h,a=r.s,o=r.v,s=[],l=1/e;e--;)s.push(n({h:i,s:a,v:o})),o=(o+l)%1;return s}n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n=this.toRgb();return t=n.r/255,e=n.g/255,r=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=w(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=a(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=a(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=i(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return o(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var a=[M(Math.round(t).toString(16)),M(Math.round(e).toString(16)),M(Math.round(r).toString(16)),M(E(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*T(this._r,255))+"%",g:Math.round(100*T(this._g,255))+"%",b:Math.round(100*T(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*T(this._r,255))+"%, "+Math.round(100*T(this._g,255))+"%, "+Math.round(100*T(this._b,255))+"%)":"rgba("+Math.round(100*T(this._r,255))+"%, "+Math.round(100*T(this._g,255))+"%, "+Math.round(100*T(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(_[o(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+s(this._r,this._g,this._b,this._a),r=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=n(t);r="#"+s(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return n(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(f,arguments)},brighten:function(){return this._applyModification(h,arguments)},darken:function(){return this._applyModification(p,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(u,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(m,arguments)},complement:function(){return this._applyCombination(v,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(y,arguments)},triad:function(){return this._applyCombination(g,[3])},tetrad:function(){return this._applyCombination(g,[4])}},n.fromRatio=function(e,r){if("object"==t(e)){var i={};for(var a in e)e.hasOwnProperty(a)&&(i[a]="a"===a?e[a]:S(e[a]));e=i}return n(e,r)},n.equals=function(t,e){return!(!t||!e)&&n(t).toRgbString()==n(e).toRgbString()},n.random=function(){return n.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},n.mix=function(t,e,r){r=0===r?0:r||50;var i=n(t).toRgb(),a=n(e).toRgb(),o=r/100;return n({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},n.readability=function(t,e){var r=n(t),i=n(e);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)},n.isReadable=function(t,e,r){var i,a,o,s,l,u=n.readability(t,e);switch(a=!1,(o=r,"AA"!==(s=((o=o||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==s&&(s="AA"),"small"!==(l=(o.size||"small").toLowerCase())&&"large"!==l&&(l="small"),i={level:s,size:l}).level+i.size){case"AAsmall":case"AAAlarge":a=u>=4.5;break;case"AAlarge":a=u>=3;break;case"AAAsmall":a=u>=7}return a},n.mostReadable=function(t,e,r){var i,a,o,s,l=null,u=0;a=(r=r||{}).includeFallbackColors,o=r.level,s=r.size;for(var c=0;cu&&(u=i,l=n(e[c]));return n.isReadable(t,l,{level:o,size:s})||!a?l:(r.includeFallbackColors=!1,n.mostReadable(t,["#fff","#000"],r))};var b=n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},_=n.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(b);function w(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function T(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function A(t){return Math.min(1,Math.max(0,t))}function k(t){return parseInt(t,16)}function M(t){return 1==t.length?"0"+t:""+t}function S(t){return t<=1&&(t=100*t+"%"),t}function E(t){return Math.round(255*parseFloat(t)).toString(16)}function L(t){return k(t)/255}var C,P,O,I=(P="[\\s|\\(]+("+(C="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+C+")[,|\\s]+("+C+")\\s*\\)?",O="[\\s|\\(]+("+C+")[,|\\s]+("+C+")[,|\\s]+("+C+")[,|\\s]+("+C+")\\s*\\)?",{CSS_UNIT:new RegExp(C),rgb:new RegExp("rgb"+P),rgba:new RegExp("rgba"+O),hsl:new RegExp("hsl"+P),hsla:new RegExp("hsla"+O),hsv:new RegExp("hsv"+P),hsva:new RegExp("hsva"+O),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function D(t){return!!I.CSS_UNIT.exec(t)}return n}()},25702:function(t){t.exports=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}},25722:function(t){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},25748:function(t,e,r){"use strict";var n=r(93950).gl_streamtube3d,i=n.createTubeMesh,a=r(15181),o=r(53914).parseColorScale,s=r(44236).extractOpts,l=r(38603),u={xaxis:0,yaxis:1,zaxis:2};function c(t,e){this.scene=t,this.uid=e,this.mesh=null,this.data=null}var f=c.prototype;function h(t){var e=t.length;return e>2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function p(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function d(t,e){var r=t.fullSceneLayout,i=t.dataScale,c=e._len,f={};function d(t,e){var n=r[e],o=i[u[e]];return a.simpleMap(t,function(t){return n.d2l(t)*o})}if(f.vectors=l(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),c),!c)return{positions:[],cells:[]};var v=d(e._Xs,"xaxis"),g=d(e._Ys,"yaxis"),y=d(e._Zs,"zaxis");if(f.meshgrid=[v,g,y],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var m=g[0],x=h(v),b=h(y),_=new Array(x.length*b.length),w=0,T=0;T13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},26446:function(t,e,r){"use strict";var n=r(16534),i=r(5159),a=r(37070),o=r(46982),s=r(15181),l=s.strTranslate,u=r(3071),c=r(73396),f=r(69562),h=r(88191),p=r(94257),d=r(12203),v=r(78945),g=v.ONEMAXYEAR,y=v.ONEAVGYEAR,m=v.ONEMINYEAR,x=v.ONEMAXQUARTER,b=v.ONEAVGQUARTER,_=v.ONEMINQUARTER,w=v.ONEMAXMONTH,T=v.ONEAVGMONTH,A=v.ONEMINMONTH,k=v.ONEWEEK,M=v.ONEDAY,S=M/2,E=v.ONEHOUR,L=v.ONEMIN,C=v.ONESEC,P=v.MINUS_SIGN,O=v.BADNUM,I={K:"zeroline"},D={K:"gridline",L:"path"},z={K:"minor-gridline",L:"path"},R={K:"tick",L:"path"},F={K:"tick",L:"text"},B={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},N=r(5126),j=N.MID_SHIFT,U=N.CAP_SHIFT,V=N.LINE_SPACING,H=N.OPPOSITE_SIDE,q=t.exports={};q.setConvert=r(18687);var G=r(50446),Y=r(93003),W=Y.idSort,Z=Y.isLinked;q.id2name=Y.id2name,q.name2id=Y.name2id,q.cleanId=Y.cleanId,q.list=Y.list,q.listIds=Y.listIds,q.getFromId=Y.getFromId,q.getFromTrace=Y.getFromTrace;var X=r(40243);function J(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}q.getAutoRange=X.getAutoRange,q.findExtremes=X.findExtremes,q.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map(function(t){return t+" domain"})),c[u]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,c,u)},q.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},q.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==q.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var u=q.getFromId(e,n);l=r(i,a=u.fraction2r(a)),o=u.cleanPos}t[i]=o(l)},q.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:q.getFromId(e,r).cleanPos)(t)},q.redrawComponents=function(t,e){e=e||q.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),u={},c=0;cr&&f2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},q.saveRangeInitial=function(t,e){for(var r=q.list(t,"",!0),n=!1,i=0;i.3*h||c(n)||c(a))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=q.tickIncrement(t,"M6","reverse")+1.5*M:a.exactMonths>.8?t=q.tickIncrement(t,"M1","reverse")+15.5*M:t-=S;var l=q.tickIncrement(t,r);if(l<=n)return l}return t}(m,t,y,u,a)),g=m;g<=c;)g=q.tickIncrement(g,y,!1,a);return{start:e.c2r(m,0,a),end:e.c2r(g,0,a),size:y,_dataSpan:c-u}},q.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,a=e.dtick&&i(e._tmin);if(a){var o=q.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*o+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,q.prepTicks(t,r),a){var u=i(e.dtick),c=i(t.dtick),f=u?e.dtick:+e.dtick.substring(1),h=c?t.dtick:+t.dtick.substring(1);u&&c?tt(f,h)?f===2*k&&h===2*M&&(t.dtick=k):f===2*k&&h===3*M?t.dtick=k:f!==k||(e._input.minor||{}).nticks?et(f/h,2.5)?t.dtick=f/2:t.dtick=f:t.dtick=M:"M"===String(e.dtick).charAt(0)?c?t.dtick="M1":tt(f,h)?f>=12&&2===h&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?tt(f,h)||(t.dtick=et(f/h,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},q.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,q.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=q.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=E,o&&!n&&t.dtick=(I?0:1);D--){var z=!D;D?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var R=D?t:s.extendFlat({},t,t.minor);if(z?q.prepMinorTicks(R,t,e):q.prepTicks(R,e),"array"!==R.tickmode)if("sync"!==R.tickmode){var F=J(c),B=F[0],N=F[1],j=i(R.dtick),U="log"===a&&!(j||"L"===R.dtick.charAt(0)),V=q.tickFirst(R,e);if(D){if(t._tmin=V,V=N:W<=N;W=q.tickIncrement(W,Z,f,o)){if(D&&H++,R.rangebreaks&&!f){if(W=p)break}if(C.length>d||W===Y)break;Y=W;var X={value:W};D?(U&&W!==(0|W)&&(X.simpleLabel=!0),l>1&&H%l&&(X.skipLabel=!0),C.push(X)):(X.minor=!0,P.push(X))}}else C=[],v=it(t);else D?(C=[],v=at(t)):(P=[],L=at(t))}if(I&&!("inside"===t.minor.ticks&&"outside"===t.ticks||"outside"===t.minor.ticks&&"inside"===t.ticks)){for(var K=C.map(function(t){return t.value}),$=[],Q=0;Q0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,u=t[o].value,c=Math.abs(u-l),f=r||c,h=0;f>=m?h=c>=m&&c<=g?c:y:r===b&&f>=_?h=c>=_&&c<=x?c:b:f>=A?h=c>=A&&c<=w?c:T:r===k&&f>=k?h=k:f>=M?h=M:r===S&&f>=S?h=S:r===E&&f>=E&&(h=E),h>=c&&(h=c,s=!0);var p=i+h;if(e.rangebreaks&&h>0){for(var d=0,v=0;v<84;v++){var L=(v+.5)/84;e.maskBreaks(i*(1-L)+L*p)!==O&&d++}(h*=d/84)||(t[n].drop=!0),s&&c>k&&(h=c)}(h>0||0===n)&&(t[n].periodX=i+h/2)}}(C,t,t._definedDelta),t.rangebreaks){var ot="y"===t._id.charAt(0),st=1;"auto"===t.tickmode&&(st=t.tickfont?t.tickfont.size:12);var lt=NaN;for(r=C.length-1;r>-1;r--)if(C[r].drop)C.splice(r,1);else{C[r].value=Dt(C[r].value,t);var ut=t.c2p(C[r].value);(ot?lt>ut-st:ltp||ftp&&(ct.periodX=p),ft10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=M&&a<=10||e>=15*M)t._tickround="d";else if(e>=L&&a<=16||e>=E)t._tickround="M";else if(e>=C&&a<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===t.minexponent?3:t.minexponent;Math.abs(u)>c&&(yt(t.exponentformat)&&!mt(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function vt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}q.autoTicks=function(t,e,r){var n;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var o=2*e;if(o>y)e/=y,n=a(10),t.dtick="M"+12*pt(e,n,ot);else if(o>T)e/=T,t.dtick="M"+pt(e,1,st);else if(o>M){if(t.dtick=pt(e,M,t._hasDayOfWeekBreaks?[1,2,7,14]:ut),!r){var l=q.getTickFormat(t),u="period"===t.ticklabelmode;u&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),u&&(t._dowTick0=t.tick0)}}else o>E?t.dtick=pt(e,E,st):o>L?t.dtick=pt(e,L,lt):o>C?t.dtick=pt(e,C,lt):(n=a(10),t.dtick=pt(e,n,ot))}else if("log"===t.type){t.tick0=0;var c=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(c[1]-c[0])<1){var f=1.5*Math.abs((c[1]-c[0])/e);e=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/f,n=a(10),t.dtick="L"+pt(e,n,ot)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):It(t)?(t.tick0=0,n=1,t.dtick=pt(e,n,ht)):(t.tick0=0,n=a(10),t.dtick=pt(e,n,ot));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var h=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(h)}},q.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,a);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?ft:ct,f=t+.01*o,h=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},q.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1] ")}else t._prevDateHead=l,u+="
"+l;e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,a){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);if("never"===a&&(a=""),n&&"L"!==c&&(o="L3",c="L"),u||"L"===c)e.text=xt(Math.pow(10,l),t,a,n);else if(i(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),p=t.exponentformat;"power"===p||yt(p)&&mt(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":P)+h+"",e.fontSize*=1.25):("e"===p||"E"===p)&&h>2?e.text="1"+p+(f>0?"+":P)+h:(e.text=xt(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,u,v):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):It(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=xt(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=xt(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="π":e.text=o[0]+"π":e.text=["",o[0],"","⁄","",o[1],"","π"].join(""),l&&(e.text=P+e.text)}}}}(t,o,r,u,v):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=xt(e.x,t,i,n)}(t,o,0,u,v),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),t.labelalias&&t.labelalias.hasOwnProperty(o.text)){var g=t.labelalias[o.text];"string"==typeof g&&(o.text=g)}if("boundaries"===t.tickson||t.showdividers){var y=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[y(o.x-.5),y(o.x+t.dtick-.5)]}return o},q.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return q.hoverLabelText(t,n,r)+" - "+q.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,o=q.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":P+o:o};var gt=["f","p","n","μ","m","","k","M","G","T"];function yt(t){return"SI"===t||"B"===t}function mt(t){return t>14||t<-15}function xt(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=q.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};dt(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,P);var p,d=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+p+"":"B"===l&&9===u?t+="B":yt(l)&&(t+=gt[u/3+5])),a?P+t:t}function bt(t,e){if(t){var r=Object.keys(B).reduce(function(t,r){return-1!==e.indexOf(r)&&B[r].forEach(function(e){t[e]=1}),t},{});Object.keys(t).forEach(function(e){r[e]||(1===e.length?t[e]=0:delete t[e])})}}function _t(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=n(t))}function s(t,e){var r=null===e[0],n=null===e[1],i=a(t,e[0])>=0,o=a(t,e[1])<=0;return(r||i)&&(n||o)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=0&&i.unshift(i.splice(n,1).shift())}});var o={false:{left:0,right:0}};return s.syncOrAsync(i.map(function(e){return function(){if(e){var n=q.getFromId(t,e);r||(r={}),r.axShifts=o,r.overlayingShiftedAx=a;var i=q.drawOne(t,n,r);return n._shiftPusher&&Ft(n,n._fullDepth||0,o,!0),n._r=n.range.slice(),n._rl=s.simpleMap(n._r,n.r2l),i}}}))},q.drawOne=function(t,e,r){var n,i,l,u=(r=r||{}).axShifts||{},p=r.overlayingShiftedAx||[];e.setScale();var d=t._fullLayout,v=e._id,g=v.charAt(0),y=q.counterLetter(v),m=d._plots[e._mainSubplot];if(m){if(e._shiftPusher=e.autoshift||-1!==p.indexOf(e._id)||-1!==p.indexOf(e.overlaying),e._shiftPusher&"free"===e.anchor){var x=e.linewidth/2||0;"inside"===e.ticks&&(x+=e.ticklen),Ft(e,x,u,!0),Ft(e,e.shift||0,u,!1)}!0===r.skipTitle&&void 0!==e._shift||(e._shift=function(t,e){return t.autoshift?e[t.overlaying][t.side]:t.shift||0}(e,u));var b=m[g+"axislayer"],_=e._mainLinePosition,w=_+=e._shift,T=e._mainMirrorPosition,A=e._vals=q.calcTicks(e),k=[e.mirror,w,T].join("_");for(n=0;n0?r.bottom-c:0,f))));var h=0,p=0;if(e._shiftPusher&&(h=Math.max(f,r.height>0?"l"===l?c-r.left:r.right-c:0),e.title.text!==d._dfltTitle[g]&&(p=(e._titleStandoff||0)+(e._titleScoot||0),"l"===l&&(p+=At(e))),e._fullDepth=Math.max(h,p)),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var v=[0,1],m="number"==typeof e._shift?e._shift:0;if("x"===g){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?c-r.top:0,f),v.reverse()),r.width>0){var x=r.right-(e._offset+e._length);x>0&&(n.xr=1,n.r=x);var b=e._offset-r.left;b>0&&(n.xl=0,n.l=b)}}else if("l"===l?(e._depth=Math.max(r.height>0?c-r.left:0,f),n[l]=e._depth-m):(e._depth=Math.max(r.height>0?r.right-c:0,f),n[l]=e._depth+m,v.reverse()),r.height>0){var _=r.bottom-(e._offset+e._length);_>0&&(n.yb=0,n.b=_);var w=e._offset-r.top;w>0&&(n.yt=1,n.t=w)}n[y]="free"===e.anchor?e.position:e._anchorAxis.domain[v[0]],e.title.text!==d._dfltTitle[g]&&(n[l]+=At(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=f),!0===e.mirror||"ticks"===e.mirror?i[y]=e._anchorAxis.domain[v[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[y]=[e._counterDomainMin,e._counterDomainMax][v[1]]))}lt&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(bt(n,e.automargin),bt(i,e.automargin)),a.autoMargin(t,St(e),n),a.autoMargin(t,Et(e),i),a.autoMargin(t,Lt(e),s)}),s.syncOrAsync(ot)}}function ut(t){var r=v+(t||"tick");return M[r]||(M[r]=function(t,e){var r,n,i,a;return t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each(function(){var t=Mt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)})):(r=0,n=0,i=0,a=0),{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),M[r]}},q.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map(function(t){return-t})),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},q.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},q.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var u=t.side,c=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;return(o||n)&&(c+=h*U,f+=(t.linewidth||0)/2),(i||a)&&(c+=(t.linewidth||0)/2,f+=3),s&&"top"===u&&(f-=h*(1-U)),(i||n)&&(c=-c),"bottom"!==u&&"right"!==u||(f=-f),[l?c:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(wt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(wt(e)))}},q.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},q.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),u=a("right"),c=a("bottom")||l||o||u,f=a("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,p=0,d=0,v=h?t.ticklen:0;if(f?v*=-1:c&&(v=0),h&&(p+=v,r)){var g=s.deg2rad(r);p=v*Math.cos(g)+1,d=v*Math.sin(g)}t.showticklabels&&(h||t.showline)&&(p+=.2*t.tickfont.size);var y,m,x,b,_,w={labelStandoff:p+=(t.linewidth||1)/2*(f?-1:1),labelShift:d},T=0,A=t.side,k=t._id.charAt(0),M=t.tickangle;if("x"===k)b=(_=!f&&"bottom"===A||f&&"top"===A)?1:-1,f&&(b*=-1),y=d*b,m=e+p*b,x=_?1:-.2,90===Math.abs(M)&&(f?x+=j:x=-90===M&&"bottom"===A?U:90===M&&"top"===A?j:.5,T=j/2*(M/90)),w.xFn=function(t){return t.dx+y+T*t.fontSize},w.yFn=function(t){return t.dy+m+t.fontSize*x},w.anchorFn=function(t,e){if(c){if(l)return"end";if(u)return"start"}return i(e)&&0!==e&&180!==e?e*b<0!==f?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==f?-n:0};else if("y"===k){if(b=(_=!f&&"left"===A||f&&"right"===A)?1:-1,f&&(b*=-1),y=p,m=d*b,x=0,f||90!==Math.abs(M)||(x=-90===M&&"left"===A||90===M&&"right"===A?U:.5),f){var S=i(M)?+M:0;if(0!==S){var E=s.deg2rad(S);T=Math.abs(Math.sin(E))*U*b,x=0}}w.xFn=function(t){return t.dx+e-(y+t.fontSize*x)*b+T*t.fontSize},w.yFn=function(t){return t.dy+m+t.fontSize*j},w.anchorFn=function(t,e){return i(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},q.drawTicks=function(t,e,r){r=r||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?r.vals.filter(function(t){return t.minor&&!t.noTick}):[]).concat(e.ticks?r.vals.filter(function(t){return!t.minor&&!t.noTick}):[]),o=r.layer.selectAll("path."+i).data(a,Tt);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each(function(t){return f.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)}).style("stroke-width",function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"}).attr("d",r.path).style("display",null),Rt(e,[R]),o.attr("transform",r.transFn)},q.drawGrid=function(t,e,r){if(r=r||{},"sync"!==e.tickmode){var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?r.vals.filter(function(t){return t.minor}):[],s=e.showgrid?r.vals.filter(function(t){return!t.minor}):[],l=r.counterAxis;if(l&&q.shouldShowZeroLine(t,e,l))for(var u="array"===e.tickmode,c=0;c=0;y--){var m=y?v:g;if(m){var x=m.selectAll("path."+i).data(y?s:o,Tt);x.exit().remove(),x.enter().append("path").classed(i,1).classed("crisp",!1!==r.crisp),x.attr("transform",r.transFn).attr("d",r.path).each(function(t){return f.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")}).style("stroke-dasharray",function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)}).style("stroke-width",function(t){return(t.minor?d:e._gw)+"px"}).style("display",null),"function"==typeof r.path&&x.attr("d",r.path)}}Rt(e,[D,z])}},q.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=q.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each(function(){r.layer.selectAll("path").sort(function(t,e){return W(t.id,e.id)})}),a.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.zerolinecolor||f.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),Rt(e,[I])},q.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,o=e._id,c=o.charAt(0),f=r.cls||o+"tick",p=r.vals.filter(function(t){return t.text}),d=r.labelFns,v=r.secondary?0:e.tickangle,g=(e._prevTickAngles||{})[f],y=r.layer.selectAll("g."+f).data(e.showticklabels?p:[],Tt),m=[];function x(t,a){t.each(function(t){var o=n.select(this),s=o.select(".text-math-group"),c=d.anchorFn(t,a),f=r.transFn.call(o.node(),t)+(i(a)&&0!==+a?" rotate("+a+","+d.xFn(t)+","+(d.yFn(t)-t.fontSize/2)+")":""),p=u.lineCount(o),v=V*t.fontSize,g=d.heightFn(t,i(a)?+a:0,(p-1)*v);if(g&&(f+=l(0,g)),s.empty()){var y=o.select("text");y.attr({transform:f,"text-anchor":c}),y.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var m=h.bBox(s.node()).width*{end:-.5,start:.5}[c];s.attr("transform",f+l(m,0))}})}y.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each(function(e){var r=n.select(this),i=t._promises.length;r.call(u.positionText,d.xFn(e),d.yFn(e)).call(h.font,e.font,e.fontSize,e.fontColor).text(e.text).call(u.convertToTspans,t),t._promises[i]?m.push(t._promises.pop().then(function(){x(r,v)})):x(r,v)}),Rt(e,[F]),y.exit().remove(),r.repositionOnUpdate&&y.each(function(t){n.select(this).select("text").call(u.positionText,d.xFn(t),d.yFn(t))}),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&"allow"!==r){var i=-1!==r.indexOf("hide"),o="x"===e._id.charAt(0),l=0,u=o?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf("domain")){var c=s.simpleMap(e.range,e.r2l);l=e.l2p(c[0])+e._offset,u=e.l2p(c[1])+e._offset}var f=Math.min(l,u),p=Math.max(l,u),d=e.side,v=1/0,g=-1/0;for(var m in y.each(function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=h.bBox(r.node()),s=0;o?(a.right>p||a.leftp||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)})})})})},x(y,g+1?g:v);var b=null;e._selections&&(e._selections[f]=y);var _=[function(){return m.length&&Promise.all(m)}];e.automargin&&a._redrawFromAutoMarginCount&&90===g?(b=90,_.push(function(){x(y,g)})):_.push(function(){if(x(y,v),p.length&&"x"===c&&!i(v)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){b=0;var t,n=0,a=[];if(y.each(function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=Mt(this),o=h.bBox(i.node());a.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})}),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=p.length,l=Math.abs((p[o-1].x-p[0].x)*e._m)/(o-1),u=e.ticklabelposition||"",f=function(t){return-1!==u.indexOf(t)},d=f("top"),g=f("left"),m=f("right"),_=f("bottom")||g||d||m?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type||"realaxis"===e._name;for(t=0;t1)for(n=1;n=u&&(m.marker.cluster=d.tree),m.marker&&(m.markerSel.positions=m.markerUnsel.positions=m.marker.positions=_),m.line&&_.length>1&&l.extendFlat(m.line,s.linePositions(t,p,_)),m.text&&(l.extendFlat(m.text,{positions:_},s.textPosition(t,p,m.text,m.marker)),l.extendFlat(m.textSel,{positions:_},s.textPosition(t,p,m.text,m.markerSel)),l.extendFlat(m.textUnsel,{positions:_},s.textPosition(t,p,m.text,m.markerUnsel))),m.fill&&!h.fill2d&&(h.fill2d=!0),m.marker&&!h.scatter2d&&(h.scatter2d=!0),m.line&&!h.line2d&&(h.line2d=!0),m.text&&!h.glText&&(h.glText=!0),h.lineOptions.push(m.line),h.fillOptions.push(m.fill),h.markerOptions.push(m.marker),h.markerSelectedOptions.push(m.markerSel),h.markerUnselectedOptions.push(m.markerUnsel),h.textOptions.push(m.text),h.textSelectedOptions.push(m.textSel),h.textUnselectedOptions.push(m.textUnsel),h.selectBatch.push([]),h.unselectBatch.push([]),d.x=w,d.y=T,d.rawx=w,d.rawy=T,d.r=g,d.theta=y,d.positions=_,d._scene=h,d.index=h.count,h.count++}}),a(t,e,r)}},t.exports.reglPrecompiled={}},27050:function(t,e,r){"use strict";var n=r(5159),i=r(15181).isArrayOrTypedArray,a=r(78945).BADNUM,o=r(46982),s=r(26446),l=r(3115).getAxisGroup,u=r(35628);function c(t,e,r,o,c){if(o.length){var b,_,w,T;switch(function(t,e){var r,a;for(r=0;rf+u||!n(c))}for(var p=0;p0;u&&(o="array");var c=r("categoryorder",o);"array"===c?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),u||"array"!==c||(e.categoryorder="trace")}}t.exports=function(t,e,r,f){function h(r,i){return n.coerce(t,e,l,r,i)}var p=s(t,e,{name:"dimensions",handleItemDefaults:c}),d=function(t,e,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,f,h);o(e,f,h),Array.isArray(p)&&p.length||(e.visible=!1),u(e,p,"values",d),h("hoveron"),h("hovertemplate"),h("arrangement"),h("bundlecolors"),h("sortpaths"),h("counts");var v={family:f.font.family,size:Math.round(f.font.size),color:f.font.color};n.coerceFont(h,"labelfont",v);var g={family:f.font.family,size:Math.round(f.font.size/1.2),color:f.font.color};n.coerceFont(h,"tickfont",g)}},27199:function(t,e,r){"use strict";var n=r(46982),i=r(98379);t.exports=function(t,e,r){var a,o,s=e._inHover,l=i.isGrouped(e),u=i.isReversed(e),c={},f=[],h=!1,p={},d=0,v=0;function g(t,n,a){if(!1!==e.visible&&(!r||t===e._id))if(""!==n&&i.isGrouped(e))-1===f.indexOf(n)?(f.push(n),h=!0,c[n]=[a]):c[n].push(a);else{var o="~~i"+d;f.push(o),c[o]=[a],d++}}for(a=0;aS&&(M=S)}A[a][0]._groupMinRank=M,A[a][0]._preGroupSort=a}var E=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(A.forEach(function(t,e){t[0]._preGroupSort=e}),A.sort(function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort}),a=0;a0)return function(t){if(!((t=String(t)).length>100)){var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(a){var o=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*n;case"minutes":case"minute":case"mins":case"min":case"m":return o*r;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(t);if("number"===l&&!1===isNaN(t))return o.long?a(s=t,i,"day")||a(s,n,"hour")||a(s,r,"minute")||a(s,e,"second")||s+" ms":function(t){return t>=i?Math.round(t/i)+"d":t>=n?Math.round(t/n)+"h":t>=r?Math.round(t/r)+"m":t>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},28209:function(t,e,r){"use strict";var n=r(37565),i=r(92204);t.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:n({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:i.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},transforms:{_isLinkedToArray:"transform",editType:"calc"},uirevision:{valType:"any",editType:"none"}}},28229:function(t,e,r){"use strict";var n=r(15181).strTranslate;function i(t,e){switch(t.type){case"log":return t.p2d(e);case"date":return t.p2r(e,0,t.calendar);default:return t.p2r(e)}}t.exports={p2r:i,r2p:function(t,e){switch(t.type){case"log":return t.d2p(e);case"date":return t.r2p(e,0,t.calendar);default:return t.r2p(e)}},axValue:function(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return i(t,r[e])}},getTransform:function(t){return n(t.xaxis._offset,t.yaxis._offset)}}},28315:function(t,e,r){"use strict";var n=r(15181),i=r(69562);t.exports=function(t,e,r,a){a("opacity");var o=a("bgcolor"),s=a("bordercolor"),l=i.opacity(s);a("borderpad");var u=a("borderwidth"),c=a("showarrow");if(a("text",c?" ":r._dfltTitle.annotation),a("textangle"),n.coerceFont(a,"font",r.font),a("width"),a("align"),a("height")&&a("valign"),c){var f,h,p=a("arrowside");-1!==p.indexOf("end")&&(f=a("arrowhead"),h=a("arrowsize")),-1!==p.indexOf("start")&&(a("startarrowhead",f),a("startarrowsize",h)),a("arrowcolor",l?e.bordercolor:i.defaultLine),a("arrowwidth",2*(l&&u||1)),a("standoff"),a("startstandoff")}var d=a("hovertext"),v=r.hoverlabel||{};if(d){var g=a("hoverlabel.bgcolor",v.bgcolor||(i.opacity(o)?i.rgb(o):i.defaultLine)),y=a("hoverlabel.bordercolor",v.bordercolor||i.contrast(g));n.coerceFont(a,"hoverlabel.font",{family:v.font.family,size:v.font.size,color:v.font.color||y})}a("captureevents",!!d)}},28369:function(t,e,r){"use strict";t.exports=function(t){for(var e,r=[],o=0,s=0,l=0,u=0,c=null,f=null,h=0,p=0,d=0,v=t.length;d4?(o=g[g.length-4],s=g[g.length-3]):(o=h,s=p),r.push(g)}return r};var n=r(639);function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},28398:function(t,e,r){"use strict";var n=r(71959);t.exports=Function.prototype.bind||n},28418:function(t,e,r){"use strict";var n=r(15181);t.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){return n.isPlainObject(t.marker)&&n.isArrayOrTypedArray(t.marker.size)}}},28480:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},28600:function(t){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},28730:function(t){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},28821:function(t,e,r){t.exports={create:r(52533),clone:r(50040),copy:r(83680),identity:r(72123),transpose:r(25702),invert:r(18049),adjoint:r(53926),determinant:r(58978),multiply:r(59129),translate:r(72115),scale:r(38011),rotate:r(82734),rotateX:r(72804),rotateY:r(78475),rotateZ:r(28846),fromRotation:r(53063),fromRotationTranslation:r(69480),fromScaling:r(3144),fromTranslation:r(4630),fromXRotation:r(32811),fromYRotation:r(52664),fromZRotation:r(99721),fromQuat:r(84538),frustum:r(42227),perspective:r(69027),perspectiveFromFieldOfView:r(5395),ortho:r(92311),lookAt:r(92983),str:r(86762)}},28845:function(t,e,r){"use strict";var n=r(3658);t.exports=function(t,e,r){var i=t.i;return"x"in t||(t.x=e._x[i]),"y"in t||(t.y=e._y[i]),n(t,e,r)}},28846:function(t){t.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+f*n,t[3]=l*i+h*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=f*i-s*n,t[7]=h*i-l*n,t}},28905:function(t,e,r){"use strict";var n=r(6537),i=r(76252),a=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;t.exports=function(t,e){return function(r,u){var c,f=arguments[2],h=arguments[3];return r=Object(i(r)),n(u),c=s(r),h&&c.sort("function"==typeof h?a.call(h,r):void 0),"function"!=typeof t&&(t=c[t]),o.call(t,c,function(t,n){return l.call(r,t)?o.call(u,f,r[t],t,r,n):e})}}},28967:function(t,e,r){"use strict";t.exports={attributes:r(35734),supplyDefaults:r(27585),calc:r(14994),colorbar:{min:"cmin",max:"cmax"},plot:r(52512),moduleType:"trace",name:"mesh3d",basePlotModule:r(41267),categories:["gl3d","showLegend"],meta:{}}},28996:function(t,e,r){"use strict";var n=r(79647);t.exports=o;var i=96;function a(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*o(r[1],t)}function o(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=a(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return a(e,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}},29076:function(t,e,r){"use strict";var n=r(15181).isArrayOrTypedArray;t.exports=function(t,e,r){var i;for(n(t)?t.length>e.length&&(t=t.slice(0,e.length)):t=[],i=0;i1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},29181:function(t,e,r){"use strict";r.d(e,{A:function(){return o}});var n=r(39913),i=r(18901);function a(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function o(t,e,r,o,l){var u,c,f=[],h=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r,o=t[0],s=t[e];if((0,n.A)(o,s)){if(!o[2]&&!s[2]){for(l.lineStart(),u=0;u=0;--u)l.point((d=p[u])[0],d[1]);else o(g.x,g.p.x,-1,l);g=g.p}p=(g=g.o).z,y=!y}while(!g.v);l.lineEnd()}}}function s(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var a in i){var o=a.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,i[a])}},29278:function(t,e,r){"use strict";var n=r(90778).counter;t.exports={idRegex:{x:n("x","( domain)?"),y:n("y","( domain)?")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},29332:function(t,e,r){"use strict";var n=r(55581),i=r(15181),a=i.strTranslate,o=i.strScale,s=r(60609).fX,l=r(60432),u=r(16534),c=r(88191),f=r(3071),h=r(10893),p="mapbox",d=e.constants=r(14617);function v(t){return"string"==typeof t&&(-1!==d.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}e.name=p,e.attr="subplot",e.idRoot=p,e.idRegex=e.attrRegex=i.counterRegex(p),e.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},e.layoutAttributes=r(75958),e.supplyLayoutDefaults=r(82881),e.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=e._subplots[p];if(n.version!==d.requiredVersion)throw new Error(d.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],a=[],o=!1,s=!1,l=0;l1&&i.warn(d.multipleTokensErrorMsg),n[0]):(a.length&&i.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,a);n.accessToken=o;for(var l=0;lw/2){var T=m.split("|").join("
");b.text(T).attr("data-unformatted",T).call(f.convertToTspans,t),_=c.bBox(b.node())}b.attr("transform",a(-3,8-_.height)),x.insert("rect",".static-attribution").attr({x:-_.width-6,y:-_.height-3,width:_.width+6,height:_.height+3,fill:"rgba(255, 255, 255, 0.75)"});var A=1;_.width+6>w&&(A=w/(_.width+6));var k=[n.l+n.w*h.x[1],n.t+n.h*(1-h.y[0])];x.attr("transform",a(k[0],k[1])+o(A))}},e.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[p],n=0;n0?os)&&(o+=i*a.FA));for(var h,p=o;i>0?p>s:p0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=o.length,u=c,console&&console.warn&&console.warn(u)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function h(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)n(l,this,e);else{var u=l.length,c=d(l,u);for(r=0;r=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return h(this,t,!0)},a.prototype.rawListeners=function(t){return h(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},30140:function(t,e,r){"use strict";var n=r(15181),i=r(26446),a=r(46716),o=r(81403),s=r(53812);function l(t,e,r){function a(r,i){return n.coerce(t,e,o,r,i)}var l=a("path"),u="path"!==a("type",l?"path":"rect");u&&delete e.path,a("opacity"),a("line.color"),a("line.width"),a("line.dash");for(var c=["x","y"],f=0;f<2;f++){var h,p,d,v=c[f],g={_fullLayout:r},y=i.coerceRef(t,e,g,v);if((h=i.getFromId(g,y))._selectionIndices.push(e._index),d=s.rangeToShapePosition(h),p=s.shapePositionToRange(h),u){var m=v+"0",x=v+"1",b=t[m],_=t[x];t[m]=p(t[m],!0),t[x]=p(t[x],!0),i.coercePosition(e,g,a,y,m),i.coercePosition(e,g,a,y,x);var w=e[m],T=e[x];void 0!==w&&void 0!==T&&(e[m]=d(w),e[x]=d(T),t[m]=b,t[x]=_)}}u&&n.noneOrAll(t,e,["x0","x1","y0","y1"])}t.exports=function(t,e){a(t,e,{name:"selections",handleItemDefaults:l});for(var r=e.selections,n=0;n0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}t.exports=function(t){return new M(t)},S.plot=function(t,e,r,n){var i=this;if(n)return i.update(t,e,!0);i._geoCalcData=t,i._fullLayout=e;var a=e[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var u=!1,c=0;c0&&o._module.calcGeoJSON(a,e)}if(!r){if(this.updateProjection(t,e))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(e,n),this.updateDims(e,n),this.updateFx(e,n),d.generalUpdatePerTraceModule(this.graphDiv,this,t,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},S.updateProjection=function(t,e){var r=this.graphDiv,n=e[this.id],l=e._size,c=n.domain,f=n.projection,h=n.lonaxis,p=n.lataxis,d=h._ax,v=p._ax,y=this.projection=function(t){var e=t.projection,r=e.type,n=w.projNames[r];n="geo"+u.titleCase(n);for(var l=(i[n]||s[n])(),c=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,f=["center","rotate","parallels","clipExtent"],h=function(t){return t?l:[]},p=0;pc*Math.PI/180}return!1},l.getPath=function(){return a().projection(l)},l.getBounds=function(t){return l.getPath().bounds(t)},l.precision(w.precision),t._isSatellite&&l.tilt(e.tilt).distance(e.distance),c&&l.clipAngle(c-w.clipPad),l}(n),m=[[l.l+l.w*c.x[0],l.t+l.h*(1-c.y[1])],[l.l+l.w*c.x[1],l.t+l.h*(1-c.y[0])]],x=n.center||{},b=f.rotation||{},_=h.range||[],T=p.range||[];if(n.fitbounds){d._length=m[1][0]-m[0][0],v._length=m[1][1]-m[0][1],d.range=g(r,d),v.range=g(r,v);var A=(d.range[0]+d.range[1])/2,k=(v.range[0]+v.range[1])/2;if(n._isScoped)x={lon:A,lat:k};else if(n._isClipped){x={lon:A,lat:k},b={lon:A,lat:k,roll:b.roll};var M=f.type,S=w.lonaxisSpan[M]/2||180,L=w.lataxisSpan[M]/2||90;_=[A-S,A+S],T=[k-L,k+L]}else x={lon:A,lat:k},b={lon:A,lat:b.lat,roll:b.roll}}y.center([x.lon-b.lon,x.lat-b.lat]).rotate([-b.lon,-b.lat,b.roll]).parallels(f.parallels);var C=E(_,T);y.fitExtent(m,C);var P=this.bounds=y.getBounds(C),O=this.fitScale=y.scale(),I=y.translate();if(n.fitbounds){var D=y.getBounds(E(d.range,v.range)),z=Math.min((P[1][0]-P[0][0])/(D[1][0]-D[0][0]),(P[1][1]-P[0][1])/(D[1][1]-D[0][1]));isFinite(z)?y.scale(z*O):u.warn("Something went wrong during"+this.id+"fitbounds computations.")}else y.scale(f.scale*O);var R=this.midPt=[(P[0][0]+P[1][0])/2,(P[0][1]+P[1][1])/2];if(y.translate([I[0]+(R[0]-I[0]),I[1]+(R[1]-I[1])]).clipExtent(P),n._isAlbersUsa){var F=y([x.lon,x.lat]),B=y.translate();y.translate([B[0]-(F[0]-B[0]),B[1]-(F[1]-B[1])])}},S.updateBaseLayers=function(t,e){var r=this,i=r.topojson,a=r.layers,o=r.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return Boolean(w.lineLayers[t])}function u(t){return Boolean(w.fillLayers[t])}var c=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter(function(t){return l(t)||u(t)?e["show"+t]:!s(t)||e[t].showgrid}),p=r.framework.selectAll(".layer").data(c,String);p.exit().each(function(t){delete a[t],delete o[t],n.select(this).remove()}),p.enter().append("g").attr("class",function(t){return"layer "+t}).each(function(t){var e=a[t]=n.select(this);"bg"===t?r.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):u(t)&&(o[t]=e.append("path").style("stroke","none"))}),p.order(),p.each(function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||u(r)?n.datum(k(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=e[t],s=w.scopeDefaults[e.scope];"lonaxis"===t?(n=s.lonaxisRange,i=s.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=s.lataxisRange,i=s.lonaxisRange,a=function(t,e){return[e,t]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};v.setConvert(l,r);var u=v.calcTicks(l);e.isScoped||"lonaxis"!==t||u.pop();for(var c=u.length,f=new Array(c),h=0;h-1&&b(n.event,i,[r.xaxis],[r.yaxis],r.id,c),s.indexOf("event")>-1&&p.click(i,n.event))})}function f(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},S.makeFramework=function(){var t=this,e=t.graphDiv,r=e._fullLayout,i="clip"+r._uid+t.id;t.clipDef=r._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(h.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},v.setConvert(t.mockAxis,r)},S.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,i=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},u.extendFlat(this.viewInitial,e)},S.render=function(t){this._hasMarkerAngles&&t?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},S._render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?c(r[0],r[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",function(t){return r(t.geojson)});for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}},30392:function(t,e,r){"use strict";var n,i=r(52237),a=r(84879),o=r(90137),s=r(67141),l=r(36434),u=r(78920),c=Function.prototype.bind,f=Object.defineProperty,h=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,i=a(e)&&o(e.value);return delete(n=s(e)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,t)?i:(e.value=c.call(i,r.resolveContext?r.resolveContext(this):this),f(this,t,e),this[t])},n},t.exports=function(t){var e=l(arguments[1]);return i(e.resolveContext)&&o(e.resolveContext),u(t,function(t,r){return n(r,t,e)})}},30430:function(t,e){"use strict";e.T={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},e.k={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},30677:function(t,e,r){"use strict";var n=t.exports={},i=r(21057).locationmodeToLayer,a=r(98409).N4;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},30723:function(t,e,r){"use strict";var n=r(78030),i=r(10017),a=n("RegExp.prototype.exec"),o=r(46169);t.exports=function(t){if(!i(t))throw new o("`regex` must be a RegExp");return function(e){return null!==a(t,e)}}},30764:function(t){"use strict";function e(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function r(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function n(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function i(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function a(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}t.exports={ge:function(t,r,n,i,a){return o(t,r,n,i,a,e)},gt:function(t,e,n,i,a){return o(t,e,n,i,a,r)},lt:function(t,e,r,i,a){return o(t,e,r,i,a,n)},le:function(t,e,r,n,a){return o(t,e,r,n,a,i)},eq:function(t,e,r,n,i){return o(t,e,r,n,i,a)}}},30792:function(t,e,r){"use strict";var n=r(15181),i=r(68047);t.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||u(this),i("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=o}function f(t,e){n(!this._parserCallback,'there is already a "callback" set!'),n(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||u(this),i("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=s}function h(t,e){n(!this._parserCallback,'There is already a "callback" set!'),n(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||u(this),i("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=l}function p(t,e,r){this._parserInit||u(this),i("write(%o bytes)",t.length),"function"==typeof e&&(r=e),g(this,t,null,r)}function d(t,e,r){this._parserInit||u(this),i("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),g(this,t,e,r)}function v(t,e,r,n){if(t._parserBytesLeft-=e.length,i("%o bytes left for stream piece",t._parserBytesLeft),t._parserState===o?(t._parserBuffers.push(e),t._parserBuffered+=e.length):t._parserState===l&&r(e),0!==t._parserBytesLeft)return n;var s=t._parserCallback;if(s&&t._parserState===o&&t._parserBuffers.length>1&&(e=Buffer.concat(t._parserBuffers,t._parserBuffered)),t._parserState!==o&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=a,t._parserBuffers.splice(0),s){var u=[];e&&u.push(e),r&&u.push(r);var c=s.length>u.length;c&&u.push(y(n));var f=s.apply(t,u);if(!c||n===f)return n}}var g=y(function t(e,r,n,i){return e._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return v(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return v(e,a,n,function(o){return o?i(o):r.length>a.length?function(){return t(e,r.slice(a.length),n,i)}:void 0})}});function y(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}},31095:function(t,e,r){"use strict";t.exports=r(87336)},31122:function(t,e,r){"use strict";var n=r(16534),i=r(15181),a=r(37070),o=r(46982),s=r(90720),l=r(95243),u=r(88191),c=r(69562),f=r(3071),h=r(5809),p=r(95755),d=r(5126),v=d.LINE_SPACING,g=d.FROM_TL,y=d.FROM_BR,m=r(27199),x=r(85747),b=r(98379),_=/^legend[0-9]*$/;function w(t,e){var r,s,f=e||{},h=t._fullLayout,d=P(f),v=f._inHover;if(v?(s=f.layer,r="hover"):(s=h._infolayer,r=d),s){var _;if(r+=h._uid,t._legendMouseDownTime||(t._legendMouseDownTime=0),v){if(!f.entries)return;_=m(f.entries,f)}else{for(var w=(t.calcdata||[]).slice(),M=h.shapes,O=0;O1)}var z=h.hiddenlabels||[];if(!(v||h.showlegend&&_.length))return s.selectAll("."+d).remove(),h._topdefs.select("#"+r).remove(),a.autoMargin(t,d);var R=i.ensureSingle(s,"g",d,function(t){v||t.attr("pointer-events","all")}),F=i.ensureSingleById(h._topdefs,"clipPath",r,function(t){t.append("rect")}),B=i.ensureSingle(R,"rect","bg",function(t){t.attr("shape-rendering","crispEdges")});B.call(c.stroke,f.bordercolor).call(c.fill,f.bgcolor).style("stroke-width",f.borderwidth+"px");var N=i.ensureSingle(R,"g","scrollbox"),j=f.title;if(f._titleWidth=0,f._titleHeight=0,j.text){var U=i.ensureSingle(N,"text",d+"titletext");U.attr("text-anchor","start").call(u.font,j.font).text(j.text),E(U,N,t,f,1)}else N.selectAll("."+d+"titletext").remove();var V=i.ensureSingle(R,"rect","scrollbar",function(t){t.attr(p.scrollBarEnterAttrs).call(c.fill,p.scrollBarColor)}),H=N.selectAll("g.groups").data(_);H.enter().append("g").attr("class","groups"),H.exit().remove();var q=H.selectAll("g.traces").data(i.identity);q.enter().append("g").attr("class","traces"),q.exit().remove(),q.style("opacity",function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==z.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){n.select(this).call(k,t,f)}).call(x,t,f).each(function(){v||n.select(this).call(S,t,d)}),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout,o=P(i);i||(i=a[o]);var s=a._size,l=b.isVertical(i),c=b.isGrouped(i),f="fraction"===i.entrywidthmode,h=i.borderwidth,d=2*h,v=p.itemGap,g=i.itemwidth+2*v,y=2*(h+v),m=C(i),x=i.y<0||0===i.y&&"top"===m,_=i.y>1||1===i.y&&"bottom"===m,w=i.tracegroupgap,A={};i._maxHeight=Math.max(x||_?a.height/2:s.h,30);var k=0;i._width=0,i._height=0;var M=function(t){var e=0,r=0,n=t.title.side;return n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight)),[e,r]}(i);if(l)r.each(function(t){var e=t[0].height;u.setTranslate(this,h+M[0],h+M[1]+i._height+e/2+v),i._height+=e,i._width=Math.max(i._width,t[0].width)}),k=g+i._width,i._width+=v+g+d,i._height+=y,c&&(e.each(function(t,e){u.setTranslate(this,0,e*i.tracegroupgap)}),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var S=L(i),E=i.x<0||0===i.x&&"right"===S,O=i.x>1||1===i.x&&"left"===S,I=_||x,D=a.width/2;i._maxWidth=Math.max(E?I&&"left"===S?s.l+s.w:D:O?I&&"right"===S?s.r+s.w:D:s.w,2*g);var z=0,R=0;r.each(function(t){var e=T(t,i,g);z=Math.max(z,e),R+=e}),k=null;var F=0;if(c){var B=0,N=0,j=0;e.each(function(){var t=0,e=0;n.select(this).selectAll("g.traces").each(function(r){var n=T(r,i,g),a=r[0].height;u.setTranslate(this,M[0],M[1]+h+v+a/2+e),e+=a,t=Math.max(t,n),A[r[0].trace.legendgroup]=t});var r=t+v;N>0&&r+h+N>i._maxWidth?(F=Math.max(F,N),N=0,j+=B+w,B=e):B=Math.max(B,e),u.setTranslate(this,N,j),N+=r}),i._width=Math.max(F,N)+h,i._height=j+B+y}else{var U=r.size(),V=R+d+(U-1)*v=i._maxWidth&&(F=Math.max(F,Y),q=0,G+=H,i._height+=H,H=0),u.setTranslate(this,M[0]+h+q,M[1]+h+G+e/2+v),Y=q+r+v,q+=n,H=Math.max(H,e)}),V?(i._width=q+d,i._height=H+y):(i._width=Math.max(F,Y)+d,i._height+=H+y)}}i._width=Math.ceil(Math.max(i._width+M[0],i._titleWidth+2*(h+p.titlePad))),i._height=Math.ceil(Math.max(i._height+M[1],i._titleHeight+2*(h+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var W=t._context.edits,Z=W.legendText||W.legendPosition;r.each(function(t){var e=n.select(this).select("."+o+"toggle"),r=t[0].height,a=t[0].trace.legendgroup,s=T(t,i,g);c&&""!==a&&(s=A[a]);var h=Z?g:k||s;l||f||(h+=v/2),u.setRect(e,0,-r/2,h,r)})}(t,H,q,f)},function(){var e,c,m,x,b=h._size,_=f.borderwidth,w="paper"===f.xref,T="paper"===f.yref;if(!v){var k,M;k=w?b.l+b.w*f.x-g[L(f)]*f._width:h.width*f.x-g[L(f)]*f._width,M=T?b.t+b.h*(1-f.y)-g[C(f)]*f._effHeight:h.height*(1-f.y)-g[C(f)]*f._effHeight;var S=function(t,e,r,n){var i=t._fullLayout,o=i[e],s=L(o),l=C(o),u="paper"===o.xref,c="paper"===o.yref;t._fullLayout._reservedMargin[e]={};var f=o.y<.5?"b":"t",h=o.x<.5?"l":"r",p={r:i.width-r,l:r+o._width,b:i.height-n,t:n+o._effHeight};if(u&&c)return a.autoMargin(t,e,{x:o.x,y:o.y,l:o._width*g[s],r:o._width*y[s],b:o._effHeight*y[l],t:o._effHeight*g[l]});u?t._fullLayout._reservedMargin[e][f]=p[f]:c||"v"===o.orientation?t._fullLayout._reservedMargin[e][h]=p[h]:t._fullLayout._reservedMargin[e][f]=p[f]}(t,d,k,M);if(S)return;if(h.margin.autoexpand){var E=k,P=M;k=w?i.constrain(k,0,h.width-f._width):E,M=T?i.constrain(M,0,h.height-f._effHeight):P,k!==E&&i.log("Constrain "+d+".x to make legend fit inside graph"),M!==P&&i.log("Constrain "+d+".y to make legend fit inside graph")}u.setTranslate(R,k,M)}if(V.on(".drag",null),R.on("wheel",null),v||f._height<=f._maxHeight||t._context.staticPlot){var O=f._effHeight;v&&(O=f._height),B.attr({width:f._width-_,height:O-_,x:_/2,y:_/2}),u.setTranslate(N,0,0),F.select("rect").attr({width:f._width-2*_,height:O-2*_,x:_,y:_}),u.setClipUrl(N,r,t),u.setRect(V,0,0,0,0),delete f._scrollY}else{var I,D,z,j=Math.max(p.scrollBarMinHeight,f._effHeight*f._effHeight/f._height),U=f._effHeight-j-2*p.scrollBarMargin,H=f._height-f._effHeight,q=U/H,G=Math.min(f._scrollY||0,H);B.attr({width:f._width-2*_+p.scrollBarWidth+p.scrollBarMargin,height:f._effHeight-_,x:_/2,y:_/2}),F.select("rect").attr({width:f._width-2*_+p.scrollBarWidth+p.scrollBarMargin,height:f._effHeight-2*_,x:_,y:_+G}),u.setClipUrl(N,r,t),Z(G,j,q),R.on("wheel",function(){Z(G=i.constrain(f._scrollY+n.event.deltaY/U*H,0,H),j,q),0!==G&&G!==H&&n.event.preventDefault()});var Y=n.behavior.drag().on("dragstart",function(){var t=n.event.sourceEvent;I="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,z=G}).on("drag",function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(D="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,G=function(t,e,r){var n=(r-e)/q+t;return i.constrain(n,0,H)}(z,I,D),Z(G,j,q))});V.call(Y);var W=n.behavior.drag().on("dragstart",function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(I=t.changedTouches[0].clientY,z=G)}).on("drag",function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(D=t.changedTouches[0].clientY,G=function(t,e,r){var n=(e-r)/q+t;return i.constrain(n,0,H)}(z,I,D),Z(G,j,q))});N.call(W)}function Z(e,r,n){f._scrollY=t._fullLayout[d]._scrollY=e,u.setTranslate(N,0,-e),u.setRect(V,f._width,p.scrollBarMargin+e*n,p.scrollBarWidth,r),F.select("rect").attr("y",_+e)}t._context.edits.legendPosition&&(R.classed("cursor-move",!0),l.init({element:R.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);m=t.x,x=t.y},moveFn:function(t,r){var n=m+t,i=x+r;u.setTranslate(R,n,i),e=l.align(n,f._width,b.l,b.l+b.w,f.xanchor),c=l.align(i+f._height,-f._height,b.t+b.h,b.t,f.yanchor)},doneFn:function(){if(void 0!==e&&void 0!==c){var r={};r[d+".x"]=e,r[d+".y"]=c,o.call("_guiRelayout",t,r)}},clickFn:function(e,r){var n=s.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return r.clientX>=t.left&&r.clientX<=t.right&&r.clientY>=t.top&&r.clientY<=t.bottom});n.size()>0&&A(t,R,n,e,r)}}))}],t)}}function T(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function A(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l)&&(1===n?e._clickTimeout=setTimeout(function(){t._fullLayout&&h(r,t,n)},t._context.doubleClickDelay):2===n&&(e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)))}function k(t,e,r){var n,a,s=P(r),l=t.data()[0][0],c=l.trace,h=o.traceIs(c,"pie-like"),d=!r._inHover&&e._context.edits.legendText&&!h,v=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,a=l.groupTitle.font):(a=r.font,r.entries?n=l.text:(n=h?l.label:c.name,c._meta&&(n=i.templateString(n,c._meta))));var g=i.ensureSingle(t,"text",s+"text");g.attr("text-anchor","start").call(u.font,a).text(d?M(n,v):n);var y=r.itemwidth+2*p.itemGap;f.positionText(g,y,0),d?g.call(f.makeEditable,{gd:e,text:n}).call(E,t,e,r).on("edit",function(n){this.text(M(n,v)).call(E,t,e,r);var a=l.trace._fullInput||{},s={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),f=u[u.length-1],h=i.keyedContainer(a,"transforms["+f+"].styles","target","value.name");h.set(l.trace._group,n),s=h.constructUpdate()}else s.name=n;return a._isShape?o.call("_guiRelayout",e,"shapes["+c.index+"].name",s.name):o.call("_guiRestyle",e,s,c.index)}):E(g,t,e,r)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function S(t,e,r){var a,o=e._context.doubleClickDelay,s=1,l=i.ensureSingle(t,"rect",r+"toggle",function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")});e._context.staticPlot||(l.on("mousedown",function(){(a=(new Date).getTime())-e._legendMouseDownTimeo&&(s=Math.max(s-1,1)),A(e,i,t,s,n.event)}}))}function E(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,function(){!function(t,e,r,n){var i=t.data()[0][0];if(r._inHover||!i||i.trace.showlegend){var a=t.select("g[class*=math-group]"),o=a.node(),s=P(r);r||(r=e._fullLayout[s]);var l,c,h=r.borderwidth,d=(1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*v;if(o){var g=u.bBox(o);l=g.height,c=g.width,1===n?u.setTranslate(a,h,h+.75*l):u.setTranslate(a,0,.25*l)}else{var y="."+s+(1===n?"title":"")+"text",m=t.select(y),x=f.lineCount(m),b=m.node();if(l=d*x,c=b?u.bBox(b).width:0,1===n)"left"===r.title.side&&(c+=2*p.itemGap),f.positionText(m,h+p.titlePad,h+d);else{var _=2*p.itemGap+r.itemwidth;i.groupTitle&&(_=p.itemGap,c-=r.itemwidth),f.positionText(m,_,-d*((x-1)/2-.3))}}1===n?(r._titleWidth=c,r._titleHeight=l):(i.lineHeight=d,i.height=Math.max(l,16)+3,i.width=c)}else t.remove()}(e,r,n,i)})}function L(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function C(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}function P(t){return t._id||"legend"}t.exports=function(t,e){if(e)w(t,e);else{var r=t._fullLayout,i=r._legends;r._infolayer.selectAll('[class^="legend"]').each(function(){var t=n.select(this),e=t.attr("class").split(" ")[0];e.match(_)&&-1===i.indexOf(e)&&t.remove()});for(var a=0;a.999&&(i=.999);var a,o,s,l=Math.pow(i,2),u=e.vTotal,c=u,f=u*l/(1-l)/u,h=[];for(h.push(S()),o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var p=s.v/c;f+=p,h.push(S())}var d=1/0,v=-1/0;for(o=0;o-1;o--)if(!(s=t[o]).hidden){var k=h[A+=1][0],M=h[A][1];s.TL=[-k,M],s.TR=[k,M],s.BL=_,s.BR=T,s.pxmid=w(s.TR,s.BR),_=s.TL,T=s.TR}}function S(){var t,e={x:t=Math.sqrt(f),y:-t};return[e.x,e.y]}}(e),h.each(function(){var h=n.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove(),h.each(function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=y.index;var h=d.cx,m=d.cy,x=n.select(this),w=x.selectAll("path.surface").data([o]);w.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),x.call(v,t,e);var T="M"+(h+o.TR[0])+","+(m+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";w.attr("d",T),b(t,o,d);var A=p.castOption(y.textposition,o.pts),k=x.selectAll("g.slicetext").data(o.text&&"none"!==A?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each(function(){var r=a.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)}),p=a.ensureUniformFontSize(t,g(y,o,c.font));r.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,p).call(l.convertToTspans,t);var d,v,x,b=i.bBox(r.node()),_=Math.min(o.BL[1],o.BR[1])+m,w=Math.max(o.TL[1],o.TR[1])+m;v=Math.max(o.TL[0],o.BL[0])+h,x=Math.min(o.TR[0],o.BR[0])+h,(d=u(v,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,f(y.type,d,c),e[s].transform=d,a.setTransormAndDisplay(r,d)})}});var m=n.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);m.enter().append("g").classed("titletext",!0),m.exit().remove(),m.each(function(){var e=a.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)}),r=y.title.text;y._meta&&(r=a.templateString(r,y._meta)),e.text(r).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,y.title.font).call(l.convertToTspans,t);var u=x(d,c._size);e.attr("transform",s(u.x,u.y)+o(Math.min(1,u.scale))+s(u.tx,u.ty))})})})}},31489:function(t,e,r){"use strict";var n=r(98054),i=r(15181),a=["xaxis","yaxis","zaxis"];function o(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}o.prototype.merge=function(t,e){for(var r=this,o=0;o<3;++o){var s=e[a[o]];s.visible?(r.labels[o]=t._meta?i.templateString(s.title.text,t._meta):s.title.text,"font"in s.title&&(s.title.font.color&&(r.labelColor[o]=n(s.title.font.color)),s.title.font.family&&(r.labelFont[o]=s.title.font.family),s.title.font.size&&(r.labelSize[o]=s.title.font.size)),"showline"in s&&(r.lineEnable[o]=s.showline),"linecolor"in s&&(r.lineColor[o]=n(s.linecolor)),"linewidth"in s&&(r.lineWidth[o]=s.linewidth),"showgrid"in s&&(r.gridEnable[o]=s.showgrid),"gridcolor"in s&&(r.gridColor[o]=n(s.gridcolor)),"gridwidth"in s&&(r.gridWidth[o]=s.gridwidth),"log"===s.type?r.zeroEnable[o]=!1:"zeroline"in s&&(r.zeroEnable[o]=s.zeroline),"zerolinecolor"in s&&(r.zeroLineColor[o]=n(s.zerolinecolor)),"zerolinewidth"in s&&(r.zeroLineWidth[o]=s.zerolinewidth),"ticks"in s&&s.ticks?r.lineTickEnable[o]=!0:r.lineTickEnable[o]=!1,"ticklen"in s&&(r.lineTickLength[o]=r._defaultLineTickLength[o]=s.ticklen),"tickcolor"in s&&(r.lineTickColor[o]=n(s.tickcolor)),"tickwidth"in s&&(r.lineTickWidth[o]=s.tickwidth),"tickangle"in s&&(r.tickAngle[o]="auto"===s.tickangle?-3600:Math.PI*-s.tickangle/180),"showticklabels"in s&&(r.tickEnable[o]=s.showticklabels),"tickfont"in s&&(s.tickfont.color&&(r.tickColor[o]=n(s.tickfont.color)),s.tickfont.family&&(r.tickFont[o]=s.tickfont.family),s.tickfont.size&&(r.tickSize[o]=s.tickfont.size)),"mirror"in s?-1!==["ticks","all","allticks"].indexOf(s.mirror)?(r.lineTickMirror[o]=!0,r.lineMirror[o]=!0):!0===s.mirror?(r.lineTickMirror[o]=!1,r.lineMirror[o]=!0):(r.lineTickMirror[o]=!1,r.lineMirror[o]=!1):r.lineMirror[o]=!1,"showbackground"in s&&!1!==s.showbackground?(r.backgroundEnable[o]=!0,r.backgroundColor[o]=n(s.backgroundcolor)):r.backgroundEnable[o]=!1):(r.tickEnable[o]=!1,r.labelEnable[o]=!1,r.lineEnable[o]=!1,r.lineTickEnable[o]=!1,r.gridEnable[o]=!1,r.zeroEnable[o]=!1,r.backgroundEnable[o]=!1)}},t.exports=function(t,e){var r=new o;return r.merge(t,e),r}},31515:function(t,e,r){"use strict";var n=r(77546),i=r(5159);function a(t,e){var r,a=Array.isArray(e);function o(t){return i(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(a?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=a?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=a?e.map(o):[o(e)]),r}function o(t){return function(e){e=a(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=a(t,e),end:1/0,size:1/0}}}t.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},31576:function(t,e,r){"use strict";var n=r(16534),i=r(93441),a=r(95243),o=r(71467),s=r(44036).makeDragBox,l=r(29278).DRAGGERSIZE;e.initInteractions=function(t){var r=t._fullLayout;if(t._context.staticPlot)n.select(t).selectAll(".drag").remove();else if(r._has("cartesian")||r._has("splom")){Object.keys(r._plots||{}).sort(function(t,e){if((r._plots[t].mainplot&&!0)===(r._plots[e].mainplot&&!0)){var n=t.split("y"),i=e.split("y");return n[0]===i[0]?Number(n[1]||1)-Number(i[1]||1):Number(n[0]||1)-Number(i[0]||1)}return r._plots[t].mainplot?1:-1}).forEach(function(e){var n=r._plots[e],o=n.xaxis,u=n.yaxis;if(!n.mainplot){var c=s(t,n,o._offset,u._offset,o._length,u._length,"ns","ew");c.onmousemove=function(r){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===e&&t._fullLayout._plots[e]&&i.hover(t,r,e)},i.hover(t,r,e),t._fullLayout._lasthover=c,t._fullLayout._hoversubplot=e},c.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,a.unhover(t,e))},t._context.showAxisDragHandles&&(s(t,n,o._offset-l,u._offset-l,l,l,"n","w"),s(t,n,o._offset+o._length,u._offset-l,l,l,"n","e"),s(t,n,o._offset-l,u._offset+u._length,l,l,"s","w"),s(t,n,o._offset+o._length,u._offset+u._length,l,l,"s","e"))}if(t._context.showAxisDragHandles){if(e===o._mainSubplot){var f=o._mainLinePosition;"top"===o.side&&(f-=l),s(t,n,o._offset+.1*o._length,f,.8*o._length,l,"","ew"),s(t,n,o._offset,f,.1*o._length,l,"","w"),s(t,n,o._offset+.9*o._length,f,.1*o._length,l,"","e")}if(e===u._mainSubplot){var h=u._mainLinePosition;"right"!==u.side&&(h-=l),s(t,n,h,u._offset+.1*u._length,l,.8*u._length,"ns",""),s(t,n,h,u._offset+.9*u._length,l,.1*u._length,"s",""),s(t,n,h,u._offset,l,.1*u._length,"n","")}}});var o=r._hoverlayer.node();o.onmousemove=function(e){e.target=t._fullLayout._lasthover,i.hover(t,e,r._hoversubplot)},o.onclick=function(e){e.target=t._fullLayout._lasthover,i.click(t,e)},o.onmousedown=function(e){t._fullLayout._lasthover.onmousedown(e)},e.updateFx(t)}},e.updateFx=function(t){var e=t._fullLayout,r="pan"===e.dragmode?"move":"crosshair";o(e._draggers,r)}},31593:function(t){"use strict";t.exports=function(t){for(var e={},r=[],n=0,i=0;iv-p?p=v-(d-v):d-v=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},31790:function(t){"use strict";t.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},31808:function(t,e,r){"use strict";var n=r(41365),i=r(79691),a=Object.create(null);t.exports=function(t){return Object.defineProperties(t,{for:n(function(e){return a[e]?a[e]:a[e]=t(String(e))}),keyFor:n(function(t){var e;for(e in i(t),a)if(a[e]===t)return e})})}},31821:function(t,e,r){"use strict";var n=r(15181).isArrayOrTypedArray,i=r(44236),a=r(51257).wrap;t.exports=function(t,e){var r,o;return i.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=i.extractOpts(e.line).colorscale,i.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;r0&&(p=t.dxydi([],i-1,o,0,s),y.push(l[0]+p[0]/3),m.push(l[1]+p[1]/3),d=t.dxydi([],i-1,o,1,s),y.push(f[0]-d[0]/3),m.push(f[1]-d[1]/3)),y.push(f[0]),m.push(f[1]),l=f;else for(i=t.a2i(n),u=Math.floor(Math.max(0,Math.min(C-2,i))),c=i-u,x.length=C,x.crossLength=P,x.xy=function(e){return t.evalxy([],i,e)},x.dxy=function(e,r){return t.dxydj([],u,e,c,r)},a=0;a0&&(v=t.dxydj([],u,a-1,c,0),y.push(l[0]+v[0]/3),m.push(l[1]+v[1]/3),g=t.dxydj([],u,a-1,c,1),y.push(f[0]-g[0]/3),m.push(f[1]-g[1]/3)),y.push(f[0]),m.push(f[1]),l=f;return x.axisLetter=e,x.axis=b,x.crossAxis=k,x.value=n,x.constvar=r,x.index=h,x.x=y,x.y=m,x.smoothing=k.smoothing,x}function D(n){var i,a,o,s,l,u=[],c=[],f={};if(f.length=x.length,f.crossLength=A.length,"b"===e)for(o=Math.max(0,Math.min(P-2,n)),l=Math.min(1,Math.max(0,n-o)),f.xy=function(e){return t.evalxy([],e,n)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},i=0;ix.length-1||_.push(i(D(o),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(h=c;hx.length-1||v<0||v>x.length-1))for(g=x[s],y=x[v],a=0;ax[x.length-1]||w.push(i(I(d),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&T.push(i(D(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(D(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,c=(u=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort(function(t,e){return t-e}))[0],f=u[1],h=c;h<=f;h++)p=b.tick0+b.dtick*h,_.push(i(I(p),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(h=c-1;hx[x.length-1]||w.push(i(I(d),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&T.push(i(I(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(I(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},33064:function(t,e,r){"use strict";var n=r(5159),i=r(25623),a=r(28209),o=r(19389),s=r(69562),l=r(28730).DESELECTDIM,u=r(23716),c=r(90778).counter,f=r(82797).modHalf,h=r(80740).isArrayOrTypedArray;function p(t,r){var n=e.valObjectMeta[r.valType];if(r.arrayOk&&h(t))return!0;if(n.validateFunction)return n.validateFunction(t,r);var i={},a=i,o={set:function(t){a=t}};return n.coerceFunction(t,o,i,r),a!==i}e.valObjectMeta={data_array:{coerceFunction:function(t,e,r){h(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every(function(t){return i(t).isValid()})?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||c(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a"),o.hovertemplate=h.hovertemplate,a}function x(t,e){y.push(t._hovertitle+": "+e)}}},33928:function(t){"use strict";t.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},34008:function(t,e,r){"use strict";var n=r(10194),i=r(32021),a=r(13616),o=r(46329).sorterAsc,s=r(46982);e.containerArrayMatch=r(14665);var l=e.isAddVal=function(t){return"add"===t||n(t)},u=e.isRemoveVal=function(t){return null===t||"remove"===t};e.applyContainerArrayChanges=function(t,e,r,n,c){var f=e.astr,h=s.getComponentMethod(f,"supplyLayoutDefaults"),p=s.getComponentMethod(f,"draw"),d=s.getComponentMethod(f,"drawOne"),v=n.replot||n.recalc||h===i||p===i,g=t.layout,y=t._fullLayout;if(r[""]){Object.keys(r).length>1&&a.warn("Full array edits are incompatible with other edits",f);var m=r[""][""];if(u(m))e.set(null);else{if(!Array.isArray(m))return a.warn("Unrecognized full array edit value",f,m),!0;e.set(m)}return!v&&(h(g,y),p(t),!0)}var x,b,_,w,T,A,k,M,S=Object.keys(r).map(Number).sort(o),E=e.get(),L=E||[],C=c(y,f).get(),P=[],O=-1,I=L.length;for(x=0;xL.length-(k?0:1))a.warn("index out of range",f,_);else if(void 0!==A)T.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(A)?P.push(_):k?("add"===A&&(A={}),L.splice(_,0,A),C&&C.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,A),-1===O&&(O=_);else for(b=0;b=0;x--)L.splice(P[x],1),C&&C.splice(P[x],1);if(L.length?E||e.set(L):e.set(null),v)return!1;if(h(g,y),d!==i){var D;if(-1===O)D=S;else{for(I=Math.max(L.length,I),D=[],x=0;x=O);x++)D.push(_);for(x=O;x>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function c(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.I=a,a.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},a.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},34256:function(t,e,r){"use strict";var n=r(15181),i=r(3071).sanitizeHTML,a=r(26654),o=r(14617);function s(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=o.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var l=s.prototype;function u(t){if(!t.visible)return!1;var e=t.source;if(Array.isArray(e)&&e.length>0){for(var r=0;r0}function c(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var i=t.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(e,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":i.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=u(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,u(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,a={type:r};return"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates),a[e]=n,t.sourceattribution&&(a.attribution=i(t.sourceattribution)),a}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;rr?r:t:te?e:t}},34758:function(t,e,r){"use strict";t.exports={attributes:r(88669),supplyDefaults:r(25834),plot:r(65255),calc:r(74289),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:r(29435),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}},34802:function(t,e,r){"use strict";var n=r(28398),i=r(86692),a=r(11878),o=r(58157);t.exports=o||n.call(a,i)},34820:function(t){"use strict";t.exports=r,t.exports.float32=t.exports.float=r,t.exports.fract32=t.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=r(t));for(var n=0,i=e.length;n"),l.color=function(t,e){var r=t.marker,i=e.mc||r.color,a=e.mlc||r.line.color,o=e.mlw||r.line.width;return n(i)?i:n(a)&&o?a:void 0}(c,h),[l]}}},35331:function(t,e,r){"use strict";var n=r(52237),i={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!n(t)&&hasOwnProperty.call(i,typeof t)}},35352:function(t,e,r){var n=r(43482);t.exports=function(t,e,r){function i(t,e){return{id:r?r.segmentId():-1,start:t,end:e,myFill:{above:null,below:null},otherFill:null}}function a(t,e,n){return{id:r?r.segmentId():-1,start:t,end:e,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var o=n.create();function s(t,r){o.insertBefore(t,function(n){return i=t.isStart,a=t.pt,o=r,s=n.isStart,l=n.pt,u=n.other.pt,(0!==(c=e.pointsCompare(a,l))?c:e.pointsSame(o,u)?0:i!==s?i?1:-1:e.pointAboveOrOnLine(o,s?l:u,s?u:l)?1:-1)<0;var i,a,o,s,l,u,c})}function l(t,e){var r=function(t,e){var r=n.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return s(r,t.end),r}(t,e);return function(t,e,r){var i=n.node({isStart:!1,pt:e.end,seg:e,primary:r,other:t,status:null});t.other=i,s(i,t.pt)}(r,t,e),r}function u(t,e){var n=a(e,t.seg.end,t.seg);return function(t,e){r&&r.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,s(t.other,t.pt)}(t,e),l(n,t.primary)}function c(i,a){var s=n.create();function l(t){return s.findTransition(function(r){var n,i,a,o,s,l;return n=t,i=r.ev,a=n.seg.start,o=n.seg.end,s=i.seg.start,l=i.seg.end,(e.pointsCollinear(a,s,l)?e.pointsCollinear(o,s,l)||e.pointAboveOrOnLine(o,s,l)?1:-1:e.pointAboveOrOnLine(a,s,l)?1:-1)>0})}function c(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,l=a.start,c=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,l,c);if(!1===f){if(!e.pointsCollinear(o,s,l))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,l))return!1;var h=e.pointsSame(o,l),p=e.pointsSame(s,c);if(h&&p)return n;var d=!h&&e.pointBetween(o,l,c),v=!p&&e.pointBetween(s,l,c);if(h)return v?u(n,s):u(t,c),n;d&&(p||(v?u(n,s):u(t,c)),u(n,o))}else 0===f.alongA&&(-1===f.alongB?u(t,l):0===f.alongB?u(t,f.pt):1===f.alongB&&u(t,c)),0===f.alongB&&(-1===f.alongA?u(n,o):0===f.alongA?u(n,f.pt):1===f.alongA&&u(n,s));return!1}for(var f=[];!o.isEmpty();){var h=o.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var p=l(h),d=p.before?p.before.ev:null,v=p.after?p.after.ev:null;function g(){if(d){var t=c(h,d);if(t)return t}return!!v&&c(h,v)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!v&&v.seg);var y,m,x=g();if(x)t?(m=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(x.seg.myFill.above=!x.seg.myFill.above):x.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(x.seg),h.other.remove(),h.remove();if(o.getHead()!==h){r&&r.rewind(h.seg);continue}t?(m=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=v?v.seg.myFill.above:i,h.seg.myFill.above=m?!h.seg.myFill.below:h.seg.myFill.below):null===h.seg.otherFill&&(y=v?h.primary===v.primary?v.seg.otherFill.above:v.seg.myFill.above:h.primary?a:i,h.seg.otherFill={above:y,below:y}),r&&r.status(h.seg,!!d&&d.seg,!!v&&v.seg),h.other.status=p.insert(n.node({ev:h}))}else{var b=h.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(b.prev)&&s.exists(b.next)&&c(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}o.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var r,n=t[t.length-1],a=0;a=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},36066:function(t){"use strict";t.exports=Math.floor},36434:function(t,e,r){"use strict";var n=r(42964),i=Array.prototype.forEach,a=Object.create;t.exports=function(t){var e=a(null);return i.call(arguments,function(t){n(t)&&function(t,e){var r;for(r in t)e[r]=t[r]}(Object(t),e)}),e}},36557:function(t,e,r){"use strict";var n=r(16534),i=r(46982),a=r(37070),o=r(15181),s=o.strTranslate,l=r(26446),u=r(69562),c=r(88191),f=r(93441),h=r(3071),p=r(71467),d=r(95243),v=r(92444).arrayEditor,g=r(348);function y(t,e){var r=t._fullLayout.annotations[e]||{},n=l.getFromId(t,r.xref),i=l.getFromId(t,r.yref);n&&n.setScale(),i&&i.setScale(),x(t,r,e,!1,n,i)}function m(t,e,r,n,i){var a=i[r],o=i[r+"ref"],s=-1!==r.indexOf("y"),u="domain"===l.getRefType(o),c=s?n.h:n.w;return t?u?a+(s?-e:e)/t._length:t.p2r(t.r2p(a)+e):a+(s?-e:e)/c}function x(t,e,r,a,y,x){var b,_,w=t._fullLayout,T=t._fullLayout._size,A=t._context.edits;a?(b="annotation-"+a,_=a+".annotations"):(b="annotation",_="annotations");var k=v(t.layout,_,e),M=k.modifyBase,S=k.modifyItem,E=k.getUpdateObj;w._infolayer.selectAll("."+b+'[data-index="'+r+'"]').remove();var L="clip"+w._uid+"_ann"+r;if(e._input&&!1!==e.visible){var C={x:{},y:{}},P=+e.textangle||0,O=w._infolayer.append("g").classed(b,!0).attr("data-index",String(r)).style("opacity",e.opacity),I=O.append("g").classed("annotation-text-g",!0),D=A[e.showarrow?"annotationTail":"annotationPosition"],z=e.captureevents||A.annotationText||D,R=I.append("g").style("pointer-events",z?"all":null).call(p,"pointer").on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",Y(n.event))});e.hovertext&&R.on("mouseover",function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();f.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:t})}).on("mouseout",function(){f.loneUnhover(w._hoverlayer.node())});var F=e.borderwidth,B=e.borderpad,N=F+B,j=R.append("rect").attr("class","bg").style("stroke-width",F+"px").call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor),U=e.width||e.height,V=w._topclips.selectAll("#"+L).data(U?[0]:[]);V.enter().append("clipPath").classed("annclip",!0).attr("id",L).append("rect"),V.exit().remove();var H=e.font,q=w._meta?o.templateString(e.text,w._meta):e.text,G=R.append("text").classed("annotation-text",!0).text(q);A.annotationText?G.call(h.makeEditable,{delegate:R,gd:t}).call(W).on("edit",function(r){e.text=r,this.call(W),S("text",r),y&&y.autorange&&M(y._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0),i.call("_guiRelayout",t,E())}):G.call(W)}else n.selectAll("#"+L).remove();function Y(t){var n={index:r,annotation:e._input,fullAnnotation:e,event:t};return a&&(n.subplotId=a),n}function W(r){return r.call(c.font,H).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),h.convertToTspans(r,t,Z),r}function Z(){var r=G.selectAll("a");1===r.size()&&r.text()===G.text()&&R.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(j.node());var n=R.select(".annotation-text-math-group"),f=!n.empty(),v=c.bBox((f?n:G).node()),b=v.width,_=v.height,k=e.width||b,z=e.height||_,B=Math.round(k+2*N),H=Math.round(z+2*N);function q(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,Z=["x","y"],X=0;X1)&&(nt===rt?((pt=it.r2fraction(e["a"+et]))<0||pt>1)&&(W=!0):W=!0),J=it._offset+it.r2p(e[et]),Q=.5}else{var dt="domain"===ht;"x"===et?($=e[et],J=dt?it._offset+it._length*$:J=T.l+T.w*$):($=1-e[et],J=dt?it._offset+it._length*$:J=T.t+T.h*$),Q=e.showarrow?.5:$}if(e.showarrow){ft.head=J;var vt=e["a"+et];if(tt=ot*q(.5,e.xanchor)-st*q(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);"domain"===gt?("y"===et&&(vt=1-vt),ft.tail=it._offset+it._length*vt):"paper"===gt?"y"===et?(vt=1-vt,ft.tail=T.t+T.h*vt):ft.tail=T.l+T.w*vt:ft.tail=it._offset+it.r2p(vt),K=tt}else ft.tail=J+vt,K=tt+vt;ft.text=ft.tail+tt;var yt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,yt-1)),"pixel"===nt){var mt=-Math.max(ft.tail-3,ft.text),xt=Math.min(ft.tail+3,ft.text)-yt;mt>0?(ft.tail+=mt,ft.text+=mt):xt>0&&(ft.tail-=xt,ft.text-=xt)}ft.tail+=ct,ft.head+=ct}else K=tt=lt*q(Q,ut),ft.text=J+tt;ft.text+=ct,tt+=ct,K+=ct,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)R.remove();else{var bt=0,_t=0;if("left"!==e.align&&(bt=(k-b)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(z-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:N+bt-1,y:N+_t}).call(c.setClipUrl,U?L:null,t);else{var wt=N+_t-v.top,Tt=N+bt-v.left;G.call(h.positionText,Tt,wt).call(c.setClipUrl,U?L:null,t)}V.select("rect").call(c.setRect,N,N,k,z),j.call(c.setRect,F/2,F/2,B-F,H-F),R.call(c.setTranslate,Math.round(C.x.text-B/2),Math.round(C.y.text-H/2)),I.attr({transform:"rotate("+P+","+C.x.text+","+C.y.text+")"});var At,kt=function(r,n){O.selectAll(".annotation-arrow-g").remove();var l=C.x.head,f=C.y.head,h=C.x.tail+r,p=C.y.tail+n,v=C.x.text+r,b=C.y.text+n,_=o.rotationXYMatrix(P,v,b),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),L=+j.attr("width"),D=+j.attr("height"),z=v-.5*L,F=z+L,B=b-.5*D,N=B+D,U=[[z,B,z,N],[z,N,F,N],[F,N,F,B],[F,B,z,B]].map(k);if(!U.reduce(function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){U.forEach(function(t){var e=o.segmentsIntersect(h,p,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,p=e.y)});var V=e.arrowwidth,H=e.arrowcolor,q=e.arrowside,G=O.append("g").style({opacity:u.opacity(H)}).classed("annotation-arrow-g",!0),Y=G.append("path").attr("d","M"+h+","+p+"L"+l+","+f).style("stroke-width",V+"px").call(u.stroke,u.rgb(H));if(g(Y,q,e),A.annotationPosition&&Y.node().parentNode&&!a){var W=l,Z=f;if(e.standoff){var X=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-p,2));W+=e.standoff*(h-l)/X,Z+=e.standoff*(p-f)/X}var J,K,$=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(p-Z),transform:s(W,Z)}).style("stroke-width",V+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");d.init({element:$.node(),gd:t,prepFn:function(){var t=c.getTranslate(R);J=t.x,K=t.y,y&&y.autorange&&M(y._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),i=n[0]+t,a=n[1]+r;R.call(c.setTranslate,i,a),S("x",m(y,t,"x",T,e)),S("y",m(x,r,"y",T,e)),e.axref===e.xref&&S("ax",m(y,t,"ax",T,e)),e.ayref===e.yref&&S("ay",m(x,r,"ay",T,e)),G.attr("transform",s(t,r)),I.attr({transform:"rotate("+P+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&kt(0,0),D&&d.init({element:R.node(),gd:t,prepFn:function(){At=I.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",m(y,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",m(x,r,"ay",T.w,e)):S("ay",e.ay+r),kt(t,r);else{if(a)return;var i,o;if(y)i=m(y,t,"x",T,e);else{var l=e._xsize/T.w,u=e.x+(e._xshift-e.xshift)/T.w-l/2;i=d.align(u+t/T.w,l,0,1,e.xanchor)}if(x)o=m(x,r,"y",T,e);else{var c=e._ysize/T.h,f=e.y-(e._yshift+e.yshift)/T.h-c/2;o=d.align(f-r/T.h,c,0,1,e.yanchor)}S("x",i),S("y",o),y&&x||(n=d.getCursor(y?.5:i,x?.5:o,e.xanchor,e.yanchor))}I.attr({transform:s(t,r)+At}),p(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",Y(n))},doneFn:function(){p(R),i.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}t.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){_.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},_.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=_.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var A=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function M(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&D.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&D.length>15&&0===l.shapes.length&&0===l.images.length,_.linkSubplots(h,l,f,n),_.cleanPlot(h,l,f,n);var N=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||N,V=!(!l._has||!l._has("cartesian"))||j;U&&!V?n._bgLayer.remove():V&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&d({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var h=_.layoutAttributes.width.min,p=_.layoutAttributes.height.min;n1,v=!e.height&&Math.abs(r.height-i)>1;(v||d)&&(d&&(r.width=n),v&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),_.sanitizeMargins(r)},_.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,u=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in u.length||u.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(c.subplotSort);for(a=0;a1&&(r.l/=y,r.r/=y)}if(p){var m=(r.t+r.b)/p;m>1&&(r.t/=m,r.b/=m)}var x=void 0!==r.xl?r.xl:r.x,b=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,T=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:x,size:r.l+g},r:{val:b,size:r.r+g},b:{val:T,size:r.b+g},t:{val:w,size:r.t+g}},v[e]=1}else delete d[e],delete v[e];if(!n._replotting)return _.doAutoMargin(t)}},_.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),P(e);var i=e._size,a=e.margin,l={t:0,b:0,l:0,r:0},u=c.extendFlat({},i),f=a.l,h=a.r,d=a.t,v=a.b,g=e._pushmargin,y=e._pushmarginIds,m=e.minreducedwidth,x=e.minreducedheight;if(!1!==a.autoexpand){for(var b in g)y[b]||delete g[b];var w=t._fullLayout._reservedMargin;for(var T in w)for(var A in w[T]){var k=w[T][A];l[A]=Math.max(l[A],k)}for(var M in g.base={l:{val:0,size:f},r:{val:1,size:h},t:{val:1,size:d},b:{val:0,size:v}},l){var S=0;for(var E in g)"base"!==E&&o(g[E][M].size)&&(S=g[E][M].size>S?g[E][M].size:S);var L=Math.max(0,a[M]-S);l[M]=Math.max(0,l[M]-L)}for(var C in g){var O=g[C].l||{},I=g[C].b||{},D=O.val,z=O.size,R=I.val,F=I.size,B=r-l.r-l.l,N=n-l.t-l.b;for(var j in g){if(o(z)&&g[j].r){var U=g[j].r.val,V=g[j].r.size;if(U>D){var H=(z*U+(V-B)*D)/(U-D),q=(V*(1-D)+(z-B)*(1-U))/(U-D);H+q>f+h&&(f=H,h=q)}}if(o(F)&&g[j].t){var G=g[j].t.val,Y=g[j].t.size;if(G>R){var W=(F*G+(Y-N)*R)/(G-R),Z=(Y*(1-R)+(F-N)*(1-G))/(G-R);W+Z>v+d&&(v=W,d=Z)}}}}}var X=c.constrain(r-a.l-a.r,2,m),J=c.constrain(n-a.t-a.b,2,x),K=Math.max(0,r-X),$=Math.max(0,n-J);if(K){var Q=(f+h)/K;Q>1&&(f/=Q,h/=Q)}if($){var tt=(v+d)/$;tt>1&&(v/=tt,d/=tt)}if(i.l=Math.round(f)+l.l,i.r=Math.round(h)+l.r,i.t=Math.round(d)+l.t,i.b=Math.round(v)+l.b,i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&(_.didMarginChange(u,i)||function(t){if("_redrawFromAutoMarginCount"in t._fullLayout)return!1;var e=p.list(t,"",!0);for(var r in e)if(e[r].autoshift||e[r].shift)return!0;return!1}(t))){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var et=3*(1+Object.keys(y).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){n=!0}),r.redraw&&t._transitionData._interruptCallbacks.push(function(){return s.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var a=0,o=0;function l(){return a++,function(){var e;o++,n||o!==a||(e=i,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(r.redraw)return s.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e)))}}r.runFn(l),setTimeout(l())})}],a=c.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then(function(){return t})}_.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},_.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&_.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function u(t,e){if("function"==typeof t)return e?"_function_":null;if(c.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach(function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!c.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=u(t[a],e)}else e&&(i[a]="_function")}),i}return Array.isArray(t)?t.map(function(t){return u(t,e)}):c.isTypedArray(t)?c.simpleMap(t,c.identity):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map(function(t){var r=u(t);return e&&delete r.fit,r})};if(!e&&(f.layout=u(s),i)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(f.frames=u(l)),a&&(f.config=u(t._context,!0)),"object"===n?f:JSON.stringify(f)},_.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(z(o,u,f),i=0;i1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[u]=255*a;return i}},n.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},37087:function(t,e,r){"use strict";var n=r(97456),i=r(54324),a=r(94316),o=r(99803),s=r(87486),l=r(2362),u=r(19723),c=r(24418).isSize;t.exports=h;var f=h.cache={};function h(t){if("string"!=typeof t)throw new Error("Font argument must be a string.");if(f[t])return f[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==a.indexOf(t))return f[t]={system:t};for(var e,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},h=u(t,/\s+/);e=h.shift();){if(-1!==i.indexOf(e))return["style","variant","weight","stretch"].forEach(function(t){r[t]=e}),f[t]=r;if(-1===s.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===l.indexOf(e)){if(-1===o.indexOf(e)){if(c(e)){var d=u(e,"/");if(r.size=d[0],null!=d[1]?r.lineHeight=p(d[1]):"/"===h[0]&&(h.shift(),r.lineHeight=p(h.shift())),!h.length)throw new Error("Missing required font-family.");return r.family=u(h.join(" "),/\s*,\s*/).map(n),f[t]=r}throw new Error("Unknown or unsupported font token: "+e)}r.weight=e}else r.stretch=e;else r.variant=e;else r.style=e}throw new Error("Missing required font-size.")}function p(t){var e=parseFloat(t);return e.toString()===t?e:t}},37101:function(t,e,r){"use strict";function n(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function i(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function a(){}r.d(e,{GW:function(){return $},Dj:function(){return q}});var o=.7,s=1/o,l="\\s*([+-]?\\d+)\\s*",u="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",f=/^#([0-9a-f]{3,8})$/,h=new RegExp("^rgb\\(".concat(l,",").concat(l,",").concat(l,"\\)$")),p=new RegExp("^rgb\\(".concat(c,",").concat(c,",").concat(c,"\\)$")),d=new RegExp("^rgba\\(".concat(l,",").concat(l,",").concat(l,",").concat(u,"\\)$")),v=new RegExp("^rgba\\(".concat(c,",").concat(c,",").concat(c,",").concat(u,"\\)$")),g=new RegExp("^hsl\\(".concat(u,",").concat(c,",").concat(c,"\\)$")),y=new RegExp("^hsla\\(".concat(u,",").concat(c,",").concat(c,",").concat(u,"\\)$")),m={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function x(){return this.rgb().formatHex()}function b(){return this.rgb().formatRgb()}function _(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=f.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?w(e):3===r?new k(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?T(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?T(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=h.exec(t))?new k(e[1],e[2],e[3],1):(e=p.exec(t))?new k(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=d.exec(t))?T(e[1],e[2],e[3],e[4]):(e=v.exec(t))?T(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=g.exec(t))?P(e[1],e[2]/100,e[3]/100,1):(e=y.exec(t))?P(e[1],e[2]/100,e[3]/100,e[4]):m.hasOwnProperty(t)?w(m[t]):"transparent"===t?new k(NaN,NaN,NaN,0):null}function w(t){return new k(t>>16&255,t>>8&255,255&t,1)}function T(t,e,r,n){return n<=0&&(t=e=r=NaN),new k(t,e,r,n)}function A(t,e,r,n){return 1===arguments.length?((i=t)instanceof a||(i=_(i)),i?new k((i=i.rgb()).r,i.g,i.b,i.opacity):new k):new k(t,e,r,null==n?1:n);var i}function k(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function M(){return"#".concat(C(this.r)).concat(C(this.g)).concat(C(this.b))}function S(){var t=E(this.opacity);return"".concat(1===t?"rgb(":"rgba(").concat(L(this.r),", ").concat(L(this.g),", ").concat(L(this.b)).concat(1===t?")":", ".concat(t,")"))}function E(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function L(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function C(t){return((t=L(t))<16?"0":"")+t.toString(16)}function P(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new I(t,e,r,n)}function O(t){if(t instanceof I)return new I(t.h,t.s,t.l,t.opacity);if(t instanceof a||(t=_(t)),!t)return new I;if(t instanceof I)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=NaN,l=o-i,u=(o+i)/2;return l?(s=e===o?(r-n)/l+6*(r0&&u<1?0:s,new I(s,l,u,t.opacity)}function I(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function D(t){return(t=(t||0)%360)<0?t+360:t}function z(t){return Math.max(0,Math.min(1,t||0))}function R(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function F(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}n(a,_,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:x,formatHex:x,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return O(this).formatHsl()},formatRgb:b,toString:b}),n(k,A,i(a,{brighter:function(t){return t=null==t?s:Math.pow(s,t),new k(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?o:Math.pow(o,t),new k(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},clamp:function(){return new k(L(this.r),L(this.g),L(this.b),E(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:M,formatHex:M,formatHex8:function(){return"#".concat(C(this.r)).concat(C(this.g)).concat(C(this.b)).concat(C(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:S,toString:S})),n(I,function(t,e,r,n){return 1===arguments.length?O(t):new I(t,e,r,null==n?1:n)},i(a,{brighter:function(t){return t=null==t?s:Math.pow(s,t),new I(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?o:Math.pow(o,t),new I(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new k(R(t>=240?t-240:t+120,i,n),R(t,i,n),R(t<120?t+240:t-120,i,n),this.opacity)},clamp:function(){return new I(D(this.h),z(this.s),z(this.l),E(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=E(this.opacity);return"".concat(1===t?"hsl(":"hsla(").concat(D(this.h),", ").concat(100*z(this.s),"%, ").concat(100*z(this.l),"%").concat(1===t?")":", ".concat(t,")"))}}));var B=function(t){return function(){return t}};function N(t,e){var r=e-t;return r?function(t,e){return function(r){return t+r*e}}(t,r):B(isNaN(t)?e:t)}var j=function t(e){var r=function(t){return 1===(t=+t)?N:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):B(isNaN(e)?r:e)}}(e);function n(t,e){var n=r((t=A(t)).r,(e=A(e)).r),i=r(t.g,e.g),a=r(t.b,e.b),o=N(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return n.gamma=t,n}(1);function U(t){return function(e){var r,n,i=e.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;r=1?(r=1,e-1):Math.floor(r*e),i=t[n],a=t[n+1],o=n>0?t[n-1]:2*i-a,s=na&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:q(r,n)})),a=Z.lastIndex;return a"),color:_(o,"bgcolor")||l.addOpacity(v.color,1),borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:n.event.x"),color:_(o,"bgcolor")||i.tinyColorHue,borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:m,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});p(w,.85),d(w)}}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(n.select(e).call(m,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:n.event,points:[i.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(e,r,i){var a=r.node;a.originalEvent=n.event,t._hoverdata=[a],n.select(e).call(m,r,i),s.click(t,{target:!0})}}})}},37629:function(t,e,r){"use strict";var n=r(82797),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return a(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,u){i=i||0,a=a||0;var c,f,h,p,d,v=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}v?(c=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},37704:function(t,e,r){"use strict";var n=r(15181),i=r(6680),a=r(28418),o=r(52948),s=r(4868),l=r(68478),u=r(54563),c=r(46190),f=r(77423);t.exports=function(t,e,r,h){function p(r,i){return n.coerce(t,e,f,r,i)}var d,v=p("a"),g=p("b"),y=p("c");if(v?(d=v.length,g?(d=Math.min(d,g.length),y&&(d=Math.min(d,y.length))):d=y?Math.min(d,y.length):0):g&&y&&(d=Math.min(g.length,y.length)),d){e._length=d,p("sum"),p("text"),p("hovertext"),"fills"!==e.hoveron&&p("hovertemplate"),p("mode",d1&&(h.variants=f.variants),f.orientation&&(h.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=t.length){var p=a(t,f.exif_location.offset),d=t.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),v=s.get_orientation(d);v>0&&(h.orientation=v)}return h}}}}}}},38188:function(t,e,r){"use strict";r.d(e,{Tj:function(){return o},$I:function(){return s}});var n="$";function i(){}function a(t,e){var r=new i;if(t instanceof i)t.each(function(t,e){r.set(e,t)});else if(Array.isArray(t)){var n,a=-1,o=t.length;if(null==e)for(;++a=n.length)return null!=t&&r.sort(t),null!=e?e(r):r;for(var u,c,f,h=-1,p=r.length,d=n[i++],v=o(),g=s();++hn.length)return t;var a,o=i[r-1];return null!=e&&r>=n.length?a=t.entries():(a=[],t.each(function(t,e){a.push({key:e,values:s(t,r)})})),null!=o?a.sort(function(t,e){return o(t.key,e.key)}):a}return r={object:function(t){return a(t,0,l,u)},map:function(t){return a(t,0,c,f)},entries:function(t){return s(a(t,0,c,f),0)},key:function(t){return n.push(t),r},sortKeys:function(t){return i[n.length-1]=t,r},sortValues:function(e){return t=e,r},rollup:function(t){return e=t,r}}}function l(){return{}}function u(t,e,r){t[e]=r}function c(){return o()}function f(t,e,r){t.set(e,r)}function h(){}var p=o.prototype;h.prototype=function(t,e){var r=new h;if(t instanceof h)t.each(function(t){r.add(t)});else if(t){var n=-1,i=t.length;if(null==e)for(;++n0){for(var n=[],i=0;i80*n){a=s=t[0],o=l=t[1];for(var x=n;xs&&(s=f),h>l&&(l=h);d=0!==(d=Math.max(s-a,l-o))?32767/d:0}return i(y,m,n,a,o,d,0),m}function r(t,e,r,n,i){var a,o;if(i===M(t,e,r,n)>0)for(a=e;a=e;a-=n)o=T(a,t[a],t[a+1],o);return o&&y(o,o.next)&&(A(o),o=o.next),o}function n(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!y(n,n.next)&&0!==g(n.prev,n,n.next))n=n.next;else{if(A(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function i(t,e,r,u,c,f,p){if(t){!p&&f&&function(t,e,r,n){var i=t;do{0===i.z&&(i.z=h(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,u=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1)}(i)}(t,u,c,f);for(var d,v,g=t;t.prev!==t.next;)if(d=t.prev,v=t.next,f?o(t,u,c,f):a(t))e.push(d.i/r|0),e.push(t.i/r|0),e.push(v.i/r|0),A(t),t=v.next,g=v.next;else if((t=v)===g){p?1===p?i(t=s(n(t),e,r),e,r,u,c,f,2):2===p&&l(t,e,r,u,c,f):i(n(t),e,r,u,c,f,1);break}}}function a(t){var e=t.prev,r=t,n=t.next;if(g(e,r,n)>=0)return!1;for(var i=e.x,a=r.x,o=n.x,s=e.y,l=r.y,u=n.y,c=ia?i>o?i:o:a>o?a:o,p=s>l?s>u?s:u:l>u?l:u,v=n.next;v!==e;){if(v.x>=c&&v.x<=h&&v.y>=f&&v.y<=p&&d(i,s,a,l,o,u,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function o(t,e,r,n){var i=t.prev,a=t,o=t.next;if(g(i,a,o)>=0)return!1;for(var s=i.x,l=a.x,u=o.x,c=i.y,f=a.y,p=o.y,v=sl?s>u?s:u:l>u?l:u,x=c>f?c>p?c:p:f>p?f:p,b=h(v,y,e,r,n),_=h(m,x,e,r,n),w=t.prevZ,T=t.nextZ;w&&w.z>=b&&T&&T.z<=_;){if(w.x>=v&&w.x<=m&&w.y>=y&&w.y<=x&&w!==i&&w!==o&&d(s,c,l,f,u,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,T.x>=v&&T.x<=m&&T.y>=y&&T.y<=x&&T!==i&&T!==o&&d(s,c,l,f,u,p,T.x,T.y)&&g(T.prev,T,T.next)>=0)return!1;T=T.nextZ}for(;w&&w.z>=b;){if(w.x>=v&&w.x<=m&&w.y>=y&&w.y<=x&&w!==i&&w!==o&&d(s,c,l,f,u,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;T&&T.z<=_;){if(T.x>=v&&T.x<=m&&T.y>=y&&T.y<=x&&T!==i&&T!==o&&d(s,c,l,f,u,p,T.x,T.y)&&g(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function s(t,e,r){var i=t;do{var a=i.prev,o=i.next.next;!y(a,o)&&m(a,i,i.next,o)&&_(a,o)&&_(o,a)&&(e.push(a.i/r|0),e.push(i.i/r|0),e.push(o.i/r|0),A(i),A(i.next),i=t=o),i=i.next}while(i!==t);return n(i)}function l(t,e,r,a,o,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&v(l,u)){var c=w(l,u);return l=n(l,l.next),c=n(c,c.next),i(l,e,r,a,o,s,0),void i(c,e,r,a,o,s,0)}u=u.next}l=l.next}while(l!==t)}function u(t,e){return t.x-e.x}function c(t,e){var r=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o&&(o=s,r=n.x=n.x&&n.x>=c&&i!==n.x&&d(ar.x||n.x===r.x&&f(r,n)))&&(r=n,p=l)),n=n.next}while(n!==u);return r}(t,e);if(!r)return e;var i=w(r,t);return n(i,i.next),n(r,r.next)}function f(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function h(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,r=t;do{(e.x=(t-o)*(a-s)&&(t-o)*(n-s)>=(r-o)*(e-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&m(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(_(t,e)&&_(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||y(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function m(t,e,r,n){var i=b(g(t,e,r)),a=b(g(t,e,n)),o=b(g(r,n,t)),s=b(g(r,n,e));return i!==a&&o!==s||!(0!==i||!x(t,r,e))||!(0!==a||!x(t,n,e))||!(0!==o||!x(r,t,n))||!(0!==s||!x(r,e,n))}function x(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function b(t){return t>0?1:t<0?-1:0}function _(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function w(t,e){var r=new k(t.i,t.x,t.y),n=new k(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function T(t,e,r,n){var i=new k(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function A(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function k(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},38793:function(t,e,r){"use strict";var n=r(93441),i=r(15181),a=r(26446),o=r(44236).extractOpts;t.exports=function(t,e,r,s,l){l||(l={});var u,c,f,h,p=l.isContour,d=t.cd[0],v=d.trace,g=t.xa,y=t.ya,m=d.x,x=d.y,b=d.z,_=d.xCenter,w=d.yCenter,T=d.zmask,A=v.zhoverformat,k=m,M=x;if(!1!==t.index){try{f=Math.round(t.index[1]),h=Math.round(t.index[0])}catch(e){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(f<0||f>=b[0].length||h<0||h>b.length)return}else{if(n.inbox(e-m[0],e-m[m.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(p){var S;for(k=[2*m[0]-m[1]],S=1;S")}}t.exports={hoverPoints:function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,u=s.cd[s.index],c=s.trace;if(l.isPtInside(u))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(u,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:i}},39452:function(t,e,r){var n=r(9915),i=r(18610);function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=a},39555:function(t,e,r){var n=r(49149);t.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&t[0]&&"number"==typeof t[0][0]){var i,a,o,s,l=t[0].length,u=t.length*l;e&&"string"!=typeof e||(e=new(n(e||"float32"))(u+r));var c=e.length-r;if(u!==c)throw new Error("source length "+u+" ("+l+"x"+t.length+") does not match destination length "+c);for(i=0,o=r;ir.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}},!!u&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}}),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})},!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},T.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),b(e),e.glplot.axes.update(e.axesOptions);for(var u=Object.keys(e.traces),c=null,h=e.glplot.selection,v=0;v")):"isosurface"===t.type||"volume"===t.type?(A.valueLabel=p.hoverLabelText(e._mockAxis,e._mockAxis.d2l(h.traceCoordinate[3]),t.valuehoverformat),E.push("value: "+A.valueLabel),h.textLabel&&E.push(h.textLabel),x=E.join("
")):x=h.textLabel;var L={x:h.traceCoordinate[0],y:h.traceCoordinate[1],z:h.traceCoordinate[2],data:w._input,fullData:w,curveNumber:w.index,pointNumber:T};d.appendArrayPointValue(L,w,T),t._module.eventData&&(L=w._module.eventData(L,h,w,{},T));var C={points:[L]};if(e.fullSceneLayout.hovermode){var P=[];d.loneHover({trace:w,x:(.5+.5*m[0]/m[3])*s,y:(.5-.5*m[1]/m[3])*l,xLabel:A.xLabel,yLabel:A.yLabel,zLabel:A.zLabel,text:x,name:c.name,color:d.castHoverOption(w,T,"bgcolor")||c.color,borderColor:d.castHoverOption(w,T,"bordercolor"),fontFamily:d.castHoverOption(w,T,"font.family"),fontSize:d.castHoverOption(w,T,"font.size"),fontColor:d.castHoverOption(w,T,"font.color"),nameLength:d.castHoverOption(w,T,"namelength"),textAlign:d.castHoverOption(w,T,"align"),hovertemplate:f.castOption(w,T,"hovertemplate"),hovertemplateLabels:f.extendFlat({},L,A),eventData:[L]},{container:n,gd:r,inOut_bbox:P}),L.bbox=P[0]}h.distance<5&&(h.buttons||_)?r.emit("plotly_click",C):r.emit("plotly_hover",C),this.oldEventData=C}else d.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},T.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var k=["xaxis","yaxis","zaxis"];function M(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=k[i],o=a.charAt(0),s=n[a],l=e[o],u=e[o+"calendar"],c=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var h,p=0;p<(c||l.length);p++)if(f.isArrayOrTypedArray(l[p]))for(var d=0;dy[1][o])y[0][o]=-1,y[1][o]=1;else{var C=y[1][o]-y[0][o];y[0][o]-=C/32,y[1][o]+=C/32}if("reversed"===l.autorange){var P=y[0][o];y[0][o]=y[1][o],y[1][o]=P}}else{var O=l.range;y[0][o]=l.r2l(O[0]),y[1][o]=l.r2l(O[1])}y[0][o]===y[1][o]&&(y[0][o]-=1,y[1][o]+=1),m[o]=y[1][o]-y[0][o],n.glplot.setBounds(o,{min:y[0][o]*p[o],max:y[1][o]*p[o]})}var I=c.aspectmode;if("cube"===I)g=[1,1,1];else if("manual"===I){var D=c.aspectratio;g=[D.x,D.y,D.z]}else{if("auto"!==I&&"data"!==I)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=[1,1,1];for(o=0;o<3;++o){var R=x[u=(l=c[k[o]]).type];z[o]=Math.pow(R.acc,1/R.count)/p[o]}g="data"===I||Math.max.apply(null,z)/Math.min.apply(null,z)<=4?z:[1,1,1]}c.aspectratio.x=f.aspectratio.x=g[0],c.aspectratio.y=f.aspectratio.y=g[1],c.aspectratio.z=f.aspectratio.z=g[2],n.glplot.setAspectratio(c.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=c.aspectmode);var F=c.domain||null,B=e._size||null;if(F&&B){var N=n.container.style;N.position="absolute",N.left=B.l+F.x[0]*B.w+"px",N.top=B.t+(1-F.y[1])*B.h+"px",N.width=B.w*(F.x[1]-F.x[0])+"px",N.height=B.h*(F.y[1]-F.y[0])+"px"}n.glplot.redraw()}},T.destroy=function(){var t=this;t.glplot&&(t.camera.mouseListener.enabled=!1,t.container.removeEventListener("wheel",t.camera.wheelListener),t.camera=null,t.glplot.dispose(),t.container.parentNode.removeChild(t.container),t.glplot=null)},T.getCamera=function(){var t,e=this;return e.camera.view.recalcMatrix(e.camera.view.lastT()),{up:{x:(t=e.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},T.setViewport=function(t){var e,r=this,n=t.camera;r.camera.lookAt.apply(this,[[(e=n).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),r.glplot.setAspectratio(t.aspectratio),"orthographic"===n.projection.type!==r.camera._ortho&&(r.glplot.redraw(),r.glplot.clearRGBA(),r.glplot.dispose(),r.initializeGLPlot())},T.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},T.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},T.saveLayout=function(t){var e,r,n,i,a,o,s=this,l=s.fullLayout,u=s.isCameraChanged(t),h=s.isAspectChanged(t),p=u||h;if(p){var d={};u&&(e=s.getCamera(),n=(r=f.nestedProperty(t,s.id+".camera")).get(),d[s.id+".camera"]=n),h&&(i=s.glplot.getAspectratio(),o=(a=f.nestedProperty(t,s.id+".aspectratio")).get(),d[s.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",t,l._preGUI,d),u&&(r.set(e),f.nestedProperty(l,s.id+".camera").set(e)),h&&(a.set(i),f.nestedProperty(l,s.id+".aspectratio").set(i),s.glplot.redraw())}return p},T.updateFx=function(t,e){var r=this,n=r.camera;if(n)if("orbit"===t)n.mode="orbit",n.keyBindingMode="rotate";else if("turntable"===t){n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate";var i=r.graphDiv,a=i._fullLayout,o=r.fullSceneLayout.camera,s=o.up.x,l=o.up.y,u=o.up.z;if(u/Math.sqrt(s*s+l*l+u*u)<.999){var h=r.id+".camera.up",p={x:0,y:0,z:1},d={};d[h]=p;var v=i.layout;c.call("_storeDirectGUIEdit",v,a._preGUI,d),o.up=p,f.nestedProperty(v,h).set(p)}}else n.keyBindingMode=t;r.fullSceneLayout.hovermode=e},T.toImage=function(t){var e=this;t||(t="png"),e.staticMode&&e.container.appendChild(n),e.glplot.redraw();var r=e.glplot.gl,i=r.drawingBufferWidth,a=r.drawingBufferHeight;r.bindFramebuffer(r.FRAMEBUFFER,null);var o=new Uint8Array(i*a*4);r.readPixels(0,0,i,a,r.RGBA,r.UNSIGNED_BYTE,o),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(o,i,a);var s=document.createElement("canvas");s.width=i,s.height=a;var l,u=s.getContext("2d",{willReadFrequently:!0}),c=u.createImageData(i,a);switch(c.data.set(o),u.putImageData(c,0,0),t){case"jpeg":l=s.toDataURL("image/jpeg");break;case"webp":l=s.toDataURL("image/webp");break;default:l=s.toDataURL("image/png")}return e.staticMode&&e.container.removeChild(n),l},T.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[k[t]];p.setConvert(e,this.fullLayout),e.setScale=f.noop}},T.make4thDimension=function(){var t=this,e=t.graphDiv._fullLayout;t._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(t._mockAxis,e)},t.exports=w},39616:function(t,e,r){"use strict";t.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],u=0;u<3;++u){var c=s[a[u]];if(c._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(c._length)===1/0||isNaN(c._length))l[u]=[];else{c._input_range=c.range.slice(),c.range[0]=r[u].lo/t.dataScale[u],c.range[1]=r[u].hi/t.dataScale[u],c._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),c.range[0]===c.range[1]&&(c.range[0]-=1,c.range[1]+=1);var f=c.tickmode;if("auto"===c.tickmode){c.tickmode="linear";var h=c.nticks||i.constrain(c._length/40,4,9);n.autoTicks(c,Math.abs(c.range[1]-c.range[0])/h)}for(var p=n.calcTicks(c,{msUTC:!0}),d=0;d/g," "));l[u]=p,c.tickmode=f}}for(e.ticks=l,u=0;u<3;++u)for(o[u]=.5*(t.glplot.bounds[0][u]+t.glplot.bounds[1][u]),d=0;d<2;++d)e.bounds[d][u]=t.glplot.bounds[d][u];t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;a0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each(function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(a)}).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,p);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,function(t){t.style("pointer-events","all")}),c=0;c0&&((T=E-s(x)-l(b))>L?A/T>C&&(_=x,w=b,C=A/T):A/E>C&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},C=A/E));if(h===v){var P=h-1,O=h+1;if(M)if(0===h)i=[0,1];else{var I=(h>0?f:c).reduce(function(t,e){return Math.max(t,l(e))},0),D=h/(1-Math.min(.5,I/E));i=h>0?[0,D]:[D,0]}else i=S?[Math.max(0,P),Math.max(1,O)]:[P,O]}else M?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-C*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-p(e,x.val,b.val))/(E-s(_)-l(w)),i=[_.val-C*s(_),w.val+C*l(w)];return y&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function p(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),S=k((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=k(r.vpadplus||r.vpad),L=k(r.vpadminus||r.vpad);if(!T){if(h=1/0,p=-1/0,w)for(n=0;n0&&(h=a),a>p&&a-o&&(h=a),a>p&&a=O;n--)P(n);return{min:d,max:v,opts:r}},concatExtremes:g};var v=3;function g(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,u=[],f=[];function h(t,e){for(n=0;n=r&&(u.extrapad||!o)){s=!1;break}i(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=a&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function b(t){return i(t)&&Math.abs(t)=e}},40413:function(t,e,r){"use strict";var n=r(11882),i=r(13625),a=r(83998),o=r(79659),s=r(44220),l=r(56895),u=r(39555);function c(t,e){if(!(this instanceof c))return new c(t,e);this.traces=[],this.passes={},this.regl=t,this.scatter=n(t),this.canvas=this.scatter.canvas}function f(t,e,r){return(null!=t.id?t.id:t)<<16|(255&e)<<8|255&r}function h(t,e,r){var n,i,a,o,s=t[e],l=t[r];return s.length>2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x,s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y,l.height),[a,n,o,i]}function p(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}t.exports=c,c.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o(function(){e.draw(),e.dirty=!0,e.planned=null})):(this.draw(),this.dirty=!0,o(function(){e.dirty=!1})),this)},c.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;nA))&&(s.lower||!(T0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return l.alloc(0);for(var e=l.allocUnsafe(t>>>0),r=this.head,n=0;r;)f(r.data,e,n),n+=r.data.length,r=r.next;return e}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0===(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=l.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,a=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,a),0===(t-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,e}},{key:c,value:function(t,e){return u(this,i(i({},e),{},{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},40668:function(t){"use strict";function e(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}t.exports=function(t,r){var n,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,u="h"===s.orientation,c=[];if(!1===r)for(n=0;n0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",A,"after",k,"iterations"),t}},40937:function(t,e,r){"use strict";t.exports=r(48410)},41093:function(t,e){"use strict";function r(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function n(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!p(t[0])||!p(t[1]))throw new Error("coordinates must contain numbers");return r({type:"Point",coordinates:t},e,n)}function i(t,e,n){void 0===n&&(n={});for(var i=0,a=t;i=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},e.radiansToLength=c,e.lengthToRadians=f,e.lengthToDegrees=function(t,e){return h(f(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=h,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return c(f(t,e),r)},e.convertArea=function(t,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[r];if(!i)throw new Error("invalid original units");var a=e.areaFactors[n];if(!a)throw new Error("invalid final units");return t/i*a},e.isNumber=p,e.isObject=function(t){return!!t&&t.constructor===Object},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(t){if(!p(t))throw new Error("bbox must only contain numbers")})},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},41199:function(t){"use strict";t.exports=function(t){for(var e=t.length,r=new Array(e),n=new Array(e),i=new Array(e),a=new Array(e),o=new Array(e),s=new Array(e),l=0;l0;){e=u[u.length-1];var p=t[e];if(a[e]=0&&s[e].push(o[v])}a[e]=d}else{if(n[e]===r[e]){var g=[],y=[],m=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,g.push(x),y.push(s[x]),m+=s[x].length,o[x]=f.length,x===e){l.length=d;break}}f.push(g);var b=new Array(m);for(d=0;d halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},T.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=i(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map(function(t){return parseFloat(t)}):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=f(t.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=m(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=T.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach(function(t,r){if("string"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(T.baseFontSize+"px "+t)}else{var i=t.style,s=t.weight,l=t.stretch,u=t.variant;t=n.parse(n.stringify(t)),i&&(t.style=i),s&&(t.weight=s),l&&(t.stretch=l),u&&(t.variant=u)}var c=n.stringify({size:T.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),f=p(t.size),h=Math.round(f[0]*d(f[1]));if(h!==e.fontSize[r]&&(o=!0,e.fontSize[r]=h),!(e.font[r]&&c==e.font[r].baseString||(a=!0,e.font[r]=T.fonts[c],e.font[r]))){var v=t.family.join(", "),g=[t.style];t.style!=t.variant&&g.push(t.variant),t.variant!=t.weight&&g.push(t.weight),_&&t.weight!=t.stretch&&g.push(t.stretch),e.font[r]={baseString:c,family:v,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:y(v,{origin:"top",fontSize:T.baseFontSize,fontStyle:g.join(" ")})},T.fonts[c]=e.font[r]}}),(a||o)&&this.font.forEach(function(r,i){var a=n.stringify({size:e.fontSize[i],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[i]=e.shader.atlas[a],!e.fontAtlas[i]){var o=r.metrics;e.shader.atlas[a]=e.fontAtlas[i]={fontString:a,step:2*Math.ceil(e.fontSize[i]*o.bottom*.5),em:e.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)}),"string"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),h=0;h2){for(var w=!t.position[0].length,A=c.mallocFloat(2*this.count),k=0,M=0;k1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0})),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(t,r){var n=(e.font[r]||e.font[0]).metrics,i=0;return i+=.5*n.bottom,-1*(i+="number"==typeof t?t-n.baseline:-n[t])})),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var q;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var G=t.color.length;q=c.mallocUint8(G);for(var Y=(t.color.subarray||t.color.slice).bind(t.color),W=0;W4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var J=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(J);for(var K=0;K1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},T.prototype.destroy=function(){},T.prototype.kerning=!0,T.prototype.position={constant:new Float32Array(2)},T.prototype.translate=null,T.prototype.scale=null,T.prototype.font=null,T.prototype.text="",T.prototype.positionOffset=[0,0],T.prototype.opacity=1,T.prototype.color=new Uint8Array([0,0,0,255]),T.prototype.alignOffset=[0,0],T.maxAtlasSize=1024,T.atlasCanvas=document.createElement("canvas"),T.atlasContext=T.atlasCanvas.getContext("2d",{alpha:!1}),T.baseFontSize=64,T.fonts={},t.exports=T},41499:function(t,e,r){"use strict";var n,i,a,o=r(15181),s=r(69562),l=r(92444),u=r(13516),c=r(60609).KO,f=r(25124),h=r(14736),p=r(16361),d=r(18687),v=r(41548),g=r(50883),y=g.axisNames,m=(n=function(t){return t.slice().reverse().map(function(t){return-t}).concat([0]).concat(t)},i=String,a={},function(t){var e=i?i(t):t;if(e in a)return a[e];var r=n(t);return a[e]=r,r});function x(t,e,r,n){var i=r("bgcolor");n.bgColor=s.combine(i,n.paper_bgcolor);var a,u=c(n.fullData,g.name,n.id),x=n.layoutOut;function b(t,e){return r(a+"."+t,e)}for(var _=0;_e.model.rawColor?1:t.model.rawColor"),L=n.mouse(f)[0];o.loneHover({trace:h,x:b-d.left+v.left,y:_-d.top+v.top,text:E,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:T,idealAlign:L1&&h.displayInd===f.dimensions.length-1?(i=u.left,a="left"):(i=u.left+u.width,a="right");var v=c.model.count,g=c.model.categoryLabel,y=v/c.parcatsViewModel.model.count,m={countLabel:v,categoryLabel:g,probabilityLabel:y.toFixed(3)},x=[];-1!==c.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",m.countLabel].join(" ")),-1!==c.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+m.categoryLabel+"):",m.probabilityLabel].join(" "));var b=x.join("
");return{trace:p,x:o*(i-e.left),y:s*(d-e.top),text:b,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:p.hovertemplate,hovertemplateLabels:m,eventData:[{data:p._input,fullData:p,count:v,category:g,probability:y}]}}function L(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var e,r=t.parcatsViewModel.graphDiv,i=r._fullLayout,a=i._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron,u=this;"color"===l?(function(t){var e=n.select(t).datum(),r=k(e);w(r),r.each(function(){s.raiseToTop(this)}),n.select(t.parentNode).selectAll("rect.bandrect").filter(function(t){return t.color===e.color}).each(function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)})}(u),S(u,"plotly_hover",n.event)):(function(t){n.select(t.parentNode).selectAll("rect.bandrect").each(function(t){var e=k(t);w(e),e.each(function(){s.raiseToTop(this)})}),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(u),M(u,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?e=E(r,a,u):"color"===l?e=function(t,e,r){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=r.getBoundingClientRect(),u=n.select(r).datum(),f=u.categoryViewModel,h=f.parcatsViewModel,p=h.model.dimensions[f.model.dimensionInd],d=h.trace,v=l.y+l.height/2;h.dimensions.length>1&&p.displayInd===h.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=f.model.categoryLabel,y=u.parcatsViewModel.model.count,m=0;u.categoryViewModel.bands.forEach(function(t){t.color===u.color&&(m+=t.count)});var x=f.model.count,b=0;h.pathSelection.each(function(t){t.model.color===u.color&&(b+=t.model.count)});var _=m/y,w=m/b,T=m/x,A={countLabel:y,categoryLabel:g,probabilityLabel:_.toFixed(3)},k=[];-1!==f.parcatsViewModel.hoverinfoItems.indexOf("count")&&k.push(["Count:",A.countLabel].join(" ")),-1!==f.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(k.push("P(color ∩ "+g+"): "+A.probabilityLabel),k.push("P("+g+" | color): "+w.toFixed(3)),k.push("P(color | "+g+"): "+T.toFixed(3)));var M=k.join("
"),S=c.mostReadable(u.color,["black","white"]);return{trace:d,x:o*(i-e.left),y:s*(v-e.top),text:M,color:u.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:A,eventData:[{data:d._input,fullData:d,category:g,count:y,probability:_,categorycount:x,colorcount:b,bandcolorcount:m}]}}(r,a,u):"dimension"===l&&(e=function(t,e,r){var i=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){i.push(E(t,e,this))}),i}(r,a,u)),e&&o.loneHover(e,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r}))}}function C(t){var e=t.parcatsViewModel;e.dragDimension||(_(e.pathSelection),T(e.dimensionSelection.selectAll("g.category")),A(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(v),-1!==e.hoverinfoItems.indexOf("skip"))||("color"===t.parcatsViewModel.hoveron?S(this,"plotly_unhover",n.event):M(this,"plotly_unhover",n.event))}function P(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map(function(t){return t.displayInd}),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each(function(e){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map(function(t){return t.displayInd}),e.model.dragY=e.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each(function(e){e.yf.y+f.height/2&&(o.model.displayInd=f.model.displayInd,f.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=n.event.x;var h=t.parcatsViewModel.dimensions[r],p=t.parcatsViewModel.dimensions[i];void 0!==h&&a.model.dragXp.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}j(t.parcatsViewModel),N(t.parcatsViewModel),R(t.parcatsViewModel),z(t.parcatsViewModel)}}function I(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=D(t.parcatsViewModel),i=t.parcatsViewModel.model.dimensions.map(function(t){return t.displayInd}),o=t.initialDragDimensionDisplayInds.some(function(t,e){return t!==i[e]});o&&i.forEach(function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r});var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map(function(t){return t.displayInd});if(s=t.initialDragCategoryDisplayInds.some(function(t,e){return t!==l[e]})){var u=t.model.categories.slice().sort(function(t,e){return t.displayInd-e.displayInd}),c=u.map(function(t){return t.categoryValue}),f=u.map(function(t){return t.categoryLabel});e["dimensions["+t.model.containerInd+"].categoryarray"]=[c],e["dimensions["+t.model.containerInd+"].ticktext"]=[f],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?S(t.potentialClickBand,"plotly_click",n.event.sourceEvent):M(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd&&(t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null),t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,j(t.parcatsViewModel),N(t.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each(function(){R(t.parcatsViewModel,!0),z(t.parcatsViewModel,!0)}).each("end",function(){(o||s)&&a.restyle(t.parcatsViewModel.graphDiv,e,[r])})}}function D(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)c+="C"+u[s]+","+(e[s+1]+n)+" "+l[s]+","+(e[s]+n)+" "+(t[s]+r[s])+","+(e[s]+n),c+="l-"+r[s]+",0 ";return c+"Z"}function N(t){var e=t.dimensions,r=t.model,n=e.map(function(t){return t.categories.map(function(t){return t.y})}),i=t.model.dimensions.map(function(t){return t.categories.map(function(t){return t.displayInd})}),a=t.model.dimensions.map(function(t){return t.displayInd}),o=t.dimensions.map(function(t){return t.model.dimensionInd}),s=e.map(function(t){return t.x}),l=e.map(function(t){return t.width}),u=[];for(var c in r.paths)r.paths.hasOwnProperty(c)&&u.push(r.paths[c]);function f(t){var e=t.categoryInds.map(function(t,e){return i[e][t]});return o.map(function(t){return e[t]})}u.sort(function(e,r){var n=f(e),i=f(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),ni?1:0});for(var h=new Array(u.length),p=e[0].model.count,d=e[0].categories.map(function(t){return t.height}).reduce(function(t,e){return t+e}),v=0;v0?d*(y.count/p):0;for(var m,x=new Array(n.length),b=0;b1?(t.width-80-16)/(n-1):0)*i;var a,o,s,l,u,c=[],f=t.model.maxCats,h=e.categories.length,p=e.count,d=t.height-8*(f-1),v=8*(f-h)/2,g=e.categories.map(function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}});for(g.sort(function(t,e){return t.displayInd-e.displayInd}),u=0;u0?o.count/p*d:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:v,bands:[],parcatsViewModel:t},v=v+a+8,c.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:c,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}t.exports=function(t,e,r,n){h(r,t,n,e)}},41545:function(t,e,r){"use strict";t.exports=r(29114)},41548:function(t,e,r){"use strict";var n=r(24761),i=r(94257),a=r(79444).u,o=r(15181).extendFlat,s=r(7458).overrideAll,l=s({color:i.color,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash},"plot","from-root"),u=s({ticklen:i.ticklen,tickwidth:o({},i.tickwidth,{dflt:2}),tickcolor:i.tickcolor,showticklabels:i.showticklabels,labelalias:i.labelalias,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,tickfont:i.tickfont,tickformat:i.tickformat,hoverformat:i.hoverformat,layer:i.layer},"plot","from-root"),c=o({visible:o({},i.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:o({},i.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},l,u),f=o({visible:o({},i.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:i.ticks,editType:"calc"},l,u);t.exports={domain:a({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:n.background},realaxis:c,imaginaryaxis:f,editType:"calc"}},41562:function(t,e,r){"use strict";var n=r(15181),i=r(69562),a=r(46982),o=r(72639),s=r(63457),l=r(88156),u=r(41993),c=r(74349),f=n.coerceFont;function h(t,e,r,i,a,o){var s=!(!1===(o=o||{}).moduleHasSelected),l=!(!1===o.moduleHasUnselected),u=!(!1===o.moduleHasConstrain),c=!(!1===o.moduleHasCliponaxis),h=!(!1===o.moduleHasTextangle),p=!(!1===o.moduleHasInsideanchor),d=!!o.hasPathbar,v=Array.isArray(a)||"auto"===a,g=v||"inside"===a,y=v||"outside"===a;if(g||y){var m=f(i,"textfont",r.font),x=n.extendFlat({},m),b=!(t.textfont&&t.textfont.color);if(b&&delete x.color,f(i,"insidetextfont",x),d){var _=n.extendFlat({},m);b&&delete _.color,f(i,"pathbar.textfont",_)}y&&f(i,"outsidetextfont",m),s&&i("selected.textfont.color"),l&&i("unselected.textfont.color"),u&&i("constraintext"),c&&i("cliponaxis"),h&&i("textangle"),i("texttemplate")}g&&p&&i("insidetextanchor")}t.exports={supplyDefaults:function(t,e,r,u){function f(r,i){return n.coerce(t,e,c,r,i)}if(o(t,e,u,f)){s(t,e,u,f),f("xhoverformat"),f("yhoverformat"),f("orientation",e.x&&!e.y?"h":"v"),f("base"),f("offset"),f("width"),f("text"),f("hovertext"),f("hovertemplate");var p=f("textposition");h(t,0,u,f,p,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(t,e,f,r,u);var d=(e.marker.line||{}).color,v=a.getComponentMethod("errorbars","supplyDefaults");v(t,e,d||i.defaultLine,{axis:"y"}),v(t,e,d||i.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1},crossTraceDefaults:function(t,e){var r,i;function a(t){return n.coerce(i._input,i,c,t)}if("group"===e.barmode)for(var o=0;o")}function p(t){return t+"°"}}(u,v,t,l[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}}},42591:function(t,e,r){"use strict";var n=r(62284),i=r(93335).IMAGE_URL_PREFIX,a=r(66424).Buffer;e.p=function(t){var e=t.replace(i,""),r=new a(e,"base64");return n(r)}},42699:function(t){"use strict";var e=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,r=/^[^\.\[\]]+$/;t.exports=function(t,n){for(;n;){var i=t.match(e);if(i)t=i[1];else{if(!t.match(r))throw new Error("bad relativeAttr call:"+[t,n]);t=""}if("^"!==n.charAt(0))break;n=n.slice(1)}return t&&"["!==n.charAt(0)?t+"."+n:t+n}},42817:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(69651);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},42874:function(t,e,r){var n=r(9915),i=r(18610);function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o(8+(t-=this.jdEpoch)+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s(20+(t-=this.jdEpoch),20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=a},42964:function(t,e,r){"use strict";var n=r(65941)();t.exports=function(t){return t!==n&&null!==t}},43016:function(t,e,r){"use strict";r.r(e),r.d(e,{timeDay:function(){return y.A},timeDays:function(){return y._},timeFriday:function(){return m.Sh},timeFridays:function(){return m.tz},timeHour:function(){return v},timeHours:function(){return g},timeInterval:function(){return n.A},timeMillisecond:function(){return a},timeMilliseconds:function(){return o},timeMinute:function(){return h},timeMinutes:function(){return p},timeMonday:function(){return m.By},timeMondays:function(){return m.KP},timeMonth:function(){return b},timeMonths:function(){return _},timeSaturday:function(){return m.kS},timeSaturdays:function(){return m.t$},timeSecond:function(){return u},timeSeconds:function(){return c},timeSunday:function(){return m.fz},timeSundays:function(){return m.se},timeThursday:function(){return m.dt},timeThursdays:function(){return m.Q$},timeTuesday:function(){return m.eQ},timeTuesdays:function(){return m.yW},timeWednesday:function(){return m.l3},timeWednesdays:function(){return m.gf},timeWeek:function(){return m.fz},timeWeeks:function(){return m.se},timeYear:function(){return w.A},timeYears:function(){return w.V},utcDay:function(){return L.A},utcDays:function(){return L.o},utcFriday:function(){return C.a1},utcFridays:function(){return C.Zn},utcHour:function(){return S},utcHours:function(){return E},utcMillisecond:function(){return a},utcMilliseconds:function(){return o},utcMinute:function(){return A},utcMinutes:function(){return k},utcMonday:function(){return C.rt},utcMondays:function(){return C.ON},utcMonth:function(){return O},utcMonths:function(){return I},utcSaturday:function(){return C.c8},utcSaturdays:function(){return C.Xo},utcSecond:function(){return u},utcSeconds:function(){return c},utcSunday:function(){return C.Hl},utcSundays:function(){return C.aZ},utcThursday:function(){return C.pT},utcThursdays:function(){return C.wr},utcTuesday:function(){return C.sr},utcTuesdays:function(){return C.jN},utcWednesday:function(){return C.z2},utcWednesdays:function(){return C.G6},utcWeek:function(){return C.Hl},utcWeeks:function(){return C.aZ},utcYear:function(){return D.A},utcYears:function(){return D.j}});var n=r(15824),i=(0,n.A)(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?(0,n.A)(function(e){e.setTime(Math.floor(e/t)*t)},function(e,r){e.setTime(+e+r*t)},function(e,r){return(r-e)/t}):i:null};var a=i,o=i.range,s=r(21365),l=(0,n.A)(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+e*s.Tt)},function(t,e){return(e-t)/s.Tt},function(t){return t.getUTCSeconds()}),u=l,c=l.range,f=(0,n.A)(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*s.Tt)},function(t,e){t.setTime(+t+e*s.rR)},function(t,e){return(e-t)/s.rR},function(t){return t.getMinutes()}),h=f,p=f.range,d=(0,n.A)(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*s.Tt-t.getMinutes()*s.rR)},function(t,e){t.setTime(+t+e*s.JJ)},function(t,e){return(e-t)/s.JJ},function(t){return t.getHours()}),v=d,g=d.range,y=r(90059),m=r(12053),x=(0,n.A)(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),b=x,_=x.range,w=r(1864),T=(0,n.A)(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*s.rR)},function(t,e){return(e-t)/s.rR},function(t){return t.getUTCMinutes()}),A=T,k=T.range,M=(0,n.A)(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+e*s.JJ)},function(t,e){return(e-t)/s.JJ},function(t){return t.getUTCHours()}),S=M,E=M.range,L=r(20361),C=r(29423),P=(0,n.A)(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),O=P,I=P.range,D=r(21662)},43030:function(t,e,r){"use strict";t.exports=r(31149)},43061:function(t,e,r){"use strict";var n=r(31164);t.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},43094:function(t,e,r){"use strict";var n,i,a,o,s=r(5763),l=r(16534).round,u="M0,0Z",c=Math.sqrt(2),f=Math.sqrt(3),h=Math.PI,p=Math.cos,d=Math.sin;function v(t){return null===t}function g(t,e,r){if(!(t&&t%360!=0||e))return r;if(a===t&&o===e&&n===r)return i;function l(t,r){var n=p(t),i=d(t),a=r[0],o=r[1]+(e||0);return[a*n-o*i,a*i+o*n]}a=t,o=e,n=r;for(var u=t/180*h,c=0,f=0,v=s(r),g="",y=0;ym.glText.length){var T=_-m.glText.length;for(v=0;vr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t}),m.line2d.update(m.lineOptions)),m.error2d){var k=(m.errorXOptions||[]).concat(m.errorYOptions||[]);m.error2d.update(k)}m.scatter2d&&m.scatter2d.update(m.markerOptions),m.fillOrder=s.repeat(null,_),m.fill2d&&(m.fillOptions=m.fillOptions.map(function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,u=m.lineOptions[e],c=[];s._ownfill&&c.push(e),s._nexttrace&&c.push(e+1),c.length&&(m.fillOrder[e]=c);var f,h,p=[],d=u&&u.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(d[h+1]);)h-=2;0!==d[f+1]&&(p=[d[f],0]),p=p.concat(d.slice(f,h+2)),0!==d[h+1]&&(p=p.concat([d[h],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(d[h]);)h-=2;0!==d[f]&&(p=[0,d[f+1]]),p=p.concat(d.slice(f,h+2)),0!==d[h]&&(p=p.concat([0,d[h+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(p=[],i=0,t.splitNull=!0,a=0;a-1;for(v=0;v<_;v++){var L=r[v][0],C=L.trace,P=L.t,O=P.index,I=C._length,D=P.x,z=P.y;if(C.selectedpoints||S||E){if(S||(S=!0),C.selectedpoints){var R=m.selectBatch[O]=s.selIndices2selPoints(C),F={};for(g=0;g0?Math.max(r,a):0}}},43929:function(t,e,r){"use strict";var n=r(59043),i=r(15181),a=r(93003),o=r(40243).findExtremes,s=r(89196),l=r(2524),u=l.calcMarkerSize,c=l.calcAxisExpansion,f=l.setFirstScatter,h=r(80924),p=r(59509),d=r(71796),v=r(78945).BADNUM,g=r(879).TOO_MANY_POINTS;function y(t,e,r){var n=t._extremes[e._id],i=o(e,r._bnds,{padded:!0});n.min=n.min.concat(i.min),n.max=n.max.concat(i.max)}t.exports=function(t,e){var r,o=t._fullLayout,l=e._xA=a.getFromId(t,e.xaxis,"x"),m=e._yA=a.getFromId(t,e.yaxis,"y"),x=o._plots[e.xaxis+e.yaxis],b=e._length,_=b>=g,w=2*b,T={},A=l.makeCalcdata(e,"x"),k=m.makeCalcdata(e,"y"),M=s(e,l,"x",A),S=s(e,m,"y",k),E=M.vals,L=S.vals;e._x=E,e._y=L,e.xperiodalignment&&(e._origX=A,e._xStarts=M.starts,e._xEnds=M.ends),e.yperiodalignment&&(e._origY=k,e._yStarts=S.starts,e._yEnds=S.ends);var C=new Array(w),P=new Array(b);for(r=0;r1&&i.extendFlat(s.line,p.linePositions(t,r,n)),s.errorX||s.errorY){var l=p.errorBarPositions(t,r,n,a,o);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}return s.text&&(i.extendFlat(s.text,{positions:n},p.textPosition(t,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},p.textPosition(t,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},p.textPosition(t,r,s.text,s.markerUnsel))),s}(t,0,e,C,E,L),D=d(t,x);return f(o,e),_?I.marker&&(O=I.marker.sizeAvg||Math.max(I.marker.size,3)):O=u(e,b),c(t,e,l,m,E,L,O),I.errorX&&y(e,l,I.errorX),I.errorY&&y(e,m,I.errorY),I.fill&&!D.fill2d&&(D.fill2d=!0),I.marker&&!D.scatter2d&&(D.scatter2d=!0),I.line&&!D.line2d&&(D.line2d=!0),!I.errorX&&!I.errorY||D.error2d||(D.error2d=!0),I.text&&!D.glText&&(D.glText=!0),I.marker&&(I.marker.snap=b),D.lineOptions.push(I.line),D.errorXOptions.push(I.errorX),D.errorYOptions.push(I.errorY),D.fillOptions.push(I.fill),D.markerOptions.push(I.marker),D.markerSelectedOptions.push(I.markerSel),D.markerUnselectedOptions.push(I.markerUnsel),D.textOptions.push(I.text),D.textSelectedOptions.push(I.textSel),D.textUnselectedOptions.push(I.textUnsel),D.selectBatch.push([]),D.unselectBatch.push([]),T._scene=D,T.index=D.count,T.x=E,T.y=L,T.positions=C,D.count++,[{x:!1,y:!1,t:T,trace:e}]}},44036:function(t,e,r){"use strict";var n=r(16534),i=r(15181),a=i.numberFormat,o=r(25623),s=r(21757),l=r(46982),u=i.strTranslate,c=r(3071),f=r(69562),h=r(88191),p=r(93441),d=r(26446),v=r(71467),g=r(95243),y=r(7514),m=y.selectingOrDrawing,x=y.freeMode,b=r(5126).FROM_TL,_=r(91371),w=r(357).redrawReglTraces,T=r(37070),A=r(93003).getFromId,k=r(35640).prepSelect,M=r(35640).clearOutline,S=r(35640).selectOnClick,E=r(44559),L=r(29278),C=L.MINDRAG,P=L.MINZOOM,O=!0;function I(t,e,r,n){var a=i.ensureSingle(t.draglayer,e,r,function(e){e.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id)});return a.call(v,n),a.node()}function D(t,e,r,i,a,o,s){var l=I(t,"rect",e,r);return n.select(l).call(h.setRect,i,a,o,s),l}function z(t,e){for(var r=0;r=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",u(r,n)).attr("d",i+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),V(t,e,i,a)}function V(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function H(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(t){O&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),O=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,P)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function Y(t,e,r,n,a){for(var o,s,l,u,c=!1,f={},h={},p=(a||{}).xaHash,d=(a||{}).yaHash,v=0;v=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(H(i),2!==t||yt||qt(),gt)o.indexOf("select")>-1&&S(r,i,J,K,e.id,Pt),o.indexOf("event")>-1&&p.click(i,r,e.id);else if(1===t&&yt){var s=v?I:O,u="s"===v||"w"===y?0:1,f=s._name+".range["+u+"]",h=function(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,u),d="left",g="middle";if(s.fixedrange)return;v?(g="n"===v?"top":"bottom","right"===s.side&&(d="right")):"e"===y&&(d="right"),i._context.showAxisRangeEntryBoxes&&n.select(bt).call(c.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:g}).on("edit",function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,f,e)})}}}function Dt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,pt*e+_t)),i=Math.max(0,Math.min(et,dt*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Lt.attr("d","M0,0Z")}if(Tt.l=Math.min(_t,n),Tt.r=Math.max(_t,n),Tt.t=Math.min(wt,i),Tt.b=Math.max(wt,i),rt.isSubplotConstrained)a>P||o>P?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?Tt.t=wt-o:Tt.b=wt+o):(a=o*tt/et,_t>n?Tt.l=_t-a:Tt.r=_t+a),Lt.attr("d",G(Tt))):s();else if(nt.isSubplotConstrained)if(a>P||o>P){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),u=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=u*tt,Tt.b=(1-l)*et,Tt.t=(1-u)*et,Lt.attr("d",G(Tt))}else s();else!at||o0){var c;if(nt.isSubplotConstrained||!it&&1===at.length){for(c=0;ce}function f(t,e){return t>=e}e.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-s)-1:Math.floor((t-e.start)/e.size+s);var a,o,h=0,p=e.length,d=0,v=p>1?(e[p-1]-e[0])/(p-1):1;for(o=v>=0?r?l:u:r?f:c,t+=v*s*(r?-1:1)*(v>=0?1:-1);h90&&i.log("Long binary search..."),h-1},e.sorterAsc=function(t,e){return t-e},e.sorterDes=function(t,e){return e-t},e.distinctVals=function(t){var r,n=t.slice();for(n.sort(e.sorterAsc),r=n.length-1;r>-1&&n[r]===o;r--);for(var i,a=n[r]-n[0]||1,s=a/(r||1)/1e4,l=[],u=0;u<=r;u++){var c=n[u],f=c-i;void 0===i?(l.push(c),i=c):f>s&&(a=Math.min(a,f),l.push(c),i=c)}return{vals:l,minDiff:a}},e.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},e.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;i0){var h=i.c2l(c);i._lowerLogErrorBound||(i._lowerLogErrorBound=h),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}t.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;eT?c.push({code:"unused",traceType:m,templateCount:w,dataCount:T}):T>w&&c.push({code:"reused",traceType:m,templateCount:w,dataCount:T})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=v(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&c.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&g(a)&&t(a,o)}}({data:p,layout:h},""),c.length)return c.map(y)}},46813:function(t){"use strict";t.exports=n;var e=(n.canvas=document.createElement("canvas")).getContext("2d"),r=i([32,126]);function n(t,n){Array.isArray(t)&&(t=t.join(", "));var a,o={},s=16,l=.05;n&&(2===n.length&&"number"==typeof n[0]?a=i(n):Array.isArray(n)?a=n:(n.o?a=i(n.o):n.pairs&&(a=n.pairs),n.fontSize&&(s=n.fontSize),null!=n.threshold&&(l=n.threshold))),a||(a=r),e.font=s+"px "+t;for(var u=0;us*l){var p=(h-f)/s;o[c]=1e3*p}}return o}function i(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),i=t[0];i=90||i>90&&a>=450?1:s<=0&&u<=0?0:Math.max(s,u),[i<=180&&a>=180||i>180&&a>=540?-1:o>=0&&l>=0?0:Math.min(o,l),i<=270&&a>=270||i>270&&a>=630?-1:s>=0&&u>=0?0:Math.min(s,u),a>=360?1:o<=0&&l<=0?0:Math.max(o,l),e]}(d),_=b[2]-b[0],w=b[3]-b[1],T=p/h,A=Math.abs(w/_);T>A?(v=h,x=(p-(g=h*A))/i.h/2,y=[s[0],s[1]],m=[f[0]+x,f[1]-x]):(g=p,x=(h-(v=p/A))/i.w/2,y=[s[0]+x,s[1]-x],m=[f[0],f[1]]),r.xLength2=v,r.yLength2=g,r.xDomain2=y,r.yDomain2=m;var k,M=r.xOffset2=i.l+i.w*y[0],S=r.yOffset2=i.t+i.h*(1-m[1]),E=r.radius=v/_,L=r.innerRadius=r.getHole(e)*E,C=r.cx=M-E*b[0],P=r.cy=S+E*b[3],O=r.cxx=C-M,I=r.cyy=P-S,D=a.side;"counterclockwise"===D?(k=D,D="top"):"clockwise"===D&&(k=D,D="bottom"),r.radialAxis=r.mockAxis(t,e,a,{_id:"x",side:D,_trueSide:k,domain:[L/i.w,E/i.w]}),r.angularAxis=r.mockAxis(t,e,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(t,e),r.updateAngularAxis(t,e),r.updateRadialAxis(t,e),r.updateRadialAxisTitle(t,e),r.xaxis=r.mockCartesianAxis(t,e,{_id:"x",domain:y}),r.yaxis=r.mockCartesianAxis(t,e,{_id:"y",domain:m});var F=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",F).attr("transform",l(O,I)),n.frontplot.attr("transform",l(M,S)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",F).attr("transform",l(C,P)).call(u.fill,e.bgcolor)},N.mockAxis=function(t,e,r,n){var i=o.extendFlat({},r,n);return d(i,e,t),i},N.mockCartesianAxis=function(t,e,r){var n=this,i=n.isSmith,a=r._id,s=o.extendFlat({type:"linear"},r);p(s,t);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var t=n.sectorBBox,r=l[a],i=n.radialAxis._rl,o=(i[1]-i[0])/(1-n.getHole(e));s.range=[t[r[0]]*o,t[r[1]]*o]},s.isPtWithinRange="x"!==a||i?function(){return!0}:function(t){return n.isPtInside(t)},s.setRange(),s.setScale(),s},N.doAutoRange=function(t,e){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(e);v(n,i);var o=i.range;a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,"gregorian"),i.r2l(o[1],null,"gregorian")]},N.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,c=r.innerRadius,f=r.cx,p=r.cy,d=r.getRadial(e),v=z(r.getSector(e)[0],360),g=r.radialAxis,y=c90&&v<=270&&(g.tickangle=180);var x=m?function(t){var e=I(r,C([t.x,0]));return l(e[0]-f,e[1]-p)}:function(t){return l(g.l2p(t.x)+c,0)},b=m?function(t){return O(r,t.x,-1/0,1/0)}:function(t){return r.pathArc(g.r2p(t.x)+c)},_=j(d);if(r.radialTickLayout!==_&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=_),y){g.setScale();var w=0,T=m?(g.tickvals||[]).filter(function(t){return t>=0}).map(function(t){return h.tickText(g,t,!0,!1)}):h.calcTicks(g),A=m?T:h.clipEnds(g,T),k=h.getTickSigns(g)[2];m&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(k=-k),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),h.drawTicks(n,g,{vals:T,layer:i["radial-axis"],path:h.makeTickPath(g,0,k),transFn:x,crisp:!1}),h.drawGrid(n,g,{vals:A,layer:i["radial-grid"],path:b,transFn:o.noop,crisp:!1}),h.drawLabels(n,g,{vals:T,layer:i["radial-axis"],transFn:x,labelFns:h.makeLabelFns(g,w)})}var M=r.radialAxisAngle=r.vangles?F(U(R(d.angle),r.vangles)):d.angle,S=l(f,p),E=S+s(-M);V(i["radial-axis"],y&&(d.showticklabels||d.ticks),{transform:E}),V(i["radial-grid"],y&&d.showgrid,{transform:m?"":S}),V(i["radial-line"].select("line"),y&&d.showline,{x1:m?-a:c,y1:0,x2:a,y2:0,transform:E}).attr("stroke-width",d.linewidth).call(u.stroke,d.linecolor)},N.updateRadialAxisTitle=function(t,e,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(e),u=n.id+"title",f=0;if(l.title){var h=c.bBox(n.layers["radial-axis"].node()).height,p=l.title.font.size,d=l.side;f="top"===d?p:"counterclockwise"===d?-(h+.4*p):h+.8*p}var v=void 0!==r?r:n.radialAxisAngle,g=R(v),y=Math.cos(g),m=Math.sin(g),b=o+a/2*y+f*m,_=s-a/2*m+f*y;n.layers["radial-axis-title"]=x.draw(i,u,{propContainer:l,propName:n.id+".radialaxis.title",placeholder:D(i,"Click to enter radial axis title"),attributes:{x:b,y:_,"text-anchor":"middle"},transform:{rotate:-v}})}},N.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,c=r.innerRadius,f=r.cx,p=r.cy,d=r.getAngular(e),v=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",d.rotation),v.setGeometry(),v.setScale());var y=g?function(t){var e=I(r,C([0,t.x]));return Math.atan2(e[0]-f,e[1]-p)-Math.PI/2}:function(t){return v.t2g(t.x)};"linear"===v.type&&"radians"===v.thetaunit&&(v.tick0=F(v.tick0),v.dtick=F(v.dtick));var m=function(t){return l(f+a*Math.cos(t),p-a*Math.sin(t))},x=g?function(t){var e=I(r,C([0,t.x]));return l(e[0],e[1])}:function(t){return m(y(t))},b=g?function(t){var e=I(r,C([0,t.x])),n=Math.atan2(e[0]-f,e[1]-p)-Math.PI/2;return l(e[0],e[1])+s(-F(n))}:function(t){var e=y(t);return m(e)+s(-F(e))},_=g?function(t){return P(r,t.x,0,1/0)}:function(t){var e=y(t),r=Math.cos(e),n=Math.sin(e);return"M"+[f+c*r,p-c*n]+"L"+[f+a*r,p-a*n]},w=h.makeLabelFns(v,0).labelStandoff,T={xFn:function(t){var e=y(t);return Math.cos(e)*w},yFn:function(t){var e=y(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(w+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*M)},anchorFn:function(t){var e=y(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=y(t);return-.5*(1+Math.sin(n))*r}},A=j(d);r.angularTickLayout!==A&&(i["angular-axis"].selectAll("."+v._id+"tick").remove(),r.angularTickLayout=A);var k,S=g?[1/0].concat(v.tickvals||[]).map(function(t){return h.tickText(v,t,!0,!1)}):h.calcTicks(v);if(g&&(S[0].text="∞",S[0].fontSize*=1.75),"linear"===e.gridshape?(k=S.map(y),o.angleDelta(k[0],k[1])<0&&(k=k.slice().reverse())):k=null,r.vangles=k,"category"===v.type&&(S=S.filter(function(t){return o.isAngleInsideSector(y(t),r.sectorInRad)})),v.visible){var E="inside"===v.ticks?-1:1,L=(v.linewidth||1)/2;h.drawTicks(n,v,{vals:S,layer:i["angular-axis"],path:"M"+E*L+",0h"+E*v.ticklen,transFn:b,crisp:!1}),h.drawGrid(n,v,{vals:S,layer:i["angular-grid"],path:_,transFn:o.noop,crisp:!1}),h.drawLabels(n,v,{vals:S,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:x,labelFns:T})}V(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:l(f,p)}).attr("stroke-width",d.linewidth).call(u.stroke,d.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1)),this.updateHoverAndMainDrag(t))},N.updateHoverAndMainDrag=function(t){var e,r,s=this,u=s.isSmith,c=s.gd,f=s.layers,h=t._zoomlayer,p=S.MINZOOM,d=S.OFFEDGE,v=s.radius,x=s.innerRadius,T=s.cx,A=s.cy,k=s.cxx,M=s.cyy,L=s.sectorInRad,C=s.vangles,P=s.radialAxis,O=E.clampTiny,I=E.findXYatLength,D=E.findEnclosingVertexAngles,z=S.cornerHalfWidth,R=S.cornerLen/2,F=g.makeDragger(f,"path","maindrag",!1===t.dragmode?"none":"crosshair");n.select(F).attr("d",s.pathSubplot()).attr("transform",l(T,A)),F.onmousemove=function(t){m.hover(c,t,s.id),c._fullLayout._lasthover=F,c._fullLayout._hoversubplot=s.id},F.onmouseout=function(t){c._dragging||y.unhover(c,t)};var B,N,j,U,V,H,q,G,Y,W={element:F,gd:c,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function Z(t,e){return Math.sqrt(t*t+e*e)}function X(t,e){return Z(t-k,e-M)}function J(t,e){return Math.atan2(M-e,t-k)}function K(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function $(t,e){if(0===t)return s.pathSector(2*z);var r=R/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,v)),o=a-z,l=a+z;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,i)+"L"+K(l,i)+"A"+[l,l]+" 0,0,1 "+K(l,n)+"Z"}function Q(t,e,r){if(0===t)return s.pathSector(2*z);var n,i,a=K(t,e),o=K(t,r),l=O((a[0]+o[0])/2),u=O((a[1]+o[1])/2);if(l&&u){var c=u/l,f=-1/c,h=I(z,c,l,u);n=I(R,f,h[0][0],h[0][1]),i=I(R,f,h[1][0],h[1][1])}else{var p,d;u?(p=R,d=z):(p=z,d=R),n=[[l-p,u-d],[l+p,u-d]],i=[[l-p,u+d],[l+p,u+d]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function tt(t,e){return e=Math.max(Math.min(e,v),x),tp?(t-1&&1===t&&_(e,c,[s.xaxis],[s.yaxis],s.id,W),r.indexOf("event")>-1&&m.click(c,e,s.id)}W.prepFn=function(t,n,a){var l=c._fullLayout.dragmode,f=F.getBoundingClientRect();c._fullLayout._calcInverseTransform(c);var p=c._fullLayout._invTransform;e=c._fullLayout._invScaleX,r=c._fullLayout._invScaleY;var d=o.apply3DTransform(p)(n-f.left,a-f.top);if(B=d[0],N=d[1],C){var y=E.findPolygonOffset(v,L[0],L[1],C);B+=k+y[0],N+=M+y[1]}switch(l){case"zoom":W.clickFn=st,u||(W.moveFn=C?it:rt,W.doneFn=at,function(){j=null,U=null,V=s.pathSubplot(),H=!1;var t=c._fullLayout[s.id];q=i(t.bgcolor).getLuminance(),(G=g.makeZoombox(h,q,T,A,V)).attr("fill-rule","evenodd"),Y=g.makeCorners(h,T,A),w(c)}());break;case"select":case"lasso":b(t,n,a,W,l)}},y.init(W)},N.updateRadialDrag=function(t,e,r){var i=this,u=i.gd,c=i.layers,f=i.radius,h=i.innerRadius,p=i.cx,d=i.cy,v=i.radialAxis,m=S.radialDragBoxSize,x=m/2;if(v.visible){var b,_,T,M=R(i.radialAxisAngle),E=v._rl,L=E[0],C=E[1],P=E[r],O=.75*(E[1]-E[0])/(1-i.getHole(e))/f;r?(b=p+(f+x)*Math.cos(M),_=d-(f+x)*Math.sin(M),T="radialdrag"):(b=p+(h-x)*Math.cos(M),_=d-(h-x)*Math.sin(M),T="radialdrag-inner");var I,D,z,B=g.makeRectDragger(c,T,"crosshair",-x,-x,m,m),N={element:B,gd:u};!1===t.dragmode&&(N.dragmode=!1),V(n.select(B),v.visible&&h0==(r?z>L:z=0&&f("surfacecolor",p||d);for(var v=["x","y","z"],g=0;g<3;++g){var y="projection."+v[g];f(y+".show")&&(f(y+".opacity"),f(y+".scale"))}var m=n.getComponentMethod("errorbars","supplyDefaults");m(t,e,p||d||r,{axis:"z"}),m(t,e,p||d||r,{axis:"y",inherit:"z"}),m(t,e,p||d||r,{axis:"x",inherit:"z"})}else e.visible=!1}},47718:function(t){t.exports=function(t){var e=0,r=0,n=0,i=0;return t.map(function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case"a":t[6]+=n,t[7]+=i;break;case"v":t[1]+=i;break;case"h":t[1]+=n;break;default:for(var s=1;s-1?i(r):r}},47755:function(t){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}},47912:function(t){"use strict";t.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},47936:function(t,e,r){"use strict";var n=r(46982),i=r(15181).isArrayOrTypedArray;t.exports=function(t,e,r,a,o,s){var l,u,c,f=[],h=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(i(e)&&e.length>1&&!p&&"category"!==s.type){var v=e.length;if(!(v<=o))return h?e.slice(0,o):e.slice(0,o+1);if(h||d)f=e.slice(0,o);else if(1===o)f=[e[0]-.5,e[0]+.5];else{for(f=[1.5*e[0]-.5*e[1]],c=1;c/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var u,c="string"==typeof(u=i)&&u.match(n.latexCheck);t.latex=c;var f,h,p=c?"":T(t.calcdata.cells.prefix,e,r)||"",d=c?"":T(t.calcdata.cells.suffix,e,r)||"",v=c?null:T(t.calcdata.cells.format,e,r)||null,g=p+(v?a(v)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!c&&(f=w(g)),t.cellHeightMayIncrease=s||c||t.mayHaveMarkup||(void 0===f?w(g):f),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var y=(" "===n.wrapSplitCharacter?g.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===u.length&&(u[0]===i.length-1?u.unshift(u[0]-1):u.push(u[0]+1)),u[0]%2&&u.reverse(),e.each(function(t,e){t.page=u[e],t.scrollY=l}),e.attr("transform",function(t){var e=z(t.rowBlocks,t.page)-t.scrollY;return c(0,e)}),t&&(C(t,r,e,u,n.prevPages,n,0),C(t,r,e,u,n.prevPages,n,1),x(r,t))}}function L(t,e,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter(function(t){return s.key===t.key}),u=r||s.scrollbarState.dragMultiplier,c=s.scrollY;s.scrollY=void 0===a?s.scrollY+u*i.event.dy:a;var f=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(k);return E(t,f,l),s.scrollY===c}}function C(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});b(t,e,a,r),i[o]=n[o]}))}function P(t,e,r,a){return function(){var o=i.select(e.parentNode);o.each(function(t){var e=t.fragments;o.selectAll("tspan.line").each(function(t,r){e[r].width=this.getComputedTextLength()});var r,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],u=0,c=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)u+(i=(r=s.shift()).width+a)>c&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],u=0),l.push(r.text),u+=i;u&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0}),o.selectAll("tspan.line").remove(),_(o.select("."+n.cn.cellText),r,t,a),i.select(e.parentNode.parentNode).call(D)}}function O(t,e,r,a,o){return function(){if(!o.settledY){var s=i.select(e.parentNode),l=B(o),u=o.key-l.firstRowIndex,f=l.rows[u].rowHeight,h=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:f,p=Math.max(h,f);p-l.rows[u].rowHeight&&(l.rows[u].rowHeight=p,t.selectAll("."+n.cn.columnCell).call(D),E(null,t.filter(k),0),x(r,a,!0)),s.attr("transform",function(){var t=this,e=t.parentNode.getBoundingClientRect(),r=i.select(t.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),a=t.transform.baseVal.consolidate(),s=r.top-e.top+(a?a.matrix.f:n.cellPad);return c(I(o,i.select(t.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),s)}),o.settledY=!0}}}function I(t,e){switch(t.align){case"left":default:return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2}}function D(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+R(e,1/0)},0),r=R(B(t),t.key);return c(0,r+e)}).selectAll("."+n.cn.cellRect).attr("height",function(t){return(e=B(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r})}function z(t,e){for(var r=0,n=e-1;n>=0;n--)r+=F(t[n]);return r}function R(t,e){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:c({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:u.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:c({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},48563:function(t,e,r){"use strict";var n=r(5159),i=r(15181),a=r(69562),o=r(44236),s=r(78945).BADNUM,l=r(93024).makeBlank;t.exports=function(t){var e=t[0].trace,r=!0===e.visible&&0!==e._length,u=e._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:l()};if(!r)return u;var c,f=[],h=e.z,p=e.radius,d=i.isArrayOrTypedArray(h)&&h.length,v=i.isArrayOrTypedArray(p);for(c=0;c0?+p[c]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:m})}}var b=o.extractOpts(e),_=b.reversescale?o.flipScale(b.colorscale):b.colorscale,w=_[0][1],T=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(c=1;c<_.length;c++)T.push(_[c][0],_[c][1]);var A=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return i.extendFlat(u.heatmap.paint,{"heatmap-weight":d?A:1/(b.max-b.min),"heatmap-color":T,"heatmap-radius":v?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),u.geojson={type:"FeatureCollection",features:f},u.heatmap.layout.visibility="visible",u}},48648:function(t,e,r){"use strict";t.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:r(16665),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:r(98963),supplyDefaults:r(8180),colorbar:r(23814),formatLabels:r(15379),calc:r(84755),hoverPoints:r(53726).hoverPoints,selectPoints:r(75828),meta:{}}},48771:function(t,e,r){"use strict";var n,i,a,o=r(41365),s=r(79691),l=r(62019).Symbol,u=r(43499),c=r(90907),f=r(31808),h=Object.create,p=Object.defineProperties,d=Object.defineProperty;if("function"==typeof l)try{String(l()),a=!0}catch(t){}else l=null;i=function(t){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return n(t)},t.exports=n=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return a?l(e):(r=h(i.prototype),e=void 0===e?"":String(e),p(r,{__description__:o("",e),__name__:o("",u(e))}))},c(n),f(n),p(i.prototype,{constructor:o(n),toString:o("",function(){return this.__name__})}),p(n.prototype,{toString:o(function(){return"Symbol ("+s(this).__description__+")"}),valueOf:o(function(){return s(this)})}),d(n.prototype,n.toPrimitive,o("",function(){var t=s(this);return"symbol"==typeof t?t:t.toString()})),d(n.prototype,n.toStringTag,o("c","Symbol")),d(i.prototype,n.toStringTag,o("c",n.prototype[n.toStringTag])),d(i.prototype,n.toPrimitive,o("c",n.prototype[n.toPrimitive]))},48846:function(t,e,r){"use strict";var n=r(15181),i=r(28418),a=r(52948),o=r(4868),s=r(54563),l=r(46190),u=r(71337);t.exports=function(t,e,r,c){function f(r,i){return n.coerce(t,e,u,r,i)}var h,p=f("locations");if(p&&p.length){var d,v=f("geojson");("string"==typeof v&&""!==v||n.isPlainObject(v))&&(d="geojson-id"),"geojson-id"===f("locationmode",d)&&f("featureidkey"),h=p.length}else{var g=f("lon")||[],y=f("lat")||[];h=Math.min(g.length,y.length)}h?(e._length=h,f("text"),f("hovertext"),f("hovertemplate"),f("mode"),i.hasLines(e)&&(o(t,e,r,c,f),f("connectgaps")),i.hasMarkers(e)&&a(t,e,r,c,f,{gradient:!0}),i.hasText(e)&&(f("texttemplate"),s(t,e,c,f)),f("fill"),"none"!==e.fill&&l(t,e,r,f),n.coerceSelectionMarkerOpacity(e,f)):e.visible=!1}},48928:function(t,e,r){"use strict";var n=r(619),i=r(15181).fillText;t.exports=function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,u=t.xa._length,c=u*l/2,f=u-c;return s.x0=Math.max(Math.min(s.x0,f),c),s.x1=Math.max(Math.min(s.x1,f),c),o}var h=s.cd[s.index];s.a=h.a,s.b=h.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var p=s.trace,d=p._carpet,v=p._module.formatLabels(h,p);s.yLabel=v.yLabel,delete s.text;var g=[];if(!p.hovertemplate){var y=(h.hi||p.hoverinfo).split("+");-1!==y.indexOf("all")&&(y=["a","b","text"]),-1!==y.indexOf("a")&&m(d.aaxis,h.a),-1!==y.indexOf("b")&&m(d.baxis,h.b),g.push("y: "+s.yLabel),-1!==y.indexOf("text")&&i(h,p,g),s.extraText=g.join("
")}return o}function m(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},49061:function(t,e,r){"use strict";var n=r(38532).rb,i=r(38532).ay,a=r(71337),o=r(31164),s=r(75958),l=r(28209),u=r(79335),c=r(8357).extendFlat,f=r(7458).overrideAll,h=r(75958),p=a.line,d=a.marker;t.exports=f({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:c({},h.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:c({},d.opacity,{dflt:1})},mode:c({},o.mode,{dflt:"markers"}),text:c({},o.text,{}),texttemplate:i({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:c({},o.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:o.connectgaps,marker:c({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:d.opacity,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode},u("marker")),fill:a.fill,fillcolor:o.fillcolor,textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:c({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:n()},"calc","nested")},49149:function(t){t.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},49188:function(t){"use strict";var e=Object.prototype.toString,r=e.call(function(){return arguments}());t.exports=function(t){return e.call(t)===r}},49210:function(t,e,r){"use strict";var n=r(46982),i=r(15181);t.exports=function(t,e,r,a){var o=r("x"),s=r("y"),l=i.minRowLength(o),u=i.minRowLength(s);l&&u?(e._length=Math.min(l,u),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a),(r("z")||r("marker.color"))&&r("histfunc"),r("histnorm"),r("autobinx"),r("autobiny")):e.visible=!1}},49241:function(t,e,r){"use strict";var n=r(15181),i=r(77042),a=r(63457),o=r(52270);function s(t,e,r,n){r(n+".line.color"),r(n+".line.width",e.line.width),r(n+".line.dash",e.line.dash)}t.exports=function(t,e,r,l){function u(r,i){return n.coerce(t,e,o,r,i)}i(t,e,u,l)?(a(t,e,l,u,{x:!0}),u("xhoverformat"),u("yhoverformat"),u("line.width"),u("line.dash"),s(0,e,u,"increasing"),s(0,e,u,"decreasing"),u("text"),u("hovertext"),u("tickwidth"),l._requestRangeslider[e.xaxis]=!0):e.visible=!1}},49367:function(t,e,r){"use strict";var n=r(21073),i=r(36562),a=r(46169),o=r(94693);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],f=!!o&&o(t,e);if(n)n(t,e,{configurable:null===u&&f?f.configurable:!u,enumerable:null===s&&f?f.enumerable:!s,value:r,writable:null===l&&f?f.writable:!l});else{if(!c&&(s||l||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},49369:function(t,e,r){"use strict";t.exports=r(88890)},49397:function(t){"use strict";t.exports=function(t,e,r,n,i){t.lon=e.lon,t.lat=e.lat,t.location=e.loc?e.loc:null;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t}},49513:function(t){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},49746:function(t,e,r){"use strict";var n=r(15181),i=r(46716),a=r(12261),o=r(28418),s=r(52948),l=r(8113),u=r(62623).isOpenSymbol;function c(t,e){function r(r,i){return n.coerce(t,e,a.dimensions,r,i)}r("label");var i=r("values");i&&i.length?r("visible"):e.visible=!1,r("axis.type"),r("axis.matches")}t.exports=function(t,e,r,f){function h(r,i){return n.coerce(t,e,a,r,i)}var p=i(t,e,{name:"dimensions",handleItemDefaults:c}),d=h("diagonal.visible"),v=h("showupperhalf"),g=h("showlowerhalf");if(l(e,p,"values")&&(d||v||g)){h("text"),h("hovertext"),h("hovertemplate"),h("xhoverformat"),h("yhoverformat"),s(t,e,r,f,h,{noAngleRef:!0,noStandOff:!0});var y=u(e.marker.symbol),m=o.isBubble(e);h("marker.line.width",y||m?1:0),function(t,e,r,n){var i,a,o=e.dimensions,s=o.length,l=e.showupperhalf,u=e.showlowerhalf,c=e.diagonal.visible,f=new Array(s),h=new Array(s);for(i=0;ia&&l||i1)for(var r=1;r2*o}(i,e))return"date";var g="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),i=0,o=0,s={},c=0;c2*i}(i,g)?"category":function(t,e){for(var r=t.length,n=0;n0&&P<0&&(P+=360);var O,I,D,z=(C+P)/2;if(!p){var R=d?f.projRotate:[z,0,0];O=r("projection.rotation.lon",R[0]),r("projection.rotation.lat",R[1]),r("projection.rotation.roll",R[2]),r("showcoastlines",!d&&x)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!x&&void 0)&&r("oceancolor")}p?(I=-96.6,D=38.7):(I=d?z:O,D=(L[0]+L[1])/2),r("center.lon",I),r("center.lat",D),v&&(r("projection.tilt"),r("projection.distance")),g&&r("projection.parallels",f.projParallels||[0,60]),r("projection.scale"),r("showland",!!x&&void 0)&&r("landcolor"),r("showlakes",!!x&&void 0)&&r("lakecolor"),r("showrivers",!!x&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",d&&"usa"!==c&&x)&&(r("countrycolor"),r("countrywidth")),("usa"===c||"north america"===c&&50===u)&&(r("showsubunits",x),r("subunitcolor"),r("subunitwidth")),d||r("showframe",x)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):y?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}t.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:s,handleDefaults:u,fullData:r,partition:"y"})}},50772:function(t,e,r){"use strict";var n=r(25722),i=r(87758),a=r(60220);t.exports=function(t){var e,s,l=[],u=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)u=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var c=t.slice(1);u=1,(p=c.length)<=4?(l=[parseInt(c[0]+c[0],16),parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16)],4===p&&(u=parseInt(c[3]+c[3],16)/255)):(l=[parseInt(c[0]+c[1],16),parseInt(c[2]+c[3],16),parseInt(c[4]+c[5],16)],8===p&&(u=parseInt(c[6]+c[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1],h="rgb"===f;s=c=f.replace(/a$/,"");var p="cmyk"===c?4:"gray"===c?1:3;l=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===p?parseFloat(t)/100:"rgb"===c?255*parseFloat(t)/100:parseFloat(t);if("h"===c[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),f===c&&l.push(1),u=h||void 0===l[p]?1:l[p],l=l.slice(0,p)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(i(t)){var d=a(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),u=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(u/=100)}else(Array.isArray(t)||r.g.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",u=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:u}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}},50780:function(t,e,r){"use strict";var n=r(83998),i=r(91300),a=r(94521),o=r(13625),s=r(18610),l=r(39555),u=r(34820),c=u.float32,f=u.fract32;t.exports=function(t,e){if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");var r,u,p,d,v,g,y=t._gl,m={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return d=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),u=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),v=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"static",type:"float",data:h}),T(e),r=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{color:{buffer:d,offset:function(t,e){return 4*e.offset},divisor:1},position:{buffer:u,offset:function(t,e){return 8*e.offset},divisor:1},positionFract:{buffer:p,offset:function(t,e){return 8*e.offset},divisor:1},error:{buffer:v,offset:function(t,e){return 16*e.offset},divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:h.length}),s(b,{update:T,draw:_,destroy:A,regl:t,gl:y,canvas:y.canvas,groups:x}),b;function b(t){t?T(t):null===t&&A(),_()}function _(e){if("number"==typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),x.forEach(function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?w(r):t.draw=!0)})}function w(t){"number"==typeof t&&(t=x[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function T(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(b.groups=x=t.map(function(t,u){var c=x[u];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),c||(x[u]=c={id:u,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},m,t)),a(c,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function l(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[s(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[s(t.byteLength)>>2].push(t)}var r=o(8,function(){return[]});return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function u(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||$(t.data))}function c(t,e,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},l=0,c={uint8:5121,uint16:5123};e.oes_element_index_uint&&(c.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)l(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,o=0,h=0;Array.isArray(t)||$(t)||u(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=nt[t.usage]),"primitive"in t&&(n=st[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=c[t.type]),"length"in t?o=0|t.length:(o=i,5123===h||5122===h?o*=2:5125!==h&&5124!==h||(o*=4))),a(f,e,r,n,i,o,h)}else l(),f.primType=4,f.vertCount=0,f.type=5121;return s}var l=r.create(null,34963,!0),f=new i(l._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=f,s.subdata=function(t,e){return l.subdata(t,e),s},s.destroy=function(){o(f)},s},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){Q(s).forEach(o)}}}function y(t){for(var e=J.allocType(5123,t.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,p(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function C(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(ut).forEach(function(e){t+=ut[e].stats.size}),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;P.call(r);var a=L();return"number"==typeof t?M(a,0|t,"number"==typeof e?0|e:0|t):t?(O(r,t),S(a,t)):M(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,l(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,z(i),E(a,3553),I(r,3553),R(),C(a),o.profile&&(i.stats.size=k(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=X[i.internalformat],n.type=K[i.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=it[r.wrapS],n.wrapT=it[r.wrapT],n}var i=new D(3553);return ut[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=v();return l(o,i),o.width=0,o.height=0,p(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,z(i),d(o,3553,e,r,a),R(),g(o),n},n.resize=function(e,r){var a=0|e,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,z(i);for(var l=0;i.mipmask>>l;++l){var u=a>>l,c=s>>l;if(!u||!c)break;t.texImage2D(3553,l,i.format,u,c,0,i.format,i.type,null)}return R(),o.profile&&(i.stats.size=k(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,s,u){function f(t,e,r,n,i,a){var s,u=h.texInfo;for(P.call(u),s=0;6>s;++s)y[s]=L();if("number"!=typeof t&&t){if("object"==typeof t)if(e)S(y[0],t),S(y[1],e),S(y[2],r),S(y[3],n),S(y[4],i),S(y[5],a);else if(O(u,t),c(h,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)l(y[s],h),S(y[s],t[s]);else for(s=0;6>s;++s)S(y[s],t)}else for(t=0|t||1,s=0;6>s;++s)M(y[s],t,t);for(l(h,y[0]),h.mipmask=u.genMipmaps?(y[0].width<<1)-1:y[0].mipmask,h.internalformat=y[0].internalformat,f.width=y[0].width,f.height=y[0].height,z(h),s=0;6>s;++s)E(y[s],34069+s);for(I(u,34067),R(),o.profile&&(h.stats.size=k(h.internalformat,h.type,f.width,f.height,u.genMipmaps,!0)),f.format=X[h.internalformat],f.type=K[h.type],f.mag=rt[u.magFilter],f.min=nt[u.minFilter],f.wrapS=it[u.wrapS],f.wrapT=it[u.wrapT],s=0;6>s;++s)C(y[s]);return f}var h=new D(34067);ut[h.id]=h,a.cubeCount++;var y=Array(6);return f(e,r,n,i,s,u),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=v();return l(a,h),a.width=0,a.height=0,p(a,e),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,z(h),d(a,34069+t,r,n,i),R(),g(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,z(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return R(),o.profile&&(h.stats.size=k(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,o.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);I(e.texInfo,e.target)})},refresh:function(){for(var e=0;ei;++i){for(u=0;ut;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach(function(t){t.destroy()})}})},clear:function(){Q(A).forEach(g)},restore:function(){x.cur=null,x.next=null,x.dirty=!0,Q(A).forEach(function(e){e.framebuffer=t.createFramebuffer(),y(e)})}})}function E(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function L(t,e,r,n,i,a,o){function s(){this.id=++f,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}var l=r.maxAttributes,c=Array(l);for(r=0;r=h.byteLength?l.subdata(h):(l.destroy(),r.buffers[s]=null)),r.buffers[s]||(l=r.buffers[s]=i.create(c,34962,!1,!0)),f.buffer=i.getBuffer(l),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,t[s]=1):i.getBuffer(c)?(f.buffer=i.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(c.buffer)?(f.buffer=i.getBuffer(c.buffer),f.size=0|(+c.size||f.buffer.dimension),f.normalized=!!c.normalized||!1,f.type="type"in c?rt[c.type]:f.buffer.dtype,f.offset=0|(c.offset||0),f.stride=0|(c.stride||0),f.divisor=0|(c.divisor||0),f.state=1):"x"in c&&(f.x=+c.x||0,f.y=+c.y||0,f.z=+c.z||0,f.w=+c.w||0,f.state=2)}for(l=0;lt&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);Q(u).forEach(e),u={},Q(c).forEach(e),c={},h.forEach(function(e){t.deleteProgram(e.program)}),h.length=0,f={},r.shaderCount=0},program:function(e,n,i,a){var o=f[n];o||(o=f[n]={});var p=o[e];if(p&&(p.refCount++,!a))return p;var d=new s(n,e);return r.shaderCount++,l(d,i,a),p||(o[e]=d),h.push(d),G(d,{destroy:function(){if(d.refCount--,0>=d.refCount){t.deleteProgram(d.program);var e=h.indexOf(d);h.splice(e,1),r.shaderCount--}0>=o[d.vertId].refCount&&(t.deleteShader(c[d.vertId]),delete c[d.vertId],delete f[d.fragId][d.vertId]),Object.keys(f[d.fragId]).length||(t.deleteShader(u[d.fragId]),delete u[d.fragId],delete f[d.fragId])}})},restore:function(){u={},c={};for(var t=0;t>>e|t<<32-e}function I(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function D(t){return Array.prototype.slice.call(t)}function z(t){return D(t).join("")}function R(t){function e(){var t=[],e=[];return G(function(){t.push.apply(t,D(arguments))},{def:function(){var r="v"+i++;return e.push(r),0>>4&15)+"0123456789abcdef".charAt(15&e);return r}(function(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<<24-r%32;var n,i,a,o,s,l,u,c,f,h,p,d=8*t.length;for(t=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),e[d>>5]|=128<<24-d%32,e[15+(d+64>>9<<4)]=d,c=0;cf;f++){var v;16>f?r[f]=e[f+c]:(h=f,p=I(p=O(p=r[f-2],17)^O(p,19)^p>>>10,r[f-7]),v=O(v=r[f-15],7)^O(v,18)^v>>>3,r[h]=I(I(p,v),r[f-16])),h=I(I(I(I(u,h=O(h=o,6)^O(h,11)^O(h,25)),o&s^~o&l),Mt[f]),r[f]),p=I(u=O(u=d,2)^O(u,13)^O(u,22),d&n^d&i^n&i),u=l,l=s,s=o,o=I(a,h),a=i,i=n,n=d,d=I(h,p)}t[0]=I(d,t[0]),t[1]=I(n,t[1]),t[2]=I(i,t[2]),t[3]=I(a,t[3]),t[4]=I(o,t[4]),t[5]=I(s,t[5]),t[6]=I(l,t[6]),t[7]=I(u,t[7])}for(e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}(function(t){for(var e,r,n="",i=-1;++i=e&&56320<=r&&57343>=r&&(e=65536+((1023&e)<<10)+(1023&r),i++),127>=e?n+=String.fromCharCode(e):2047>=e?n+=String.fromCharCode(192|e>>>6&31,128|63&e):65535>=e?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):2097151>=e&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(r))),n[e])?n[e].apply(null,o):(r=Function.apply(null,a.concat(r)),n&&(n[e]=r),r.apply(null,o))}}}function F(t){return Array.isArray(t)||$(t)||u(t)}function B(t){return t.sort(function(t,e){return"viewport"===t?-1:"viewport"===e?1:t"+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",s,"(",i,".buffer)){",c,"=",a,".createStream(",34962,",",i,".buffer);","}else{",c,"=",a,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",c,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",a,".destroyStream(",c,");","}"),l})}),o}function M(t,e,n,i,a){function s(t){var e=u[t];e&&(h[t]=e)}var l=function(t,e){if("string"==typeof(r=t.static).frag&&"string"==typeof r.vert){if(0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[d,v,g,s],");")}p&&"null"!==p?m?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(c+".drawElements("+[d,g,y,v+"<<(("+y+"-5121)>>1)"]+");")}function e(){r(c+".drawArrays("+[d,v,g]+");")}p&&"null"!==p?m?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,u=t.shared,c=u.gl,f=u.draw,h=n.draw,p=function(){var i=h.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a),h.elementsActive&&a("if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=a.def(),a(i,"=",f,".","elements",";","if(",i,"){",c,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",u.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+u.vao,".currentVAO.elements);",et?"":"if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),d=i("primitive"),v=i("offset"),g=function(){var i=h.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(f,".","count"),i}();if("number"==typeof g){if(0===g)return}else r("if(",g,"){"),r.exit("}");Q&&(s=i("instances"),l=t.instancing);var y=p+".type",m=h.elements&&j(h.elements)&&!h.vaoActive;Q&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function H(t,e,r,n,i){return i=(e=_()).proc("body",i),Q&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function q(t,e,r,n){P(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),I(t,e,r,n.attributes,function(){return!0})),D(t,e,r,n.uniforms,function(){return!0},!1),z(t,e,e,r)}function Y(t,e,r,n){function i(){return!0}t.batchId="a1",P(t,e),I(t,e,r,n.attributes,i),D(t,e,r,n.uniforms,i,!1),z(t,e,e,r)}function Z(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}P(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var u=t.scope(),c=t.scope();e(u.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",c,"}",u.exit),r.needsContext&&S(t,c,r.context),r.needsFramebuffer&&E(t,c,r.framebuffer),C(t,c,r.state,i),r.profile&&i(r.profile)&&O(t,c,r,!1,!0),n?(r.useVAO?r.drawVAO?i(r.drawVAO)?c(t.shared.vao,".setVAO(",r.drawVAO.append(t,c),");"):u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):u(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(u(t.shared.vao,".setVAO(null);"),I(t,u,r,n.attributes,a),I(t,c,r,n.attributes,i)),D(t,u,r,n.uniforms,a,!1),D(t,c,r,n.uniforms,i,!0),z(t,u,c,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,c),l=c.def(n,".id"),u=c.def(e,"[",l,"]"),c(t.shared.gl,".useProgram(",n,".program);","if(!",u,"){",u,"=",e,"[",l,"]=",t.link(function(e){return H(Y,t,r,e,2)}),"(",n,");}",u,".call(this,a0[",s,"],",s,");"))}function X(t,r){function n(e){var n=r.shader[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.shader,"."+e,n):i.set(a.shader,"."+e,t.link(n,{stable:!0})))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;if(S(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),B(Object.keys(r.state)).forEach(function(e){var n=r.state[e],o=n.append(t,i);m(o)?o.forEach(function(r,n){isNaN(r)?i.set(t.next[e],"["+n+"]",r):i.set(t.next[e],"["+n+"]",t.link(r,{stable:!0}))}):j(n)?i.set(a.next,"."+e,t.link(o,{stable:!0})):i.set(a.next,"."+e,o)}),O(t,i,r,!0,!0),["elements","offset","count","instances","primitive"].forEach(function(e){var n=r.draw[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.draw,"."+e,n):i.set(a.draw,"."+e,t.link(n),{stable:!0}))}),Object.keys(r.uniforms).forEach(function(n){var o=r.uniforms[n].append(t,i);Array.isArray(o)&&(o="["+o.map(function(e){return isNaN(e)?e:t.link(e,{stable:!0})})+"]"),i.set(a.uniforms,"["+t.link(e.id(n),{stable:!0})+"]",o)}),Object.keys(r.attributes).forEach(function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new K).forEach(function(t){i.set(a,"."+t,n[t])})}),r.scopeVAO){var s=r.scopeVAO.append(t,i);isNaN(s)?i.set(a.vao,".targetVAO",s):i.set(a.vao,".targetVAO",t.link(s,{stable:!0}))}n("vert"),n("frag"),0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(c).forEach(function(e){t+=c[e].stats.size}),t}),{create:function(e,r){function o(e,r){var n=0,a=0,c=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(a=e.shape)[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(c=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==u.width||a!==u.height||c!==u.format)return o.width=u.width=n,o.height=u.height=a,u.format=c,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,c,n,a),i.profile&&(u.stats.size=wt[u.format]*u.width*u.height),o.format=l[u.format],o}var u=new a(t.createRenderbuffer());return c[u.id]=u,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===u.width&&a===u.height||(o.width=u.width=n,o.height=u.height=a,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,u.format,n,a),i.profile&&(u.stats.size=wt[u.format]*u.width*u.height)),o},o._reglType="renderbuffer",o._renderbuffer=u,i.profile&&(o.stats=u.stats),o.destroy=function(){u.decRef()},o},clear:function(){Q(c).forEach(o)},restore:function(){Q(c).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)}),t.bindRenderbuffer(36161,null)}}},At=[];At[6408]=4,At[6407]=3;var kt=[];kt[5121]=1,kt[5126]=4,kt[36193]=2;var Mt=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],St=["x","y","z","w"],Et="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Lt={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ct={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Pt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ot={cw:2304,ccw:2305},It=new N(!1,!1,!1,function(){});return function(t){function e(){if(0===J.length)T&&T.update(),et=null;else{et=Z.next(e),f();for(var t=J.length-1;0<=t;--t){var r=J[t];r&&r(O,null,0)}d.flush(),T&&T.update()}}function r(){!et&&0=J.length&&n()}}}}function c(){var t=V.viewport,e=V.scissor_box;t[0]=t[1]=e[0]=e[1]=0,O.viewportWidth=O.framebufferWidth=O.drawingBufferWidth=t[2]=e[2]=d.drawingBufferWidth,O.viewportHeight=O.framebufferHeight=O.drawingBufferHeight=t[3]=e[3]=d.drawingBufferHeight}function f(){O.tick+=1,O.time=p(),c(),U.procs.poll()}function h(){B.refresh(),c(),U.procs.refresh(),T&&T.update()}function p(){return(X()-A)/1e3}if(!(t=a(t)))return null;var d=t.gl,y=d.getContextAttributes();d.isContextLost();var m=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;ie;++e)rt(G({framebuffer:t.framebuffer.faces[e]},t),l);else rt(t,l);else l(0,t)},prop:W.define.bind(null,1),context:W.define.bind(null,2),this:W.define.bind(null,3),draw:s({}),buffer:function(t){return D.create(t,34962,!1,!1)},elements:function(t){return z.create(t,!1)},texture:B.create2D,cube:B.createCube,renderbuffer:N.create,framebuffer:j.create,framebufferCube:j.createCube,vao:R.createVAO,attributes:y,frame:u,on:function(t,e){var r;switch(t){case"frame":return u(e);case"lost":r=$;break;case"restore":r=Q;break;case"destroy":r=tt}return r.push(e),{cancel:function(){for(var t=0;tMath.abs(s)?(u.boxEnd[1]=u.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),u.boxEnd[1]l[3]&&(u.boxEnd[1]=l[3],u.boxEnd[0]=u.boxStart[0]+(l[3]-u.boxStart[1])/Math.abs(_))):(u.boxEnd[0]=u.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),u.boxEnd[0]l[2]&&(u.boxEnd[0]=l[2],u.boxEnd[1]=u.boxStart[1]+(l[2]-u.boxStart[0])*Math.abs(_)))}}else u.boxEnabled?(a=u.boxStart[0]!==u.boxEnd[0],s=u.boxStart[1]!==u.boxEnd[1],a||s?(a&&(g(0,u.boxStart[0],u.boxEnd[0]),t.xaxis.autorange=!1),s&&(g(1,u.boxStart[1],u.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),u.boxEnabled=!1,u.boxInited=!1):u.boxInited&&(u.boxInited=!1);break;case"pan":u.boxEnabled=!1,u.boxInited=!1,e?(u.panning||(u.dragStart[0]=n,u.dragStart[1]=i),Math.abs(u.dragStart[0]-n)=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(e,r){e>=t&&(this.__redo__[r]=++e)},this),this.__redo__.push(t)):f(this,"__redo__",l("c",[t])))}),_onDelete:l(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,r){e>t&&(this.__redo__[r]=--e)},this)))}),_onClear:l(function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0})}))),f(n.prototype,c.iterator,l(function(){return this}))},51239:function(t,e,r){"use strict";var n=r(16534);t.exports=function(t){n.select(t).selectAll(".im image").style("opacity",function(t){return t[0].trace.opacity})}},51257:function(t,e,r){"use strict";var n=r(94963);function i(t){return[t]}t.exports={keyFun:function(t){return t.key},repeat:i,descend:n,wrap:i,unwrap:function(t){return t[0]}}},51311:function(t,e,r){"use strict";r.d(e,{A:function(){return s},x:function(){return o}});var n=r(18901),i=r(32279),a=r(76610);function o(t,e){return[(0,n.gn)(e)*(0,n.F8)(t),(0,n.F8)(e)]}function s(){return(0,a.A)(o).scale(249.5).clipAngle(90+n.Ni)}o.invert=(0,i.I)(n.qR)},51326:function(t,e,r){"use strict";var n=r(15181),i=r(37070),a=r(86877),o=r(45728).dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hx.length&&i.push(p("unused",a,y.concat(x.length)));var k,M,S,E,L,C=x.length,P=Array.isArray(A);if(P&&(C=Math.min(C,A.length)),2===b.dimensions)for(M=0;Mx[M].length&&i.push(p("unused",a,y.concat(M,x[M].length)));var O=x[M].length;for(k=0;k<(P?Math.min(O,A[M].length):O);k++)S=P?A[M][k]:A,E=m[M][k],L=x[M][k],n.validate(E,S)?L!==E&&L!==+E&&i.push(p("dynamic",a,y.concat(M,k),E,L)):i.push(p("value",a,y.concat(M,k),E))}else i.push(p("array",a,y.concat(M),m[M]));else for(M=0;M1&&h.push(p("object","layout"))),i.supplyDefaults(d);for(var v=d._fullData,g=r.length,y=0;y0,function(t){c||(c=t),t&&h.forEach(l),a||(h.forEach(l),f(c))})});return e.reduce(u)}},51676:function(t,e,r){"use strict";var n=r(15181);e.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},e.isTraceInSubplots=function(t,r){if("splom"===t.type){for(var n=t.xaxes||[],i=t.yaxes||[],a=0;a=0&&r.index=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},51698:function(t,e,r){"use strict";t.exports=r(25441)},51958:function(t,e){"use strict";e.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},e.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},e.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},e.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},e.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},e.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},52003:function(t,e,r){"use strict";var n=r(15181);function i(t){return n.extendFlat({},t,{edgepaths:n.extendDeep([],t.edgepaths),paths:n.extendDeep([],t.paths),starts:n.extendDeep([],t.starts)})}t.exports=function(t,e){var r,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),a=t[0],r=0;r=e-.5)return!1;return!0}h.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,h=c(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,f)||!g(t.j,f)||!g(t.k,f))return;n=c(v(t.i),v(t.j),v(t.k))}else n=0===t.alphahull?o(h):t.alphahull>0?a(t.alphahull,h):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;o0?(g="v",y=x>0?Math.min(_,b):Math.min(b)):x>0?(g="h",y=Math.min(_)):y=0;if(y){e._length=y;var S=r("orientation",g);e._hasPreCompStats?"v"===S&&0===x?(r("x0",0),r("dx",1)):"h"===S&&0===m&&(r("y0",0),r("dy",1)):"v"===S&&0===x?r("x0"):"h"===S&&0===m&&r("y0"),i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a)}else e.visible=!1}function f(t,e,r,i){var a=i.prefix,o=n.coerce2(t,e,u,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";e._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var c=r(a+"points",l);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.angle"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete e.marker;var f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(e,r)}t.exports={supplyDefaults:function(t,e,r,i){function s(r,i){return n.coerce(t,e,u,r,i)}if(c(t,e,s,i),!1!==e.visible){o(t,e,i,s),s("xhoverformat"),s("yhoverformat");var l=e._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||r),s("line.width"),s("fillcolor",a.addOpacity(e.line.color,.5));var h=!1;if(l){var p=s("mean"),d=s("sd");p&&p.length&&(h=!0,d&&d.length&&(h="sd"))}s("boxmean",h),s("whiskerwidth"),s("width"),s("quartilemethod");var v=!1;if(l){var g=s("notchspan");g&&g.length&&(v=!0)}else n.validate(t.notchwidth,u.notchwidth)&&(v=!0);s("notched",v)&&s("notchwidth"),f(t,e,s,{prefix:"box"})}},crossTraceDefaults:function(t,e){var r,i;function a(t){return n.coerce(i._input,i,u,t)}for(var o=0;o=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],u=l,f=a;i*fe){h=r;break}}if(a=c,isNaN(a)&&(a=isNaN(f)||isNaN(h)?isNaN(f)?h:f:e-u[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);v&&(o.interval=l[a],o.intervalPix=d,o.region=v)}}if(t.ordinal&&!o.region){var g=t.unitTickvals,m=t.unitToPaddedPx.invert(e);for(r=0;r=x[0]&&m<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[r-a.grabPoint,r+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),b(t.parentNode)}function T(t,e){var r=_(e,e.height-i.mouse(t)[1]-2*n.verticalPadding),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}function A(t){t.on("mousemove",function(t){i.event.preventDefault(),t.parent.inBrushDrag||T(this,t)}).on("mouseleave",function(t){t.parent.inBrushDrag||m()}).call(i.behavior.drag().on("dragstart",function(t){!function(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.unitToPaddedPx.invert(r),o=e.brush,s=_(e,r),l=s.interval,u=o.svgBrush;if(u.wasDragged=!1,u.grabbingBar="ns"===s.region,u.grabbingBar){var c=l.map(e.unitToPaddedPx);u.grabPoint=r-c[0]-n.verticalPadding,u.barLength=c[1]-c[0]}u.clickableOrdinalRange=s.clickableOrdinalRange,u.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(u.stayingIntervals=u.stayingIntervals.filter(function(t){return t[0]!==l[0]&&t[1]!==l[1]})),u.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,u.brushStartCallback()}(this,t)}).on("drag",function(t){w(this,t)}).on("dragend",function(t){!function(t,e){var r=e.brush,n=r.filter,a=r.svgBrush;a._dragging||(T(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,m(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&M(r)):M(r),a.brushCallback(e),b(t.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(u?[a.newExtent]:[]),a.extent.length||M(r),a.brushCallback(e),u?b(t.parentNode,s):(s(),b(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)}))}function k(t,e){return t[0]-e[0]}function M(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function S(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}t.exports={makeBrush:function(t,e,r,n,i,a){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map(function(t){return t.slice().sort(s)}).sort(k)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=S(r),e=r.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map(function(t){return t.slice()})}(e),n=r.slice();e.filter.set(n),o()}),brushEndCallback:a}}},ensureAxisBrush:function(t,e,r){var i=t.selectAll("."+n.cn.axisBrush).data(o,a);i.enter().append("g").classed(n.cn.axisBrush,!0),function(t,e,r){var i=r._context.staticPlot,a=t.selectAll(".background").data(o);a.enter().append("rect").classed("background",!0).call(d).call(v).style("pointer-events",i?"none":"auto").attr("transform",l(0,n.verticalPadding)),a.call(A).attr("height",function(t){return t.height-n.verticalPadding});var s=t.selectAll(".highlight-shadow").data(o);s.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",e).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),s.attr("y1",function(t){return t.height}).call(x);var u=t.selectAll(".highlight").data(o);u.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),u.attr("y1",function(t){return t.height}).call(x)}(i,e,r)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map(function(t){return t.sort(s)}),t=e.multiselect?S(t.sort(k)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map(function(t){var e=[p(0,r,t[0],[]),p(1,r,t[1],[])];if(e[1]>e[0])return e}).filter(function(t){return t})).length)return}return t.length>1?t:t[0]}}},53063:function(t){t.exports=function(t,e,r){var n,i,a,o=r[0],s=r[1],l=r[2],u=Math.sqrt(o*o+s*s+l*l);return Math.abs(u)<1e-6?null:(o*=u=1/u,s*=u,l*=u,n=Math.sin(e),a=1-(i=Math.cos(e)),t[0]=o*o*a+i,t[1]=s*o*a+l*n,t[2]=l*o*a-s*n,t[3]=0,t[4]=o*s*a-l*n,t[5]=s*s*a+i,t[6]=l*s*a+o*n,t[7]=0,t[8]=o*l*a+s*n,t[9]=s*l*a-o*n,t[10]=l*l*a+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}},53125:function(t,e,r){"use strict";var n=r(32832),i=r(56852);t.exports=function(t,e,r,a,o){var s,l=r("contours.coloring"),u="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(u=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),i(r,a,u,o)}},53128:function(t,e,r){"use strict";var n=r(15181).isArray1D;t.exports=function(t,e,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(e._cheater=!i,a&&!n(i)||s&&!n(o))e._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},53188:function(t){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},53373:function(t,e,r){"use strict";var n=r(7514).selectMode,i=r(7826).clearOutline,a=r(99603),o=a.readPaths,s=a.writePaths,l=a.fixDatesForPaths;t.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var a=r.getAttribute("d"),u=e.gd,c=u._fullLayout.newselection,f=e.plotinfo,h=f.xaxis,p=f.yaxis,d=e.isActiveSelection,v=e.dragmode,g=(u.layout||{}).selections||[];if(!n(v)&&void 0!==d){var y=u._fullLayout._activeSelectionIndex;if(y0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},53812:function(t,e,r){"use strict";var n=r(65552),i=r(15181),a=r(26446);e.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},e.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},e.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},e.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},e.extractPathCoords=function(t,e,r){var a=[];return t.match(n.segmentRE).forEach(function(t){var o=e[t.charAt(0)].drawn;if(void 0!==o){var s=t.substr(1).match(n.paramRE);if(s&&!(s.lengthp&&(t="X"),t});return a>p&&(d=d.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),c+d})}(r,s,u);if("pixel"===r.xsizemode){var b=s(r.xanchor);c=b+r.x0,f=b+r.x1}else c=s(r.x0),f=s(r.x1);if("pixel"===r.ysizemode){var _=u(r.yanchor);h=_-r.y0,p=_-r.y1}else h=u(r.y0),p=u(r.y1);if("line"===d)return"M"+c+","+h+"L"+f+","+p;if("rect"===d)return"M"+c+","+h+"H"+f+"V"+p+"H"+c+"Z";var w=(c+f)/2,T=(h+p)/2,A=Math.abs(w-c),k=Math.abs(T-h),M="A"+A+","+k,S=w+A+","+T;return"M"+S+M+" 0 1,1 "+w+","+(T-k)+M+" 0 0,1 "+S+"Z"}},53851:function(t,e,r){"use strict";var n=r(52382);t.exports={moduleType:"component",name:n.name,layoutAttributes:r(62466),supplyLayoutDefaults:r(26741),draw:r(53853)}},53852:function(t,e,r){"use strict";var n=r(3438).bc,i=r(3438).bb;function a(t,e){if(t.length<4+e)return null;var r=i(t,e);return t.length>4&15,i=15&t[4],a=t[5]>>4&15,o=n(t,6),l=8,u=0;ue.width||t.width===e.width&&t.height>e.height?t:e}),i=r.reduce(function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e}),n.width>i.height||n.width===i.height&&n.height>i.width?n:i),s=1;e.transforms.forEach(function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(s=0===t.value?r[s]:e[s=e[s=r[s]]]),"irot"===t.type)for(var n=0;n0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function E(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",f.railTouchRectClass,function(n){n.call(k,e,t,r).style("pointer-events","all")});i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function P(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,i=s.ensureSingle(t,"rect",f.railRectClass);i.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(t){var e=t._context.staticPlot,r=t._fullLayout,a=function(t,e){for(var r=t[f.name],n=[],i=0;i0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(s.enter().append("g").classed(f.containerClassName,!0).style("cursor",e?null:"ew-resize"),s.exit().each(function(){n.select(this).selectAll("g."+f.groupClassName).each(l)}).remove(),0!==a.length){var u=s.selectAll("g."+f.groupClassName).data(a,y);u.enter().append("g").classed(f.groupClassName,!0),u.exit().each(l).remove();for(var c=0;c-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var u=l.substr(8).split(".")[0];if(n(u)&&(u=+u),u>=13)return!0}}return r}},54113:function(t){"use strict";t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},54129:function(t,e,r){"use strict";var n=r(62839),i=r(21073),a=r(76056),o=r(80515);t.exports=function(t){var e=a(arguments),r=t.length-(arguments.length-1);return n(e,1+(r>0?r:0),!0)},i?i(t.exports,"apply",{value:o}):t.exports.apply=o},54174:function(t,e,r){"use strict";t.exports={moduleType:"trace",name:"icicle",basePlotModule:r(47199),categories:[],animatable:!0,attributes:r(55077),layoutAttributes:r(86320),supplyDefaults:r(59378),supplyLayoutDefaults:r(61511),calc:r(54745)._,crossTraceCalc:r(54745).t,plot:r(47103),style:r(6343).style,colorbar:r(23814),meta:{}}},54222:function(t){"use strict";t.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"
",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},54249:function(t,e,r){"use strict";var n=r(5159),i=r(15181),a=r(78945).BADNUM;t.exports=function(t,e,r,o){var s,l,u,c,f,h;function p(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f0?e+S+E:e,bottom:r=r>0?r+S+E:r,left:a=a>0?a+S+E:a,right:i=i>0?i+S+E:i}}(s),d=function(t,e){var i=(0,n.T9)(t.nodes,function(t){return t.column}),s=o-r,c=l-a,f=s/(s+e.right+e.left),h=c/(c+e.top+e.bottom);return r=r*f+e.left,o=0==e.right?o:o*f,a=a*h+e.top,l*=h,t.nodes.forEach(function(t){t.x0=r+t.column*((o-r-u)/i),t.x1=t.x0+u}),h}(s,p);f*=d,s.links.forEach(function(t){t.width=t.value*f}),h.forEach(function(t){var e=t.length;t.forEach(function(t,r){t.depth==h.length-1&&1==e||0==t.depth&&1==e?(t.y0=l/2-t.value*f,t.y1=t.y0+t.value*f):t.partOfCycle?0==D(t,i)?(t.y0=l/2+r,t.y1=t.y0+t.value*f):"top"==t.circularLinkType?(t.y0=a+r,t.y1=t.y0+t.value*f):(t.y0=l-t.value*f-r,t.y1=t.y0+t.value*f):0==p.top||0==p.bottom?(t.y0=(l-a)/e*r,t.y1=t.y0+t.value*f):(t.y0=(l-a)/2-e/2+r,t.y1=t.y0+t.value*f)})})})(f),g();for(var p=1,d=c;d>0;--d)v(p*=.99,f),g();function v(t,e){var r=h.length;h.forEach(function(i){var a=i.length,o=i[0].depth;i.forEach(function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&D(i,e)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=l/2-s/2,i.y1=l/2+s/2;else if(o==r-1&&1==a)s=i.y1-i.y0,i.y0=l/2-s/2,i.y1=l/2+s/2;else{var u=(0,n.i2)(i.sourceLinks,_),c=(0,n.i2)(i.targetLinks,b),f=((u&&c?(u+c)/2:u||c)-x(i))*t;i.y0+=f,i.y1+=f}})})}function g(){h.forEach(function(e){var r,n,i,o=a,s=e.length;for(e.sort(y),i=0;i0&&(r.y0+=n,r.y1+=n),o=r.y1+t;if((n=o-t-l)>0)for(o=r.y0-=n,r.y1-=n,i=s-2;i>=0;--i)(n=(r=e[i]).y1+t-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0})}}(f,O,c),B(f);for(var p=0;p<4;p++)X(f,l,c),J(f,0,c),W(f,a,l,c),X(f,l,c),J(f,0,c);return function(t,e,r){var i=t.nodes,a=t.links,o=!1,s=!1;if(a.forEach(function(t){"top"==t.circularLinkType?o=!0:"bottom"==t.circularLinkType&&(s=!0)}),0==o||0==s){var l=(0,n.jk)(i,function(t){return t.y0}),u=(r-e)/((0,n.T9)(i,function(t){return t.y1})-l);i.forEach(function(t){var e=(t.y1-t.y0)*u;t.y0=(t.y0-l)*u,t.y1=t.y0+e}),a.forEach(function(t){t.y0=(t.y0-l)*u,t.y1=(t.y1-l)*u,t.width=t.width*u})}}(f,a,l),F(f,I,l,c),f}function B(t){t.nodes.forEach(function(t){t.sourceLinks.sort(g),t.targetLinks.sort(v)}),t.nodes.forEach(function(t){var e=t.y0,r=e,n=t.y1,i=n;t.sourceLinks.forEach(function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)}),t.targetLinks.forEach(function(t){t.circular?(t.y1=i-t.width/2,i-=t.width):(t.y1=r+t.width/2,r+=t.width)})})}return R.nodeId=function(t){return arguments.length?(c="function"==typeof t?t:p(t),R):c},R.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:p(t),R):h},R.nodeWidth=function(t){return arguments.length?(u=+t,R):u},R.nodePadding=function(e){return arguments.length?(t=+e,R):t},R.nodes=function(t){return arguments.length?(M="function"==typeof t?t:p(t),R):M},R.links=function(t){return arguments.length?(C="function"==typeof t?t:p(t),R):C},R.size=function(t){return arguments.length?(r=a=0,o=+t[0],l=+t[1],R):[o-r,l-a]},R.extent=function(t){return arguments.length?(r=+t[0][0],o=+t[1][0],a=+t[0][1],l=+t[1][1],R):[[r,a],[o,l]]},R.iterations=function(t){return arguments.length?(O=+t,R):O},R.circularLinkGap=function(t){return arguments.length?(I=+t,R):I},R.nodePaddingRatio=function(t){return arguments.length?(e=+t,R):e},R.sortNodes=function(t){return arguments.length?(z=t,R):z},R.update=function(t){return P(t,c),B(t),t.links.forEach(function(t){t.circular&&(t.circularLinkType=t.y0+t.y1e.source.column)}function D(t,e){var r=0;t.sourceLinks.forEach(function(t){r=t.circular&&!Q(t,e)?r+1:r});var n=0;return t.targetLinks.forEach(function(t){n=t.circular&&!Q(t,e)?n+1:n}),r+n}function z(t){var e=t.source.sourceLinks,r=0;e.forEach(function(t){r=t.circular?r+1:r});var n=t.target.targetLinks,i=0;return n.forEach(function(t){i=t.circular?i+1:i}),!(r>1||i>1)}function R(t,e,r){return t.sort(B),t.forEach(function(n,i){var a=0;if(Q(n,r)&&z(n))n.circularPathData.verticalBuffer=a+n.width/2;else{for(var o=0;oa?s:a}n.circularPathData.verticalBuffer=a+n.width/2}}),t}function F(t,e,r,i){var o=(0,n.jk)(t.links,function(t){return t.source.y0});t.links.forEach(function(t){t.circular&&(t.circularPathData={})}),R(t.links.filter(function(t){return"top"==t.circularLinkType}),e,i),R(t.links.filter(function(t){return"bottom"==t.circularLinkType}),e,i),t.links.forEach(function(n){if(n.circular){if(n.circularPathData.arcRadius=n.width+E,n.circularPathData.leftNodeBuffer=5,n.circularPathData.rightNodeBuffer=5,n.circularPathData.sourceWidth=n.source.x1-n.source.x0,n.circularPathData.sourceX=n.source.x0+n.circularPathData.sourceWidth,n.circularPathData.targetX=n.target.x0,n.circularPathData.sourceY=n.y0,n.circularPathData.targetY=n.y1,Q(n,i)&&z(n))n.circularPathData.leftSmallArcRadius=E+n.width/2,n.circularPathData.leftLargeArcRadius=E+n.width/2,n.circularPathData.rightSmallArcRadius=E+n.width/2,n.circularPathData.rightLargeArcRadius=E+n.width/2,"bottom"==n.circularLinkType?(n.circularPathData.verticalFullExtent=n.source.y1+S+n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.rightLargeArcRadius):(n.circularPathData.verticalFullExtent=n.source.y0-S-n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.rightLargeArcRadius);else{var s=n.source.column,l=n.circularLinkType,u=t.links.filter(function(t){return t.source.column==s&&t.circularLinkType==l});"bottom"==n.circularLinkType?u.sort(j):u.sort(N);var c=0;u.forEach(function(t,r){t.circularLinkID==n.circularLinkID&&(n.circularPathData.leftSmallArcRadius=E+n.width/2+c,n.circularPathData.leftLargeArcRadius=E+n.width/2+r*e+c),c+=t.width}),s=n.target.column,u=t.links.filter(function(t){return t.target.column==s&&t.circularLinkType==l}),"bottom"==n.circularLinkType?u.sort(V):u.sort(U),c=0,u.forEach(function(t,r){t.circularLinkID==n.circularLinkID&&(n.circularPathData.rightSmallArcRadius=E+n.width/2+c,n.circularPathData.rightLargeArcRadius=E+n.width/2+r*e+c),c+=t.width}),"bottom"==n.circularLinkType?(n.circularPathData.verticalFullExtent=Math.max(r,n.source.y1,n.target.y1)+S+n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.rightLargeArcRadius):(n.circularPathData.verticalFullExtent=o-S-n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.rightLargeArcRadius)}n.circularPathData.leftInnerExtent=n.circularPathData.sourceX+n.circularPathData.leftNodeBuffer,n.circularPathData.rightInnerExtent=n.circularPathData.targetX-n.circularPathData.rightNodeBuffer,n.circularPathData.leftFullExtent=n.circularPathData.sourceX+n.circularPathData.leftLargeArcRadius+n.circularPathData.leftNodeBuffer,n.circularPathData.rightFullExtent=n.circularPathData.targetX-n.circularPathData.rightLargeArcRadius-n.circularPathData.rightNodeBuffer}if(n.circular)n.path=function(t){return"top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY}(n);else{var f=(0,a.pq)().source(function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]}).target(function(t){return[t.target.x0,t.y1]});n.path=f(n)}})}function B(t,e){return H(t)==H(e)?"bottom"==t.circularLinkType?j(t,e):N(t,e):H(e)-H(t)}function N(t,e){return t.y0-e.y0}function j(t,e){return e.y0-t.y0}function U(t,e){return t.y1-e.y1}function V(t,e){return e.y1-t.y1}function H(t){return t.target.column-t.source.column}function q(t){return t.target.x0-t.source.x1}function G(t,e){var r=O(t),n=q(e)/Math.tan(r);return"up"==$(t)?t.y1+n:t.y1-n}function Y(t,e){var r=O(t),n=q(e)/Math.tan(r);return"up"==$(t)?t.y1-n:t.y1+n}function W(t,e,r,n){t.links.forEach(function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)t.nodes.forEach(function(o){if(o.column==a){var u,c=s/(l+1),f=Math.pow(1-c,3),h=3*c*Math.pow(1-c,2),p=3*Math.pow(c,2)*(1-c),d=Math.pow(c,3),v=f*i.y0+h*i.y0+p*i.y1+d*i.y1,g=v-i.width/2,y=v+i.width/2;g>o.y0&&ga.y0&&i.y0a.y0&&i.y1a.y1)&&Z(t,u,e,r)})):(y>o.y0&&yo.y1)&&(u=y-o.y0+10,o=Z(o,u,e,r),t.nodes.forEach(function(t){M(t,n)!=M(o,n)&&t.column==o.column&&t.y0o.y1&&Z(t,u,e,r)}))}})}})}function Z(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach(function(t){t.y1=t.y1+e}),t.sourceLinks.forEach(function(t){t.y0=t.y0+e})),t}function X(t,e,r,n){t.nodes.forEach(function(i){n&&i.y+(i.y1-i.y0)>e&&(i.y=i.y-(i.y+(i.y1-i.y0)-e));var a=t.links.filter(function(t){return M(t.source,r)==M(i,r)}),o=a.length;o>1&&a.sort(function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!K(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=Y(e,t);return t.y1-r}if(e.target.column>t.target.column)return Y(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0});var s=i.y0;a.forEach(function(t){t.y0=s+t.width/2,s+=t.width}),a.forEach(function(t,e){if("bottom"==t.circularLinkType){for(var r=e+1,n=0;r1&&n.sort(function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!K(t,e))return t.y0-e.y0;if(e.source.column0?"up":"down"}function Q(t,e){return M(t.source,e)==M(t.target,e)}},54563:function(t,e,r){"use strict";var n=r(15181);t.exports=function(t,e,r,i,a){a=a||{},i("textposition"),n.coerceFont(i,"textfont",a.font||r.font),a.noSelect||(i("selected.textfont.color"),i("unselected.textfont.color"))}},54605:function(t,e,r){"use strict";var n=r(37070);e.name="funnelarea",e.plot=function(t,r,i,a){n.plotBasePlot(e.name,t,r,i,a)},e.clean=function(t,r,i,a){n.cleanBasePlot(e.name,t,r,i,a)}},54660:function(t,e,r){"use strict";var n=r(22994),i=r(37565),a=r(31164).line,o=r(30430).T,s=r(8357).extendFlat,l=r(92444).templatedArray,u=(r(85669),r(28209)),c=r(38532).LF,f=r(12367);t.exports=l("shape",{visible:s({},u.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:s({},u.legend,{editType:"calc+arraydraw"}),legendgroup:s({},u.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:s({},u.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:i({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:s({},u.legendrank,{editType:"calc+arraydraw"}),legendwidth:s({},u.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:s({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:s({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:s({},a.color,{editType:"arraydraw"}),width:s({},a.width,{editType:"calc+arraydraw"}),dash:s({},o,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:c({},{keys:Object.keys(f)}),font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})},54707:function(t,e,r){"use strict";var n=r(19260).hoverPoints,i=r(26446).hoverLabelText;t.exports=function(t,e,r,a,o){var s=n(t,e,r,a,o);if(s){var l=(t=s[0]).cd[t.index],u=t.cd[0].trace;if(!u.cumulative.enabled){var c="h"===u.orientation?"y":"x";t[c+"Label"]=i(t[c+"a"],[l.ph0,l.ph1],u[c+"hoverformat"])}return s}}},54718:function(t,e,r){"use strict";function n(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}r.d(e,{GP:function(){return h},OE:function(){return v}});var i,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(t){if(!(e=a.exec(t)))throw new Error("invalid format: "+t);var e;return new s({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function s(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function l(t,e){var r=n(t,e);if(!r)return t+"";var i=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}o.prototype=s.prototype,s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var u={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return l(100*t,e)},r:l,s:function(t,e){var r=n(t,e);if(!r)return t+"";var a=r[0],o=r[1],s=o-(i=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+n(t,Math.max(0,e+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function c(t){return t}var f,h,p=Array.prototype.map,d=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function v(t){var e,r,a=void 0===t.grouping||void 0===t.thousands?c:(e=p.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var i=t.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(r)}),s=void 0===t.currency?"":t.currency[0]+"",l=void 0===t.currency?"":t.currency[1]+"",f=void 0===t.decimal?".":t.decimal+"",h=void 0===t.numerals?c:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(p.call(t.numerals,String)),v=void 0===t.percent?"%":t.percent+"",g=void 0===t.minus?"-":t.minus+"",y=void 0===t.nan?"NaN":t.nan+"";function m(t){var e=(t=o(t)).fill,r=t.align,n=t.sign,c=t.symbol,p=t.zero,m=t.width,x=t.comma,b=t.precision,_=t.trim,w=t.type;"n"===w?(x=!0,w="g"):u[w]||(void 0===b&&(b=12),_=!0,w="g"),(p||"0"===e&&"="===r)&&(p=!0,e="0",r="=");var T="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",A="$"===c?l:/[%p]/.test(w)?v:"",k=u[w],M=/[defgprs%]/.test(w);function S(t){var o,s,l,u=T,c=A;if("c"===w)c=k(t)+c,t="";else{var v=(t=+t)<0||1/t<0;if(t=isNaN(t)?y:k(Math.abs(t),b),_&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),v&&0===+t&&"+"!==n&&(v=!1),u=(v?"("===n?n:g:"-"===n||"("===n?"":n)+u,c=("s"===w?d[8+i/3]:"")+c+(v&&"("===n?")":""),M)for(o=-1,s=t.length;++o(l=t.charCodeAt(o))||l>57){c=(46===l?f+t.slice(o+1):t.slice(o))+c,t=t.slice(0,o);break}}x&&!p&&(t=a(t,1/0));var S=u.length+t.length+c.length,E=S>1)+u+t+c+E.slice(S);break;default:t=E+u+t+c}return h(t)}return b=void 0===b?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),S.toString=function(){return t+""},S}return{format:m,formatPrefix:function(t,e){var r,i=m(((t=o(t)).type="f",t)),a=3*Math.max(-8,Math.min(8,Math.floor((r=e,((r=n(Math.abs(r)))?r[1]:NaN)/3)))),s=Math.pow(10,-a),l=d[8+a/3];return function(t){return i(s*t)+l}}}}f=v({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),h=f.format,f.formatPrefix},54745:function(t,e,r){"use strict";var n=r(60512);e._=function(t,e){return n.calc(t,e)},e.t=function(t){return n._runCrossTraceCalc("icicle",t)}},54791:function(t,e,r){"use strict";var n=r(5159),i=r(25623),a=r(15181).isArrayOrTypedArray;e.coerceString=function(t,e,r){if("string"==typeof e){if(e||!t.noBlank)return e}else if(("number"==typeof e||!0===e)&&!t.strict)return String(e);return void 0!==r?r:t.dflt},e.coerceNumber=function(t,e,r){if(n(e)){e=+e;var i=t.min,a=t.max;if(!(void 0!==i&&ea))return e}return void 0!==r?r:t.dflt},e.coerceColor=function(t,e,r){return i(e).isValid()?e:void 0!==r?r:t.dflt},e.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},e.getValue=function(t,e){var r;return Array.isArray(t)?e0?1:0}function r(t){var e=t[0],r=t[1];if(!isFinite(e)||!isFinite(r))return[1,0];var n=(e+1)*(e+1)+r*r;return[(e*e+r*r-1)/n,2*r/n]}function n(t,e){var r=e[0],n=e[1];return[r*t.radius+t.cx,-n*t.radius+t.cy]}function i(t,e){return e*t.radius}t.exports={smith:r,reactanceArc:function(t,e,a,o){var s=n(t,r([a,e])),l=s[0],u=s[1],c=n(t,r([o,e])),f=c[0],h=c[1];if(0===e)return["M"+l+","+u,"L"+f+","+h].join(" ");var p=i(t,1/Math.abs(e));return["M"+l+","+u,"A"+p+","+p+" 0 0,"+(e<0?1:0)+" "+f+","+h].join(" ")},resistanceArc:function(t,a,o,s){var l=i(t,1/(a+1)),u=n(t,r([a,o])),c=u[0],f=u[1],h=n(t,r([a,s])),p=h[0],d=h[1];if(e(o)!==e(s)){var v=n(t,r([a,0]));return["M"+c+","+f,"A"+l+","+l+" 0 0,"+(00?"white":"black",c.lineWidth=Math.abs(p)),c.translate(.5*r,.5*f),c.scale(g,g),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var y=new Path2D(t);c.fill(y),p&&c.stroke(y)}else{var m=a(t);o(c,m),c.fill(),p&&c.stroke()}return c.setTransform(1,0,0,1,0,0),l(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}},55070:function(t){"use strict";t.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}},55077:function(t,e,r){"use strict";var n=r(38532).rb,i=r(38532).ay,a=r(79335),o=r(79444).u,s=r(62736),l=r(75408),u=r(48519),c=r(93952),f=r(8357).extendFlat,h=r(30430).k;t.exports={labels:l.labels,parents:l.parents,values:l.values,branchvalues:l.branchvalues,count:l.count,level:l.level,maxdepth:l.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:u.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:f({colors:l.marker.colors,line:l.marker.line,pattern:h,editType:"calc"},a("marker",{colorAttr:"colors",anim:!1})),leaf:l.leaf,pathbar:u.pathbar,text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:c.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u.outsidetextfont,textposition:u.textposition,sort:s.sort,root:l.root,domain:o({name:"icicle",trace:!0,editType:"calc"})}},55217:function(t){"use strict";t.exports=function(t,e,r){if(0===t.length)return"";var n,i=[],a=r?3:1;for(n=0;n.999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",n.getDfltFromLayout("hovermode"))}t.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:c,attributes:l,handleDefaults:f,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},55270:function(t,e,r){"use strict";r.d(e,{A:function(){return i}});var n=r(77371);function i(){var t,e=[];return{point:function(e,r,n){t.push([e,r,n])},lineStart:function(){e.push(t=[])},lineEnd:n.A,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}},55380:function(t,e,r){"use strict";var n=r(58261),i=Math.abs,a=Math.floor;t.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*a(i(t)):t}},55482:function(t,e,r){"use strict";var n=r(16534);t.exports=function(t){n.select(t).selectAll(".hm image").style("opacity",function(t){return t.trace.opacity})}},55581:function(t){t.exports=function(){"use strict";var t,e,r;function n(n,i){if(t)if(e){var a="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),(r=i(o)).workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))}else e=i;else t=i}return n(0,function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r="1.10.1",n=i;function i(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}i.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)(n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var a=o;function o(t,e){this.x=t,this.y=e}function s(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var l=s(.25,.1,.25,1);function u(t,e,r){return Math.min(r,Math.max(e,t))}function c(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function f(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function v(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function g(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})}function y(t,e){return-1!==t.indexOf(e,t.length-e.length)}function m(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function x(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?m(t,b):t}var _={};function w(t){_[t]||("undefined"!=typeof console&&console.warn(t),_[t]=!0)}function T(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function A(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""}),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var S=null;function E(t){if(null==S){var e=t.navigator?t.navigator.userAgent:null;S=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return S}function L(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var C,P,O,I,D=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),z=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,R=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,F={now:D,frame:function(t){var e=z(t);return{cancel:function(){return R(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return C||(C=self.document.createElement("a")),C.href=t,C.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==P&&(P=self.matchMedia("(prefers-reduced-motion: reduce)")),P.matches)}},B={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},N={supported:!1,testSupport:function(t){!j&&I&&(U?V(t):O=t)}},j=!1,U=!1;function V(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,I),t.isContextLost())return;N.supported=!0}catch(t){}t.deleteTexture(e),j=!0}self.document&&((I=self.document.createElement("img")).onload=function(){O&&V(O),O=null,U=!0},I.onerror=function(){j=!0,O=null},I.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var H="01";var q=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function G(t){return 0===t.indexOf("mapbox:")}q.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",H,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},q.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},q.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},q.prototype.normalizeStyleURL=function(t,e){if(!G(t))return t;var r=X(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeGlyphsURL=function(t,e){if(!G(t))return t;var r=X(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSourceURL=function(t,e){if(!G(t))return t;var r=X(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSpriteURL=function(t,e,r,n){var i=X(t);return G(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,J(i))},q.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!G(t))return t;var r=X(t),n=F.devicePixelRatio>=2||512===e?"@2x":"",i=N.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+i),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(t){for(var e=0,r=t;e=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},Q.prototype.processRequests=function(t){},Q.prototype.postEvent=function(t,e,n,i){var a=this;if(B.EVENTS_URL){var o=X(B.EVENTS_URL);o.params.push("access_token="+(i||B.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:H,userId:this.anonId},l=e?f(s,e):s,u={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=At(u,function(t){a.pendingRequest=null,n(t),a.saveEventData(),a.processRequests(i)})}},Q.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,rt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(B.EVENTS_URL&&n||B.ACCESS_TOKEN&&Array.isArray(t)&&t.some(function(t){return G(t)||W(t)}))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),v(this.anonId)||(this.anonId=d()),this.postEvent(i,{skuToken:this.skuToken},function(t){t||n&&(e.success[n]=!0)},t))}},e}(Q),nt=function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){B.EVENTS_URL&&B.ACCESS_TOKEN&&Array.isArray(t)&&t.some(function(t){return G(t)||W(t)})&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=$(B.ACCESS_TOKEN),n=r?r.u:B.ACCESS_TOKEN,i=n!==this.eventData.tokenU;v(this.anonId)||(this.anonId=d(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n)},t)}},e}(Q),it=new nt,at=it.postTurnstileEvent.bind(it),ot=new rt,st=ot.postMapLoadEvent.bind(ot),lt="mapbox-tiles",ut=500,ct=50;function ft(){self.caches&&!tt&&(tt=self.caches.open(lt))}function ht(t,e,r){if(ft(),tt){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach(function(t,e){return n.headers.set(e,t)});var i=M(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,function(e){var r=new self.Response(e,n);ft(),tt&&tt.then(function(e){return e.put(pt(t.url),r)}).catch(function(t){return w(t.message)})}))}}function pt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function dt(t,e){if(ft(),!tt)return e(null);var r=pt(t.url);tt.then(function(t){t.match(r).then(function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=M(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)}).catch(e)}).catch(e)}var vt,gt=1/0;function yt(){return null==vt&&(vt=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),vt}var mt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(mt);var xt=function(t){function e(e,r,n){401===r&&W(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),bt=k()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function _t(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:bt(),signal:n.signal}),a=!1,o=!1,s=(r=i.url).indexOf("sku=")>0&&W(r);"json"===t.type&&i.headers.set("Accept","application/json");var l=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&w(r),n&&a)return u(n);var l=Date.now();self.fetch(i).then(function(r){if(r.ok){var n=s?r.clone():null;return u(r,n,l)}return e(new xt(r.statusText,r.status,t.url))}).catch(function(t){20!==t.code&&e(new Error(t.message))})}},u=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then(function(t){o||(n&&s&&ht(i,n,s),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))}).catch(function(t){o||e(new Error(t.message))})};return s?dt(i,l):l(null,null),{cancel:function(){o=!0,a||n.abort()}}}var wt=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(bt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return _t(t,e);if(k()&&self.worker&&self.worker.actor){return self.worker.actor.send("getResource",t,e,void 0,!0)}}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new xt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Tt=function(t,e){return wt(f(t,{type:"arrayBuffer"}),e)},At=function(t,e){return wt(f(t,{method:"POST"}),e)};function kt(t){var e=self.document.createElement("a");return e.href=t,e.protocol===self.document.location.protocol&&e.host===self.document.location.host}var Mt,St;Mt=[],St=0;var Et=function(t,e){if(N.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),St>=B.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return Mt.push(r),r}St++;var n=!1,i=function(){if(!n)for(n=!0,St--;Mt.length&&St0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},It.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Dt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},zt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Rt(t){var e=t.key,r=t.value;return r?[new zt(e,r,"constants have been deprecated as of v8")]:[]}function Ft(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var te=[Vt,Ht,qt,Gt,Yt,Jt,Wt,$t(Zt),Kt];function ee(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!ee(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=te;r255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),u=i.indexOf(")");if(-1!==l&&u+1===i.length){var c=i.substr(0,l),f=i.substr(l+1,u-(l+1)).split(","),h=1;switch(c){case"rgba":if(4!==f.length)return null;h=o(f.pop());case"rgb":return 3!==f.length?null:[a(f[0]),a(f[1]),a(f[2]),h];case"hsla":if(4!==f.length)return null;h=o(f.pop());case"hsl":if(3!==f.length)return null;var p=(parseFloat(f[0])%360+360)%360/360,d=o(f[1]),v=o(f[2]),g=v<=.5?v*(d+1):v+d-v*d,y=2*v-g;return[n(255*s(y,g,p+1/3)),n(255*s(y,g,p)),n(255*s(y,g,p-1/3)),h];default:return null}}return null}}catch(t){}}),ae=ie.parseCSSColor,oe=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};oe.parse=function(t){if(t){if(t instanceof oe)return t;if("string"==typeof t){var e=ae(t);if(e)return new oe(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},oe.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},oe.prototype.toArray=function(){var t=this,e=t.r,r=t.g,n=t.b,i=t.a;return 0===i?[0,0,0,0]:[255*e/i,255*r/i,255*n/i,i]},oe.black=new oe(0,0,0,1),oe.white=new oe(1,1,1,1),oe.transparent=new oe(0,0,0,0),oe.red=new oe(1,0,0,1);var se=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};se.prototype.compare=function(t,e){return this.collator.compare(t,e)},se.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var le=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ue=function(t){this.sections=t};ue.fromString=function(t){return new ue([new le(t,null,null,null,null)])},ue.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some(function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length})},ue.factory=function(t){return t instanceof ue?t:ue.fromString(t)},ue.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map(function(t){return t.text}).join("")},ue.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function he(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof oe)return!0;if(t instanceof se)return!0;if(t instanceof ue)return!0;if(t instanceof ce)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in ye)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=ye[s],n++}else a=Zt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=$t(a,o)}else r=ye[i];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map(function(t){return t.serialize()}))};var xe=function(t){this.type=Jt,this.sections=t};xe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Ht)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,$t(qt))))return null;var u=null;if(o["text-color"]&&!(u=e.parse(o["text-color"],1,Yt)))return null;var c=n[n.length-1];c.scale=s,c.font=l,c.textColor=u}else{var f=e.parse(t[a],1,Zt);if(!f)return null;var h=f.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:f,scale:null,font:null,textColor:null})}}return new xe(n)},xe.prototype.evaluate=function(t){return new ue(this.sections.map(function(e){var r=e.content.evaluate(t);return pe(r)===Kt?new le("",r,null,null,null):new le(de(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)}))},xe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},be.prototype.eachChild=function(t){t(this.input)},be.prototype.outputDefined=function(){return!1},be.prototype.serialize=function(){return["image",this.input.serialize()]};var _e={"to-boolean":Gt,"to-color":Yt,"to-number":Ht,"to-string":qt},we=function(t,e){this.type=t,this.args=e};we.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=_e[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":fe(e[0],e[1],e[2],e[3])))return new oe(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ge(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ce(t,e){var r,n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),a=Math.pow(2,e.z);return[Math.round(n*a*Se),Math.round(i*a*Se)]}function Pe(t,e,r){var n=t[0]-e[0],i=t[1]-e[1],a=t[0]-r[0],o=t[1]-r[1];return n*o-a*i===0&&n*a<=0&&i*o<=0}function Oe(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Ie(t,e){for(var r=!1,n=0,i=e.length;n0&&f<0||c<0&&f>0}function Re(t,e,r,n){var i,a,o=[e[0]-t[0],e[1]-t[1]];return 0!==(i=[n[0]-r[0],n[1]-r[1]],a=o,i[0]*a[1]-i[1]*a[0])&&!(!ze(t,e,r,n)||!ze(r,n,t,e))}function Fe(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===a&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a}Ee(e,t)}function He(t,e,r,n){for(var i=Math.pow(2,n.z)*Se,a=[n.x*Se,n.y*Se],o=[],s=0,l=t;s=0)return!1;var r=!0;return t.eachChild(function(t){r&&!Ze(t,e)&&(r=!1)}),r}Ge.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(he(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ge("Input is not a number.");o=s-1}return 0}Je.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Je.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new me(e,[t]):"coerce"===r?new we(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert")}if(!(a instanceof ve)&&"resolvedImage"!==a.type.kind&&Ke(a)){var l=new Ae;try{a=new ve(a.type,a.evaluate(l))}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Je.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Je(this.registry,n,e||null,i,this.errors)},Je.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map(function(t){return"["+t+"]"}).join("");this.errors.push(new jt(n,t))},Je.prototype.checkSubtype=function(t,e){var r=ee(t,e);return r&&this.error(r),r};var Qe=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=e.parse(s,u,i);if(!c)return null;i=i||c.type,n.push([o,c])}return new Qe(i,r,n)},Qe.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[$e(e,n)].evaluate(t)},Qe.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var er=Object.freeze({__proto__:null,number:tr,color:function(t,e,r){return new oe(tr(t.r,e.r,r),tr(t.g,e.g,r),tr(t.b,e.b,r),tr(t.a,e.a,r))},array:function(t,e,r){return t.map(function(t,n){return tr(t,e[n],r)})}}),rr=.95047,nr=1.08883,ir=4/29,ar=6/29,or=3*ar*ar,sr=ar*ar*ar,lr=Math.PI/180,ur=180/Math.PI;function cr(t){return t>sr?Math.pow(t,1/3):t/or+ir}function fr(t){return t>ar?t*t*t:or*(t-ir)}function hr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function pr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function dr(t){var e=pr(t.r),r=pr(t.g),n=pr(t.b),i=cr((.4124564*e+.3575761*r+.1804375*n)/rr),a=cr((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-cr((.0193339*e+.119192*r+.9503041*n)/nr)),alpha:t.a}}function vr(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*fr(e),r=rr*fr(r),n=nr*fr(n),new oe(hr(3.2404542*r-1.5371385*e-.4985314*n),hr(-.969266*r+1.8760108*e+.041556*n),hr(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function gr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var yr={forward:dr,reverse:vr,interpolate:function(t,e,r){return{l:tr(t.l,e.l,r),a:tr(t.a,e.a,r),b:tr(t.b,e.b,r),alpha:tr(t.alpha,e.alpha,r)}}},mr={forward:function(t){var e=dr(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*ur;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*lr,r=t.c;return vr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:gr(t.h,e.h,r),c:tr(t.c,e.c,r),l:tr(t.l,e.l,r),alpha:tr(t.alpha,e.alpha,r)}}},xr=Object.freeze({__proto__:null,lab:yr,hcl:mr}),br=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a1}))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Ht)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=Yt:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var c=0;c=f)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var v=e.parse(h,d,u);if(!v)return null;u=u||v.type,l.push([f,v])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new br(u,r,n,i,l):e.error("Type "+Qt(u)+" is not interpolatable.")},br.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=$e(e,n),o=e[a],s=e[a+1],l=br.interpolationFactor(this.interpolation,n,o,s),u=r[a].evaluate(t),c=r[a+1].evaluate(t);return"interpolate"===this.operator?er[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?mr.reverse(mr.interpolate(mr.forward(u),mr.forward(c),l)):yr.reverse(yr.interpolate(yr.forward(u),yr.forward(c),l))},br.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ge("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ge("Array index must be an integer, but found "+e+" instead.");return r[e]},Ar.prototype.eachChild=function(t){t(this.index),t(this.input)},Ar.prototype.outputDefined=function(){return!1},Ar.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var kr=function(t,e){this.type=Gt,this.needle=t,this.haystack=e};kr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Zt),n=e.parse(t[2],2,Zt);return r&&n?re(r.type,[Gt,qt,Ht,Vt,Zt])?new kr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Qt(r.type)+" instead"):null},kr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!ne(e,["boolean","string","number","null"]))throw new ge("Expected first argument to be of type boolean, string, number or null, but found "+Qt(pe(e))+" instead.");if(!ne(r,["string","array"]))throw new ge("Expected second argument to be of type array or string, but found "+Qt(pe(r))+" instead.");return r.indexOf(e)>=0},kr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},kr.prototype.outputDefined=function(){return!0},kr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Mr=function(t,e,r){this.type=Ht,this.needle=t,this.haystack=e,this.fromIndex=r};Mr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Zt),n=e.parse(t[2],2,Zt);if(!r||!n)return null;if(!re(r.type,[Gt,qt,Ht,Vt,Zt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Qt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ht);return i?new Mr(r,n,i):null}return new Mr(r,n)},Mr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!ne(e,["boolean","string","number","null"]))throw new ge("Expected first argument to be of type boolean, string, number or null, but found "+Qt(pe(e))+" instead.");if(!ne(r,["string","array"]))throw new ge("Expected second argument to be of type array or string, but found "+Qt(pe(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},Mr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Mr.prototype.outputDefined=function(){return!1},Mr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Sr=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};Sr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,pe(h)))return null}else r=pe(h);if(void 0!==i[String(h)])return u.error("Branch labels must be unique.");i[String(h)]=a.length}var p=e.parse(l,o,n);if(!p)return null;n=n||p.type,a.push(p)}var d=e.parse(t[1],1,Zt);if(!d)return null;var v=e.parse(t[t.length-1],t.length-1,n);return v?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new Sr(r,n,d,i,a,v):null},Sr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(pe(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Sr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Sr.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})&&this.otherwise.outputDefined()},Sr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Zt),n=e.parse(t[2],2,Ht);if(!r||!n)return null;if(!re(r.type,[$t(Zt),qt,Zt]))return e.error("Expected first argument to be of type array or string, but found "+Qt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ht);return i?new Lr(r.type,r,n,i):null}return new Lr(r.type,r,n)},Lr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!ne(e,["string","array"]))throw new ge("Expected first argument to be of type array or string, but found "+Qt(pe(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},Lr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Lr.prototype.outputDefined=function(){return!1},Lr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Ir=Or("==",function(t,e,r){return e===r},Pr),Dr=Or("!=",function(t,e,r){return e!==r},function(t,e,r,n){return!Pr(0,e,r,n)}),zr=Or("<",function(t,e,r){return e",function(t,e,r){return e>r},function(t,e,r,n){return n.compare(e,r)>0}),Fr=Or("<=",function(t,e,r){return e<=r},function(t,e,r,n){return n.compare(e,r)<=0}),Br=Or(">=",function(t,e,r){return e>=r},function(t,e,r,n){return n.compare(e,r)>=0}),Nr=function(t,e,r,n,i){this.type=qt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Nr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ht);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,qt)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,qt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Ht)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Ht))?null:new Nr(r,i,a,o,s)},Nr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Nr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Nr.prototype.outputDefined=function(){return!1},Nr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var jr=function(t){this.type=Ht,this.input=t};jr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Qt(r.type)+" instead."):new jr(r):null},jr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ge("Expected value to be of type string or array, but found "+Qt(pe(e))+" instead.")},jr.prototype.eachChild=function(t){t(this.input)},jr.prototype.outputDefined=function(){return!1},jr.prototype.serialize=function(){var t=["length"];return this.eachChild(function(e){t.push(e.serialize())}),t};var Ur={"==":Ir,"!=":Dr,">":Rr,"<":zr,">=":Br,"<=":Fr,array:me,at:Ar,boolean:me,case:Er,coalesce:wr,collator:Me,format:xe,image:be,in:kr,"index-of":Mr,interpolate:br,"interpolate-hcl":br,"interpolate-lab":br,length:jr,let:Tr,literal:ve,match:Sr,number:me,"number-format":Nr,object:me,slice:Lr,step:Qe,string:me,"to-boolean":we,"to-color":we,"to-number":we,"to-string":we,var:Xe,within:Ge};function Vr(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=fe(r,n,i,o);if(s)throw new ge(s);return new oe(r/255*o,n/255*o,i/255*o,o)}function Hr(t,e){return t in e}function qr(t,e){var r=e[t];return void 0===r?null:r}function Gr(t){return{type:t}}function Yr(t){return{result:"success",value:t}}function Wr(t){return{result:"error",value:t}}function Zr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Xr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Jr(t){return!!t.expression&&t.expression.interpolated}function Kr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function $r(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Qr(t){return t}function tn(t,e){var r,n,i,a="color"===e.type,o=t.stops&&"object"==typeof t.stops[0][0],s=o||void 0!==t.property,l=o||!s,u=t.type||(Jr(e)?"exponential":"interval");if(a&&((t=Ft({},t)).stops&&(t.stops=t.stops.map(function(t){return[t[0],oe.parse(t[1])]})),t.default?t.default=oe.parse(t.default):t.default=oe.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!xr[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);if("exponential"===u)r=an;else if("interval"===u)r=nn;else if("categorical"===u){r=rn,n=Object.create(null);for(var c=0,f=t.stops;c=t.stops[n-1][0])return t.stops[n-1][1];var i=$e(t.stops.map(function(t){return t[0]}),r);return t.stops[i][1]}function an(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Kr(r))return en(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=$e(t.stops.map(function(t){return t[0]}),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],u=er[e.type]||Qr;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=xr[t.colorSpace];u=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return u(r,n,o)}}:u(s,l,o)}function on(t,e,r){return"color"===e.type?r=oe.parse(r):"formatted"===e.type?r=ue.fromString(r.toString()):"resolvedImage"===e.type?r=ce.fromString(r.toString()):Kr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),en(r,t.default,e.default)}ke.register(Ur,{error:[{kind:"error"},[qt],function(t,e){var r=e[0];throw new ge(r.evaluate(t))}],typeof:[qt,[Zt],function(t,e){return Qt(pe(e[0].evaluate(t)))}],"to-rgba":[$t(Ht,4),[Yt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Yt,[Ht,Ht,Ht],Vr],rgba:[Yt,[Ht,Ht,Ht,Ht],Vr],has:{type:Gt,overloads:[[[qt],function(t,e){return Hr(e[0].evaluate(t),t.properties())}],[[qt,Wt],function(t,e){var r=e[0],n=e[1];return Hr(r.evaluate(t),n.evaluate(t))}]]},get:{type:Zt,overloads:[[[qt],function(t,e){return qr(e[0].evaluate(t),t.properties())}],[[qt,Wt],function(t,e){var r=e[0],n=e[1];return qr(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[Zt,[qt],function(t,e){return qr(e[0].evaluate(t),t.featureState||{})}],properties:[Wt,[],function(t){return t.properties()}],"geometry-type":[qt,[],function(t){return t.geometryType()}],id:[Zt,[],function(t){return t.id()}],zoom:[Ht,[],function(t){return t.globals.zoom}],"heatmap-density":[Ht,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ht,[],function(t){return t.globals.lineProgress||0}],accumulated:[Zt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ht,Gr(Ht),function(t,e){for(var r=0,n=0,i=e;n":[Gt,[qt,Zt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[Gt,[Zt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Gt,[qt,Zt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[Gt,[Zt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Gt,[qt,Zt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[Gt,[Zt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Gt,[Zt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Gt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Gt,[$t(qt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Gt,[$t(Zt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Gt,[qt,$t(Zt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Gt,[qt,$t(Zt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Gt,overloads:[[[Gt,Gt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Gr(Gt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Ur}function un(t,e){var r=new Je(Ur,[],e?function(t){var e={color:Yt,string:qt,number:Ht,enum:qt,boolean:Gt,formatted:Jt,resolvedImage:Kt};return"array"===t.type?$t(e[t.value]||Zt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Yr(new sn(n,e)):Wr(r.errors)}sn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},sn.prototype.evaluate=function(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ge("Expected value to be one of "+Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var cn=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!We(e.expression)};cn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},cn.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var fn=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!We(e.expression),this.interpolationType=n};function hn(t,e){if("error"===(t=un(t,e)).result)return t;var r=t.value.expression,n=Ye(r);if(!n&&!Zr(e))return Wr([new jt("","data expressions not supported")]);var i=Ze(r,["zoom"]);if(!i&&!Xr(e))return Wr([new jt("","zoom expressions not supported")]);var a=dn(r);if(!a&&!i)return Wr([new jt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof jt)return Wr([a]);if(a instanceof br&&!Jr(e))return Wr([new jt("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Yr(new cn(n?"constant":"source",t.value));var o=a instanceof br?a.interpolation:void 0;return Yr(new fn(n?"camera":"composite",t.value,a.labels,o))}fn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},fn.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)},fn.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?br.interpolationFactor(this.interpolationType,t,e,r):0};var pn=function(t,e){this._parameters=t,this._specification=e,Ft(this,tn(this._parameters,this._specification))};function dn(t){var e=null;if(t instanceof Tr)e=dn(t.result);else if(t instanceof wr)for(var r=0,n=t.args;rn.maximum?[new zt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function mn(t){var e,r,n,i=t.valueSpec,a=Bt(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,u="array"===Kr(t.value.stops)&&"array"===Kr(t.value.stops[0])&&"object"===Kr(t.value.stops[0][0]),c=vn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new zt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(gn({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:f})),"array"===Kr(r)&&0===r.length&&e.push(new zt(t.key,r,"array must have at least one stop")),e},default:function(t){return Vn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&c.push(new zt(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||c.push(new zt(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Jr(t.valueSpec)&&c.push(new zt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Zr(t.valueSpec)?c.push(new zt(t.key,t.value,"property functions not supported")):s&&!Xr(t.valueSpec)&&c.push(new zt(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!u||void 0!==t.value.property||c.push(new zt(t.key,t.value,'"property" property is required')),c;function f(t){var e=[],a=t.value,s=t.key;if("array"!==Kr(a))return[new zt(s,a,"array expected, "+Kr(a)+" found")];if(2!==a.length)return[new zt(s,a,"array length 2 expected, length "+a.length+" found")];if(u){if("object"!==Kr(a[0]))return[new zt(s,a,"object expected, "+Kr(a[0])+" found")];if(void 0===a[0].zoom)return[new zt(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new zt(s,a,"object stop key must have value")];if(n&&n>Bt(a[0].zoom))return[new zt(s,a[0].zoom,"stop zoom values must appear in ascending order")];Bt(a[0].zoom)!==n&&(n=Bt(a[0].zoom),r=void 0,o={}),e=e.concat(vn({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:yn,value:h}}))}else e=e.concat(h({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return ln(Nt(a[1]))?e.concat([new zt(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(Vn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=Kr(t.value),l=Bt(t.value),u=null!==t.value?t.value:n;if(e){if(s!==e)return[new zt(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new zt(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var c="number expected, "+s+" found";return Zr(i)&&void 0===a&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new zt(t.key,u,c)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function kn(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e"===r||"<="===r||">="===r?Sn(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Mn))):"all"===r?["all"].concat(t.slice(1).map(Mn)):"none"===r?["all"].concat(t.slice(1).map(Mn).map(Cn)):"in"===r?En(t[1],t.slice(2)):"!in"===r?Cn(En(t[1],t.slice(2))):"has"===r?Ln(t[1]):"!has"===r?Cn(Ln(t[1])):"within"!==r||t}function Sn(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function En(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(function(t){return typeof t!=typeof e[0]})?["filter-in-large",t,["literal",e.sort(An)]]:["filter-in-small",t,["literal",e]]}}function Ln(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Cn(t){return["!",t]}function Pn(t){return _n(Nt(t.value))?xn(Ft({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):On(t)}function On(t){var e=t.value,r=t.key;if("array"!==Kr(e))return[new zt(r,e,"array expected, "+Kr(e)+" found")];var n,i=t.styleSpec,a=[];if(e.length<1)return[new zt(r,e,"filter array must have at least 1 element")];switch(a=a.concat(bn({key:r+"[0]",value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Bt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Bt(e[1])&&a.push(new zt(r,e,'"$type" cannot be use with operator "'+e[0]+'"'));case"==":case"!=":3!==e.length&&a.push(new zt(r,e,'filter array for operator "'+e[0]+'" must have 3 elements'));case"in":case"!in":e.length>=2&&"string"!==(n=Kr(e[1]))&&a.push(new zt(r+"[1]",e[1],"string expected, "+n+" found"));for(var o=2;o=c[p+0]&&n>=c[p+1])?(o[h]=!0,a.push(u[h])):o[h]=!1}}},ti.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),f=this._convertToCellCoord(n),h=l;h<=c;h++)for(var p=u;p<=f;p++){var d=this.d*p+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(p),this._convertFromCellCoord(h+1),this._convertFromCellCoord(p+1)))&&i.call(this,t,e,r,n,d,a,o,s))return}},ti.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},ti.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},ti.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=Qn+this.cells.length+1+1,r=0,n=0;n=0)){var f=t[c];u[c]=ni[l].shallow.indexOf(c)>=0?f:li(f,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(u.$name=l),u}throw new Error("can't serialize object of type "+typeof t)}function ui(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||oi(t)||si(t)||ArrayBuffer.isView(t)||t instanceof ei)return t;if(Array.isArray(t))return t.map(ui);if("object"==typeof t){var e=t.$name||"Object",r=ni[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i=0?s:ui(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var ci=function(){this.first=!0};ci.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function hi(t){for(var e=0,r=t;e=65097&&t<=65103)||fi["CJK Compatibility Ideographs"](t)||fi["CJK Compatibility"](t)||fi["CJK Radicals Supplement"](t)||fi["CJK Strokes"](t)||!(!fi["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||fi["CJK Unified Ideographs Extension A"](t)||fi["CJK Unified Ideographs"](t)||fi["Enclosed CJK Letters and Months"](t)||fi["Hangul Compatibility Jamo"](t)||fi["Hangul Jamo Extended-A"](t)||fi["Hangul Jamo Extended-B"](t)||fi["Hangul Jamo"](t)||fi["Hangul Syllables"](t)||fi.Hiragana(t)||fi["Ideographic Description Characters"](t)||fi.Kanbun(t)||fi["Kangxi Radicals"](t)||fi["Katakana Phonetic Extensions"](t)||fi.Katakana(t)&&12540!==t||!(!fi["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!fi["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||fi["Unified Canadian Aboriginal Syllabics"](t)||fi["Unified Canadian Aboriginal Syllabics Extended"](t)||fi["Vertical Forms"](t)||fi["Yijing Hexagram Symbols"](t)||fi["Yi Syllables"](t)||fi["Yi Radicals"](t))))}function gi(t){return!(vi(t)||function(t){return!!(fi["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||fi["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||fi["Letterlike Symbols"](t)||fi["Number Forms"](t)||fi["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||fi["Control Pictures"](t)&&9251!==t||fi["Optical Character Recognition"](t)||fi["Enclosed Alphanumerics"](t)||fi["Geometric Shapes"](t)||fi["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||fi["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||fi["CJK Symbols and Punctuation"](t)||fi.Katakana(t)||fi["Private Use Area"](t)||fi["CJK Compatibility Forms"](t)||fi["Small Form Variants"](t)||fi["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function yi(t){return fi.Arabic(t)||fi["Arabic Supplement"](t)||fi["Arabic Extended-A"](t)||fi["Arabic Presentation Forms-A"](t)||fi["Arabic Presentation Forms-B"](t)}function mi(t){return t>=1424&&t<=2303||fi["Arabic Presentation Forms-A"](t)||fi["Arabic Presentation Forms-B"](t)}function xi(t,e){return!(!e&&mi(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||fi.Khmer(t))}function bi(t){for(var e=0,r=t;e-1&&(Mi=Ai),ki&&ki(t)};function Li(){Ci.fire(new Pt("pluginStateChange",{pluginStatus:Mi,pluginURL:Si}))}var Ci=new It,Pi=function(){return Mi},Oi=function(){if(Mi!==_i||!Si)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Mi=wi,Li(),Si&&Tt({url:Si},function(t){t?Ei(t):(Mi=Ti,Li())})},Ii={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Mi===Ti||null!=Ii.applyArabicShaping},isLoading:function(){return Mi===wi},setState:function(t){Mi=t.pluginStatus,Si=t.pluginURL},isParsed:function(){return null!=Ii.applyArabicShaping&&null!=Ii.processBidirectionalText&&null!=Ii.processStyledBidirectionalText},getPluginURL:function(){return Si}},Di=function(){Ii.isLoading()||Ii.isLoaded()||"deferred"!==Pi()||Oi()},zi=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ci,this.transition={})};zi.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Ri=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if($r(t))return new pn(t,e);if(ln(t)){var r=hn(t,e);if("error"===r.result)throw new Error(r.value.map(function(t){return t.key+": "+t.message}).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=oe.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Ri.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Ri.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var Fi=function(t){this.property=t,this.value=new Ri(t,void 0)};Fi.prototype.transitioned=function(t,e){return new Ni(this.property,this.value,e,f({},t.transition,this.transition),t.now)},Fi.prototype.untransitioned=function(){return new Ni(this.property,this.value,null,{},0)};var Bi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Bi.prototype.getValue=function(t){return b(this._values[t].value.value)},Bi.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Fi(this._values[t].property)),this._values[t].value=new Ri(this._values[t].property,null===e?void 0:b(e))},Bi.prototype.getTransition=function(t){return b(this._values[t].transition)},Bi.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Fi(this._values[t].property)),this._values[t].transition=b(e)||void 0},Bi.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return i};var ji=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};ji.prototype.possiblyEvaluate=function(t,e,r){for(var n=new Hi(this._properties),i=0,a=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Gi),Wi=function(t){this.specification=t};Wi.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new zi(Math.floor(e.zoom-1),e)),t.expression.evaluate(new zi(Math.floor(e.zoom),e)),t.expression.evaluate(new zi(Math.floor(e.zoom+1),e)),e)}},Wi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Wi.prototype.interpolate=function(t){return t};var Zi=function(t){this.specification=t};Zi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},Zi.prototype.interpolate=function(){return!1};var Xi=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new Ri(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Fi(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};ii("DataDrivenProperty",Gi),ii("DataConstantProperty",qi),ii("CrossFadedDataDrivenProperty",Yi),ii("CrossFadedProperty",Wi),ii("ColorRampProperty",Zi);var Ji="-transition",Ki=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Ui(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Bi(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Hi(r.paint)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(Jn,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return y(t,Ji)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(Xn,n,t,e,r))return!1}if(y(t,Ji))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;var i=this._transitionablePaint._values[t],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(t,s,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),x(t,function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)})},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Kn(this,t.call(Wn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Dt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Vi&&Zr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(It),$i={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Qi=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},ta=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function ea(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map(function(t){var i,a=(i=t.type,$i[i].BYTES_PER_ELEMENT),o=r=ra(r,Math.max(e,a)),s=t.components||1;return n=Math.max(n,a),r+=a*s,{name:t.name,type:t.type,components:s,offset:o}}),size:ra(r,Math.max(n,e)),alignment:e}}function ra(t,e){return Math.ceil(t/e)*e}ta.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},ta.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},ta.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},ta.prototype.clear=function(){this.length=0},ta.prototype.resize=function(t){this.reserve(t),this.length=t},ta.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},ta.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var na=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(ta);na.prototype.bytesPerElement=4,ii("StructArrayLayout2i4",na);var ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}(ta);ia.prototype.bytesPerElement=8,ii("StructArrayLayout4i8",ia);var aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(ta);aa.prototype.bytesPerElement=12,ii("StructArrayLayout2i4i12",aa);var oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t},e}(ta);oa.prototype.bytesPerElement=8,ii("StructArrayLayout2i4ub8",oa);var sa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l,u)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c){var f=9*t,h=18*t;return this.uint16[f+0]=e,this.uint16[f+1]=r,this.uint16[f+2]=n,this.uint16[f+3]=i,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.uint8[h+16]=u,this.uint8[h+17]=c,t},e}(ta);sa.prototype.bytesPerElement=18,ii("StructArrayLayout8ui2ub18",sa);var la=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c,f){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,i,a,o,s,l,u,c,f)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c,f,h){var p=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=u,this.int16[p+9]=c,this.int16[p+10]=f,this.int16[p+11]=h,t},e}(ta);la.prototype.bytesPerElement=24,ii("StructArrayLayout4i4ui4i24",la);var ua=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(ta);ua.prototype.bytesPerElement=12,ii("StructArrayLayout3f12",ua);var ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(ta);ca.prototype.bytesPerElement=4,ii("StructArrayLayout1ul4",ca);var fa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u){var c=10*t,f=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=a,this.int16[c+5]=o,this.uint32[f+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=u,t},e}(ta);fa.prototype.bytesPerElement=20,ii("StructArrayLayout6i1ul2ui20",fa);var ha=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(ta);ha.prototype.bytesPerElement=12,ii("StructArrayLayout2i2i2i12",ha);var pa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,a){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t},e}(ta);pa.prototype.bytesPerElement=16,ii("StructArrayLayout2f1f2i16",pa);var da=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}(ta);da.prototype.bytesPerElement=12,ii("StructArrayLayout2ub2f12",da);var va=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(ta);va.prototype.bytesPerElement=6,ii("StructArrayLayout3ui6",va);var ga=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,v,g){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,v,g)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,v,g,y){var m=24*t,x=12*t,b=48*t;return this.int16[m+0]=e,this.int16[m+1]=r,this.uint16[m+2]=n,this.uint16[m+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[m+10]=l,this.uint16[m+11]=u,this.uint16[m+12]=c,this.float32[x+7]=f,this.float32[x+8]=h,this.uint8[b+36]=p,this.uint8[b+37]=d,this.uint8[b+38]=v,this.uint32[x+10]=g,this.int16[m+22]=y,t},e}(ta);ga.prototype.bytesPerElement=48,ii("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ga);var ya=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,v,g,y,m,x,b,_,w,T,A,k,M,S){var E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,v,g,y,m,x,b,_,w,T,A,k,M,S)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,v,g,y,m,x,b,_,w,T,A,k,M,S,E){var L=34*t,C=17*t;return this.int16[L+0]=e,this.int16[L+1]=r,this.int16[L+2]=n,this.int16[L+3]=i,this.int16[L+4]=a,this.int16[L+5]=o,this.int16[L+6]=s,this.int16[L+7]=l,this.uint16[L+8]=u,this.uint16[L+9]=c,this.uint16[L+10]=f,this.uint16[L+11]=h,this.uint16[L+12]=p,this.uint16[L+13]=d,this.uint16[L+14]=v,this.uint16[L+15]=g,this.uint16[L+16]=y,this.uint16[L+17]=m,this.uint16[L+18]=x,this.uint16[L+19]=b,this.uint16[L+20]=_,this.uint16[L+21]=w,this.uint16[L+22]=T,this.uint32[C+12]=A,this.float32[C+13]=k,this.float32[C+14]=M,this.float32[C+15]=S,this.float32[C+16]=E,t},e}(ta);ya.prototype.bytesPerElement=68,ii("StructArrayLayout8i15ui1ul4f68",ya);var ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(ta);ma.prototype.bytesPerElement=4,ii("StructArrayLayout1f4",ma);var xa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(ta);xa.prototype.bytesPerElement=6,ii("StructArrayLayout3i6",xa);var ba=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,a=4*t;return this.uint32[i+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=n,t},e}(ta);ba.prototype.bytesPerElement=8,ii("StructArrayLayout1ul2ui8",ba);var _a=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(ta);_a.prototype.bytesPerElement=4,ii("StructArrayLayout2ui4",_a);var wa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(ta);wa.prototype.bytesPerElement=2,ii("StructArrayLayout1ui2",wa);var Ta=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(ta);Ta.prototype.bytesPerElement=8,ii("StructArrayLayout2f8",Ta);var Aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(ta);Aa.prototype.bytesPerElement=16,ii("StructArrayLayout4f16",Aa);var ka=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Qi);ka.prototype.size=20;var Ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ka(this,t)},e}(fa);ii("CollisionBoxArray",Ma);var Sa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Qi);Sa.prototype.size=48;var Ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Sa(this,t)},e}(ga);ii("PlacedSymbolArray",Ea);var La=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Qi);La.prototype.size=68;var Ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new La(this,t)},e}(ya);ii("SymbolInstanceArray",Ca);var Pa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(ma);ii("GlyphOffsetArray",Pa);var Oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(xa);ii("SymbolLineVertexArray",Oa);var Ia=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Qi);Ia.prototype.size=8;var Da=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Ia(this,t)},e}(ba);ii("FeatureIndexArray",Da);var za=ea([{name:"a_pos",components:2,type:"Int16"}],4).members,Ra=function(t){void 0===t&&(t=[]),this.segments=t};function Fa(t,e){return 256*(t=u(Math.floor(t),0,255))+u(Math.floor(e),0,255)}Ra.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Ra.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+Ra.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Ra.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Ra.prototype.get=function(){return this.segments},Ra.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+(((a>>>16)+58964&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}}),ja=e(function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}}),Ua=Na,Va=Na,Ha=ja;Ua.murmur3=Va,Ua.murmur2=Ha;var qa=function(){this.ids=[],this.positions=[],this.indexed=!1};qa.prototype.add=function(t,e,r,n){this.ids.push(Ya(t)),this.positions.push(e,r,n)},qa.prototype.getPositions=function(t){for(var e=Ya(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var a=[];this.ids[r]===e;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},qa.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return Wa(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},qa.deserialize=function(t){var e=new qa;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var Ga=Math.pow(2,53)-1;function Ya(t){var e=+t;return!isNaN(e)&&e<=Ga?e:Ua(String(t))}function Wa(t,e,r,n){for(;r>1],a=r-1,o=n+1;;){do{a++}while(t[a]i);if(a>=o)break;Za(t,a,o),Za(e,3*a,3*o),Za(e,3*a+1,3*o+1),Za(e,3*a+2,3*o+2)}o-ryo.max||o.yyo.max)&&(w("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=u(o.x,yo.min,yo.max),o.y=u(o.y,yo.min,yo.max))}return r}function xo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var bo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new na,this.indexArray=new va,this.segments=new Ra,this.programConfigurations=new fo(za,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function _o(t,e){for(var r=0;r1){if(ko(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Lo(t,e){for(var r,n,i,a=!1,o=0;oe.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Co(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Po(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var a=T(t,e,r[0]);return a!==T(t,e,r[1])||a!==T(t,e,r[2])||a!==T(t,e,r[3])}function Oo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Io(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Do(t,e,r,n,i){if(!e[0]&&!e[1])return t;var o=a.convert(e)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=vo||c<0||c>=vo)){var f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=f.vertexLength;xo(this.layoutVertexArray,u,c,-1,-1),xo(this.layoutVertexArray,u,c,1,-1),xo(this.layoutVertexArray,u,c,1,1),xo(this.layoutVertexArray,u,c,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),f.vertexLength+=4,f.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},ii("CircleBucket",bo,{omit:["layers"]});var zo=new Xi({"circle-sort-key":new Gi(Dt.layout_circle["circle-sort-key"])}),Ro={paint:new Xi({"circle-radius":new Gi(Dt.paint_circle["circle-radius"]),"circle-color":new Gi(Dt.paint_circle["circle-color"]),"circle-blur":new Gi(Dt.paint_circle["circle-blur"]),"circle-opacity":new Gi(Dt.paint_circle["circle-opacity"]),"circle-translate":new qi(Dt.paint_circle["circle-translate"]),"circle-translate-anchor":new qi(Dt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new qi(Dt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new qi(Dt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Gi(Dt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Gi(Dt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Gi(Dt.paint_circle["circle-stroke-opacity"])}),layout:zo},Fo="undefined"!=typeof Float32Array?Float32Array:Array;function Bo(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function No(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],v=e[12],g=e[13],y=e[14],m=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*f+w*v,t[1]=x*i+b*l+_*h+w*g,t[2]=x*a+b*u+_*p+w*y,t[3]=x*o+b*c+_*d+w*m,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*f+w*v,t[5]=x*i+b*l+_*h+w*g,t[6]=x*a+b*u+_*p+w*y,t[7]=x*o+b*c+_*d+w*m,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*f+w*v,t[9]=x*i+b*l+_*h+w*g,t[10]=x*a+b*u+_*p+w*y,t[11]=x*o+b*c+_*d+w*m,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*f+w*v,t[13]=x*i+b*l+_*h+w*g,t[14]=x*a+b*u+_*p+w*y,t[15]=x*o+b*c+_*d+w*m,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var jo=No;var Uo,Vo=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};function Ho(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}Uo=new Fo(3),Fo!=Float32Array&&(Uo[0]=0,Uo[1]=0,Uo[2]=0),function(){var t=new Fo(4);Fo!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var qo=function(t){var e=t[0],r=t[1];return e*e+r*r},Go=(function(){var t=new Fo(2);Fo!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,Ro)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new bo(t)},e.prototype.queryRadius=function(t){var e=t;return Oo("circle-radius",this,e)+Oo("circle-stroke-width",this,e)+Io(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var l=Do(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),f=c?l:function(t,e){return t.map(function(t){return Yo(t,e)})}(l,s),h=c?u*o:u,p=0,d=n;pt.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l80*r){n=a=t[0],i=o=t[1];for(var d=r;da&&(a=s),l>o&&(o=l);u=0!==(u=Math.max(a-n,o-i))?1/u:0}return cs(h,p,r,n,i,u),p}function ls(t,e,r,n,i){var a,o;if(i===Os(t,e,r,n)>0)for(a=e;a=e;a-=n)o=Ls(a,t[a],t[a+1],o);return o&&Ts(o,o.next)&&(Cs(o),o=o.next),o}function us(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Ts(n,n.next)&&0!==ws(n.prev,n,n.next))n=n.next;else{if(Cs(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function cs(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=ms(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,u=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?hs(t,n,i,a):fs(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Cs(t),t=l.next,u=l.next;else if((t=l)===u){o?1===o?cs(t=ps(us(t),e,r),e,r,n,i,a,2):2===o&&ds(t,e,r,n,i,a):cs(us(t),e,r,n,i,a,1);break}}}function fs(t){var e=t.prev,r=t,n=t.next;if(ws(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(bs(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&ws(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function hs(t,e,r,n){var i=t.prev,a=t,o=t.next;if(ws(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=ms(s,l,e,r,n),h=ms(u,c,e,r,n),p=t.prevZ,d=t.nextZ;p&&p.z>=f&&d&&d.z<=h;){if(p!==t.prev&&p!==t.next&&bs(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&ws(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&bs(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ws(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&bs(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&ws(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=h;){if(d!==t.prev&&d!==t.next&&bs(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ws(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function ps(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!Ts(i,a)&&As(i,n,n.next,a)&&Ss(i,a)&&Ss(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),Cs(n),Cs(n.next),n=t=a),n=n.next}while(n!==t);return us(n)}function ds(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&_s(o,s)){var l=Es(o,s);return o=us(o,o.next),l=us(l,l.next),cs(o,e,r,n,i,a),void cs(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function vs(t,e){return t.x-e.x}function gs(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&bs(ar.x||n.x===r.x&&ys(r,n)))&&(r=n,h=l)),n=n.next}while(n!==u);return r}(t,e)){var r=Es(e,t);us(e,e.next),us(r,r.next)}}function ys(t,e){return ws(t.prev,t,e.prev)<0&&ws(e.next,t,t.next)<0}function ms(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function xs(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function _s(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&As(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Ss(t,e)&&Ss(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(ws(t.prev,t,e.prev)||ws(t,e.prev,e))||Ts(t,e)&&ws(t.prev,t,t.next)>0&&ws(e.prev,e,e.next)>0)}function ws(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ts(t,e){return t.x===e.x&&t.y===e.y}function As(t,e,r,n){var i=Ms(ws(t,e,r)),a=Ms(ws(t,e,n)),o=Ms(ws(r,n,t)),s=Ms(ws(r,n,e));return i!==a&&o!==s||!(0!==i||!ks(t,r,e))||!(0!==a||!ks(t,n,e))||!(0!==o||!ks(r,t,n))||!(0!==s||!ks(r,e,n))}function ks(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ms(t){return t>0?1:t<0?-1:0}function Ss(t,e){return ws(t.prev,t,t.next)<0?ws(t,e,t.next)>=0&&ws(t,t.prev,e)>=0:ws(t,e,t.prev)<0||ws(t,t.next,e)<0}function Es(t,e){var r=new Ps(t.i,t.x,t.y),n=new Ps(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Ls(t,e,r,n){var i=new Ps(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Cs(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ps(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Os(t,e,r,n){for(var i=0,a=e,o=r-n;ar;){if(n-r>600){var a=n-r+1,o=e-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Ds(t,e,Math.max(r,Math.floor(e-o*l/a+u)),Math.min(n,Math.floor(e+(a-o)*l/a+u)),i)}var c=t[e],f=r,h=n;for(zs(t,r,e),i(t[n],c)>0&&zs(t,r,n);f0;)h--}0===i(t[r],c)?zs(t,r,h):zs(t,++h,n),h<=e&&(r=h+1),e<=h&&(n=h-1)}}function zs(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Rs(t,e){return te?1:0}function Fs(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o1)for(var l=0;l0&&(n+=t[i-1].length,r.holes.push(n))}return r},as.default=os;var Us=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new na,this.indexArray=new va,this.indexArray2=new _a,this.programConfigurations=new fo(is,t.layers,t.zoom),this.segments=new Ra,this.segments2=new Ra,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};Us.prototype.populate=function(t,e,r){this.hasPattern=Ns("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=t;a>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},Ws.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},Ws.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=Ws.types[this.type];function c(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function Qs(t,e,r){if(3===t){var n=new Js(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Ks.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Ys(this._pbf,e,this.extent,this._keys,this._values)};var tl={VectorTile:function(t,e){this.layers=t.readFields(Qs,{},e)},VectorTileFeature:Ys,VectorTileLayer:Js},el=tl.VectorTileFeature.types,rl=Math.pow(2,13);function nl(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*rl)+o,i*rl*2,a*rl*2,Math.round(s))}var il=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new aa,this.indexArray=new va,this.programConfigurations=new fo(Gs,t.layers,t.zoom),this.segments=new Ra,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function al(t,e){return t.x===e.x&&(t.x<0||t.x>vo)||t.y===e.y&&(t.y<0||t.y>vo)}function ol(t){return t.every(function(t){return t.x<0})||t.every(function(t){return t.x>vo})||t.every(function(t){return t.y<0})||t.every(function(t){return t.y>vo})}il.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Ns("fill-extrusion",this.layers,e);for(var n=0,i=t;n=1){var m=d[g-1];if(!al(y,m)){f.vertexLength+4>Ra.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=y.sub(m)._perp()._unit(),b=m.dist(y);v+b>32768&&(v=0),nl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,v),nl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,v),v+=b,nl(this.layoutVertexArray,m.x,m.y,x.x,x.y,0,0,v),nl(this.layoutVertexArray,m.x,m.y,x.x,x.y,0,1,v);var _=f.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),f.vertexLength+=4,f.primitiveLength+=2}}}}if(f.vertexLength+l>Ra.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===el[t.type]){for(var w=[],T=[],A=f.vertexLength,k=0,M=s;k=2&&t[l-1].equals(t[l-2]);)l--;for(var u=0;u0;if(T&&y>u){var k=c.dist(p);if(k>2*f){var M=c.sub(c.sub(p)._mult(f/k)._round());this.updateDistance(p,M),this.addCurrentVertex(M,v,0,0,h),p=M}}var S=p&&d,E=S?r:s?"butt":n;if(S&&"round"===E&&(_i&&(E="bevel"),"bevel"===E&&(_>2&&(E="flipbevel"),_100)m=g.mult(-1);else{var L=_*v.add(g).mag()/v.sub(g).mag();m._perp()._mult(L*(A?-1:1))}this.addCurrentVertex(c,m,0,0,h),this.addCurrentVertex(c,m.mult(-1),0,0,h)}else if("bevel"===E||"fakeround"===E){var C=-Math.sqrt(_*_-1),P=A?C:0,O=A?0:C;if(p&&this.addCurrentVertex(c,v,P,O,h),"fakeround"===E)for(var I=Math.round(180*w/Math.PI/20),D=1;D2*f){var j=c.add(d.sub(c)._mult(f/N)._round());this.updateDistance(c,j),this.addCurrentVertex(j,g,0,0,h),c=j}}}}},vl.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.x+e.y*r,s=e.y-e.x*r,l=-e.x+e.y*n,u=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,l,u,a,!0,-n,i),this.distance>dl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a))},vl.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,l=t.y,u=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&u)<<2,u>>6);var c=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),o.primitiveLength++),i?this.e2=c:this.e1=c},vl.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(dl-1):this.distance},vl.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},ii("LineBucket",vl,{omit:["layers","patternFeatures"]});var gl=new Xi({"line-cap":new qi(Dt.layout_line["line-cap"]),"line-join":new Gi(Dt.layout_line["line-join"]),"line-miter-limit":new qi(Dt.layout_line["line-miter-limit"]),"line-round-limit":new qi(Dt.layout_line["line-round-limit"]),"line-sort-key":new Gi(Dt.layout_line["line-sort-key"])}),yl={paint:new Xi({"line-opacity":new Gi(Dt.paint_line["line-opacity"]),"line-color":new Gi(Dt.paint_line["line-color"]),"line-translate":new qi(Dt.paint_line["line-translate"]),"line-translate-anchor":new qi(Dt.paint_line["line-translate-anchor"]),"line-width":new Gi(Dt.paint_line["line-width"]),"line-gap-width":new Gi(Dt.paint_line["line-gap-width"]),"line-offset":new Gi(Dt.paint_line["line-offset"]),"line-blur":new Gi(Dt.paint_line["line-blur"]),"line-dasharray":new Wi(Dt.paint_line["line-dasharray"]),"line-pattern":new Yi(Dt.paint_line["line-pattern"]),"line-gradient":new Zi(Dt.paint_line["line-gradient"])}),layout:gl},ml=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new zi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=f({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Gi),xl=new ml(yl.paint.properties["line-width"].specification);xl.useIntegerZoom=!0;var bl=function(t){function e(e){t.call(this,e,yl)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=ts(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=xl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new vl(t)},e.prototype.queryRadius=function(t){var e=t,r=_l(Oo("line-width",this,e),Oo("line-gap-width",this,e)),n=Oo("line-offset",this,e);return r/2+Math.abs(n)+Io(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s){var l=Do(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),u=s/2*_l(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){for(var r=[],n=new a(0,0),i=0;i=3)for(var a=0;a0?e+2*t:t}var wl=ea([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Tl=ea([{name:"a_projected_pos",components:3,type:"Float32"}],4),Al=(ea([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ea([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),kl=(ea([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),ea([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Ml=ea([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Sl(t,e,r){return t.sections.forEach(function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Ii.applyArabicShaping&&(t=Ii.applyArabicShaping(t)),t}(t.text,e,r)}),t}ea([{name:"triangle",components:3,type:"Uint16"}]),ea([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),ea([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ea([{type:"Float32",name:"offsetX"}]),ea([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var El={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Ll=24,Cl=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,c=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},Pl=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,u-=8);t[r+p-d]|=128*v},Ol=Il;function Il(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Il.Varint=0,Il.Fixed64=1,Il.Bytes=2,Il.Fixed32=5;var Dl=4294967296,zl=1/Dl,Rl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Fl(t){return t.type===Il.Bytes?t.readVarint()+t.pos:t.pos+1}function Bl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Nl(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function jl(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Kl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Il.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Xl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Kl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Xl(this.buf,this.pos)+Xl(this.buf,this.pos+4)*Dl;return this.pos+=8,t},readSFixed64:function(){var t=Xl(this.buf,this.pos)+Kl(this.buf,this.pos+4)*Dl;return this.pos+=8,t},readFloat:function(){var t=Cl(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Cl(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return Bl(t,n,e);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return Bl(t,n,e);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return Bl(t,n,e);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return Bl(t,n,e);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return Bl(t,n,e);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return Bl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Rl?function(t,e,r){return Rl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(a=t[i+1]))&&(u=(31&l)<<6|63&a)<=127&&(u=null):3===c?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((u=(15&l)<<12|(63&a)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=c}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Il.Bytes)return t.push(this.readVarint(e));var r=Fl(this);for(t=t||[];this.pos127;);else if(e===Il.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Il.Fixed32)this.pos+=4;else{if(e!==Il.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Nl(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Pl(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Pl(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&Nl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Il.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,jl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Ul,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,ql,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Vl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Hl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Gl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Yl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Wl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Zl,e)},writeBytesField:function(t,e){this.writeTag(t,Il.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Il.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Il.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Il.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Il.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Il.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Il.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Il.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Il.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Il.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};function $l(t,e,r){1===t&&r.readMessage(Ql,e)}function Ql(t,e,r){if(3===t){var n=r.readMessage(tu,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,u=n.top,c=n.advance;e.push({id:i,bitmap:new Ko({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:u,advance:c}})}}function tu(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function eu(t){for(var e=0,r=0,n=0,i=t;n=0;h--){var p=o[h];if(!(f.w>p.w||f.h>p.h)){if(f.x=p.x,f.y=p.y,l=Math.max(l,f.y+f.h),s=Math.max(s,f.x+f.w),f.w===p.w&&f.h===p.h){var d=o.pop();h0&&B>k&&(k=B)}else{var N=r[S.fontStack],j=N&&N[L];if(j&&j.rect)O=j.rect,P=j.metrics;else{var U=e[S.fontStack],V=U&&U[L];if(!V)continue;P=V.metrics}C=(_-S.scale)*Ll}z?(t.verticalizable=!0,A.push({glyph:L,imageName:I,x:h,y:p+C,vertical:z,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:P,rect:O}),h+=D*S.scale+u):(A.push({glyph:L,imageName:I,x:h,y:p+C,vertical:z,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:P,rect:O}),h+=P.advance*S.scale+u)}if(0!==A.length){var H=h-u;d=Math.max(H,d),xu(A,0,A.length-1,g,k)}h=0;var q=a*_+k;T.lineOffset=Math.max(k,w),p+=q,v=Math.max(q,v),++y}else p+=a,++y}var G=p-ou,Y=mu(o),W=Y.horizontalAlign,Z=Y.verticalAlign;(function(t,e,r,n,i,a,o,s,l){var u=(e-r)*i,c=0;c=a!==o?-s*n-ou:(-n*l+.5)*o;for(var f=0,h=t;f=0&&n>=t&&cu[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},lu.prototype.substring=function(t,e){var r=new lu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},lu.prototype.toString=function(){return this.text},lu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce(function(e,r){return Math.max(e,t.sections[r].scale)},0)},lu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(su.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var cu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},fu={};function hu(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*Ll/a+i:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+i:0}function pu(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,c=0,f=0;f-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],u=0;sn;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=f.dist(h)}return!0}function Eu(t){for(var e=0,r=0;ru){var d=(u-l)/p,v=tr(f.x,h.x,d),g=tr(f.y,h.y,d),y=new _u(v,g,h.angleTo(f),c);return y._round(),!o||Su(t,y,s,o,e)?y:void 0}l+=p}}function Ou(t,e,r,n,i,a,o,s,l){var u=Lu(n,a,o),c=Cu(n,i),f=c*o,h=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-f=0&&b=0&&_=0&&h+u<=c){var w=new _u(b,_,m,d);w._round(),n&&!Su(t,w,a,n,i)||p.push(w)}}f+=y}return s||p.length||o||(p=Iu(t,f/2,r,n,i,a,o,!0,l)),p}function Du(t,e,r,n,i){for(var o=[],s=0;s=n&&h.x>=n||(f.x>=n?f=new a(n,f.y+(h.y-f.y)*((n-f.x)/(h.x-f.x)))._round():h.x>=n&&(h=new a(n,f.y+(h.y-f.y)*((n-f.x)/(h.x-f.x)))._round()),f.y>=i&&h.y>=i||(f.y>=i?f=new a(f.x+(h.x-f.x)*((i-f.y)/(h.y-f.y)),i)._round():h.y>=i&&(h=new a(f.x+(h.x-f.x)*((i-f.y)/(h.y-f.y)),i)._round()),u&&f.equals(u[u.length-1])||(u=[f],o.push(u)),u.push(h)))))}return o}function zu(t,e,r,n){var i=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,u=o.paddedRect.h-2,c=t.right-t.left,f=t.bottom-t.top,h=o.stretchX||[[0,l]],p=o.stretchY||[[0,u]],d=function(t,e){return t+e[1]-e[0]},v=h.reduce(d,0),g=p.reduce(d,0),y=l-v,m=u-g,x=0,b=v,_=0,w=g,T=0,A=y,k=0,M=m;if(o.content&&n){var S=o.content;x=Ru(h,0,S[0]),_=Ru(p,0,S[1]),b=Ru(h,S[0],S[2]),w=Ru(p,S[1],S[3]),T=S[0]-x,k=S[1]-_,A=S[2]-S[0]-b,M=S[3]-S[1]-w}var E=function(n,i,l,u){var h=Bu(n.stretch-x,b,c,t.left),p=Nu(n.fixed-T,A,n.stretch,v),d=Bu(i.stretch-_,w,f,t.top),y=Nu(i.fixed-k,M,i.stretch,g),m=Bu(l.stretch-x,b,c,t.left),S=Nu(l.fixed-T,A,l.stretch,v),E=Bu(u.stretch-_,w,f,t.top),L=Nu(u.fixed-k,M,u.stretch,g),C=new a(h,d),P=new a(m,d),O=new a(m,E),I=new a(h,E),D=new a(p/s,y/s),z=new a(S/s,L/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),B=Math.cos(R),N=[B,-F,F,B];C._matMult(N),P._matMult(N),I._matMult(N),O._matMult(N)}var j=n.stretch+n.fixed,U=l.stretch+l.fixed,V=i.stretch+i.fixed,H=u.stretch+u.fixed;return{tl:C,tr:P,bl:I,br:O,tex:{x:o.paddedRect.x+1+j,y:o.paddedRect.y+1+V,w:U-j,h:H-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:z,minFontScaleX:A/s/c,minFontScaleY:M/s/f,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var L=Fu(h,y,v),C=Fu(p,m,g),P=0;P0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var v=o.top*s-l,g=o.bottom*s+l,y=o.left*s-l,m=o.right*s+l,x=o.collisionPadding;if(x&&(y-=x[0]*s,v-=x[1]*s,m+=x[2]*s,g+=x[3]*s),c){var b=new a(y,v),_=new a(m,v),w=new a(y,g),T=new a(m,g),A=c*Math.PI/180;b._rotate(A),_._rotate(A),w._rotate(A),T._rotate(A),y=Math.min(b.x,_.x,w.x,T.x),m=Math.max(b.x,_.x,w.x,T.x),v=Math.min(b.y,_.y,w.y,T.y),g=Math.max(b.y,_.y,w.y,T.y)}t.emplaceBack(e.x,e.y,y,v,m,g,r,n,i)}this.boxEndIndex=t.length},Uu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Vu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Vu(t,e){return te?1:0}function Hu(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=t[0],u=0;uo)&&(o=c.x),(!u||c.y>s)&&(s=c.y)}var f=o-n,h=s-i,p=Math.min(f,h),d=p/2,v=new Uu([],qu);if(0===p)return new a(n,i);for(var g=n;gm.d||!m.d)&&(m=b,r&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-m.d<=e||(d=b.h/2,v.push(new Gu(b.p.x-d,b.p.y-d,d,t)),v.push(new Gu(b.p.x+d,b.p.y-d,d,t)),v.push(new Gu(b.p.x-d,b.p.y+d,d,t)),v.push(new Gu(b.p.x+d,b.p.y+d,d,t)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+m.d)),m.p}function qu(t,e){return e.max-t.max}function Gu(t,e,r,n){this.p=new a(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=c.y>t.y&&t.x<(c.x-u.x)*(t.y-u.y)/(c.y-u.y)+u.x&&(r=!r),n=Math.min(n,Eo(t,u,c))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Uu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Uu.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Uu.prototype.peek=function(){return this.data[0]},Uu.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n},Uu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=o,t=a}e[t]=i};var Yu=Number.POSITIVE_INFINITY;function Wu(t,e){return e[1]!==Yu?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function Zu(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var Xu=255,Ju=Xu*wu;function Ku(t,e,r,n,i,o,s,l,u,c,f,h,p,d,v){var g=function(t,e,r,n,i,o,s,l){for(var u=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,c=[],f=0,h=e.positionedLines;fJu&&w(t.layerIds[0]+': Value for "text-size" is >= '+Xu+'. Reduce your "text-size".'):"composite"===y.kind&&((m=[wu*d.compositeTextSizes[0].evaluate(s,{},v),wu*d.compositeTextSizes[1].evaluate(s,{},v)])[0]>Ju||m[1]>Ju)&&w(t.layerIds[0]+': Value for "text-size" is >= '+Xu+'. Reduce your "text-size".'),t.addSymbols(t.text,g,m,l,o,s,c,e,u.lineStartIndex,u.lineLength,p,v);for(var x=0,b=f;x=0;o--)if(n.dist(a[o])0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],l||u){for(var f=e.iconDependencies,h=e.glyphDependencies,p=e.availableImages,d=new zi(this.zoom),v=0,g=t;v=0;for(var I=0,D=A.sections;I=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l0},sc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},sc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},sc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},sc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},sc.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},ii("SymbolBucket",sc,{omit:["layers","collisionBoxArray","features","compareText"]}),sc.MAX_GLYPHS=65535,sc.addDynamicAttributes=nc;var lc=new Xi({"symbol-placement":new qi(Dt.layout_symbol["symbol-placement"]),"symbol-spacing":new qi(Dt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new qi(Dt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Gi(Dt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new qi(Dt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new qi(Dt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new qi(Dt.layout_symbol["icon-ignore-placement"]),"icon-optional":new qi(Dt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new qi(Dt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Gi(Dt.layout_symbol["icon-size"]),"icon-text-fit":new qi(Dt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new qi(Dt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Gi(Dt.layout_symbol["icon-image"]),"icon-rotate":new Gi(Dt.layout_symbol["icon-rotate"]),"icon-padding":new qi(Dt.layout_symbol["icon-padding"]),"icon-keep-upright":new qi(Dt.layout_symbol["icon-keep-upright"]),"icon-offset":new Gi(Dt.layout_symbol["icon-offset"]),"icon-anchor":new Gi(Dt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new qi(Dt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new qi(Dt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new qi(Dt.layout_symbol["text-rotation-alignment"]),"text-field":new Gi(Dt.layout_symbol["text-field"]),"text-font":new Gi(Dt.layout_symbol["text-font"]),"text-size":new Gi(Dt.layout_symbol["text-size"]),"text-max-width":new Gi(Dt.layout_symbol["text-max-width"]),"text-line-height":new qi(Dt.layout_symbol["text-line-height"]),"text-letter-spacing":new Gi(Dt.layout_symbol["text-letter-spacing"]),"text-justify":new Gi(Dt.layout_symbol["text-justify"]),"text-radial-offset":new Gi(Dt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new qi(Dt.layout_symbol["text-variable-anchor"]),"text-anchor":new Gi(Dt.layout_symbol["text-anchor"]),"text-max-angle":new qi(Dt.layout_symbol["text-max-angle"]),"text-writing-mode":new qi(Dt.layout_symbol["text-writing-mode"]),"text-rotate":new Gi(Dt.layout_symbol["text-rotate"]),"text-padding":new qi(Dt.layout_symbol["text-padding"]),"text-keep-upright":new qi(Dt.layout_symbol["text-keep-upright"]),"text-transform":new Gi(Dt.layout_symbol["text-transform"]),"text-offset":new Gi(Dt.layout_symbol["text-offset"]),"text-allow-overlap":new qi(Dt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new qi(Dt.layout_symbol["text-ignore-placement"]),"text-optional":new qi(Dt.layout_symbol["text-optional"])}),uc={paint:new Xi({"icon-opacity":new Gi(Dt.paint_symbol["icon-opacity"]),"icon-color":new Gi(Dt.paint_symbol["icon-color"]),"icon-halo-color":new Gi(Dt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Gi(Dt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Gi(Dt.paint_symbol["icon-halo-blur"]),"icon-translate":new qi(Dt.paint_symbol["icon-translate"]),"icon-translate-anchor":new qi(Dt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Gi(Dt.paint_symbol["text-opacity"]),"text-color":new Gi(Dt.paint_symbol["text-color"],{runtimeType:Yt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Gi(Dt.paint_symbol["text-halo-color"]),"text-halo-width":new Gi(Dt.paint_symbol["text-halo-width"]),"text-halo-blur":new Gi(Dt.paint_symbol["text-halo-blur"]),"text-translate":new qi(Dt.paint_symbol["text-translate"]),"text-translate-anchor":new qi(Dt.paint_symbol["text-translate-anchor"])}),layout:lc},cc=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Vt,this.defaultValue=t};cc.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},cc.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},cc.prototype.outputDefined=function(){return!1},cc.prototype.serialize=function(){return null},ii("FormatSectionOverride",cc,{omit:["defaultValue"]});var fc=function(t){function e(e){t.call(this,e,uc)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a",targetMapId:n,sourceMapId:a.mapId})}}},kc.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},kc.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},kc.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(ui(e.error)):n(null,ui(e.data)))}else{var i=!1,a=E(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?li(e):null,data:li(n,a)},a)}:function(t){i=!0},s=null,l=ui(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var u=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,u[0],l.source)[u[1]](l,o)}else o(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},kc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Sc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Sc.prototype.setNorthEast=function(t){return this._ne=t instanceof Lc?new Lc(t.lng,t.lat):Lc.convert(t),this},Sc.prototype.setSouthWest=function(t){return this._sw=t instanceof Lc?new Lc(t.lng,t.lat):Lc.convert(t),this},Sc.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Lc)e=t,r=t;else{if(!(t instanceof Sc)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var a=t;return this.extend(Sc.convert(a))}var o=t;return this.extend(Lc.convert(o))}return this}if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Lc(e.lng,e.lat),this._ne=new Lc(r.lng,r.lat)),this},Sc.prototype.getCenter=function(){return new Lc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Sc.prototype.getSouthWest=function(){return this._sw},Sc.prototype.getNorthEast=function(){return this._ne},Sc.prototype.getNorthWest=function(){return new Lc(this.getWest(),this.getNorth())},Sc.prototype.getSouthEast=function(){return new Lc(this.getEast(),this.getSouth())},Sc.prototype.getWest=function(){return this._sw.lng},Sc.prototype.getSouth=function(){return this._sw.lat},Sc.prototype.getEast=function(){return this._ne.lng},Sc.prototype.getNorth=function(){return this._ne.lat},Sc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Sc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Sc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Sc.prototype.contains=function(t){var e=Lc.convert(t),r=e.lng,n=e.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},Sc.convert=function(t){return!t||t instanceof Sc?t:new Sc(t)};var Ec=6371008.8,Lc=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Lc.prototype.wrap=function(){return new Lc(c(this.lng,-180,180),this.lat)},Lc.prototype.toArray=function(){return[this.lng,this.lat]},Lc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Lc.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return Ec*Math.acos(Math.min(i,1))},Lc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Sc(new Lc(this.lng-r,this.lat-e),new Lc(this.lng+r,this.lat+e))},Lc.convert=function(t){if(t instanceof Lc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Lc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Lc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Cc=2*Math.PI*Ec;function Pc(t){return Cc*Math.cos(t*Math.PI/180)}function Oc(t){return(180+t)/360}function Ic(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Dc(t,e){return t/Pc(e)}function zc(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var Rc=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Rc.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Lc.convert(t);return new Rc(Oc(r.lng),Ic(r.lat),Dc(e,r.lat))},Rc.prototype.toLngLat=function(){return new Lc(360*this.x-180,zc(this.y))},Rc.prototype.toAltitude=function(){return t=this.z,e=this.y,t*Pc(zc(e));var t,e},Rc.prototype.meterInMercatorCoordinateUnits=function(){return 1/Cc*(t=zc(this.y),1/Math.cos(t*Math.PI/180));var t};var Fc=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=jc(0,t,t,e,r)};Fc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Fc.prototype.url=function(t,e){var r,n,i,a,o,s=(r=this.x,n=this.y,i=this.z,a=Mc(256*r,256*(n=Math.pow(2,i)-n-1),i),o=Mc(256*(r+1),256*(n+1),i),a[0]+","+a[1]+","+o[0]+","+o[1]),l=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<this.canonical.z?new Nc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Nc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Nc.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?jc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):jc(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Nc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},Nc.prototype.children=function(t){if(this.overscaledZ>=t)return[new Nc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Nc(e,this.wrap,e,r,n),new Nc(e,this.wrap,e,r+1,n),new Nc(e,this.wrap,e,r,n+1),new Nc(e,this.wrap,e,r+1,n+1)]},Nc.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Uc.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Uc.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Uc.prototype.getPixels=function(){return new $o({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Uc.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-e*this.dim,l=-r*this.dim,u=a;u=0&&c[3]>=0&&s.insert(o,c[0],c[1],c[2],c[3])}},Yc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new tl.VectorTile(new Ol(this.rawTileData)).layers,this.sourceLayerCoder=new Vc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Yc.prototype.query=function(t,e,r,n){var i=this;this.loadVTLayers();for(var o=t.params||{},s=vo/t.tileSize/t.scale,l=Tn(o.filter),u=t.queryGeometry,c=t.queryPadding*s,f=Zc(u),h=this.grid.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c),p=Zc(t.cameraQueryGeometry),d=0,v=this.grid3D.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c,function(e,r,n,i){return function(t,e,r,n,i){for(var o=0,s=t;o=l.x&&i>=l.y)return!0}var u=[new a(e,r),new a(e,i),new a(n,i),new a(n,r)];if(t.length>2)for(var c=0,f=u;c=0)return!0;return!1}(a,f)){var h=this.sourceLayerCoder.decode(r),p=this.vtLayers[h].feature(n);if(i.filter(new zi(this.tileID.overscaledZ),p))for(var d=this.getId(p,h),v=0;vn)i=!1;else if(e)if(this.expirationTimect&&(t.getActor().send("enforceCacheSizeLimit",ut),gt=0)},t.clamp=u,t.clearTileCache=function(t){var e=self.caches.delete(lt);t&&e.catch(t).then(function(){return t()})},t.clipLine=Du,t.clone=function(t){var e=new Fo(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.clone$2=function(t){var e=new Fo(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Ml,t.config=B,t.create=function(){var t=new Fo(16);return Fo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new Fo(9);return Fo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new Fo(4);return Fo!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=un,t.createLayout=ea,t.createStyleLayer=function(t){return"custom"===t.type?new gc(t):new yc[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=tr,t.offscreenCanvasSupported=yt,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t},t.parseGlyphPBF=function(t){return new Ol(t).readFields($l,[])},t.pbf=Ol,t.performSymbolLayout=function(t,e,r,n,i,a,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=vo/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,c={};if("composite"===t.textSizeData.kind){var f=t.textSizeData,h=f.minZoom,p=f.maxZoom;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new zi(h),o),u["text-size"].possiblyEvaluate(new zi(p),o)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,v=d.minZoom,g=d.maxZoom;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new zi(v),o),u["icon-size"].possiblyEvaluate(new zi(g),o)]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new zi(t.zoom+1),o),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new zi(t.zoom+1),o),c.textMaxSize=u["text-size"].possiblyEvaluate(new zi(18));for(var y=l.get("text-line-height")*Ll,m="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),b=l.get("text-size"),_=function(){var a=A[T],s=l.get("text-font").evaluate(a,{},o).join(","),u=b.evaluate(a,{},o),f=c.layoutTextSize.evaluate(a,{},o),h=c.layoutIconSize.evaluate(a,{},o),p={horizontal:{},vertical:void 0},d=a.text,v=[0,0];if(d){var g=d.toString(),_=l.get("text-letter-spacing").evaluate(a,{},o)*Ll,k=function(t){for(var e=0,r=t;e=vo||f.y<0||f.y>=vo||function(t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,v,g,y,m,x,b,_,T,A,k){var M,S,E,L,C,P=t.addToLineVertexArray(e,r),O=0,I=0,D=0,z=0,R=-1,F=-1,B={},N=Ua(""),j=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(j=(M=s.layout.get("text-offset").evaluate(b,{},A).map(function(t){return t*Ll}))[0],U=M[1]):(j=s.layout.get("text-radial-offset").evaluate(b,{},A)*Ll,U=Yu),t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(b,{},A)+90,H=n.vertical;L=new ju(l,e,u,c,f,H,h,p,d,V),o&&(C=new ju(l,e,u,c,f,o,g,y,d,V))}if(i){var q=s.layout.get("icon-rotate").evaluate(b,{}),G="none"!==s.layout.get("icon-text-fit"),Y=zu(i,q,T,G),W=o?zu(o,q,T,G):void 0;E=new ju(l,e,u,c,f,i,g,y,!1,q),O=4*Y.length;var Z=t.iconSizeData,X=null;"source"===Z.kind?(X=[wu*s.layout.get("icon-size").evaluate(b,{})])[0]>Ju&&w(t.layerIds[0]+': Value for "icon-size" is >= '+Xu+'. Reduce your "icon-size".'):"composite"===Z.kind&&((X=[wu*_.compositeIconSizes[0].evaluate(b,{},A),wu*_.compositeIconSizes[1].evaluate(b,{},A)])[0]>Ju||X[1]>Ju)&&w(t.layerIds[0]+': Value for "icon-size" is >= '+Xu+'. Reduce your "icon-size".'),t.addSymbols(t.icon,Y,X,x,m,b,!1,e,P.lineStartIndex,P.lineLength,-1,A),R=t.icon.placedSymbolArray.length-1,W&&(I=4*W.length,t.addSymbols(t.icon,W,X,x,m,b,au.vertical,e,P.lineStartIndex,P.lineLength,-1,A),F=t.icon.placedSymbolArray.length-1)}for(var J in n.horizontal){var K=n.horizontal[J];if(!S){N=Ua(K.text);var $=s.layout.get("text-rotate").evaluate(b,{},A);S=new ju(l,e,u,c,f,K,h,p,d,$)}var Q=1===K.positionedLines.length;if(D+=Ku(t,e,K,a,s,d,b,v,P,n.vertical?au.horizontal:au.horizontalOnly,Q?Object.keys(n.horizontal):[J],B,R,_,A),Q)break}n.vertical&&(z+=Ku(t,e,n.vertical,a,s,d,b,v,P,au.vertical,["vertical"],B,F,_,A));var tt=S?S.boxStartIndex:t.collisionBoxArray.length,et=S?S.boxEndIndex:t.collisionBoxArray.length,rt=L?L.boxStartIndex:t.collisionBoxArray.length,nt=L?L.boxEndIndex:t.collisionBoxArray.length,it=E?E.boxStartIndex:t.collisionBoxArray.length,at=E?E.boxEndIndex:t.collisionBoxArray.length,ot=C?C.boxStartIndex:t.collisionBoxArray.length,st=C?C.boxEndIndex:t.collisionBoxArray.length,lt=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};lt=ut(S,lt),lt=ut(L,lt),lt=ut(E,lt);var ct=(lt=ut(C,lt))>-1?1:0;ct&&(lt*=k/Ll),t.glyphOffsetArray.length>=sc.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,N,tt,et,rt,nt,it,at,ot,st,u,D,z,O,I,ct,0,h,j,U,lt)}(t,f,s,r,n,i,h,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,T,M,l,b,A,S,d,e,a,u,c,o)};if("line"===E)for(var O=0,I=Du(e.geometry,0,0,vo,vo);O1){var U=Pu(j,k,r.vertical||v,n,g,x);U&&P(j,U)}}else if("Polygon"===e.type)for(var V=0,H=Fs(e.geometry,0);V=E.maxzoom||"none"!==E.visibility&&(o(S,this.zoom,n),(v[E.id]=E.createBucket({index:c.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(_,g,this.tileID.canonical),c.bucketLayerIDs.push(S.map(function(t){return t.id})))}}}var L=t.mapObject(g.glyphDependencies,function(t){return Object.keys(t).map(Number)});Object.keys(L).length?a.send("getGlyphs",{uid:this.uid,stacks:L},function(t,e){f||(f=t,h=e,O.call(l))}):h={};var C=Object.keys(g.iconDependencies);C.length?a.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"icons"},function(t,e){f||(f=t,p=e,O.call(l))}):p={};var P=Object.keys(g.patternDependencies);function O(){if(f)return s(f);if(h&&p&&d){var e=new i(h),r=new t.ImageAtlas(p,d);for(var a in v){var l=v[a];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,n),t.performSymbolLayout(l,h,e.positions,p,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(g,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(v).filter(function(t){return!t.isEmpty()}),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?e.positions:null})}}P.length?a.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"patterns"},function(t,e){f||(f=t,d=e,O.call(l))}):d={},O.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new a(e);s.abort=this.loadVectorData(e,function(e,a){if(delete n.loading[i],e||!a)return s.status="done",n.loaded[i]=s,r(e);var l=a.rawData,u={};a.expires&&(u.expires=a.expires),a.cacheControl&&(u.cacheControl=a.cacheControl);var c={};if(o){var f=o.finish();f&&(c.resourceTiming=JSON.parse(JSON.stringify(f)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,u,c))}),n.loaded=n.loaded||{},n.loaded[i]=s})},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),e(t,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var u=t.window.ImageBitmap,c=function(){this.loaded={}};c.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=e.rawImageData,o=u&&a instanceof u?this.getImageData(a):a,s=new t.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},c.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},c.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var f=function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0!=!!e&&t.reverse()}var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,v=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};v.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function P(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;s>1;D(t,e,o,n,i,a%2),I(t,e,r,n,o-1,a+1),I(t,e,r,o+1,i,a+1)}}function D(t,e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1);D(t,e,r,Math.max(n,Math.floor(r-s*u/o+c)),Math.min(i,Math.floor(r+(o-s)*u/o+c)),a)}var f=e[2*r+a],h=n,p=i;for(z(t,e,n,r),e[2*i+a]>f&&z(t,e,n,i);hf;)p--}e[2*n+a]===f?z(t,e,n,p):z(t,e,++p,i),p<=r&&(n=p+1),r<=p&&(i=p-1)}}function z(t,e,r,n){R(t,r,n),R(e,2*r,2*n),R(e,2*r+1,2*n+1)}function R(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function F(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}_.fromVectorTileJs=w,_.fromGeojsonVt=T,_.GeoJSONWrapper=A;var B=function(t){return t[0]},N=function(t){return t[1]},j=function(t,e,r,n,i){void 0===e&&(e=B),void 0===r&&(r=N),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(t.length),s=this.coords=new i(2*t.length),l=0;l=r&&s<=i&&l>=n&&l<=a&&c.push(t[d]);else{var v=Math.floor((p+h)/2);s=e[2*v],l=e[2*v+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[v]);var g=(f+1)%2;(0===f?r<=s:n<=l)&&(u.push(p),u.push(v-1),u.push(g)),(0===f?i>=s:a>=l)&&(u.push(v+1),u.push(h),u.push(g))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},j.prototype.within=function(t,e,r){return function(t,e,r,n,i,a){for(var o=[0,t.length-1,0],s=[],l=i*i;o.length;){var u=o.pop(),c=o.pop(),f=o.pop();if(c-f<=a)for(var h=f;h<=c;h++)F(e[2*h],e[2*h+1],r,n)<=l&&s.push(t[h]);else{var p=Math.floor((f+c)/2),d=e[2*p],v=e[2*p+1];F(d,v,r,n)<=l&&s.push(t[p]);var g=(u+1)%2;(0===u?r-i<=d:n-i<=v)&&(o.push(f),o.push(p-1),o.push(g)),(0===u?r+i>=d:n+i>=v)&&(o.push(p+1),o.push(c),o.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var U={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},V=function(t){this.options=X(Object.create(U),t),this.trees=new Array(this.options.maxZoom+1)};function H(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function q(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:W(n),y:Z(i),zoom:1/0,index:e,parentId:-1}}function G(t){return{type:"Feature",id:t.id,properties:Y(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function Y(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return X(X({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function W(t){return t/360+.5}function Z(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function X(t,e){for(var r in e)t[r]=e[r];return t}function J(t){return t.x}function K(t){return t.y}function $(t,e,r,n){for(var i,a=n,o=r-e>>1,s=r-e,l=t[e],u=t[e+1],c=t[r],f=t[r+1],h=e+3;ha)i=h,a=p;else if(p===a){var d=Math.abs(h-o);dn&&(i-e>3&&$(t,e,i,n),t[i+2]=a,r-i>3&&$(t,i,r,n))}function Q(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function tt(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)et(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*u-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(u-a,2))),i=l,a=u}var c=e.length-3;e[2]=1,$(e,0,c,r),e[c+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function at(t,e,r,n){for(var i=0;i1?1:r}function lt(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o=n)return null;for(var l=[],u=0;u=r&&d=n)){var v=[];if("Point"===h||"MultiPoint"===h)ut(f,v,r,n,i);else if("LineString"===h)ct(f,v,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===h)ht(f,v,r,n,i,!1);else if("Polygon"===h)ht(f,v,r,n,i,!0);else if("MultiPolygon"===h)for(var g=0;g=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function ct(t,e,r,n,i,a,o){for(var s,l,u=ft(t),c=0===i?dt:vt,f=t.start,h=0;hr&&(l=c(u,p,d,g,y,r),o&&(u.start=f+s*l)):m>n?x=r&&(l=c(u,p,d,g,y,r),b=!0),x>n&&m<=n&&(l=c(u,p,d,g,y,n),b=!0),!a&&b&&(o&&(u.end=f+s*l),e.push(u),u=ft(t)),o&&(f+=s)}var _=t.length-3;p=t[_],d=t[_+1],v=t[_+2],(m=0===i?p:d)>=r&&m<=n&&pt(u,p,d,v),_=u.length-3,a&&_>=3&&(u[_]!==u[0]||u[_+1]!==u[1])&&pt(u,u[0],u[1],u[2]),u.length&&e.push(u)}function ft(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function ht(t,e,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=c),f>o.maxY&&(o.maxY=f)}return o}function _t(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&e.size<(i?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;u--){var c=+Date.now();s=this._cluster(s,u),this.trees[u]=new j(s,J,K,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},V.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],e),s=this.getClusters([-180,n,i,a],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],u=[],c=0,f=l.range(W(r),Z(a),W(i),Z(n));c1?this._map(u,!0):null,g=(l<<5)+(e+1)+this.points.length,y=0,m=f;y>5},V.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},V.prototype._map=function(t,e){if(t.numPoints)return e?X({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?X({},n):n},Tt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Tt.prototype.splitTile=function(t,e,r,n,i,a,o){for(var s=[t,e,r,n],l=this.options,u=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<1&&console.time("creation"),h=this.tiles[f]=bt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(h.source=t,i){if(e===l.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var v,g,y,m,x,b,_=.5*l.buffer/l.extent,w=.5-_,T=.5+_,A=1+_;v=g=y=m=null,x=lt(t,c,r-_,r+T,0,h.minX,h.maxX,l),b=lt(t,c,r+w,r+A,0,h.minX,h.maxX,l),t=null,x&&(v=lt(x,c,n-_,n+T,1,h.minY,h.maxY,l),g=lt(x,c,n+w,n+A,1,h.minY,h.maxY,l),x=null),b&&(y=lt(b,c,n-_,n+T,1,h.minY,h.maxY,l),m=lt(b,c,n+w,n+A,1,h.minY,h.maxY,l),b=null),u>1&&console.timeEnd("clipping"),s.push(v||[],e+1,2*r,2*n),s.push(g||[],e+1,2*r,2*n+1),s.push(y||[],e+1,2*r+1,2*n),s.push(m||[],e+1,2*r+1,2*n+1)}}},Tt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,u=t,c=e,f=r;!l&&u>0;)u--,c=Math.floor(c/2),f=Math.floor(f/2),l=this.tiles[At(u,c,f)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",u,c,f),a>1&&console.time("drilling down"),this.splitTile(l.source,u,c,f,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?mt(this.tiles[s],i):null):null};var Mt=function(e){function r(t,r,n,i){e.call(this,t,r,n,kt),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,function(a,o){if(a||!o)return r(a);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));f(o,!0);try{e._geoJSONIndex=n.cluster?new V(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),u=0,c=l;u=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var h=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function y(t,e,r,n,i,a,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=e[+r]);a.ranges[s]=!0}for(var i=0,o=l;i1&&(l=t[++s]);var c=Math.abs(u-l.left),f=Math.abs(u-l.right),h=Math.min(c,f),p=void 0,d=i/r*(n+1);if(l.isDash){var v=n-Math.abs(d);p=Math.sqrt(h*h+v*v)}else p=n-Math.sqrt(h*h+d*d);this.data[o+u]=Math.max(0,Math.min(255,p+128))}},A.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],a=t[t.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],u=0;u1&&(l=t[++s]);var c=Math.abs(u-l.left),f=Math.abs(u-l.right),h=Math.min(c,f),p=l.isDash?h:-h;this.data[o+u]=Math.max(0,Math.min(255,p+128))}},A.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o=n&&e.x=i&&e.y0&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}})},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}}),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))})},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var a={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(i,a,function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))})},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),O=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),I=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),function(i,a){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):a&&(n.image=a,e&&(n.coordinates=e),r&&r(),n._finishLoading())})},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,function(){e.texture=null}),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=e;or.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,O.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(I),z=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some(function(t){return!Array.isArray(t)||2!==t.length||t.some(function(t){return"number"!=typeof t})})||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,O.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},j.prototype.has=function(t){return t.wrapped().key in this.data},j.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},j.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},j.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},j.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},j.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},j.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},j.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)}):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter(function(t){return n._source.hasTile(t)}))):i=[];var a=e.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(Dt(this._source.type)){for(var u={},c={},f=0,h=Object.keys(l);fthis._source.maxzoom){var g=d.children(this._source.maxzoom)[0],y=this.getTile(g);if(y&&y.hasData()){n[g.key]=g;continue}}else{var m=d.children(this._source.maxzoom);if(n[m[0].key]&&n[m[1].key]&&n[m[2].key]&&n[m[3].key])continue}for(var x=v.wasRequested(),b=d.overscaledZ-1;b>=a;--b){var _=d.scaledTo(b);if(i[_.key])break;if(i[_.key]=!0,!(v=this.getTile(_))&&x&&(v=this._addTile(_)),v&&(n[_.key]=_,x=v.wasRequested(),v.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=e;a0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map(function(t){return o.pointCoordinate(t)}),u=s.map(function(t){return o.pointCoordinate(t)}),c=this.getIds(),f=1/0,h=1/0,p=-1/0,d=-1/0,v=0,g=u;v=0&&y[1].y+g>=0){var m=l.map(function(t){return s.getTilePoint(t)}),x=u.map(function(t){return s.getTilePoint(t)});a.push({tile:n,tileID:s,queryGeometry:m,cameraQueryGeometry:x,scale:v})}}},x=0;x=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter(function(r){return!r.hasDependency(t,e)})},r}(t.Evented);function It(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Dt(t){return"raster"===t||"image"===t||"video"===t}function zt(){return new t.window.Worker(ea.workerUrl)}Ot.maxOverzooming=10,Ot.maxUnderzooming=3;var Rt="mapboxgl_preloaded_worker_pool",Ft=function(){this.active={}};Ft.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Qt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var a=0;a=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ae(e,r,n,i,a,o,s,l){var u=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(u,n.transform.zoom),f=[256/n.width*2+1,256/n.height*2+1],h=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;h.clear();for(var p=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,v=n.transform.width/n.transform.height,g=!1,y=0;yMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function le(e,r,n,i,a,o,s,l,u,c,f,h,p,d){var v,g=r/24,y=e.lineOffsetX*g,m=e.lineOffsetY*g;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,_=e.lineStartIndex+e.lineLength,w=oe(g,l,y,m,n,f,h,e,u,o,p);if(!w)return{notEnoughRoom:!0};var T=re(w.first.point,s).point,A=re(w.last.point,s).point;if(i&&!n){var k=se(e.writingMode,T,A,d);if(k)return k}v=[w.first];for(var M=e.glyphStartIndex+1;M0?C.point:ue(h,L,S,1,a),O=se(e.writingMode,S,P,d);if(O)return O}var I=ce(g*l.getoffsetX(e.glyphStartIndex),y,m,n,f,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,o,p);if(!I)return{notEnoughRoom:!0};v=[I]}for(var D=0,z=v;D0?1:-1,v=0;i&&(d*=-1,v=Math.PI),d<0&&(v+=Math.PI);for(var g=d>0?l+s:l+s+1,y=a,m=a,x=0,b=0,_=Math.abs(p),w=[];x+b<=_;){if((g+=d)=u)return null;if(m=y,w.push(y),void 0===(y=h[g])){var T=new t.Point(c.getx(g),c.gety(g)),A=re(T,f);if(A.signedDistanceFromCamera>0)y=h[g]=A.point;else{var k=g-d;y=ue(0===x?o:new t.Point(c.getx(k),c.gety(k)),T,m,_-x+1,f)}}x+=b,b=m.dist(y)}var M=(_-x)/b,S=y.sub(m),E=S.mult(M)._add(m);E._add(S._unit()._perp()._mult(n*d));var L=v+Math.atan2(y.y-m.y,y.x-m.x);return w.push(E),{point:E,angle:L,path:w}}Qt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Qt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Qt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Qt.prototype._insertBoxCell=function(t,e,r,n,i,a){this.boxCells[i].push(a)},Qt.prototype._insertCircleCell=function(t,e,r,n,i,a){this.circleCells[i].push(a)},Qt.prototype._query=function(t,e,r,n,i,a){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:o},Qt.prototype._queryCircle=function(t,e,r,n,i){var a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var u=[],c={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,u,c,i),n?u.length>0:u},Qt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Qt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Qt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Qt.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=o.seenUids,u=this.boxCells[i];if(null!==u)for(var c=this.bboxes,f=0,h=u;f=c[d+0]&&n>=c[d+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var v=this.circleCells[i];if(null!==v)for(var g=this.circles,y=0,m=v;yo*o+s*s},Qt.prototype._circleAndRectCollide=function(t,e,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var u=(o-i)/2,c=Math.abs(e-(i+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var f=l-s,h=c-u;return f*f+h*h<=r*r};var fe=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function he(t,e){for(var r=0;r=1;P--)C.push(E.path[P]);for(var O=1;O0){for(var R=C[0].clone(),F=C[0].clone(),B=1;B=k.x&&F.x<=M.x&&R.y>=k.y&&F.y<=M.y?[C]:F.xM.x||F.yM.y?[]:t.clipLine([C],k.x,k.y,M.x,M.y)}for(var N=0,j=z;N=this.screenRightBoundary||nthis.screenBottomBoundary},ve.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID].text&&(v=this.prevPlacement.variableOffsets[f.crossTileID].anchor),this.variableOffsets[f.crossTileID]={textOffset:g,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:v},this.markUsedJustification(h,t,f,p),h.allowVerticalPlacement&&(this.markUsedOrientation(h,p,f),this.placedOrientations[f.crossTileID]=p),{shift:y,placedGlyphBoxes:m}):void 0},ke.prototype.placeLayerBucketPart=function(e,r,n){var i=this,a=e.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,u=a.textLabelPlaneMatrix,c=a.labelToScreenMatrix,f=a.textPixelRatio,h=a.holdingForFade,p=a.collisionBoxArray,d=a.partiallyEvaluatedTextSize,v=a.collisionGroup,g=s.get("text-optional"),y=s.get("icon-optional"),m=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),_="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),A=m&&(x||!o.hasIconData()||y),k=x&&(m||!o.hasTextData()||g);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);var M=function(e,a){if(!r[e.crossTileID])if(h)i.placements[e.crossTileID]=new xe(!1,!1,!1);else{var p,T=!1,M=!1,S=!0,E=null,L={box:null,offscreen:null},C={box:null,offscreen:null},P=null,O=null,I=0,D=0,z=0;a.textFeatureIndex?I=a.textFeatureIndex:e.useRuntimeCollisionCircles&&(I=e.featureIndex),a.verticalTextFeatureIndex&&(D=a.verticalTextFeatureIndex);var R=a.textBox;if(R){var F=function(r){var n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[e.crossTileID];a&&(i.placedOrientations[e.crossTileID]=a,n=a,i.markUsedOrientation(o,n,e))}return n},B=function(r,n){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i0&&(N=N.filter(function(t){return t!==j.anchor})).unshift(j.anchor)}var U=function(t,r,n){for(var a=t.x2-t.x1,s=t.y2-t.y1,u=e.textBoxScale,c=w&&!x?r:null,h={box:[],offscreen:!1},p=m?2*N.length:N.length,d=0;d=N.length,A=i.attemptAnchorPlacement(g,t,a,s,u,b,_,f,l,v,y,e,o,n,c);if(A&&(h=A.placedGlyphBoxes)&&h.box&&h.box.length){T=!0,E=A.shift;break}}return h};B(function(){return U(R,a.iconBox,t.WritingMode.horizontal)},function(){var r=a.verticalTextBox,n=L&&L.box&&L.box.length;return o.allowVerticalPlacement&&!n&&e.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}}),L&&(T=L.box,S=L.offscreen);var V=F(L&&L.box);if(!T&&i.prevPlacement){var H=i.prevPlacement.variableOffsets[e.crossTileID];H&&(i.variableOffsets[e.crossTileID]=H,i.markUsedJustification(o,H.anchor,e,V))}}else{var q=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,m,f,l,v.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,e),i.placedOrientations[e.crossTileID]=r),n};B(function(){return q(R,t.WritingMode.horizontal)},function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?q(r,t.WritingMode.vertical):{box:null,offscreen:null}}),F(L&&L.box&&L.box.length)}}if(T=(p=L)&&p.box&&p.box.length>0,S=p&&p.offscreen,e.useRuntimeCollisionCircles){var G=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Y=t.evaluateSizeForFeature(o.textSizeData,d,G),W=s.get("text-padding"),Z=e.collisionCircleDiameter;P=i.collisionIndex.placeCollisionCircles(m,G,o.lineVertexArray,o.glyphOffsetArray,Y,l,u,c,n,_,v.predicate,Z,W),T=m||P.circles.length>0&&!P.collisionDetected,S=S&&P.offscreen}if(a.iconFeatureIndex&&(z=a.iconFeatureIndex),a.iconBox){var X=function(t){var e=w&&E?Ae(t,E.x,E.y,b,_,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,x,f,l,v.predicate)};M=C&&C.box&&C.box.length&&a.verticalIconBox?(O=X(a.verticalIconBox)).box.length>0:(O=X(a.iconBox)).box.length>0,S=S&&O.offscreen}var J=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=y||0===e.numIconVertices;if(J||K?K?J||(M=M&&T):T=M&&T:M=T=M&&T,T&&p&&p.box&&(C&&C.box&&D?i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,D,v.ID):i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,I,v.ID)),M&&O&&i.collisionIndex.insertCollisionBox(O.box,s.get("icon-ignore-placement"),o.bucketInstanceId,z,v.ID),P&&(T&&i.collisionIndex.insertCollisionCircles(P.circles,s.get("text-ignore-placement"),o.bucketInstanceId,I,v.ID),n)){var $=o.bucketInstanceId,Q=i.collisionCircleArrays[$];void 0===Q&&(Q=i.collisionCircleArrays[$]=new be);for(var tt=0;tt=0;--E){var L=S[E];M(o.symbolInstances.get(L),o.collisionArrays[L])}else for(var C=e.symbolInstanceStart;C=0&&(e.text.placedSymbolArray.get(u).crossTileID=a>=0&&u!==a?0:n.crossTileID)}},ke.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,a=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,x=a.numIconVertices>0,b=i.placedOrientations[a.crossTileID],_=b===t.WritingMode.vertical,w=b===t.WritingMode.horizontal||b===t.WritingMode.horizontalOnly;if(m){var T=De(y.text),A=_?ze:T;d(e.text,s,A);var k=w?ze:T;d(e.text,l,k);var M=y.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach(function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=M||_?1:0)}),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=M||w?1:0);var S=i.variableOffsets[a.crossTileID];S&&i.markUsedJustification(e,S.anchor,a,b);var E=i.placedOrientations[a.crossTileID];E&&(i.markUsedJustification(e,"left",a,E),i.markUsedOrientation(e,E,a))}if(x){var L=De(y.icon),C=!(h&&a.verticalPlacedIconSymbolIndex&&_);if(a.placedIconSymbolIndex>=0){var P=C?L:ze;d(e.icon,a.numIconVertices,P),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var O=C?ze:L;d(e.icon,a.numVerticalIconVertices,O),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var I=e.collisionArrays[n];if(I){var D=new t.Point(0,0);if(I.textBox||I.verticalTextBox){var z=!0;if(u){var R=i.variableOffsets[v];R?(D=Te(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),c&&D._rotate(f?i.transform.angle:-i.transform.angle)):z=!1}I.textBox&&Me(e.textCollisionBox.collisionVertexArray,y.text.placed,!z||_,D.x,D.y),I.verticalTextBox&&Me(e.textCollisionBox.collisionVertexArray,y.text.placed,!z||w,D.x,D.y)}var F=Boolean(!w&&I.verticalIconBox);I.iconBox&&Me(e.iconCollisionBox.collisionVertexArray,y.icon.placed,F,h?D.x:0,h?D.y:0),I.verticalIconBox&&Me(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!F,h?D.x:0,h?D.y:0)}}},g=0;gt},ke.prototype.setStale=function(){this.stale=!0};var Se=Math.pow(2,25),Ee=Math.pow(2,24),Le=Math.pow(2,17),Ce=Math.pow(2,16),Pe=Math.pow(2,9),Oe=Math.pow(2,8),Ie=Math.pow(2,1);function De(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Se+e*Ee+r*Le+e*Ce+r*Pe+e*Oe+r*Ie+e}var ze=0,Re=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Re.prototype.continuePlacement=function(t,e,r,n,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Re(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Fe.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Be=512/t.EXTENT/2,Ne=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,i)}else{var u=o[t.scaledTo(Number(a)).key];u&&u.findMatches(e.symbolInstances,t,i)}}for(var c=0;c1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),function(t,e){l=null,o||(o=t,i=e,c())}),u=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),function(t,e){u=null,o||(o=t,a=e,c())});function c(){if(o)n(o);else if(i&&a){var e=t.browser.getImageData(a),r={};for(var s in i){var l=i[s],u=l.width,c=l.height,f=l.x,h=l.y,p=l.sdf,d=l.pixelRatio,v=l.stretchX,g=l.stretchY,y=l.content,m=new t.RGBAImage({width:u,height:c});t.RGBAImage.copy(e,m,{x:f,y:h},{x:0,y:0},{width:u,height:c}),r[s]={data:m,pixelRatio:d,sdf:p,stretchX:v,stretchY:g,content:y}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),u&&(u.cancel(),u=null)}}}(e,this.map._requestManager,function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))})},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map(function(t){return t.command}).join(", ")+".");return n.forEach(function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)}),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Ot(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:e}}),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===e.type){if(He(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(o,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,function(t){return t.serialize()}),layers:this._serializeLayers(this._order)},function(t){return void 0!==t})},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=t;s=0;d--){var v=this._order[d];if(r(v))for(var g=i.length-1;g>=0;g--){var y=i[g].feature;if(n[y.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),nr=_r("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),ir=_r("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),ar=_r("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),or=_r("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),sr=_r("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),lr=_r("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),ur=_r("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),cr=_r("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),fr=_r("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hr=_r("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),pr=_r("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),dr=_r("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),vr=_r("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),gr=_r("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),yr=_r("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),mr=_r("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),xr=_r("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),br=_r("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function _r(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:t=t.replace(r,function(t,e,r,i,a){return n[a]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"}),vertexSource:e=e.replace(r,function(t,e,r,i,a){var o="float"===i?"vec2":"vec4",s=a.match(/color/)?"color":o;return n[a]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"})}}var wr=Object.freeze({__proto__:null,prelude:Xe,background:Je,backgroundPattern:Ke,circle:$e,clippingMask:Qe,heatmap:tr,heatmapTexture:er,collisionBox:rr,collisionCircle:nr,debug:ir,fill:ar,fillOutline:or,fillOutlinePattern:sr,fillPattern:lr,fillExtrusion:ur,fillExtrusionPattern:cr,hillshadePrepare:fr,hillshade:hr,line:pr,lineGradient:dr,linePattern:vr,lineSDF:gr,raster:yr,symbolIcon:mr,symbolSDF:xr,symbolTextAndIcon:br}),Tr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Tr.prototype.bind=function(t,e,r,n,i,a,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,u=0;!l&&u>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}Ar.prototype.draw=function(t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,v){var g,y=t.gl;if(!this.failedToCreate){for(var m in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[m].set(o[m]);p&&p.setUniforms(t,this.binderUniforms,f,{zoom:h});for(var x=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[e],b=0,_=c.get();b<_.length;b+=1){var w=_[b],T=w.vaos||(w.vaos={});(T[s]||(T[s]=new Tr)).bind(t,this,l,p?p.getPaintVertexBuffers():[],u,w.vertexOffset,d,v),y.drawElements(e,w.primitiveLength*x,y.UNSIGNED_SHORT,w.primitiveOffset*x*2)}}};var Mr=function(e,r,n,i){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=t.create$1();"viewport"===a.properties.get("anchor")&&t.fromRotation(l,-r.transform.angle),t.transformMat3(s,s,l);var u=a.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+n,u_opacity:i}},Sr=function(e,r,n,i,a,o,s){return t.extend(Mr(e,r,n,i),kr(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},Er=function(t){return{u_matrix:t}},Lr=function(e,r,n,i){return t.extend(Er(e),kr(n,r,i))},Cr=function(t,e){return{u_matrix:t,u_world:e}},Pr=function(e,r,n,i,a){return t.extend(Lr(e,r,n,i),{u_world:a})},Or=function(e,r,n,i){var a,o,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=ge(n,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:o}},Ir=function(t,e,r){var n=ge(r,1,e.zoom),i=Math.pow(2,e.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*i),e.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:a}},Dr=function(t,e,r){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},zr=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}},Rr=function(t){return{u_matrix:t}},Fr=function(t,e,r,n){return{u_matrix:t,u_extrude_scale:ge(e,1,r),u_intensity:n}};var Br=function(e,r,n){var i=e.transform;return{u_matrix:Hr(e,r,n),u_ratio:1/ge(r,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Nr=function(e,r,n){return t.extend(Br(e,r,n),{u_image:0})},jr=function(e,r,n,i){var a=e.transform,o=Vr(r,a);return{u_matrix:Hr(e,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/ge(r,1,a.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Ur=function(e,r,n,i,a){var o=e.transform,s=e.lineAtlas,l=Vr(r,o),u="round"===n.layout.get("line-cap"),c=s.getDash(i.from,u),f=s.getDash(i.to,u),h=c.width*a.fromScale,p=f.width*a.toScale;return t.extend(Br(e,r,n),{u_patternscale_a:[l/h,-c.height/2],u_patternscale_b:[l/p,-f.height/2],u_sdfgamma:s.width/(256*Math.min(h,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:f.y,u_mix:a.t})};function Vr(t,e){return 1/ge(t,1,e.tileZoom)}function Hr(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var qr=function(t,e,r,n,i){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Gr(i.paint.get("raster-hue-rotate"))};var a,o};function Gr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var Yr,Wr=function(t,e,r,n,i,a,o,s,l,u){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:u,u_texture:0}},Zr=function(e,r,n,i,a,o,s,l,u,c,f){var h=a.transform;return t.extend(Wr(e,r,n,i,a,o,s,l,u,c),{u_gamma_scale:i?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+f})},Xr=function(e,r,n,i,a,o,s,l,u,c){return t.extend(Zr(e,r,n,i,a,o,s,l,!0,u,!0),{u_texsize_icon:c,u_texture_icon:1})},Jr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Kr=function(e,r,n,i,a,o){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,u=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/u,f=c*(n.tileID.canonical.x+n.tileID.wrap*u),h=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/ge(n,1,r.transform.tileZoom),u_pixel_coord_upper:[f>>16,h>>16],u_pixel_coord_lower:[65535&f,65535&h]}}(i,o,n,a),{u_matrix:e,u_opacity:r})},$r={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Qr(e,r,n,i,a,o,s){for(var l=e.context,u=l.gl,c=e.useProgram("collisionBox"),f=[],h=0,p=0,d=0;d0){var _=t.create(),w=m;t.mul(_,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(_,_,y.placementViewportMatrix),f.push({circleArray:b,circleOffset:p,transform:w,invTransform:_}),p=h+=b.length/4}x&&c.draw(l,u.LINES,Mt.disabled,Et.disabled,e.colorModeForRenderPass(),Ct.disabled,Ir(m,e.transform,g),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,e.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&f.length){var T=e.useProgram("collisionCircle"),A=new t.StructArrayLayout2f1f2i16;A.resize(4*h),A._trim();for(var k=0,M=0,S=f;M=0&&(v[y.associatedIconIndex]={shiftedAnchor:S,angle:E})}else he(y.numGlyphs,p)}if(f){d.clear();for(var C=e.icon.placedSymbolArray,P=0;P0){var s=t.browser.now(),l=(s-e.timeAdded)/o,u=r?(s-r.timeAdded)/o:-1,c=n.getSource(),f=a.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!r||Math.abs(r.tileID.overscaledZ-f)>Math.abs(e.tileID.overscaledZ-f),p=h&&e.refreshedUponExpiration?1:t.clamp(h?l:1-u,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var hn=new t.Color(1,0,0,1),pn=new t.Color(0,1,0,1),dn=new t.Color(0,0,1,1),vn=new t.Color(1,0,1,1),gn=new t.Color(0,1,1,1);function yn(t){var e=t.transform.padding;mn(t,t.transform.height-(e.top||0),3,hn),mn(t,e.bottom||0,3,pn),xn(t,e.left||0,3,dn),xn(t,t.transform.width-(e.right||0),3,vn);var r=t.transform.centerPoint;!function(t,e,r,n){var i=20,a=2;bn(t,e-a/2,r-i/2,a,i,n),bn(t,e-i/2,r-a/2,i,a,n)}(t,r.x,t.transform.height-r.y,gn)}function mn(t,e,r,n){bn(t,0,e+r/2,t.transform.width,r,n)}function xn(t,e,r,n){bn(t,e-r/2,0,r,t.transform.height,n)}function bn(e,r,n,i,a,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function _n(e,r,n){var i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=Mt.disabled,u=Et.disabled,c=e.colorModeForRenderPass(),f="$debug";i.activeTexture.set(a.TEXTURE0),e.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,l,u,c,Ct.disabled,zr(o,t.Color.red),f,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=r.getTileByID(n.key).latestRawTileData,p=h&&h.byteLength||0,d=Math.floor(p/1024),v=r.getTile(n).tileSize,g=512/Math.min(v,512)*(n.overscaledZ/e.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,y+" "+d+"kb"),s.draw(i,a.TRIANGLES,l,u,Lt.alphaBlended,Ct.disabled,zr(o,t.Color.transparent,g),f,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var wn={symbol:function(e,r,n,i,a){if("translucent"===e.renderPass){var o=Et.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,a,o,s){for(var l=r.transform,u="map"===a,c="map"===o,f=0,h=e;f256&&this.clearStencil(),r.setColorMode(Lt.disabled),r.setDepthMode(Mt.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=e;a256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Et({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},Tn.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Et({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},Tn.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort(function(t,e){return e.overscaledZ-t.overscaledZ}),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],T=a[w.source],A=c[w.source];this._renderTileClippingMasks(w,A),this.renderLayer(this,T,w,A)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},Tn.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},Tn.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Ar(this.context,wr[t],e,$r[t],this._showOverdrawInspector)),this.cache[r]},Tn.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Tn.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},Tn.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var e=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,e.RGBA)}},Tn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var An=function(t,e){this.points=t,this.planes=e};An.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(function(r){return t.transformMat4([],r,e)}).map(function(e){return t.scale$1([],e,1/e[3]/r*i)}),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(e){var r=t.sub([],a[e[0]],a[e[1]]),n=t.sub([],a[e[2]],a[e[1]]),i=t.normalize([],t.cross([],r,n)),o=-t.dot(i,a[e[1]]);return i.concat(o)});return new An(a,o)};var kn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};kn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),a=0;a=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var u=Number.MAX_VALUE,c=-Number.MAX_VALUE,f=0;fthis.max[l]-this.min[l])return 0}return 1};var Mn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};Mn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},Mn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},Mn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},Mn.prototype.clone=function(){return new Mn(this.top,this.bottom,this.left,this.right)},Mn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Sn=function(e,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Mn,this._posMatrixCache={},this._alignedPosMatrixCache={}},En={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Sn.prototype.clone=function(){var t=new Sn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},En.minZoom.get=function(){return this._minZoom},En.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},En.maxZoom.get=function(){return this._maxZoom},En.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},En.minPitch.get=function(){return this._minPitch},En.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},En.maxPitch.get=function(){return this._maxPitch},En.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},En.renderWorldCopies.get=function(){return this._renderWorldCopies},En.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},En.worldSize.get=function(){return this.tileSize*this.scale},En.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},En.size.get=function(){return new t.Point(this.width,this.height)},En.bearing.get=function(){return-this.angle/Math.PI*180},En.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},En.pitch.get=function(){return this._pitch/Math.PI*180},En.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},En.fov.get=function(){return this._fov/Math.PI*180},En.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},En.zoom.get=function(){return this._zoom},En.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},En.center.get=function(){return this._center},En.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},En.padding.get=function(){return this._edgeInsets.toJSON()},En.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},En.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Sn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Sn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},Sn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Sn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),u=s-1;u<=l+1;u++)0!==u&&r.push(new t.UnwrappedTileID(u,e));return r},Sn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=An.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var u=function(t){return{aabb:new kn([t*a,0,0],[(t+1)*a,a,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],f=[],h=r,p=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(u(-d)),c.push(u(d));for(c.push(u(0));c.length>0;){var v=c.pop(),g=v.x,y=v.y,m=v.fullyVisible;if(!m){var x=v.aabb.intersects(s);if(0===x)continue;m=2===x}var b=v.aabb.distanceX(o),_=v.aabb.distanceY(o),w=Math.max(Math.abs(b),Math.abs(_)),T=3+(1<T&&v.zoom>=l)f.push({tileID:new t.OverscaledTileID(v.zoom===h?p:v.zoom,v.wrap,v.zoom,g,y),distanceSq:t.sqrLen([o[0]-.5-g,o[1]-.5-y])});else for(var A=0;A<4;A++){var k=(g<<1)+A%2,M=(y<<1)+(A>>1);c.push({aabb:v.aabb.quadrant(A),zoom:v.zoom+1,x:k,y:M,wrap:v.wrap,fullyVisible:m})}}return f.sort(function(t,e){return t.distanceSq-e.distanceSq}).map(function(t){return t.tileID})},Sn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},En.unmodified.get=function(){return this._unmodified},Sn.prototype.zoomScale=function(t){return Math.pow(2,t)},Sn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Sn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},Sn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},En.point.get=function(){return this.project(this.center)},Sn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},Sn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Sn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Sn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},Sn.prototype.coordinateLocation=function(t){return t.toLngLat()},Sn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[0]/i,s=n[0]/a,l=r[1]/i,u=n[1]/a,c=r[2]/i,f=n[2]/a,h=c===f?0:(0-c)/(f-c);return new t.MercatorCoordinate(t.number(o,s,h)/this.worldSize,t.number(l,u,h)/this.worldSize)},Sn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Sn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Sn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Sn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Sn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=e.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,a.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},Sn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Sn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,a=-90,o=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var f=this.latRange;a=t.mercatorYfromLat(f[1])*this.worldSize,e=(o=t.mercatorYfromLat(f[0])*this.worldSize)-ao&&(i=o-g)}if(this.lngRange){var y=p.x,m=u.x/2;y-ml&&(n=l-m)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:p.x,void 0!==i?i:p.y))),this._unmodified=c,this._constraining=!1}},Sn.prototype._calcMatrices=function(){if(this.height){var e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),c=this.height/50,f=new Float64Array(16);t.perspective(f,this._fov,this.width/this.height,c,u),f[8]=2*-r.x/this.width,f[9]=2*r.y/this.height,t.scale(f,f,[1,-1,1]),t.translate(f,f,[0,0,-this.cameraToCenterDistance]),t.rotateX(f,f,this._pitch),t.rotateZ(f,f,this.angle),t.translate(f,f,[-s,-l,0]),this.mercatorMatrix=t.scale([],f,[this.worldSize,this.worldSize,this.worldSize]),t.scale(f,f,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=f,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,p=this.height%2/2,d=Math.cos(this.angle),v=Math.sin(this.angle),g=s-Math.round(s)+d*h+v*p,y=l-Math.round(l)+d*p+v*h,m=new Float64Array(f);if(t.translate(m,m,[g>.5?g-1:g,y>.5?y-1:y,0]),this.alignedProjMatrix=m,f=t.create(),t.scale(f,f,[this.width/2,-this.height/2,1]),t.translate(f,f,[1,-1,0]),this.labelPlaneMatrix=f,f=t.create(),t.scale(f,f,[1,-1,1]),t.translate(f,f,[-1,-1,0]),t.scale(f,f,[2/this.width,2/this.height,1]),this.glCoordMatrix=f,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(f=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=f,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Sn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Sn.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},Sn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=e;s=3&&!t.some(function(t){return isNaN(t)})){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Ln.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var Cn={linearity:.3,easing:t.bezier(0,0,.3,1)},Pn=t.extend({deceleration:2500,maxSpeed:1400},Cn),On=t.extend({deceleration:20,maxSpeed:1400},Cn),In=t.extend({deceleration:1e3,maxSpeed:360},Cn),Dn=t.extend({deceleration:1e3,maxSpeed:90},Cn),zn=function(t){this._map=t,this.clear()};function Rn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},zn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Bn(t.type,this._map,t))},Un.prototype.dblclick=function(t){return this._firePreventable(new Bn(t.type,this._map,t))},Un.prototype.mouseover=function(t){this._map.fire(new Bn(t.type,this._map,t))},Un.prototype.mouseout=function(t){this._map.fire(new Bn(t.type,this._map,t))},Un.prototype.touchstart=function(t){return this._firePreventable(new Nn(t.type,this._map,t))},Un.prototype.touchmove=function(t){this._map.fire(new Nn(t.type,this._map,t))},Un.prototype.touchend=function(t){this._map.fire(new Nn(t.type,this._map,t))},Un.prototype.touchcancel=function(t){this._map.fire(new Nn(t.type,this._map,t))},Un.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Un.prototype.isEnabled=function(){return!0},Un.prototype.isActive=function(){return!1},Un.prototype.enable=function(){},Un.prototype.disable=function(){};var Vn=function(t){this._map=t};Vn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Vn.prototype.mousemove=function(t){this._map.fire(new Bn(t.type,this._map,t))},Vn.prototype.mousedown=function(){this._delayContextMenu=!0},Vn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Bn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Vn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Bn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Vn.prototype.isEnabled=function(){return!0},Vn.prototype.isActive=function(){return!1},Vn.prototype.enable=function(){},Vn.prototype.disable=function(){};var Hn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function qn(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},Gn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Yn=function(t){this.singleTap=new Gn(t),this.numTaps=t.numTaps,this.reset()};Yn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Yn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Yn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Yn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(n)<30;if(i&&a||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Wn=function(){this._zoomIn=new Yn({numTouches:1,numTaps:2}),this._zoomOut=new Yn({numTouches:2,numTaps:1}),this.reset()};Wn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Wn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Wn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Wn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),a=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout(function(){return n.reset()},0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):a?(this._active=!0,t.preventDefault(),setTimeout(function(){return n.reset()},0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(a)},{originalEvent:t})}}):void 0},Wn.prototype.touchcancel=function(){this.reset()},Wn.prototype.enable=function(){this._enabled=!0},Wn.prototype.disable=function(){this._enabled=!1,this.reset()},Wn.prototype.isEnabled=function(){return this._enabled},Wn.prototype.isActive=function(){return this._active};var Zn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Zn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Zn.prototype._correctButton=function(t,e){return!1},Zn.prototype._move=function(t,e){return{}},Zn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Zn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r&&(t.preventDefault(),this._moved||!(e.dist(r)0&&(this._active=!0);var i=qn(n,r),a=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in i){var u=i[l],c=this._touches[l];c&&(a._add(u),o._add(u.sub(c)),s++,i[l]=u)}if(this._touches=i,!(sMath.abs(t.x)}var oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,ai(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=t.y>0==e.y>0;return ai(t)&&ai(e)&&a}},e}(Qn),si={panStep:100,bearingStep:15,pitchStep:10},li=function(){var t=si;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep};function ui(t){return t*(2-t)}li.prototype.reset=function(){this._active=!1},li.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),o=1);break;default:return}return{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ui,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-a*e._panStep,-o*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},li.prototype.enable=function(){this._enabled=!0},li.prototype.disable=function(){this._enabled=!1,this.reset()},li.prototype.isEnabled=function(){return this._enabled},li.prototype.isActive=function(){return this._active};var ci=4.000244140625,fi=1/450,hi=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=fi,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};hi.prototype.setZoomRate=function(t){this._defaultZoomRate=t},hi.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},hi.prototype.isEnabled=function(){return!!this._enabled},hi.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},hi.prototype.isZooming=function(){return!!this._zooming},hi.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},hi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},hi.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%ci===0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},hi.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},hi.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},hi.prototype.renderFrame=function(){return this._onScrollFrame()},hi.prototype._onScrollFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>ci?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,u=this._easing,c=!1;if("wheel"===this._type&&l&&u){var f=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=u(f);o=t.number(l,s,h),f<1?this._frameId||(this._frameId=!0):c=!0}else o=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout(function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},hi.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},hi.prototype.reset=function(){this._active=!1};var pi=function(t,e){this._clickZoom=t,this._tapZoom=e};pi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},pi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},pi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},pi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var di=function(){this.reset()};di.prototype.reset=function(){this._active=!1},di.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},di.prototype.enable=function(){this._enabled=!0},di.prototype.disable=function(){this._enabled=!1,this.reset()},di.prototype.isEnabled=function(){return this._enabled},di.prototype.isActive=function(){return this._active};var vi=function(){this._tap=new Yn({numTouches:1,numTaps:1}),this.reset()};vi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},vi.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},vi.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},vi.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},vi.prototype.touchcancel=function(){this.reset()},vi.prototype.enable=function(){this._enabled=!0},vi.prototype.disable=function(){this._enabled=!1,this.reset()},vi.prototype.isEnabled=function(){return this._enabled},vi.prototype.isActive=function(){return this._active};var gi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};gi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},gi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},gi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},gi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var yi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};yi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},yi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},yi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},yi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var mi=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};mi.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},mi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},mi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},mi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},mi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},mi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var xi=function(t){return t.zoom||t.drag||t.pitch||t.rotate},bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.Event);function _i(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var wi=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new zn(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!1}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var a=0,o=this._listeners;aa?Math.min(2,_):Math.max(.5,_),w=Math.pow(g,1-e),T=i.unproject(x.add(b.mult(e*w)).mult(v));i.setLocationAtPoint(i.renderWorldCopies?T.wrap():T,d)}n._fireMoveEvents(r)},function(t){n._afterEase(r,t)},e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),a&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),u=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):o,f="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:a.padding,d=a.zoomScale(c-o),v=t.Point.convert(e.offset),g=a.centerPoint.add(v),y=a.pointLocation(g),m=t.LngLat.convert(e.center||y);this._normalizeCenter(m);var x=a.project(y),b=a.project(m).sub(x),_=e.curve,w=Math.max(a.width,a.height),T=w/d,A=b.mag();if("minZoom"in e){var k=t.clamp(Math.min(e.minZoom,o,c),a.minZoom,a.maxZoom),M=w/a.zoomScale(k-o);_=Math.sqrt(M/A*2)}var S=_*_;function E(t){var e=(T*T-w*w+(t?-1:1)*S*S*A*A)/(2*(t?T:w)*S*A);return Math.log(Math.sqrt(e*e+1)-e)}function L(t){return(Math.exp(t)-Math.exp(-t))/2}function C(t){return(Math.exp(t)+Math.exp(-t))/2}var P=E(0),O=function(t){return C(P)/C(P+_*t)},I=function(t){return w*((C(P)*(L(e=P+_*t)/C(e))-L(P))/S)/A;var e},D=(E(1)-P)/_;if(Math.abs(A)<1e-6||!isFinite(D)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);var z=Te.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==f,this._pitching=h!==l,this._padding=!a.isPaddingEqual(p),this._prepareEase(r,!1),this._ease(function(e){var i=e*D,d=1/O(i);a.zoom=1===e?c:o+a.scaleZoom(d),n._rotating&&(a.bearing=t.number(s,f,e)),n._pitching&&(a.pitch=t.number(l,h,e)),n._padding&&(a.interpolatePadding(u,p,e),g=a.centerPoint.add(v));var y=1===e?m:a.unproject(x.add(b.mult(I(i))).mult(d));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,g),n._fireMoveEvents(r)},function(){return n._afterEase(r)},e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop()}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),Ai=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};Ai.prototype.getDefaultPosition=function(){return"bottom-right"},Ai.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Ai.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Ai.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce(function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0})).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Ai.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var ki=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};ki.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},ki.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},ki.prototype.getDefaultPosition=function(){return"bottom-left"},ki.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},ki.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},ki.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var Mi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Mi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Mi.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>Pi)throw new Error("maxPitch must be less than or equal to 60");var i=new Sn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new Mi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Si,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Li))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return r._update(!1)}),this.on("moveend",function(){return r._update(!1)}),this.on("zoom",function(){return r._update(!0)}),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new wi(this,e);var a="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new Ln(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Ai({customAttribution:e.customAttribution})),this.addControl(new ki,e.logoPosition),this.on("style.load",function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)}),this.on("data",function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))}),this.on("dataloading",function(e){r.fire(new t.Event(e.dataType+"dataloading",e))})}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),a&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()Pi)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?a||(a=!0,r.call(i,new Bn(t,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(i,new Bn(t,i,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(i,new Bn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(t,e,r){var i=this;if(void 0===r)return n.prototype.off.call(this,t,e);return this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var a=n[t],o=0;o180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Fi.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Fi.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Fi.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Fi.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Fi.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Fi.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Fi.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Fi.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Fi.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Fi.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)e.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Gi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Vi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Vi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(e){var r=e.originalEvent&&"resize"===e.originalEvent.type;e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))})},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":qi--,Gi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++qi>1?(e={maximumAge:6e5,timeout:0},Gi=!0):(e=this.options.positionOptions,Gi=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Wi={maxWidth:100,unit:"metric"},Zi=function(e){this.options=t.extend({},Wi,e),t.bindAll(["_onMove","setUnit"],this)};function Xi(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?Ji(e,n,l/5280,t._getUIString("ScaleControl.Miles")):Ji(e,n,l,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Ji(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Ji(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Ji(e,n,s,t._getUIString("ScaleControl.Meters"))}function Ji(t,e,r,n){var i,a,o,s=(i=r,(a=Math.pow(10,(""+Math.floor(i)).length-1))*((o=i/a)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(o))),l=s/r;t.style.width=e*l+"px",t.innerHTML=s+" "+n}Zi.prototype.getDefaultPosition=function(){return"bottom-left"},Zi.prototype._onMove=function(){Xi(this._map,this._container,this.options)},Zi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Zi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Zi.prototype.setUnit=function(t){this.options.unit=t,Xi(this._map,this._container,this.options)};var Ki=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Ki.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Ki.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ki.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Ki.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Ki.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Ki.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ki.prototype._isFullscreen=function(){return this._fullscreen},Ki.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Ki.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var $i={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Qi=function(e){function n(r){e.call(this),this.options=t.extend(Object.create($i),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(t){var e=this,n=this._lngLat||this._trackPointer;if(this._map&&n&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(t){return e._container.classList.add(t)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Bi(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||t)){var i=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),a=this.options.anchor,o=ta(this.options.offset);if(!a){var s,l=this._container.offsetWidth,u=this._container.offsetHeight;s=i.y+o.bottom.ythis._map.transform.height-u?["bottom"]:[],i.xthis._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var c=i.add(o[a]).round();r.setTransform(this._container,Ni[a]+" translate("+c.x+"px,"+c.y+"px)"),ji(this._container,a,"popup")}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);function ta(e){if(e){if("number"==typeof e){var r=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new t.Point(0,0),top:new t.Point(0,e),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-e),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(e,0),right:new t.Point(-e,0)}}if(e instanceof t.Point||Array.isArray(e)){var n=t.Point.convert(e);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:t.Point.convert(e.center||[0,0]),top:t.Point.convert(e.top||[0,0]),"top-left":t.Point.convert(e["top-left"]||[0,0]),"top-right":t.Point.convert(e["top-right"]||[0,0]),bottom:t.Point.convert(e.bottom||[0,0]),"bottom-left":t.Point.convert(e["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(e["bottom-right"]||[0,0]),left:t.Point.convert(e.left||[0,0]),right:t.Point.convert(e.right||[0,0])}}return ta(new t.Point(0,0))}var ea={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ii,NavigationControl:Ri,GeolocateControl:Yi,AttributionControl:Ai,ScaleControl:Zi,FullscreenControl:Ki,Popup:Qi,Marker:Vi,Style:We,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){jt().acquire(Rt)},clearPrewarmedResources:function(){var t=Bt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Rt),Bt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Ft.workerCount},set workerCount(t){Ft.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return ea}),r}()},55759:function(t,e,r){"use strict";var n=r(26446),i=r(15181);function a(t,e,r){var i={type:"linear",range:[t,e]};return n.autoTicks(i,(e-t)/(r||15)),i}t.exports=function(t,e){var r=t.contours;if(t.autocontour){var o=t.zmin,s=t.zmax;(t.zauto||void 0===o)&&(o=i.aggNums(Math.min,null,e)),(t.zauto||void 0===s)&&(s=i.aggNums(Math.max,null,e));var l=a(o,s,t.ncontours);r.size=l.dtick,r.start=n.tickFirst(l),l.range.reverse(),r.end=n.tickFirst(l),r.start===o&&(r.start+=r.size),r.end===s&&(r.end-=r.size),r.start>r.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),i.extendFlat(t._input.contours,{start:r.start,end:r.end,size:r.size}),t._input.autocontour=!0}else if("constraint"!==r.type){var u,c=r.start,f=r.end,h=t._input.contours;c>f&&(r.start=h.start=f,f=r.end=h.end=c,c=r.start),r.size>0||(u=c===f?1:a(c,f,t.ncontours).dtick,h.size=r.size=u)}}},55835:function(t,e,r){"use strict";var n=r(69562),i=r(38793);t.exports=function(t,e,r,a,o){o||(o={}),o.isContour=!0;var s=i(t,e,r,a,o);return s&&s.forEach(function(t){var e=t.trace;"constraint"===e.contours.type&&(e.fillcolor&&n.opacity(e.fillcolor)?t.color=n.addOpacity(e.fillcolor,1):e.contours.showlines&&n.opacity(e.line.color)&&(t.color=n.addOpacity(e.line.color,1)))}),s}},55891:function(t,e,r){"use strict";var n=r(79758),i=r(26446),a=r(88191);t.exports=function(t,e,r,o){var s,l,u,c=r[0][0].carpet,f=i.getFromId(t,c.xaxis||"x"),h=i.getFromId(t,c.yaxis||"y"),p={xaxis:f,yaxis:h,plot:e.plot};for(s=0;s path").each(function(t){if(!t.isBlank){var e=s.marker;n.select(this).call(a.fill,t.mc||e.color).call(a.stroke,t.mlc||e.line.color).call(i.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}}),u(r,s,t),r.selectAll(".regions").each(function(){n.select(this).selectAll("path").style("stroke-width",0).call(a.fill,s.connector.fillcolor)}),r.selectAll(".lines").each(function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)})})}}},56299:function(t,e,r){"use strict";t.exports={attributes:r(48114),supplyDefaults:r(62277),calc:r(4974),plot:r(48236),moduleType:"trace",name:"table",basePlotModule:r(64381),categories:["noOpacity"],meta:{}}},56327:function(t,e,r){"use strict";t.exports={attributes:r(48246),supplyDefaults:r(17665),calc:r(60306),plot:r(9168),colorbar:r(62731),style:r(55482),hoverPoints:r(38793),moduleType:"trace",name:"heatmap",basePlotModule:r(29435),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}},56522:function(t,e,r){"use strict";t.exports={attributes:r(26761),supplyDefaults:r(18030),colorbar:r(60469),calc:r(87597),plot:r(86275),style:r(62468),moduleType:"trace",name:"contourcarpet",basePlotModule:r(29435),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},56576:function(t,e,r){"use strict";var n=r(5159),i=r(25623),a=r(69562),o={};function s(t){return function(e,r){return!!e&&!!(e=i(e)).isValid()&&(e=a.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e)}}function l(t,e){var r,n=JSON.stringify(t),a=e[n];if(!a){for(a=t.slice(),r=0;r=0}),("funnelarea"===e.type?y:e.sort)&&a.sort(function(t,e){return e.v-t.v}),a[0]&&(a[0].vTotal=g),a},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,i=t.calcdata,a=n[r+"colorway"],s=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(a=l(a,o));for(var u=0,c=0;c=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r})}),l(n.prototype,o.toStringTag,a("c","String Iterator"))},56895:function(t,e,r){"use strict";var n=r(13625);t.exports=function(t){var e;return arguments.length>1&&(t=arguments),"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]),t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(e={x:(t=n(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height),e}},56944:function(t){"use strict";t.exports=function(t,e){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"initial"in e&&(t.initial=e.initial),"delta"in e&&(t.delta=e.delta),"final"in e&&(t.final=e.final),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}},57341:function(t,e){"use strict";var r={};function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}e.throttle=function(t,e,i){var a=r[t],o=Date.now();if(!a){for(var s in r)r[s].tsa.ts+e?l():a.timer=setTimeout(function(){l(),a.timer=null},e)},e.done=function(t){var e=r[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},e.clear=function(t){if(t)n(r[t]),delete r[t];else for(var i in r)e.clear(i)}},57731:function(t,e,r){"use strict";var n=r(16534),i=r(88191),a=r(69562),o=r(26100),s=o.stylePoints,l=o.styleText;t.exports=function(t,e){e&&function(t,e){var r=e[0].trace,o=e[0].node3;o.style("opacity",e[0].trace.opacity),s(o,r,t),l(o,r,t),o.selectAll("path.js-line").style("fill","none").each(function(t){var e=n.select(this),r=t.trace,o=r.line||{};e.call(a.stroke,o.color).call(i.dashLine,o.dash||"",o.width||0),"none"!==r.fill&&e.call(a.fill,r.fillcolor)})}(t,e)}},57916:function(t,e,r){"use strict";var n=r(15181),i=r(26446),a=r(46716),o=r(28315),s=r(80379);function l(t,e,r,a){function l(r,i){return n.coerce(t,e,s,r,i)}function u(t){var n=t+"axis",a={_fullLayout:{}};return a._fullLayout[n]=r[n],i.coercePosition(e,a,l,t,t,.5)}l("visible")&&(o(t,e,a.fullLayout,l),u("x"),u("y"),u("z"),n.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",l("xanchor"),l("yanchor"),l("xshift"),l("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",l("ax",-10),l("ay",-30),n.noneOrAll(t,e,["ax","ay"])))}t.exports=function(t,e,r){a(t,e,{name:"annotations",handleItemDefaults:l,fullLayout:r.fullLayout})}},58015:function(t,e,r){"use strict";var n=r(69562),i=r(28418);t.exports=function(t,e){var r,a;if("lines"===t.mode)return(r=t.line.color)&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return(a=o&&n.opacity(o)?o:s&&n.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"")?n.opacity(a)<.3?n.addOpacity(a,.3):a:(r=(t.line||{}).color)&&n.opacity(r)&&i.hasLines(t)&&t.line.width?r:t.fillcolor}},58023:function(t,e,r){"use strict";var n=r(15181).isArrayOrTypedArray;t.exports=function(t,e,r){var i,a,o,s,l,u,c=[],f=n(t)?t.length:t,h=n(e)?e.length:e,p=n(t)?t:null,d=n(e)?e:null;p&&(o=(p.length-1)/(p[p.length-1]-p[0])/(f-1)),d&&(s=(d.length-1)/(d[d.length-1]-d[0])/(h-1));var v=1/0,g=-1/0;for(a=0;a0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function F(t,e){return null===t?e:t}function B(t,e,r){C();var n=[e],i=[r];if(s>=1)n=[e],i=[r];else if(s>0){var a=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?r[u]:L(c,f,h);l[u]=d>-1?d:O(c,f,h,F(t,p))}I(l[0],l[1],l[2])}}function N(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function j(t,e,r){return t>=e&&t<=r}function U(t){var e=.001*(E-S);return t>=S-e&&t<=E+e}function V(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function H(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[j(e[0][3],n,i),j(e[1][3],n,i),j(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return U(e[0][3])&&U(e[1][3])&&U(e[2][3])?(B(t,e,r),!0):a<3&&H(t,e,r,S,E,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var u=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach(function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var c=e[a[0]],f=e[a[1]],h=e[a[2]],p=N(h,c,n,i),d=N(h,f,n,i);o=l(t,[d,p,c],[-1,-1,r[a[0]]])||o,o=l(t,[c,f,d],[r[a[0]],r[a[1]],-1])||o,u=!0}}),u||[[0,1,2],[1,2,0],[2,0,1]].forEach(function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var c=e[a[0]],f=e[a[1]],h=e[a[2]],p=N(f,c,n,i),d=N(h,c,n,i);o=l(t,[d,p,c],[-1,-1,r[a[0]]])||o,u=!0}}),o}function q(t,e,r,n){var i=!1,a=V(e),o=[j(a[0][3],r,n),j(a[1][3],r,n),j(a[2][3],r,n),j(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return v&&(i=function(t,e,r){var n=function(n,i,a){B(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach(function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var u=a[l[0]],c=a[l[1]],f=a[l[2]],h=a[l[3]];if(v)i=B(t,[u,c,f],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var p=N(h,u,r,n),d=N(h,c,r,n),g=N(h,f,r,n);i=B(null,[p,d,g],[-1,-1,-1])||i}s=!0}}),s||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach(function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var u=a[l[0]],c=a[l[1]],f=a[l[2]],h=a[l[3]],p=N(f,u,r,n),d=N(f,c,r,n),g=N(h,c,r,n),y=N(h,u,r,n);v?(i=B(t,[u,y,p],[e[l[0]],-1,-1])||i,i=B(t,[c,d,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(t,n,i){B(null,[e[t],e[n],e[i]],[r[t],r[n],r[i]])};n(0,1,2),n(2,3,0)}(0,[p,d,g,y],[-1,-1,-1,-1])||i,s=!0}}),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach(function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var u=a[l[0]],c=a[l[1]],f=a[l[2]],h=a[l[3]],p=N(c,u,r,n),d=N(f,u,r,n),g=N(h,u,r,n);v?(i=B(t,[u,p,d],[e[l[0]],-1,-1])||i,i=B(t,[u,d,g],[e[l[0]],-1,-1])||i,i=B(t,[u,g,p],[e[l[0]],-1,-1])||i):i=B(null,[p,d,g],[-1,-1,-1])||i,s=!0}})),i}function G(t,e,r,n,i,a,o,s,l,u,c){var f=!1;return d&&(R(t,"A")&&(f=q(null,[e,r,n,a],u,c)||f),R(t,"B")&&(f=q(null,[r,n,i,l],u,c)||f),R(t,"C")&&(f=q(null,[r,a,o,l],u,c)||f),R(t,"D")&&(f=q(null,[n,a,s,l],u,c)||f),R(t,"E")&&(f=q(null,[r,n,a,l],u,c)||f)),v&&(f=q(t,[r,n,a,l],u,c)||f),f}function Y(t,e,r,n,i,a,o,s){return[!0===s[0]||H(t,V([e,r,n]),[e,r,n],a,o),!0===s[1]||H(t,V([n,i,e]),[n,i,e],a,o)]}function W(t,e,r,n,i,a,o,s,l){return s?Y(t,e,r,i,n,a,o,l):Y(t,r,i,n,e,a,o,l)}function Z(t,e,r,n,i,a,o){var s,l,u,c,f=!1,h=function(){f=H(t,[s,l,u],[-1,-1,-1],i,a)||f,f=H(t,[u,c,s],[-1,-1,-1],i,a)||f},p=o[0],d=o[1],v=o[2];return p&&(s=D(V([A(e,r-0,n-0)])[0],V([A(e-1,r-0,n-0)])[0],p),l=D(V([A(e,r-0,n-1)])[0],V([A(e-1,r-0,n-1)])[0],p),u=D(V([A(e,r-1,n-1)])[0],V([A(e-1,r-1,n-1)])[0],p),c=D(V([A(e,r-1,n-0)])[0],V([A(e-1,r-1,n-0)])[0],p),h()),d&&(s=D(V([A(e-0,r,n-0)])[0],V([A(e-0,r-1,n-0)])[0],d),l=D(V([A(e-0,r,n-1)])[0],V([A(e-0,r-1,n-1)])[0],d),u=D(V([A(e-1,r,n-1)])[0],V([A(e-1,r-1,n-1)])[0],d),c=D(V([A(e-1,r,n-0)])[0],V([A(e-1,r-1,n-0)])[0],d),h()),v&&(s=D(V([A(e-0,r-0,n)])[0],V([A(e-0,r-0,n-1)])[0],v),l=D(V([A(e-0,r-1,n)])[0],V([A(e-0,r-1,n-1)])[0],v),u=D(V([A(e-1,r-1,n)])[0],V([A(e-1,r-1,n-1)])[0],v),c=D(V([A(e-1,r-0,n)])[0],V([A(e-1,r-0,n-1)])[0],v),h()),f}function X(t,e,r,n,i,a,o,s,l,u,c,f){var h=t;return f?(d&&"even"===t&&(h=null),G(h,e,r,n,i,a,o,s,l,u,c)):(d&&"odd"===t&&(h=null),G(h,l,s,o,a,i,n,r,e,u,c))}function J(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(T-M)?[k,T]:[T,M];tt(r,L[0],L[1])}}var C=[[Math.min(S,M),Math.max(S,M)],[Math.min(k,E),Math.max(k,E)]];["x","y","z"].forEach(function(r){for(var n=[],i=0;i0&&(f.push(d.id),"x"===r?h.push([d.distRatio,0,0]):"y"===r?h.push([0,d.distRatio,0]):h.push([0,0,d.distRatio]))}else c=it(1,"x"===r?b-1:"y"===r?_-1:w-1);f.length>0&&(n[a]="x"===r?et(e,f,o,s,h,n[a]):"y"===r?rt(e,f,o,s,h,n[a]):nt(e,f,o,s,h,n[a]),a++),c.length>0&&(n[a]="x"===r?J(e,c,o,s,n[a]):"y"===r?K(e,c,o,s,n[a]):$(e,c,o,s,n[a]),a++)}var v=t.caps[r];v.show&&v.fill&&(z(v.fill),n[a]="x"===r?J(e,[0,b-1],o,s,n[a]):"y"===r?K(e,[0,_-1],o,s,n[a]):$(e,[0,w-1],o,s,n[a]),a++)}}),0===g&&P(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=y,t._Ys=m,t._Zs=x}(),t}t.exports={findNearestOnAxis:l,generateIsoMeshes:h,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new u(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},58328:function(t,e,r){"use strict";var n=r(46982),i=r(15181),a=i.extendFlat,o=i.extendDeep;function s(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function l(t){return["xaxis","yaxis","zaxis"].indexOf(t.slice(0,5))>-1}t.exports=function(t,e){var r,i=t.data,u=t.layout,c=o([],i),f=o({},u,s(e.tileClass)),h=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var p=Object.keys(f);for(r=0;r0){var b,_,w,T,A,k=t.xa,M=t.ya;"h"===d.orientation?(A=e,b="y",w=M,_="x",T=k):(A=r,b="x",w=k,_="y",T=M);var S=p[t.index];if(A>=S.span[0]&&A<=S.span[1]){var E=i.extendFlat({},t),L=T.c2p(A,!0),C=s.getKdeValue(S,d,A),P=s.getPositionOnKdePath(S,d,L),O=w._offset,I=w._length;E[b+"0"]=P[0],E[b+"1"]=P[1],E[_+"0"]=E[_+"1"]=L,E[_+"Label"]=_+": "+a.hoverLabelText(T,A,d[_+"hoverformat"])+", "+p[0].t.labels.kde+" "+C.toFixed(3);for(var D=0,z=0;zf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),d.splice(f));var v=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:p}),g=function(t,e,r,o,s){var l=s("line.color",r);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,c);o(e,l,c),Array.isArray(v)&&v.length||(e.visible=!1),h(e,v,"values",g);var y={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(c,"labelfont",y),n.coerceFont(c,"tickfont",y),n.coerceFont(c,"rangefont",y),c("labelangle"),c("labelside"),c("unselected.line.color"),c("unselected.line.opacity")}},58833:function(t){"use strict";t.exports=function(t,e){var r={},n=e._carpet,i=n.ab2ij([t.a,t.b]),a=Math.floor(i[0]),o=i[0]-a,s=Math.floor(i[1]),l=i[1]-s,u=n.evalxy([],a,s,o,l);return r.yLabel=u[1].toFixed(3),r}},58953:function(t){"use strict";t.exports=function(t,e){return"xVal"in e&&(t.x=e.xVal),"yVal"in e&&(t.y=e.yVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t.color=e.color,t.colormodel=e.trace.colormodel,t.z||(t.z=e.color),t}},58978:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],f=t[10],h=t[11],p=t[12],d=t[13],v=t[14],g=t[15];return(e*o-r*a)*(f*g-h*v)-(e*s-n*a)*(c*g-h*d)+(e*l-i*a)*(c*v-f*d)+(r*s-n*o)*(u*g-h*p)-(r*l-i*o)*(u*v-f*p)+(n*l-i*s)*(u*d-c*p)}},59043:function(t,e,r){"use strict";t.exports=r(98436)},59129:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],v=e[12],g=e[13],y=e[14],m=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*f+w*v,t[1]=x*i+b*l+_*h+w*g,t[2]=x*a+b*u+_*p+w*y,t[3]=x*o+b*c+_*d+w*m,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*f+w*v,t[5]=x*i+b*l+_*h+w*g,t[6]=x*a+b*u+_*p+w*y,t[7]=x*o+b*c+_*d+w*m,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*f+w*v,t[9]=x*i+b*l+_*h+w*g,t[10]=x*a+b*u+_*p+w*y,t[11]=x*o+b*c+_*d+w*m,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*f+w*v,t[13]=x*i+b*l+_*h+w*g,t[14]=x*a+b*u+_*p+w*y,t[15]=x*o+b*c+_*d+w*m,t}},59378:function(t,e,r){"use strict";var n=r(15181),i=r(55077),a=r(69562),o=r(79444).N,s=r(41562).handleText,l=r(53511).TEXTPAD,u=r(92967).handleMarkerDefaults,c=r(44236),f=c.hasColorscale,h=c.handleDefaults;t.exports=function(t,e,r,c){function p(r,a){return n.coerce(t,e,i,r,a)}var d=p("labels"),v=p("parents");if(d&&d.length&&v&&v.length){var g=p("values");g&&g.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),p("tiling.orientation"),p("tiling.flip"),p("tiling.pad");var y=p("text");p("texttemplate"),e.texttemplate||p("textinfo",Array.isArray(y)?"text+label":"label"),p("hovertext"),p("hovertemplate");var m=p("pathbar.visible");s(t,e,c,p,"auto",{hasPathbar:m,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition"),u(t,e,c,p);var x=e._hasColorscale=f(t,"marker","colors")||(t.marker||{}).coloraxis;x&&h(t,e,c,p,{prefix:"marker.",cLetter:"c"}),p("leaf.opacity",x?1:.7),e._hovered={marker:{line:{width:2,color:a.contrast(c.paper_bgcolor)}}},m&&(p("pathbar.thickness",e.pathbar.textfont.size+2*l),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),o(e,c,p),e._length=null}else e.visible=!1}},59451:function(t){"use strict";var e=Object.create(null),r=Math.random;t.exports=function(){var t;do{t=r().toString(36).slice(2)}while(e[t]);return t}},59487:function(t,e,r){"use strict";var n=r(97261).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,a){if("function"==typeof r)return t(e,null,r);r||(r={}),a=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;id.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(u&&e.connectgaps){var h=n[0],p=n[1];for(i=0;i1?l[i]:l[0]:l,d=Array.isArray(u)?u.length>1?u[i]:u[0]:u,v=g[p],y=g[d],m=c?c/.8+1:0,x=-y*m-.5*y;o.offset[i]=[v*m/h,x/h]}}return o}}},59817:function(t,e,r){"use strict";var n=r(62019),i={object:!0,symbol:!0};t.exports=function(){var t,e=n.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch(t){return!1}return!!i[typeof e.iterator]&&!!i[typeof e.toPrimitive]&&!!i[typeof e.toStringTag]}},59884:function(t,e,r){"use strict";var n=r(30137).EventEmitter,i=r(46982),a=r(15181),o=r(93335),s=r(58328),l=r(65479),u=r(69982);t.exports=function(t,e){var r=new n,c=s(t,{format:"png"}),f=c.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var h=o.getRedrawFunc(f);return i.call("_doPlot",f,c.data,c.layout,c.config).then(h).then(function(){var t=o.getDelay(f._fullLayout);setTimeout(function(){var t=l(f),n=document.createElement("canvas");n.id=a.randstr(),(r=u({format:e.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:n,emitter:r,svg:t})).clean=function(){f&&document.body.removeChild(f)}},t)}).catch(function(t){r.emit("error",t)}),r}},59953:function(t,e,r){"use strict";var n=r(48563),i=r(14617).traceLayerPrefix;function a(t,e){this.type="densitymapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",i+e+"-heatmap"]],this.below=null}var o=a.prototype;o.update=function(t){var e=this.subplot,r=this.layerList,i=n(t),a=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var o=0;o=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},t.exports=function(t,e){var r=e[0].trace,i=new a(t,r.uid),o=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},59975:function(t,e,r){"use strict";var n=r(76252);t.exports=function(){return n(this).length=0,this}},60042:function(t,e,r){"use strict";var n=r(97261).F.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}},60153:function(t){"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}},60154:function(t,e,r){"use strict";var n=r(41511);t.exports=function(t,e,r,i){var a=t._fullLayout,o=a._paper,s=a._size;n(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}},60220:function(t){"use strict";t.exports=function(){for(var t=0;t1){var e=(t[t.length-1]-t[0])/(t.length-1),r=Math.abs(e/100);for(A=0;Ar)return!1}return!0}(M.rangebreaks||S.rangebreaks)&&(T=function(t,e,r){for(var n=[],i=-1,a=0;at.length)&&(r=t.length),t.substring(r-e.length,r)===e}var x="",b="",_="",w="",T={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function A(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach(function(e){r[e]=t[e]}),Object.defineProperty(r,"message",{value:t.message}),r}function k(t){return g(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var M=function(t,e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&p(t,e)}(M,t);var r,i,s,c,f=(r=M,i=h(),function(){var t,e=d(r);if(i){var n=d(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return l(this,t)});function M(t){var e;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,M),"object"!==v(t)||null===t)throw new y("options","Object",t);var r=t.message,i=t.operator,a=t.stackStartFn,o=t.actual,s=t.expected,c=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)e=f.call(this,String(r));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(x="",b="",w="",_=""):(x="",b="",w="",_="")),"object"===v(o)&&null!==o&&"object"===v(s)&&null!==s&&"stack"in o&&o instanceof Error&&"stack"in s&&s instanceof Error&&(o=A(o),s=A(s)),"deepStrictEqual"===i||"strictEqual"===i)e=f.call(this,function(t,e,r){var i="",a="",o=0,s="",l=!1,u=k(t),c=u.split("\n"),f=k(e).split("\n"),h=0,p="";if("strictEqual"===r&&"object"===v(t)&&"object"===v(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===c.length&&1===f.length&&c[0]!==f[0]){var d=c[0].length+f[0].length;if(d<=10){if(!("object"===v(t)&&null!==t||"object"===v(e)&&null!==e||0===t&&0===e))return"".concat(T[r],"\n\n")+"".concat(c[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&d<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;c[0][h]===f[0][h];)h++;h>2&&(p="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",h),"^"),h=0)}}for(var g=c[c.length-1],y=f[f.length-1];g===y&&(h++<2?s="\n ".concat(g).concat(s):i=g,c.pop(),f.pop(),0!==c.length&&0!==f.length);)g=c[c.length-1],y=f[f.length-1];var A=Math.max(c.length,f.length);if(0===A){var M=u.split("\n");if(M.length>30)for(M[26]="".concat(x,"...").concat(w);M.length>27;)M.pop();return"".concat(T.notIdentical,"\n\n").concat(M.join("\n"),"\n")}h>3&&(s="\n".concat(x,"...").concat(w).concat(s),l=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var S=0,E=T[r]+"\n".concat(b,"+ actual").concat(w," ").concat(_,"- expected").concat(w),L=" ".concat(x,"...").concat(w," Lines skipped");for(h=0;h1&&h>2&&(C>4?(a+="\n".concat(x,"...").concat(w),l=!0):C>3&&(a+="\n ".concat(f[h-2]),S++),a+="\n ".concat(f[h-1]),S++),o=h,i+="\n".concat(_,"-").concat(w," ").concat(f[h]),S++;else if(f.length1&&h>2&&(C>4?(a+="\n".concat(x,"...").concat(w),l=!0):C>3&&(a+="\n ".concat(c[h-2]),S++),a+="\n ".concat(c[h-1]),S++),o=h,a+="\n".concat(b,"+").concat(w," ").concat(c[h]),S++;else{var P=f[h],O=c[h],I=O!==P&&(!m(O,",")||O.slice(0,-1)!==P);I&&m(P,",")&&P.slice(0,-1)===O&&(I=!1,O+=","),I?(C>1&&h>2&&(C>4?(a+="\n".concat(x,"...").concat(w),l=!0):C>3&&(a+="\n ".concat(c[h-2]),S++),a+="\n ".concat(c[h-1]),S++),o=h,a+="\n".concat(b,"+").concat(w," ").concat(O),i+="\n".concat(_,"-").concat(w," ").concat(P),S+=2):(a+=i,i="",1!==C&&0!==h||(a+="\n ".concat(O),S++))}if(S>20&&h30)for(p[26]="".concat(x,"...").concat(w);p.length>27;)p.pop();e=1===p.length?f.call(this,"".concat(h," ").concat(p[0])):f.call(this,"".concat(h,"\n\n").concat(p.join("\n"),"\n"))}else{var d=k(o),g="",S=T[i];"notDeepEqual"===i||"notEqual"===i?(d="".concat(T[i],"\n\n").concat(d)).length>1024&&(d="".concat(d.slice(0,1021),"...")):(g="".concat(k(s)),d.length>512&&(d="".concat(d.slice(0,509),"...")),g.length>512&&(g="".concat(g.slice(0,509),"...")),"deepEqual"===i||"equal"===i?d="".concat(S,"\n\n").concat(d,"\n\nshould equal\n\n"):g=" ".concat(i," ").concat(g)),e=f.call(this,"".concat(d).concat(g))}return Error.stackTraceLimit=c,e.generatedMessage=!r,Object.defineProperty(u(e),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),e.code="ERR_ASSERTION",e.actual=o,e.expected=s,e.operator=i,Error.captureStackTrace&&Error.captureStackTrace(u(e),a),e.stack,e.name="AssertionError",l(e)}return s=M,(c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:e,value:function(t,e){return g(this,a(a({},e),{},{customInspect:!1,depth:0}))}}])&&o(s.prototype,c),Object.defineProperty(s,"prototype",{writable:!1}),M}(c(Error),g.custom);t.exports=M},60432:function(t,e){"use strict";e.xmlns="http://www.w3.org/2000/xmlns/",e.svg="http://www.w3.org/2000/svg",e.xlink="http://www.w3.org/1999/xlink",e.svgAttrs={xmlns:e.svg,"xmlns:xlink":e.xlink}},60433:function(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},60469:function(t,e,r){"use strict";var n=r(44236),i=r(7450),a=r(15583);t.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,u=o.coloring,c=i(e,{isColorbar:!0});if("heatmap"===u){var f=n.extractOpts(e);r._fillgradient=f.reversescale?n.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else"fill"===u&&(r._fillcolor=c);r._line={color:"lines"===u?c:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},60478:function(t,e,r){"use strict";var n=r(46982),i=r(68231);t.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:r(12261),supplyDefaults:r(49746),colorbar:r(23814),calc:r(63097),plot:r(62943),hoverPoints:r(99572).hoverPoints,selectPoints:r(1396),editStyle:r(98962),meta:{}},n.register(i)},60512:function(t,e,r){"use strict";var n=r(96221),i=r(5159),a=r(15181),o=r(44236).makeColorScaleFuncFromTrace,s=r(56576).makePullColorFn,l=r(56576).generateExtendedColors,u=r(44236).calc,c=r(78945).ALMOST_EQUAL,f={},h={},p={};function d(t,e,r){var n=0,i=t.children;if(i){for(var a=i.length,o=0;o=0};g?(r=Math.min(v.length,m.length),l=function(t){return k(v[t])&&M(t)},f=function(t){return String(v[t])}):(r=Math.min(y.length,m.length),l=function(t){return k(y[t])&&M(t)},f=function(t){return String(y[t])}),b&&(r=Math.min(r,x.length));for(var S=0;S1){for(var P=a.randstr(),O=0;O<_.length;O++)""===_[O].pid&&(_[O].pid=P);_.unshift({hasMultipleRoots:!0,id:P,pid:"",label:""})}}else{var I,D=[];for(I in w)T[I]||D.push(I);if(1!==D.length)return a.warn(["Multiple implied roots, cannot build",e.type,"hierarchy of",e.name+".","These roots include:",D.join(", ")].join(" "));I=D[0],_.unshift({hasImpliedRoot:!0,id:I,pid:"",label:I})}try{h=n.stratify().id(function(t){return t.id}).parentId(function(t){return t.pid})(_)}catch(t){return a.warn(["Failed to build",e.type,"hierarchy of",e.name+".","Error:",t.message].join(" "))}var z=n.hierarchy(h),R=!1;if(b)switch(e.branchvalues){case"remainder":z.sum(function(t){return t.data.v});break;case"total":z.each(function(t){var r=t.data.data,n=r.v;if(t.children){var i=t.children.reduce(function(t,e){return t+e.data.data.v},0);if((r.hasImpliedRoot||r.hasMultipleRoots)&&(n=i),n-1?e:"Object"===e&&function(t){var e=!1;return n(v,function(r,n){if(!e)try{r(t),e=p(n,1)}catch(t){}}),e}(t)}return s?function(t){var e=!1;return n(v,function(r,n){if(!e)try{"$"+r(t)===n&&(e=p(n,1))}catch(t){}}),e}(t):null}},61097:function(t,e,r){"use strict";var n=r(88191),i=r(78945),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,u=r(15181),c=u.segmentsIntersect,f=u.constrain,h=r(6680);t.exports=function(t,e){var r,i,o,p,d,v,g,y,m,x,b,_,w,T,A,k,M,S,E=e.trace||{},L=e.xaxis,C=e.yaxis,P="log"===L.type,O="log"===C.type,I=L._length,D=C._length,z=e.backoff,R=E.marker,F=e.connectGaps,B=e.baseTolerance,N=e.shape,j="linear"===N,U=E.fill&&"none"!==E.fill,V=[],H=h.minTolerance,q=t.length,G=new Array(q),Y=0;function W(r){var n=t[r];if(!n)return!1;var i=e.linearized?L.l2p(n.x):L.c2p(n.x),o=e.linearized?C.l2p(n.y):C.c2p(n.y);if(i===a){if(P&&(i=L.c2p(n.x,!0)),i===a)return!1;O&&o===a&&(i*=Math.abs(L._m*D*(L._m>0?s:l)/(C._m*I*(C._m>0?s:l)))),i*=1e3}if(o===a){if(O&&(o=C.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function Z(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,u=i*o+a*s;if(u>0&&uot||t[1]lt)return[f(t[0],at,ot),f(t[1],st,lt)]}function ft(t,e){return t[0]===e[0]&&(t[0]===at||t[0]===ot)||t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0}function ht(t,e,r){return function(n,i){var a=ct(n),o=ct(i),s=[];if(a&&o&&ft(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*u.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);return l&&((a&&o?l>0==a[t]>o[t]?a:o:a||o)[t]+=l),s}}function pt(t){var e=t[0],r=t[1],n=e===G[Y-1][0],i=r===G[Y-1][1];if(!n||!i)if(Y>1){var a=e===G[Y-2][0],o=r===G[Y-2][1];n&&(e===at||e===ot)&&a?o?Y--:G[Y-1]=t:i&&(r===st||r===lt)&&o?a?Y--:G[Y-1]=t:G[Y++]=t}else G[Y++]=t}function dt(t){G[Y-1][0]!==t[0]&&G[Y-1][1]!==t[1]&&pt([Q,tt]),pt(t),et=null,Q=tt=0}"linear"===N||"spline"===N?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ut[i],o=c(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&J(o,t)ot?ot:0,$=e[1]lt?lt:0,K||$){if(Y)if(et){var n=nt(et,e);n.length>1&&(dt(n[0]),G[Y++]=n[1])}else rt=nt(G[Y-1],e)[0],G[Y++]=rt;else G[Y++]=[K||e[0],$||e[1]];var i=G[Y-1];K&&$&&(i[0]!==K||i[1]!==$)?(et&&(Q!==K&&tt!==$?pt(Q&&tt?(a=et,s=(o=e)[0]-a[0],l=(o[1]-a[1])/s,(a[1]*o[0]-o[1]*a[0])/s>0?[l>0?at:ot,lt]:[l>0?ot:at,st]):[Q||K,tt||$]):Q&&tt&&pt([Q,tt])),pt([K,$])):Q-K&&tt-$&&pt([K||Q,$||tt]),et=e,Q=K,tt=$}else et&&dt(nt(et,e)[0]),G[Y++]=e;var a,o,s,l}for(r=0;rX(v,yt))break;o=v,(w=m[0]*y[0]+m[1]*y[1])>b?(b=w,p=v,g=!1):w<_&&(_=w,d=v,g=!0)}if(g?(gt(p),o!==d&>(d)):(d!==i&>(d),o!==p&>(p)),gt(o),r>=t.length||!v)break;gt(v),i=v}}else gt(p)}et&&pt([Q||et[0],tt||et[1]]),V.push(G.slice(0,Y))}var mt=N.slice(N.length-1);if(z&&"h"!==mt&&"v"!==mt){for(var xt=!1,bt=-1,_t=[],wt=0;wtt.length)&&(e=t.length);for(var r=0,n=new Array(e);r10)return!0;for(var e=0;e57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function I(t){return Object.keys(t).filter(O).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function D(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);iu?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:u:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,n,a,s){if(n&&t>o){var l=d(e,a,s),u=d(r,a,s),c=t===i?0:1;return l[c]!==u[c]}return Math.floor(r/t)-Math.floor(e/t)>.1}function d(t,e,r){var n=e.c2d(t,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(t,e,r,n,a){var s,l,u=-1.1*e,h=-.1*e,p=t-h,d=r[0],v=r[1],g=Math.min(f(d+h,d+p,n,a),f(v+h,v+p,n,a)),y=Math.min(f(d+u,d+h,n,a),f(v+u,v+h,n,a));if(g>y&&yo){var m=s===i?1:6,x=s===i?"M12":"M1";return function(e,r){var o=n.c2d(e,i,a),s=o.indexOf("-",m);s>0&&(o=o.substr(0,s));var u=n.d2c(o,0,a);if(u=55296&&m<=56319&&(w+=t[++r]),w=T?h.call(T,A,w,v):w,e?(p.value=w,d(g,v,p)):g[v]=w,++v;y=v}if(void 0===y)for(y=o(t.length),e&&(g=new e(y)),r=0;r=0?1:-1,L=E*S,C=L>a.pi,P=x*k;if(o.add((0,a.FP)(P*E*(0,a.F8)(L),b*M+P*(0,a.gn)(L))),c+=C?S+E*a.FA:S,C^y>=r^T>=r){var O=(0,i.r8)((0,i.jf)(g),(0,i.jf)(w));(0,i.Cx)(O);var I=(0,i.r8)(u,O);(0,i.Cx)(I);var D=(C^S>=0?-1:1)*(0,a.qR)(I[2]);(n>D||n===D&&(O[0]||O[1]))&&(f+=C^S>=0?1:-1)}}return(c<-a.Ni||c=(a=(v+y)/2))?v=a:y=a,(c=r>=(o=(g+m)/2))?g=o:m=o,i=p,!(p=p[f=c<<1|u]))return i[f]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&r===l)return d.next=p,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(u=e>=(a=(v+y)/2))?v=a:y=a,(c=r>=(o=(g+m)/2))?g=o:m=o}while((f=c<<1|u)==(h=(l>=o)<<1|s>=a));return i[h]=p,i[f]=d,t}function s(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function l(t){return t[0]}function u(t){return t[1]}function c(t,e,r){var n=new f(null==e?l:e,null==r?u:r,NaN,NaN,NaN,NaN);return null==t?n:n.addAll(t)}function f(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function h(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}r.r(e),r.d(e,{forceCenter:function(){return n},forceCollide:function(){return g},forceLink:function(){return b},forceManyBody:function(){return X},forceRadial:function(){return J},forceSimulation:function(){return Z},forceX:function(){return K},forceY:function(){return $}});var p=c.prototype=f.prototype;function d(t){return t.x+t.vx}function v(t){return t.y+t.vy}function g(t){var e,r,n=1,o=1;function s(){for(var t,i,s,u,f,h,p,g=e.length,y=0;yu+d||if+d||os.index){var v=u-l.x-l.vx,g=f-l.y-l.vy,y=v*v+g*g;yt.r&&(t.r=t[e].r)}function u(){if(e){var n,i,a=e.length;for(r=new Array(a),n=0;nf&&(f=n),ih&&(h=i));if(u>f||c>h)return this;for(this.cover(u,c).cover(f,h),r=0;rt||t>=i||n>e||e>=a;)switch(s=(ep||(a=u.y0)>d||(o=u.x1)=m)<<1|t>=y)&&(u=v[v.length-1],v[v.length-1]=v[v.length-1-c],v[v.length-1-c]=u)}else{var x=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),_=x*x+b*b;if(_=(s=(d+g)/2))?d=s:g=s,(c=o>=(l=(v+y)/2))?v=l:y=l,e=p,!(p=p[f=c<<1|u]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[h]=p:this._root=p),this):(this._root=i,this)},p.removeAll=function(t){for(var e=0,r=t.length;e=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o0)for(var r,n,i=new Array(r),a=0;a=0&&e._call.call(null,t),e=e._next;--L}()}finally{L=0,function(){for(var t,e,r=M,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:M=e);S=t,H(n)}(),I=0}}function V(){var t=z.now(),e=t-O;e>1e3&&(D-=e,O=t)}function H(t){L||(C&&(C=clearTimeout(C)),t-I>24?(t<1/0&&(C=setTimeout(U,t-z.now()-D)),P&&(P=clearInterval(P))):(P||(O=z.now(),P=setInterval(V,1e3)),L=1,R(U)))}function q(t){return t.x}function G(t){return t.y}N.prototype=j.prototype={constructor:N,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?F():+r)+(null==e?0:+e),this._next||S===this||(S?S._next=this:M=this,S=this),this._call=t,this._time=r,H()},stop:function(){this._call&&(this._call=null,this._time=1/0,H())}};var Y=10,W=Math.PI*(3-Math.sqrt(5));function Z(t){var e,r=1,n=.001,i=1-Math.pow(n,1/300),a=0,o=.6,s=(0,y.Tj)(),l=j(c),u=E("tick","end");function c(){f(),u.call("tick",e),r1?(null==r?s.remove(t):s.set(t,p(r)),e):s.get(t)},find:function(e,r,n){var i,a,o,s,l,u=0,c=t.length;for(null==n?n=1/0:n*=n,u=0;u1?(u.on(t,r),e):u.on(t)}}}function X(){var t,e,r,n,o=i(-30),s=1,l=1/0,u=.81;function f(n){var i,a=t.length,o=c(t,q,G).visitAfter(p);for(r=n,i=0;i=l)){(t.data!==e||t.next)&&(0===f&&(d+=(f=a())*f),0===h&&(d+=(h=a())*h),d100},e.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},62658:function(t,e,r){"use strict";var n,i=r(42964),a=r(42424),o=r(4814),s=r(76252),l=r(59451),u=r(41365),c=r(96568),f=r(88833),h=r(72930).toStringTag,p=r(34412),d=Array.isArray,v=Object.defineProperty,g=Object.prototype.hasOwnProperty,y=Object.getPrototypeOf;t.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=p&&a&&WeakMap!==n?a(new WeakMap,y(this)):this,i(e)&&(d(e)||(e=c(e))),v(t,"__weakMapData__",u("c","$weakMap$"+l())),e?(f(e,function(e){s(e),t.set(e[0],e[1])}),t):t},p&&(a&&a(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:u(n)})),Object.defineProperties(n.prototype,{delete:u(function(t){return!!g.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)}),get:u(function(t){if(g.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]}),has:u(function(t){return g.call(o(t),this.__weakMapData__)}),set:u(function(t,e){return v(o(t),this.__weakMapData__,u("c",e)),this}),toString:u(function(){return"[object WeakMap]"})}),v(n.prototype,h,u("c","WeakMap"))},62731:function(t){"use strict";t.exports={min:"zmin",max:"zmax"}},62736:function(t,e,r){"use strict";var n=r(28209),i=r(79444).u,a=r(37565),o=r(24761),s=r(38532).rb,l=r(38532).ay,u=r(8357).extendFlat,c=r(30430).k,f=a({editType:"plot",arrayOk:!0,colorEditType:"plot"});t.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:u({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:u({},f,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:u({},f,{}),outsidetextfont:u({},f,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:u({},f,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:i({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:u({},f,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},62747:function(t,e,r){"use strict";function n(){return new i}function i(){this.reset()}r.d(e,{A:function(){return n}}),i.prototype={constructor:i,reset:function(){this.s=this.t=0},add:function(t){o(a,t,this.t),o(this,a.s,this.s),this.s?this.t+=a.t:this.s=a.t},valueOf:function(){return this.s}};var a=new i;function o(t,e,r){var n=t.s=e+r,i=n-e,a=n-i;t.t=e-a+(r-i)}},62804:function(t,e,r){"use strict";var n=r(15181);t.exports=function(t,e){var r=t._fullLayout,i=e.uid,a=r._splomScenes;a||(a=r._splomScenes={});var o={dirty:!0,selectBatch:[],unselectBatch:[]},s=a[e.uid];return s||((s=a[i]=n.extendFlat({},o,{matrix:!1,selectBatch:[],unselectBatch:[]})).draw=function(){s.matrix&&s.matrix.draw&&(s.selectBatch.length||s.unselectBatch.length?s.matrix.draw(s.unselectBatch,s.selectBatch):s.matrix.draw()),s.dirty=!1},s.destroy=function(){s.matrix&&s.matrix.destroy&&s.matrix.destroy(),s.matrixOptions=null,s.selectBatch=null,s.unselectBatch=null,s=null}),s.dirty||n.extendFlat(s,o),s}},62839:function(t,e,r){"use strict";var n=r(99555),i=r(49367),a=r(64866)(),o=r(94693),s=r(46169),l=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||l(e)!==e)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in t&&o){var c=o(t,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(u=!1)}return(n||u||!r)&&(a?i(t,"length",e,!0,!0):i(t,"length",e)),t}},62943:function(t,e,r){"use strict";var n=r(40413),i=r(15181),a=r(93003),o=r(7514).selectMode;function s(t,e){var r,s,l,u,c,f=t._fullLayout,h=f._size,p=e.trace,d=e.t,v=f._splomScenes[p.uid],g=v.matrixOptions,y=g.cdata,m=f._glcanvas.data()[0].regl,x=f.dragmode;if(0!==y.length){g.lower=p.showupperhalf,g.upper=p.showlowerhalf,g.diagonal=p.diagonal.visible;var b=p._visibleDims,_=y.length,w=v.viewOpts={};for(w.ranges=new Array(_),w.domains=new Array(_),c=0;c-1,P=!0;if(o(x)||p.selectedpoints||C){var O=p._length;if(p.selectedpoints){v.selectBatch=p.selectedpoints;var I=p.selectedpoints,D={};for(l=0;lh?b.sizeAvg||Math.max(b.size,3):a(e,x),p=0;pa)if(Math.abs(h*u-c*f)>a&&o){var d=r-s,v=i-l,g=u*u+c*c,y=d*d+v*v,m=Math.sqrt(g),x=Math.sqrt(p),b=o*Math.tan((n-Math.acos((g+p-y)/(2*m*x)))/2),_=b/x,w=b/m;Math.abs(_-1)>a&&(this._+="L"+(t+_*f)+","+(e+_*h)),this._+="A"+o+","+o+",0,0,"+ +(h*d>f*v)+","+(this._x1=t+w*u)+","+(this._y1=e+w*c)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,r,s,l,u){t=+t,e=+e,u=!!u;var c=(r=+r)*Math.cos(s),f=r*Math.sin(s),h=t+c,p=e+f,d=1^u,v=u?s-l:l-s;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+h+","+p:(Math.abs(this._x1-h)>a||Math.abs(this._y1-p)>a)&&(this._+="L"+h+","+p),r&&(v<0&&(v=v%i+i),v>o?this._+="A"+r+","+r+",0,1,"+d+","+(t-c)+","+(e-f)+"A"+r+","+r+",0,1,"+d+","+(this._x1=h)+","+(this._y1=p):v>a&&(this._+="A"+r+","+r+",0,"+ +(v>=n)+","+d+","+(this._x1=t+r*Math.cos(l))+","+(this._y1=e+r*Math.sin(l))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};var u=l,c=Array.prototype.slice;function f(t){return function(){return t}}function h(t){return t[0]}function p(t){return t[1]}function d(t){return t.source}function v(t){return t.target}function g(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function y(){return function(t){var e=d,r=v,n=h,i=p,a=null;function o(){var o,s=c.call(arguments),l=e.apply(this,s),f=r.apply(this,s);if(a||(a=o=u()),t(a,+n.apply(this,(s[0]=l,s)),+i.apply(this,s),+n.apply(this,(s[0]=f,s)),+i.apply(this,s)),o)return a=null,o+""||null}return o.source=function(t){return arguments.length?(e=t,o):e},o.target=function(t){return arguments.length?(r=t,o):r},o.x=function(t){return arguments.length?(n="function"==typeof t?t:f(+t),o):n},o.y=function(t){return arguments.length?(i="function"==typeof t?t:f(+t),o):i},o.context=function(t){return arguments.length?(a=null==t?null:t,o):a},o}(g)}},64015:function(t,e,r){var n=r(9915),i=r(18610),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(l);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),a=""+this.toChineseMonth(n,i);return e&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"闰"===e[0]&&(r=!0,e=e.substring(1)),"月"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(i=a.newDate(l,u,c)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n){var i,a,o;if("object"==typeof t)a=t,i=e||{};else{var s;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i={}),a={year:t,month:e,day:r,isIntercalary:s}}o=a.day-1;var l,u=f[a.year-f[0]],c=u>>13;l=c&&(a.month>c||a.isIntercalary)?a.month:a.month-1;for(var p=0;p>9&4095,(d>>5&15)-1,(31&d)+o);return i.year=v.getFullYear(),i.month=1+v.getMonth(),i.day=v.getDate(),i}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r){var n,i;if("object"==typeof t)n=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");n={year:t,month:e,day:r},i={}}var a=h[n.year-h[0]],o=n.year<<9|n.month<<5|n.day;i.year=o>=a?n.year:n.year-1,a=h[i.year-h[0]];var s,l=new Date(a>>9&4095,(a>>5&15)-1,31&a),u=new Date(n.year,n.month-1,n.day);s=Math.round((u-l)/864e5);var c,p=f[i.year-f[0]];for(c=0;c<13;c++){var d=p&1<<12-c?30:29;if(s>13;return!v||c1e-10?t:0}function h(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a0?r:1/0}),i=n.mod(r+1,e.length);return[e[r],e[i]]},findIntersectionXY:u,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),u=(-o+l)/(2*a),c=(-o-l)/(2*a);return[[u,e*u+i+n],[c,e*c+i+n]]},clampTiny:f,pathPolygon:function(t,e,r,n,i,a){return"M"+h(c(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(p(t),0,t)}function v(t){return new Uint16Array(p(2*t),0,t)}function g(t){return new Uint32Array(p(4*t),0,t)}function y(t){return new Int8Array(p(t),0,t)}function m(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function b(t){return new Float32Array(p(4*t),0,t)}function _(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):d(t)}function T(t){return s?new BigUint64Array(p(8*t),0,t):null}function A(t){return l?new BigInt64Array(p(8*t),0,t):null}function k(t){return new DataView(p(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}e.free=function(t){if(a.isBuffer(t))f[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);c[r].push(t)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(t){h(t.buffer)},e.freeArrayBuffer=h,e.freeBuffer=function(t){f[n.log2(t.length)].push(t)},e.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return d(t);case"uint16":return v(t);case"uint32":return g(t);case"int8":return y(t);case"int16":return m(t);case"int32":return x(t);case"float":case"float32":return b(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return A(t);case"biguint64":return T(t);case"buffer":return M(t);case"data":case"dataview":return k(t);default:return null}return null},e.mallocArrayBuffer=p,e.mallocUint8=d,e.mallocUint16=v,e.mallocUint32=g,e.mallocInt8=y,e.mallocInt16=m,e.mallocInt32=x,e.mallocFloat32=e.mallocFloat=b,e.mallocFloat64=e.mallocDouble=_,e.mallocUint8Clamped=w,e.mallocBigUint64=T,e.mallocBigInt64=A,e.mallocDataView=k,e.mallocBuffer=M,e.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.BIGUINT64[t].length=0,u.BIGINT64[t].length=0,u.UINT8C[t].length=0,c[t].length=0,f[t].length=0}},64815:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(22447),i=6378137;function a(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var r=1;r2){for(l=0;lt?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}t.exports=function(t){var e,r,a,o,s,l,u,c,f,h=t[0].z,p=h.length,d=h[0].length,v=2===p||2===d;for(r=0;r>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);if(p)r=p;else for(r=new Int32Array(e),l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var v=i(t.marker.color),g=i(t.marker.border.color),y=t.opacity*t.marker.opacity;v[3]*=y,this.pointcloudOptions.color=v;var m=t.marker.blend;null===m&&(m=u.length<100||c.length<100),this.pointcloudOptions.blend=m,g[3]*=y,this.pointcloudOptions.borderColor=g;var x=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=x,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,T=b/2||.5;t._extremes[_._id]=a(_,[d[0],d[2]],{ppad:T}),t._extremes[w._id]=a(w,[d[1],d[3]],{ppad:T})},l.dispose=function(){this.pointcloud.dispose()},t.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},65255:function(t,e,r){"use strict";var n=r(16534),i=r(88191),a=r(29076),o=r(55217),s=r(22951),l=r(3071),u=r(15181),c=u.strRotate,f=u.strTranslate,h=r(5126);function p(t,e,r,s,l,u,c){var f="const-"+l+"-lines",h=r.selectAll("."+f).data(u);h.enter().append("path").classed(f,!0).style("vector-effect",c?"none":"non-scaling-stroke"),h.each(function(r){var s=r,l=s.x,u=s.y,c=a([],l,t.c2p),f=a([],u,e.c2p),h="M"+o(c,f,s.smoothing);n.select(this).attr("d",h).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",i.dashStyle(s.dash,s.width)).style("fill","none")}),h.exit().remove()}function d(t,e,r,a,o,u,h,p){var d=u.selectAll("text."+p).data(h);d.enter().append("text").classed(p,!0);var v=0,g={};return d.each(function(o,u){var h;if("auto"===o.axis.tickangle)h=s(a,e,r,o.xy,o.dxy);else{var p=(o.axis.tickangle+180)*Math.PI/180;h=s(a,e,r,o.xy,[Math.cos(p),Math.sin(p)])}u||(g={angle:h.angle,flip:h.flip});var d=(o.endAnchor?-1:1)*h.flip,y=n.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,t),m=i.bBox(this);y.attr("transform",f(h.p[0],h.p[1])+c(h.angle)+f(o.axis.labelpadding*d,.3*m.height)),v=Math.max(v,m.width+o.axis.labelpadding)}),d.exit().remove(),g.maxExtent=v,g}t.exports=function(t,e,r,i){var l=t._context.staticPlot,c=e.xaxis,f=e.yaxis,h=t._fullLayout._clips;u.makeTraceGroups(i,r,"trace").each(function(e){var r=n.select(this),i=e[0],v=i.trace,g=v.aaxis,m=v.baxis,x=u.ensureSingle(r,"g","minorlayer"),b=u.ensureSingle(r,"g","majorlayer"),_=u.ensureSingle(r,"g","boundarylayer"),w=u.ensureSingle(r,"g","labellayer");r.style("opacity",v.opacity),p(c,f,b,0,"a",g._gridlines,!0),p(c,f,b,0,"b",m._gridlines,!0),p(c,f,x,0,"a",g._minorgridlines,!0),p(c,f,x,0,"b",m._minorgridlines,!0),p(c,f,_,0,"a-boundary",g._boundarylines,l),p(c,f,_,0,"b-boundary",m._boundarylines,l);var T=d(t,c,f,v,0,w,g._labels,"a-label"),A=d(t,c,f,v,0,w,m._labels,"b-label");!function(t,e,r,n,i,a,o,l){var c,f,h,p,d=u.aggNums(Math.min,null,r.a),v=u.aggNums(Math.max,null,r.a),g=u.aggNums(Math.min,null,r.b),m=u.aggNums(Math.max,null,r.b);c=.5*(d+v),f=g,h=r.ab2xy(c,f,!0),p=r.dxyda_rough(c,f),void 0===o.angle&&u.extendFlat(o,s(r,i,a,h,r.dxydb_rough(c,f))),y(t,e,r,0,h,p,r.aaxis,i,a,o,"a-title"),c=d,f=.5*(g+m),h=r.ab2xy(c,f,!0),p=r.dxydb_rough(c,f),void 0===l.angle&&u.extendFlat(l,s(r,i,a,h,r.dxyda_rough(c,f))),y(t,e,r,0,h,p,r.baxis,i,a,l,"b-title")}(t,w,v,0,c,f,T,A),function(t,e,r,n,i){var s,l,c,f,h=r.select("#"+t._clipPathId);h.size()||(h=r.append("clipPath").classed("carpetclip",!0));var p=u.ensureSingle(h,"path","carpetboundary"),d=e.clipsegments,v=[];for(f=0;f90&&m<270,b=n.select(this);b.text(h.title.text).call(l.convertToTspans,t),x&&(_=(-l.lineCount(b)+g)*v*a-_),b.attr("transform",f(e.p[0],e.p[1])+c(e.angle)+f(0,_)).attr("text-anchor","middle").call(i.font,h.title.font)}),b.exit().remove()}},65409:function(t,e,r){"use strict";var n=r(26446),i=r(15181),a=r(93441),o=r(69562),s=r(15181).fillText,l=r(11881),u={increasing:l.INCREASING.SYMBOL,decreasing:l.DECREASING.SYMBOL};function c(t,e,r,n){var i,s,l=t.cd,u=t.xa,c=l[0].trace,f=l[0].t,h=c.type,p="ohlc"===h?"l":"min",d="ohlc"===h?"h":"max",v=f.bPos||0,g=f.bdPos||f.tickLen,y=f.wHover,m=Math.min(1,g/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function x(t){var r=function(t){return t.pos+v-e}(t);return a.inbox(r-y,r+y,i)}function b(t){var e=t[p],n=t[d];return e===n||a.inbox(e-r,n-r,i)}function _(t){return(x(t)+b(t))/2}i=t.maxHoverDistance-m,s=t.maxSpikeDistance-m;var w=a.getDistanceFunction(n,x,b,_);if(a.getClosest(l,w,t),!1===t.index)return null;var T=l[t.index];if(T.empty)return null;var A=c[T.dir],k=A.line.color;return o.opacity(k)&&A.line.width?t.color=k:t.color=A.fillcolor,t.x0=u.c2p(T.pos+v-g,!0),t.x1=u.c2p(T.pos+v+g,!0),t.xLabelVal=void 0!==T.orig_p?T.orig_p:T.pos,t.spikeDistance=_(T)*s/i,t.xSpike=u.c2p(T.pos,!0),t}function f(t,e,r,a){var o=t.cd,s=t.ya,l=o[0].trace,u=o[0].t,f=[],h=c(t,e,r,a);if(!h)return[];var p=o[h.index].hi||l.hoverinfo,d=p.split("+");if("all"!==p&&-1===d.indexOf("y"))return[];for(var v=["high","open","close","low"],g={},y=0;y"+u.labels[x]+n.hoverLabelText(s,b,l.yhoverformat):((m=i.extendFlat({},h)).y0=m.y1=_,m.yLabelVal=b,m.yLabel=u.labels[x]+n.hoverLabelText(s,b,l.yhoverformat),m.name="",f.push(m),g[b]=m)}return f}function h(t,e,r,i){var a=t.cd,o=t.ya,l=a[0].trace,f=a[0].t,h=c(t,e,r,i);if(!h)return[];var p=a[h.index],d=h.index=p.i,v=p.dir;function g(t){return f.labels[t]+n.hoverLabelText(o,l[t][d],l.yhoverformat)}var y=p.hi||l.hoverinfo,m=y.split("+"),x="all"===y,b=x||-1!==m.indexOf("y"),_=x||-1!==m.indexOf("text"),w=b?[g("open"),g("high"),g("low"),g("close")+" "+u[v]]:[];return _&&s(p,l,w),h.extraText=w.join("
"),h.y0=h.y1=o.c2p(p.yc,!0),[h]}t.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?f(t,e,r,n):h(t,e,r,n)},hoverSplit:f,hoverOnPoints:h}},65479:function(t,e,r){"use strict";var n=r(16534),i=r(15181),a=r(88191),o=r(69562),s=r(60432),l=/"/g,u="TOBESTRIPPED",c=new RegExp('("'+u+")|("+u+'")',"g");t.exports=function(t,e,r){var f,h=t._fullLayout,p=h._paper,d=h._toppaper,v=h.width,g=h.height;p.insert("rect",":first-child").call(a.setRect,0,0,v,g).call(o.fill,h.paper_bgcolor);var y=h._basePlotModules||[];for(f=0;f")?"":e.html(t).text()});return e.remove(),r}(w)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(w=(w=(w=w.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),w}},65552:function(t){"use strict";t.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},65738:function(t,e,r){"use strict";t.exports=r(71233)},65743:function(t,e,r){"use strict";t.exports=r(7544)},65921:function(t,e,r){"use strict";var n=r(14083).convert,i=r(14083).convertOnSelect,a=r(14617).traceLayerPrefix;function o(t,e){this.type="choroplethmapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["fill",a+e+"-fill"],["line",a+e+"-line"]],this.below=null}var s=o.prototype;s.update=function(t){this._update(n(t)),t[0].trace._glTrace=this},s.updateOnSelect=function(t){this._update(i(t))},s._update=function(t){var e=this.subplot,r=this.layerList,n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(t.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(t,n),this.below=n);for(var i=0;i=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},t.exports=function(t,e){var r=e[0].trace,i=new o(t,r.uid),a=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}},65941:function(t){"use strict";t.exports=function(){}},65953:function(t,e,r){"use strict";var n=r(26446);t.exports=function(t,e,r){var i={},a=r[e.geo]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=n.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=n.tickText(a,a.c2l(o[1]),!0).text,i}},66031:function(t){t.exports=function(t,e,r,n){var i=t[0],a=t[1],o=!1;void 0===r&&(r=0),void 0===n&&(n=e.length);for(var s=n-r,l=0,u=s-1;la!=p>a&&i<(h-c)*(a-f)/(p-f)+c&&(o=!o)}return o}},66072:function(t,e,r){"use strict";t.exports=r(32679)},66335:function(t,e,r){"use strict";var n=r(15181);t.exports=function(t,e){for(var r=0;rh)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,d.prototype),e}function d(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return y(t)}return v(t,e,r)}function v(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|_(t,e),n=p(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(et(t,Uint8Array)){var e=new Uint8Array(t);return x(e.buffer,e.byteOffset,e.byteLength)}return m(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+l(t));if(et(t,ArrayBuffer)||t&&et(t.buffer,ArrayBuffer))return x(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(et(t,SharedArrayBuffer)||t&&et(t.buffer,SharedArrayBuffer)))return x(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return d.from(n,e,r);var i=function(t){if(d.isBuffer(t)){var e=0|b(t.length),r=p(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||rt(t.length)?p(0):m(t):"Buffer"===t.type&&Array.isArray(t.data)?m(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return d.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+l(t))}function g(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function y(t){return g(t),p(t<0?0:0|b(t))}function m(t){for(var e=t.length<0?0:0|b(t.length),r=p(e),n=0;n=h)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h.toString(16)+" bytes");return 0|t}function _(t,e){if(d.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||et(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+l(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Q(t).length;default:if(i)return n?-1:$(t).length;e=(""+e).toLowerCase(),i=!0}}function w(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return D(this,e,r);case"latin1":case"binary":return z(this,e,r);case"base64":return P(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function T(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function A(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),rt(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=d.from(e,n)),d.isBuffer(e))return 0===e.length?-1:k(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):k(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function k(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a,o=e.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function P(t,e,r){return 0===e&&r===t.length?u.fromByteArray(t):u.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,u=void 0,c=void 0,f=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(l=t[i+1]))&&(f=(31&a)<<6|63&l)>127&&(o=f);break;case 3:l=t[i+1],u=t[i+2],128==(192&l)&&128==(192&u)&&(f=(15&a)<<12|(63&l)<<6|63&u)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&(f=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){var e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn.length?(d.isBuffer(a)||(a=d.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!d.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},d.byteLength=_,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},f&&(d.prototype[f]=d.prototype.inspect),d.prototype.compare=function(t,e,r,n,i){if(et(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+l(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),s=Math.min(a,o),u=this.slice(n,i),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return M(this,t,e,r);case"utf8":case"utf-8":return S(this,t,e,r);case"ascii":case"latin1":case"binary":return E(this,t,e,r);case"base64":return L(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function D(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,a){if(!d.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function j(t,e,r,n,i){Z(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function U(t,e,r,n,i){Z(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function V(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(t,e,r,n,i){return e=+e,r>>>=0,i||V(t,0,r,4),c.write(t,e,r,n,23,4),r+4}function q(t,e,r,n,i){return e=+e,r>>>=0,i||V(t,0,r,8),c.write(t,e,r,n,52,8),r+8}d.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},d.prototype.readUint8=d.prototype.readUInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),this[t]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},d.prototype.readBigUInt64LE=it(function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);var n=e+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,24),i=this[++t]+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);var n=e*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t],i=this[++t]*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},d.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},d.prototype.readInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},d.prototype.readInt16LE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},d.prototype.readInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},d.prototype.readBigInt64LE=it(function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);var n=this[t+4]+this[t+5]*Math.pow(2,8)+this[t+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);var n=(e<<24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t];return(BigInt(n)<>>=0,e||B(t,4,this.length),c.read(this,t,!0,23,4)},d.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),c.read(this,t,!1,23,4)},d.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),c.read(this,t,!0,52,8)},d.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(t,8,this.length),c.read(this,t,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},d.prototype.writeUint8=d.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,255,0),this[e]=255&t,e+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},d.prototype.writeBigUInt64LE=it(function(t){return j(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=it(function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>>=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o|0)-s&255;return e+r},d.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},d.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},d.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},d.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},d.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},d.prototype.writeBigInt64LE=it(function(t){return j(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=it(function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeFloatLE=function(t,e,r){return H(this,t,e,!0,r)},d.prototype.writeFloatBE=function(t,e,r){return H(this,t,e,!1,r)},d.prototype.writeDoubleLE=function(t,e,r){return q(this,t,e,!0,r)},d.prototype.writeDoubleBE=function(t,e,r){return q(this,t,e,!1,r)},d.prototype.copy=function(t,e,r,n){if(!d.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function Z(t,e,r,n,i,a){if(t>r||t3?0===e||e===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(e).concat(s," and <= ").concat(r).concat(s),new G.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){X(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||J(e,t.length-(r+1))}(n,i,a)}function X(t,e){if("number"!=typeof t)throw new G.ERR_INVALID_ARG_TYPE(e,"number",t)}function J(t,e,r){if(Math.floor(t)!==t)throw X(t,r),new G.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new G.ERR_BUFFER_OUT_OF_BOUNDS;throw new G.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(e),t)}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(l(e))},TypeError),Y("ERR_OUT_OF_RANGE",function(t,e,r){var n='The value of "'.concat(t,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=W(String(r)):"bigint"==typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=W(i)),i+="n"),n+" It must be ".concat(e,". Received ").concat(i)},RangeError);var K=/[^+/0-9A-Za-z-_]/g;function $(t,e){var r;e=e||1/0;for(var n=t.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Q(t){return u.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function tt(t,e,r,n){var i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function et(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function rt(t){return t!=t}var nt=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}();function it(t){return"undefined"==typeof BigInt?at:t}function at(){throw new Error("BigInt not supported")}},66571:function(t,e,r){"use strict";var n=r(15181),i=r(46982),a=r(31164),o=r(6680),s=r(28418),l=r(72639),u=r(63457),c=r(93234),f=r(52948),h=r(4868),p=r(68478),d=r(54563),v=r(46190),g=r(15181).coercePattern;t.exports=function(t,e,r,y){function m(r,i){return n.coerce(t,e,a,r,i)}var x=l(t,e,y,m);if(x||(e.visible=!1),e.visible){u(t,e,y,m),m("xhoverformat"),m("yhoverformat");var b=c(t,e,y,m);"group"===y.scattermode&&void 0===e.orientation&&m("orientation","v");var _=!b&&x=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},67914:function(t,e,r){"use strict";var n=r(15181),i=r(73553).handleRThetaDefaults,a=r(88156),o=r(29245);t.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}i(t,e,s,l)?(l("thetaunit"),l("base"),l("offset"),l("width"),l("text"),l("hovertext"),l("hovertemplate"),a(t,e,l,r,s),n.coerceSelectionMarkerOpacity(e,l)):e.visible=!1}},68047:function(t){"use strict";t.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},68231:function(t,e,r){"use strict";var n=r(15181),i=r(90778).counter,a=r(79444).u,o=r(29278).idRegex,s=r(92444),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:a({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function c(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),u=s[0],c=(s[1]-u)/(i-o),f=c*(1-o),h=0;h1){h||p||d||"independent"===A("pattern")&&(h=!0),g._hasSubplotGrid=h;var x,b,_="top to bottom"===A("roworder"),w=h?.2:.1,T=h?.3:.1;v&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),g._domains={x:c("x",A,w,x,m),y:c("y",A,T,b,y,_)}}else delete e.grid}function A(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,c,h=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,v=r.rows,g=r.columns,y="independent"===r.pattern,m=r._axisMap={};if(d){var x=h.subplots||[];l=r.subplots=new Array(v);var b=1;for(n=0;nt.lo&&(x.so=!0)}return a});h.enter().append("path").classed("point",!0),h.exit().remove(),h.call(a.translatePoints,o,s)}function l(t,e,r,a){var o,s,l=e.val,u=e.pos,c=!!u.rangebreaks,f=a.bPos,h=a.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var d=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each(function(t){var e=u.c2l(t.pos+f,!0),i=u.l2p(e-o)+h,a=u.l2p(e+s)+h,d=c?(i+a)/2:u.l2p(e)+h,v=l.c2p(t.mean,!0),g=l.c2p(t.mean-t.sd,!0),y=l.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+v+","+i+"V"+a+("sd"===p?"m0,0L"+g+","+d+"L"+v+","+i+"L"+y+","+d+"Z":"")):n.select(this).attr("d","M"+i+","+v+"H"+a+("sd"===p?"m0,0L"+d+","+g+"L"+i+","+v+"L"+d+","+y+"Z":""))})}t.exports={plot:function(t,e,r,a){var u=t._context.staticPlot,c=e.xaxis,f=e.yaxis;i.makeTraceGroups(a,r,"trace boxes").each(function(t){var e,r,i=n.select(this),a=t[0],h=a.t,p=a.trace;h.wdPos=h.bdPos*p.whiskerwidth,!0!==p.visible||h.empty?i.remove():("h"===p.orientation?(e=f,r=c):(e=c,r=f),o(i,{pos:e,val:r},p,h,u),s(i,{x:c,y:f},p,h),l(i,{pos:e,val:r},p,h))})},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},68397:function(t,e,r){"use strict";var n=r(23786),i=r(6378),a=r(61085),o=r(38598);function s(t){return t.call.bind(t)}var l="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,c=s(Object.prototype.toString),f=s(Number.prototype.valueOf),h=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(l)var d=s(BigInt.prototype.valueOf);if(u)var v=s(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function y(t){return"[object Map]"===c(t)}function m(t){return"[object Set]"===c(t)}function x(t){return"[object WeakMap]"===c(t)}function b(t){return"[object WeakSet]"===c(t)}function _(t){return"[object ArrayBuffer]"===c(t)}function w(t){return"undefined"!=typeof ArrayBuffer&&(_.working?_(t):t instanceof ArrayBuffer)}function T(t){return"[object DataView]"===c(t)}function A(t){return"undefined"!=typeof DataView&&(T.working?T(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=o,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):o(t)||A(t)},e.isUint8Array=function(t){return"Uint8Array"===a(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===a(t)},e.isUint16Array=function(t){return"Uint16Array"===a(t)},e.isUint32Array=function(t){return"Uint32Array"===a(t)},e.isInt8Array=function(t){return"Int8Array"===a(t)},e.isInt16Array=function(t){return"Int16Array"===a(t)},e.isInt32Array=function(t){return"Int32Array"===a(t)},e.isFloat32Array=function(t){return"Float32Array"===a(t)},e.isFloat64Array=function(t){return"Float64Array"===a(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===a(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===a(t)},y.working="undefined"!=typeof Map&&y(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(y.working?y(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},x.working="undefined"!=typeof WeakMap&&x(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(x.working?x(t):t instanceof WeakMap)},b.working="undefined"!=typeof WeakSet&&b(new WeakSet),e.isWeakSet=function(t){return b(t)},_.working="undefined"!=typeof ArrayBuffer&&_(new ArrayBuffer),e.isArrayBuffer=w,T.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&T(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=A;var k="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function M(t){return"[object SharedArrayBuffer]"===c(t)}function S(t){return void 0!==k&&(void 0===M.working&&(M.working=M(new k)),M.working?M(t):t instanceof k)}function E(t){return g(t,f)}function L(t){return g(t,h)}function C(t){return g(t,p)}function P(t){return l&&g(t,d)}function O(t){return u&&g(t,v)}e.isSharedArrayBuffer=S,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===c(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===c(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===c(t)},e.isGeneratorObject=function(t){return"[object Generator]"===c(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===c(t)},e.isNumberObject=E,e.isStringObject=L,e.isBooleanObject=C,e.isBigIntObject=P,e.isSymbolObject=O,e.isBoxedPrimitive=function(t){return E(t)||L(t)||C(t)||P(t)||O(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(w(t)||S(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})})},68478:function(t){"use strict";t.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},68552:function(t,e,r){"use strict";var n=r(15181),i=r(25103),a=r(9381),o=r(93335);t.exports=function(t,e){var r;return n.isPlainObject(t)||(r=n.getGraphDiv(t)),(e=e||{}).format=e.format||"png",e.width=e.width||null,e.height=e.height||null,e.imageDataOnly=!0,new Promise(function(s,l){r&&r._snapshotInProgress&&l(new Error("Snapshotting already in progress.")),n.isIE()&&"svg"!==e.format&&l(new Error(o.MSG_IE_BAD_FORMAT)),r&&(r._snapshotInProgress=!0);var u=i(t,e),c=e.filename||t.fn||"newplot";c+="."+e.format.replace("-","."),u.then(function(t){return r&&(r._snapshotInProgress=!1),a(t,c,e.format)}).then(function(t){s(t)}).catch(function(t){r&&(r._snapshotInProgress=!1),l(t)})})}},68559:function(t,e,r){"use strict";var n=r(69562),i=r(79335),a=r(99012).axisHoverFormat,o=r(38532).rb,s=r(28209),l=r(8357).extendFlat,u=r(7458).overrideAll;function c(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var f=t.exports=u(l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},i("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:c(),y:c(),z:c()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:l({},i.zauto,{}),zmin:l({},i.zmin,{}),zmax:l({},i.zmax,{})},hoverinfo:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");f.x.editType=f.y.editType=f.z.editType="calc+clearAxisTypes",f.transforms=void 0},68572:function(t){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},68649:function(t,e,r){"use strict";var n=r(26446),i=r(81878),a=r(15181).fillText;t.exports=function(t,e,r){var o,s,l,u,c=t.cd,f=c[0].trace,h=t.subplot,p=[e,r],d=[e+360,r];for(s=0;s")}}(t,f,o),[t]}},68661:function(t,e,r){"use strict";t.exports={attributes:r(70856),supplyDefaults:r(27071),calc:r(88472),plot:r(60154),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:r(72384),categories:["noOpacity"],meta:{}}},68731:function(t){"use strict";t.exports=i,t.exports.isMobile=i,t.exports.default=i;var e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(t){t||(t={});var i=t.ua;if(i||"undefined"==typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!=typeof i)return!1;var a=e.test(i)&&!r.test(i)||!!t.tablet&&n.test(i);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},68871:function(t,e,r){var n=r(9915),i=r(18610);function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},68947:function(t,e,r){var n=r(9915),i=r(18610);function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},68983:function(t){t.exports=!0},69027:function(t){t.exports=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t}},69030:function(t,e,r){"use strict";r.d(e,{A:function(){return l}});var n=r(55270),i=r(29181),a=r(18901),o=r(62244),s=r(22208);function l(t,e,r,a){return function(l){var f,h,p,d=e(l),v=(0,n.A)(),g=e(v),y=!1,m={point:x,lineStart:_,lineEnd:w,polygonStart:function(){m.point=T,m.lineStart=A,m.lineEnd=k,h=[],f=[]},polygonEnd:function(){m.point=x,m.lineStart=_,m.lineEnd=w,h=(0,s.Am)(h);var t=(0,o.A)(f,a);h.length?(y||(l.polygonStart(),y=!0),(0,i.A)(h,c,t,r,l)):t&&(y||(l.polygonStart(),y=!0),l.lineStart(),r(null,null,1,l),l.lineEnd()),y&&(l.polygonEnd(),y=!1),h=f=null},sphere:function(){l.polygonStart(),l.lineStart(),r(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function x(e,r){t(e,r)&&l.point(e,r)}function b(t,e){d.point(t,e)}function _(){m.point=b,d.lineStart()}function w(){m.point=x,d.lineEnd()}function T(t,e){p.push([t,e]),g.point(t,e)}function A(){g.lineStart(),p=[]}function k(){T(p[0][0],p[0][1]),g.lineEnd();var t,e,r,n,i=g.clean(),a=v.result(),o=a.length;if(p.pop(),f.push(p),p=null,o)if(1&i){if((e=(r=a[0]).length-1)>0){for(y||(l.polygonStart(),y=!0),l.lineStart(),t=0;t1&&2&i&&a.push(a.pop().concat(a.shift())),h.push(a.filter(u))}return m}}function u(t){return t.length>1}function c(t,e){return((t=t.x)[0]<0?t[1]-a.TW-a.Ni:a.TW-t[1])-((e=e.x)[0]<0?e[1]-a.TW-a.Ni:a.TW-e[1])}},69082:function(t){"use strict";t.exports=function(t,e,r,n,i){t.location=e.location,t.z=e.z;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t.ct=a.ct,t}},69110:function(t,e,r){"use strict";var n=r(16534),i=r(15181),a=r(88191),o=r(3071),s=r(80783),l=r(76780).styleOne,u=r(93952),c=r(95304),f=r(96303),h=!0;t.exports=function(t,e,r,p,d){var v=d.barDifY,g=d.width,y=d.height,m=d.viewX,x=d.viewY,b=d.pathSlice,_=d.toMoveInsideSlice,w=d.strTransform,T=d.hasTransition,A=d.handleSlicesExit,k=d.makeUpdateSliceInterpolator,M=d.makeUpdateTextInterpolator,S={},E=t._context.staticPlot,L=t._fullLayout,C=e[0],P=C.trace,O=C.hierarchy,I=g/P._entryDepth,D=c.listPath(r.data,"id"),z=s(O.copy(),[g,y],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(z=z.filter(function(t){var e=D.indexOf(t.data.id);return-1!==e&&(t.x0=I*e,t.x1=I*(e+1),t.y0=v,t.y1=v+y,t.onPathbar=!0,!0)})).reverse(),(p=p.data(z,c.getPtId)).enter().append("g").classed("pathbar",!0),A(p,h,S,[g,y],b),p.order();var R=p;T&&(R=R.transition().each("end",function(){var e=n.select(this);c.setSliceCursor(e,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),R.each(function(s){s._x0=m(s.x0),s._x1=m(s.x1),s._y0=x(s.y0),s._y1=x(s.y1),s._hoverX=m(s.x1-Math.min(g,y)/2),s._hoverY=x(s.y1-y/2);var p=n.select(this),d=i.ensureSingle(p,"path","surface",function(t){t.style("pointer-events",E?"none":"all")});T?d.transition().attrTween("d",function(t){var e=k(t,h,S,[g,y]);return function(t){return b(e(t))}}):d.attr("d",b),p.call(f,r,t,e,{styleOne:l,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),d.call(l,s,P,t,{hovered:!1}),s._text=(c.getPtLabel(s)||"").split("
").join(" ")||"";var v=i.ensureSingle(p,"g","slicetext"),A=i.ensureSingle(v,"text","",function(t){t.attr("data-notex",1)}),C=i.ensureUniformFontSize(t,c.determineTextFont(P,s,L.font,{onPathbar:!0}));A.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,C).call(o.convertToTspans,t),s.textBB=a.bBox(A.node()),s.transform=_(s,{fontSize:C.size,onPathbar:!0}),s.transform.fontSize=C.size,T?A.transition().attrTween("transform",function(t){var e=M(t,h,S,[g,y]);return function(t){return w(e(t))}}):A.attr("transform",w(s))})}},69309:function(t,e,r){"use strict";var n=r(15181),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},69342:function(t){"use strict";t.exports=Object},69480:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,f=n*l,h=n*u,p=i*l,d=i*u,v=a*u,g=o*s,y=o*l,m=o*u;return t[0]=1-(p+v),t[1]=f+m,t[2]=h-y,t[3]=0,t[4]=f-m,t[5]=1-(c+v),t[6]=d+g,t[7]=0,t[8]=h+y,t[9]=d-g,t[10]=1-(c+p),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},69508:function(t,e,r){"use strict";t.exports=r(89811)},69543:function(t,e,r){"use strict";var n=r(16534),i=r(5159),a=[];t.exports=function(t,e){if(-1===a.indexOf(t)){a.push(t);var r=1e3;i(e)?r=e:"long"===e&&(r=3e3);var o=n.select("body").selectAll(".plotly-notifier").data([0]);o.enter().append("div").classed("plotly-notifier",!0),o.selectAll(".notifier-note").data(a).enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var i=n.select(this);i.append("button").classed("notifier-close",!0).html("×").on("click",function(){i.transition().call(s)});for(var a=i.append("p"),o=t.split(//g),l=0;l=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||u).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,u))),(i.isDark()?e?i.lighten(e):u:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e=2){var s,u,c="";if(2===o.length)for(s=0;s<2;s++)if(u=b(o[s])){c=g;break}var f=i("pattern",c);if(f===g)for(s=0;s<2;s++)(u=b(o[s]))&&(e.bounds[s]=o[s]=u-1);if(f)for(s=0;s<2;s++)switch(u=o[s],f){case g:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[s]=o[s]=u;break;case y:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[s]=o[s]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]0&&(i=S(t[a],t[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))g.Ni}).map(l)).concat((0,F.y1)((0,g.mk)(a/p)*p,i,p).filter(function(t){return(0,g.tn)(t%v)>g.Ni}).map(u))}return m.lines=function(){return x().map(function(t){return{type:"LineString",coordinates:t}})},m.outline=function(){return{type:"Polygon",coordinates:[c(n).concat(f(o).slice(1),c(r).reverse().slice(1),f(s).reverse().slice(1))]}},m.extent=function(t){return arguments.length?m.extentMajor(t).extentMinor(t):m.extentMinor()},m.extentMajor=function(t){return arguments.length?(n=+t[0][0],r=+t[1][0],s=+t[0][1],o=+t[1][1],n>r&&(t=n,n=r,r=t),s>o&&(t=s,s=o,o=t),m.precision(y)):[[n,s],[r,o]]},m.extentMinor=function(r){return arguments.length?(e=+r[0][0],t=+r[1][0],a=+r[0][1],i=+r[1][1],e>t&&(r=e,e=t,t=r),a>i&&(r=a,a=i,i=r),m.precision(y)):[[e,a],[t,i]]},m.step=function(t){return arguments.length?m.stepMajor(t).stepMinor(t):m.stepMinor()},m.stepMajor=function(t){return arguments.length?(d=+t[0],v=+t[1],m):[d,v]},m.stepMinor=function(t){return arguments.length?(h=+t[0],p=+t[1],m):[h,p]},m.precision=function(h){return arguments.length?(y=+h,l=B(a,i,90),u=N(e,t,y),c=B(s,o,90),f=N(n,r,y),m):y},m.extentMajor([[-180,-90+g.Ni],[180,90-g.Ni]]).extentMinor([[-180,-80-g.Ni],[180,80+g.Ni]])}function U(){return j()()}var V,H,q,G,Y=r(9432),W=r(86705),Z=(0,v.A)(),X=(0,v.A)(),J={point:y.A,lineStart:y.A,lineEnd:y.A,polygonStart:function(){J.lineStart=K,J.lineEnd=tt},polygonEnd:function(){J.lineStart=J.lineEnd=J.point=y.A,Z.add((0,g.tn)(X)),X.reset()},result:function(){var t=Z/2;return Z.reset(),t}};function K(){J.point=$}function $(t,e){J.point=Q,V=q=t,H=G=e}function Q(t,e){X.add(G*t-q*e),q=t,G=e}function tt(){Q(V,H)}var et,rt,nt,it,at=J,ot=r(73342),st=0,lt=0,ut=0,ct=0,ft=0,ht=0,pt=0,dt=0,vt=0,gt={point:yt,lineStart:mt,lineEnd:_t,polygonStart:function(){gt.lineStart=wt,gt.lineEnd=Tt},polygonEnd:function(){gt.point=yt,gt.lineStart=mt,gt.lineEnd=_t},result:function(){var t=vt?[pt/vt,dt/vt]:ht?[ct/ht,ft/ht]:ut?[st/ut,lt/ut]:[NaN,NaN];return st=lt=ut=ct=ft=ht=pt=dt=vt=0,t}};function yt(t,e){st+=t,lt+=e,++ut}function mt(){gt.point=xt}function xt(t,e){gt.point=bt,yt(nt=t,it=e)}function bt(t,e){var r=t-nt,n=e-it,i=(0,g.RZ)(r*r+n*n);ct+=i*(nt+t)/2,ft+=i*(it+e)/2,ht+=i,yt(nt=t,it=e)}function _t(){gt.point=yt}function wt(){gt.point=At}function Tt(){kt(et,rt)}function At(t,e){gt.point=kt,yt(et=nt=t,rt=it=e)}function kt(t,e){var r=t-nt,n=e-it,i=(0,g.RZ)(r*r+n*n);ct+=i*(nt+t)/2,ft+=i*(it+e)/2,ht+=i,pt+=(i=it*t-nt*e)*(nt+t),dt+=i*(it+e),vt+=3*i,yt(nt=t,it=e)}var Mt=gt;function St(t){this._context=t}St.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,g.FA)}},result:y.A};var Et,Lt,Ct,Pt,Ot,It=(0,v.A)(),Dt={point:y.A,lineStart:function(){Dt.point=zt},lineEnd:function(){Et&&Rt(Lt,Ct),Dt.point=y.A},polygonStart:function(){Et=!0},polygonEnd:function(){Et=null},result:function(){var t=+It;return It.reset(),t}};function zt(t,e){Dt.point=Rt,Lt=Pt=t,Ct=Ot=e}function Rt(t,e){Pt-=t,Ot-=e,It.add((0,g.RZ)(Pt*Pt+Ot*Ot)),Pt=t,Ot=e}var Ft=Dt;function Bt(){this._string=[]}function Nt(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function jt(t,e){var r,n,i=4.5;function a(t){return t&&("function"==typeof i&&n.pointRadius(+i.apply(this,arguments)),(0,m.A)(t,r(n))),n.result()}return a.area=function(t){return(0,m.A)(t,r(at)),at.result()},a.measure=function(t){return(0,m.A)(t,r(Ft)),Ft.result()},a.bounds=function(t){return(0,m.A)(t,r(ot.A)),ot.A.result()},a.centroid=function(t){return(0,m.A)(t,r(Mt)),Mt.result()},a.projection=function(e){return arguments.length?(r=null==e?(t=null,W.A):(t=e).stream,a):t},a.context=function(t){return arguments.length?(n=null==t?(e=null,new Bt):new St(e=t),"function"!=typeof i&&n.pointRadius(i),a):e},a.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(n.pointRadius(+t),+t),a):i},a.projection(t).context(e)}Bt.prototype={_radius:4.5,_circle:Nt(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Nt(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var Ut=r(76610);function Vt(t){var e=0,r=g.pi/3,n=(0,Ut.U)(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*g.F2,r=t[1]*g.F2):[e*g.uj,r*g.uj]},i}function Ht(t,e){var r=(0,g.F8)(t),n=(r+(0,g.F8)(e))/2;if((0,g.tn)(n)=.12&&i<.234&&n>=-.425&&n<-.214?s:i>=.166&&i<.234&&n>=-.214&&n<-.115?l:o).invert(t)},c.stream=function(r){return t&&e===r?t:(n=[o.stream(e=r),s.stream(r),l.stream(r)],i=n.length,t={point:function(t,e){for(var r=-1;++r0?e<-g.TW+g.Ni&&(e=-g.TW+g.Ni):e>g.TW-g.Ni&&(e=g.TW-g.Ni);var r=i/(0,g.n7)(te(e),n);return[r*(0,g.F8)(n*t),i-r*(0,g.gn)(n*t)]}return a.invert=function(t,e){var r=i-e,a=(0,g._S)(n)*(0,g.RZ)(t*t+r*r),o=(0,g.FP)(t,(0,g.tn)(r))*(0,g._S)(r);return r*n<0&&(o-=g.pi*(0,g._S)(t)*(0,g._S)(r)),[o/n,2*(0,g.rY)((0,g.n7)(i/a,1/n))-g.TW]},a}function re(){return Vt(ee).scale(109.5).parallels([30,30])}Kt.invert=function(t,e){return[t,2*(0,g.rY)((0,g.oN)(e))-g.TW]};var ne=r(77405);function ie(t,e){var r=(0,g.gn)(t),n=t===e?(0,g.F8)(t):(r-(0,g.gn)(e))/(e-t),i=r/n+t;if((0,g.tn)(n)2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)}xe.invert=(0,me.I)(function(t){return 2*(0,g.rY)(t)}),_e.invert=function(t,e){return[-e,2*(0,g.rY)((0,g.oN)(t))-g.TW]}},69943:function(t,e,r){"use strict";var n=r(16722),i=/[\n\r\u2028\u2029]/g;t.exports=function(t){var e=n(t);return null===e?"":(e.length>100&&(e=e.slice(0,99)+"…"),e=e.replace(i,function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}))}},69982:function(t,e,r){"use strict";var n=r(15181),i=r(30137).EventEmitter,a=r(93335);t.exports=function(t){var e=t.emitter||new i,r=new Promise(function(i,o){var s=window.Image,l=t.svg,u=t.format||"png";if(n.isIE()&&"svg"!==u){var c=new Error(a.MSG_IE_BAD_FORMAT);return o(c),t.promise?r:e.emit("error",c)}var f,h,p=t.canvas,d=t.scale||1,v=t.width||300,g=t.height||150,y=d*v,m=d*g,x=p.getContext("2d",{willReadFrequently:!0}),b=new s;"svg"===u||n.isSafari()?h=a.encodeSVG(l):(f=a.createBlob(l,"svg"),h=a.createObjectURL(f)),p.width=y,p.height=m,b.onload=function(){var r;switch(f=null,a.revokeObjectURL(h),"svg"!==u&&x.drawImage(b,0,0,y,m),u){case"jpeg":r=p.toDataURL("image/jpeg");break;case"png":r=p.toDataURL("image/png");break;case"webp":r=p.toDataURL("image/webp");break;case"svg":r=h;break;default:var n="Image format is not jpeg, png, svg or webp.";if(o(new Error(n)),!t.promise)return e.emit("error",n)}i(r),t.promise||e.emit("success",r)},b.onerror=function(r){if(f=null,a.revokeObjectURL(h),o(r),!t.promise)return e.emit("error",r)},b.src=h});return t.promise?r:e}},70200:function(t,e,r){"use strict";var n=r(37070);e.name="pie",e.plot=function(t,r,i,a){n.plotBasePlot(e.name,t,r,i,a)},e.clean=function(t,r,i,a){n.cleanBasePlot(e.name,t,r,i,a)}},70212:function(t,e,r){"use strict";var n=r(15181),i=r(24181),a=r(32832),o=r(64579);t.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}i(t,e,l,s)?(l("text"),l("zsmooth"),a(t,e,s,l,{prefix:"",cLetter:"z"})):e.visible=!1}},70394:function(t,e,r){"use strict";var n=r(16534),i=r(15181);function a(t){return"_"+t+"Text_minsize"}t.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=a(t),i=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=o0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var c,f=Math.floor((e-o.x0)/s.dx),h=Math.floor(Math.abs(r-o.y0)/s.dy);if(s._hasZ?c=o.z[h][f]:s._hasSource&&(c=s._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,h,1,1).data),c){var p,d=o.hi||s.hoverinfo;if(d){var v=d.split("+");-1!==v.indexOf("all")&&(v=["color"]),-1!==v.indexOf("color")&&(p=!0)}var g,y=a.colormodel[s.colormodel],m=y.colormodel||s.colormodel,x=m.length,b=s._scaler(c),_=y.suffix,w=[];(s.hovertemplate||p)&&(w.push("["+[b[0]+_[0],b[1]+_[1],b[2]+_[2]].join(", ")),4===x&&w.push(", "+b[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=m.toUpperCase()+": "+w),Array.isArray(s.hovertext)&&Array.isArray(s.hovertext[h])?g=s.hovertext[h][f]:Array.isArray(s.text)&&Array.isArray(s.text[h])&&(g=s.text[h][f]);var T=u.c2p(o.y0+(h+.5)*s.dy),A=o.x0+(f+.5)*s.dx,k=o.y0+(h+.5)*s.dy,M="["+c.slice(0,s.colormodel.length).join(", ")+"]";return[i.extendFlat(t,{index:[h,f],x0:l.c2p(o.x0+f*s.dx),x1:l.c2p(o.x0+(f+1)*s.dx),y0:T,y1:T,color:b,xVal:A,xLabelVal:A,yVal:k,yLabelVal:k,zLabelVal:M,text:g,hovertemplateLabels:{zLabel:M,colorLabel:w,"color[0]Label":b[0]+_[0],"color[1]Label":b[1]+_[1],"color[2]Label":b[2]+_[2],"color[3]Label":b[3]+_[3]}})]}}}},70919:function(t,e,r){"use strict";var n=r(27050).setGroupPositions;t.exports=function(t,e){var r,i,a=t._fullLayout,o=t._fullData,s=t.calcdata,l=e.xaxis,u=e.yaxis,c=[],f=[],h=[];for(i=0;ig.Ni?o=90:m<-g.Ni&&(i=-90),h[0]=n,h[1]=a},sphere:function(){n=-(a=180),i=-(o=90)}};function b(t,e){f.push(h=[n=t,a=t]),eo&&(o=e)}function _(t,e){var r=(0,v.jf)([t*g.F2,e*g.F2]);if(c){var l=(0,v.r8)(c,r),u=[l[1],-l[0],0],p=(0,v.r8)(u,l);(0,v.Cx)(p),p=(0,v.EV)(p);var d,y=t-s,m=y>0?1:-1,x=p[0]*g.uj*m,b=(0,g.tn)(y)>180;b^(m*so&&(o=d):b^(m*s<(x=(x+360)%360-180)&&xo&&(o=e)),b?tS(n,a)&&(a=t):S(t,a)>S(n,a)&&(n=t):a>=n?(ta&&(a=t)):t>s?S(n,t)>S(n,a)&&(a=t):S(t,a)>S(n,a)&&(n=t)}else f.push(h=[n=t,a=t]);eo&&(o=e),c=r,s=t}function w(){x.point=_}function T(){h[0]=n,h[1]=a,x.point=b,c=null}function A(t,e){if(c){var r=t-s;m.add((0,g.tn)(r)>180?r+(r>0?360:-360):r)}else l=t,u=e;d.Y7.point(t,e),_(t,e)}function k(){d.Y7.lineStart()}function M(){A(l,u),d.Y7.lineEnd(),(0,g.tn)(m)>g.Ni&&(n=-(a=180)),h[0]=n,h[1]=a,c=null}function S(t,e){return(e-=t)<0?e+360:e}function E(t,e){return t[0]-e[0]}function L(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eS(s[0],s[1])&&(s[1]=l[1]),S(l[0],s[1])>S(s[0],s[1])&&(s[0]=l[0])):u.push(s=l);for(c=-1/0,e=0,s=u[r=u.length-1];e<=r;s=l,++e)l=u[e],(p=S(s[1],l[0]))>c&&(c=p,n=l[0],a=s[1])}return f=h=null,n===1/0||i===1/0?[[NaN,NaN],[NaN,NaN]]:[[n,i],[a,o]]}},71045:function(t,e,r){"use strict";var n=r(15181),i=r(18687),a=n.deg2rad,o=n.rad2deg;t.exports=function(t,e,r){switch(i(t,r),t._id){case"x":case"radialaxis":!function(t,e){var r=e._subplot;t.setGeometry=function(){var e=t._rl[0],n=t._rl[1],i=r.innerRadius,a=(r.radius-i)/(n-e),o=i/a,s=e>n?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var r=t.type;if("linear"===r){var i=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?a(t):t}(i(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?o(t):t}(t,e))}}t.makeCalcdata=function(e,i){var a,o,s=e[i],l=e._length,u=function(r){return t.d2c(r,e.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(a=new Array(l),o=0;o=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a0,f=t._context.staticPlot;e.each(function(e){var h,p=e[0].trace,d=p.error_x||{},v=p.error_y||{};p.ids&&(h=function(t){return t.id});var g=o.hasMarkers(p)&&p.marker.maxdisplayed>0;v.visible||d.visible||(e=[]);var y=n.select(this).selectAll("g.errorbar").data(e,h);if(y.exit().remove(),e.length){d.visible||y.selectAll("path.xerror").remove(),v.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var m=y.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(y,r.layerClipId,t),y.each(function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}(t,l,u);if(!g||t.vis){var a,o=e.select("path.yerror");if(v.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var h=v.width;a="M"+(r.x-h)+","+r.yh+"h"+2*h+"m-"+h+",0V"+r.ys,r.noYS||(a+="m-"+h+",0h"+2*h),o.size()?c&&(o=o.transition().duration(s.duration).ease(s.easing)):o=e.append("path").style("vector-effect",f?"none":"non-scaling-stroke").classed("yerror",!0),o.attr("d",a)}else o.remove();var p=e.select("path.xerror");if(d.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var y=(d.copy_ystyle?v:d).width;a="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(a+="m0,-"+y+"v"+2*y),p.size()?c&&(p=p.transition().duration(s.duration).ease(s.easing)):p=e.append("path").style("vector-effect",f?"none":"non-scaling-stroke").classed("xerror",!0),p.attr("d",a)}else p.remove()}})}})}},71649:function(t){"use strict";t.exports=function(t,e,r){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),"h"===r.orientation?(t.label=t.y,t.value=t.x):(t.label=t.x,t.value=t.y),t}},71796:function(t,e,r){"use strict";var n=r(15181);t.exports=function(t,e){var r=e._scene,i={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},a={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return e._scene||((r=e._scene={}).init=function(){n.extendFlat(r,a,i)},r.init(),r.update=function(t){var e=n.repeat(t,r.count);if(r.fill2d&&r.fill2d.update(e),r.scatter2d&&r.scatter2d.update(e),r.line2d&&r.line2d.update(e),r.error2d&&r.error2d.update(e.concat(e)),r.select2d&&r.select2d.update(e),r.glText)for(var i=0;iE.uf};if(e._hasPreCompStats){var U=e[x],V=function(t){return m.d2c((e[t]||[])[r])},H=1/0,q=-1/0;for(r=0;r=E.q1&&E.q3>=E.med){var Y=V("lowerfence");E.lf=Y!==s&&Y<=E.q1?Y:p(E,C,P);var W=V("upperfence");E.uf=W!==s&&W>=E.q3?W:d(E,C,P);var Z=V("mean");E.mean=Z!==s?Z:P?o.mean(C,P):(E.q1+E.q3)/2;var X=V("sd");E.sd=Z!==s&&X>=0?X:P?o.stdev(C,P,E.mean):E.q3-E.q1,E.lo=v(E),E.uo=g(E);var J=V("notchspan");J=J!==s&&J>0?J:y(E,P),E.ln=E.med-J,E.un=E.med+J;var K=E.lf,$=E.uf;e.boxpoints&&C.length&&(K=Math.min(K,C[0]),$=Math.max($,C[P-1])),e.notched&&(K=Math.min(K,E.ln),$=Math.max($,E.un)),E.min=K,E.max=$}else{var Q;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join("\n")),Q=E.med!==s?E.med:E.q1!==s?E.q3!==s?(E.q1+E.q3)/2:E.q1:E.q3!==s?E.q3:0,E.med=Q,E.q1=E.q3=Q,E.lf=E.uf=Q,E.mean=E.sd=Q,E.ln=E.un=Q,E.min=E.max=Q}H=Math.min(H,E.min),q=Math.max(q,E.max),E.pts2=L.filter(j),M.push(E)}}e._extremes[m._id]=i.findExtremes(m,[H,q],{padded:!0})}else{var tt=m.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&it0){var ct,ft;(E={}).pos=E[_]=B[r],L=E.pts=nt[r].sort(f),P=(C=E[x]=L.map(h)).length,E.min=C[0],E.max=C[P-1],E.mean=o.mean(C,P),E.sd=o.stdev(C,P,E.mean),E.med=o.interp(C,.5),P%2&&(lt||ut)?(lt?(ct=C.slice(0,P/2),ft=C.slice(P/2+1)):ut&&(ct=C.slice(0,P/2+1),ft=C.slice(P/2)),E.q1=o.interp(ct,.5),E.q3=o.interp(ft,.5)):(E.q1=o.interp(C,.25),E.q3=o.interp(C,.75)),E.lf=p(E,C,P),E.uf=d(E,C,P),E.lo=v(E),E.uo=g(E);var ht=y(E,P);E.ln=E.med-ht,E.un=E.med+ht,at=Math.min(at,E.ln),ot=Math.max(ot,E.un),E.pts2=L.filter(j),M.push(E)}e._extremes[m._id]=i.findExtremes(m,e.notched?tt.concat([at,ot]):tt,{padded:!0})}return function(t,e){if(o.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(M[0].t={num:T[S],dPos:N,posLetter:_,valLetter:x,labels:{med:l(t,"median:"),min:l(t,"min:"),q1:l(t,"q1:"),q3:l(t,"q3:"),max:l(t,"max:"),mean:"sd"===e.boxmean?l(t,"mean ± σ:"):l(t,"mean:"),lf:l(t,"lower fence:"),uf:l(t,"upper fence:")}},T[S]++,M):[{t:{empty:!0}}]};var u={text:"tx",hovertext:"htx"};function c(t,e,r){for(var n in u)o.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(e[n][r[0]])&&(t[u[n]]=e[n][r[0]][r[1]]):t[u[n]]=e[n][r])}function f(t,e){return t.v-e.v}function h(t){return t.v}function p(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(o.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function d(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(o.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function v(t){return 4*t.q1-3*t.q3}function g(t){return 4*t.q3-3*t.q1}function y(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}},71959:function(t){"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n")}function c(t){return t+"°"}}t.exports={hoverPoints:function(t,e,r){var o=t.cd,c=o[0].trace,f=t.xa,h=t.ya,p=t.subplot,d=[],v=l+c.uid+"-circle",g=c.cluster&&c.cluster.enabled;if(g){var y=p.map.queryRenderedFeatures(null,{layers:[v]});d=y.map(function(t){return t.id})}var m=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),x=e-m;if(n.getClosest(o,function(t){var e=t.lonlat;if(e[0]===s)return 1/0;if(g&&-1===d.indexOf(t.i+1))return 1/0;var n=i.modHalf(e[0],360),a=e[1],o=p.project([n,a]),l=o.x-f.c2p([x,a]),u=o.y-h.c2p([n,r]),c=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-c,1-3/c)},t),!1!==t.index){var b=o[t.index],_=b.lonlat,w=[i.modHalf(_[0],360)+m,_[1]],T=f.c2p(w),A=h.c2p(w),k=b.mrc||1;t.x0=T-k,t.x1=T+k,t.y0=A-k,t.y1=A+k;var M={};M[c.subplot]={_subplot:p};var S=c._module.formatLabels(b,c,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=a(c,b),t.extraText=u(c,b,o[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}},getExtraText:u}},72026:function(t,e,r){"use strict";t.exports={moduleType:"component",name:"legend",layoutAttributes:r(60633),supplyLayoutDefaults:r(15614),draw:r(31122),style:r(85747)}},72028:function(t,e,r){"use strict";var n=r(24873);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},72095:function(t,e,r){"use strict";var n=r(78032),i=r(46982),a=r(9295),o=r(60609).eV,s=r(29435),l=r(93003).getFromId,u=r(26446).shouldShowZeroLine,c="splom",f={};function h(t,e,r){for(var n=r.matrixOptions.data.length,i=e._visibleDims,a=r.viewOpts.ranges=new Array(n),o=0;o0?1:t<0?-1:0},g=Math.sin,y=Math.tan,m=1e-6,x=1e-12,b=Math.PI,_=b/2,w=b/4,T=Math.SQRT1_2,A=P(2),k=P(b),M=2*b,S=180/b,E=b/180;function L(t){return t>1?_:t<-1?-_:Math.asin(t)}function C(t){return t>1?0:t<-1?b:Math.acos(t)}function P(t){return t>0?Math.sqrt(t):0}function O(t){return(l(t)-l(-t))/2}function I(t){return(l(t)+l(-t))/2}function D(t){var e=y(t/2),r=2*c(s(t/2))/(e*e);function n(t,e){var n=s(t),i=s(e),a=g(e),o=i*n,l=-((1-o?c((1+o)/2)/(1-o):-.5)+r/(1+o));return[l*i*g(t),l*a]}return n.invert=function(e,n){var a,l=P(e*e+n*n),u=-t/2,f=50;if(!l)return[0,0];do{var h=u/2,p=s(h),d=g(h),v=d/p,y=-c(i(p));u-=a=(2/v*y-r*v-l)/(-y/(d*d)+1-r/(2*p*p))*(p<0?.7:1)}while(i(a)>m&&--f>0);var x=g(u);return[o(e*x,l*s(u)),L(n*x/l)]},n}function z(){var t=_,e=(0,n.U)(D),r=e(t);return r.radius=function(r){return arguments.length?e(t=r*E):t*S},r.scale(179.976).clipAngle(147)}function R(t,e){var r=s(e),n=function(t){return t?t/Math.sin(t):1}(C(r*s(t/=2)));return[2*r*g(t)*n,g(e)*n]}function F(){return(0,n.A)(R).scale(152.63)}function B(t){var e=g(t),r=s(t),n=t>=0?1:-1,a=y(n*t),l=(1+e-r)/2;function u(t,i){var u=s(i),c=s(t/=2);return[(1+u)*g(t),(n*i>-o(c,a)-.001?0:10*-n)+l+g(i)*r-(1+u)*e*c]}return u.invert=function(t,u){var c=0,f=0,h=50;do{var p=s(c),d=g(c),v=s(f),y=g(f),x=1+v,b=x*d-t,_=l+y*r-x*e*p-u,w=x*p/2,T=-d*y,A=e*x*d/2,k=r*v+e*p*y,M=T*A-k*w,S=(_*T-b*k)/M/2,E=(b*A-_*w)/M;i(E)>2&&(E/=2),c-=S,f-=E}while((i(S)>m||i(E)>m)&&--h>0);return n*f>-o(s(c),a)-.001?[2*c,f]:null},u}function N(){var t=20*E,e=t>=0?1:-1,r=y(e*t),i=(0,n.U)(B),a=i(t),l=a.stream;return a.parallel=function(n){return arguments.length?(r=y((e=(t=n*E)>=0?1:-1)*t),i(t)):t*S},a.stream=function(n){var i=a.rotate(),u=l(n),c=(a.rotate([0,0]),l(n)),f=a.precision();return a.rotate(i),u.sphere=function(){c.polygonStart(),c.lineStart();for(var n=-180*e;e*n<180;n+=90*e)c.point(n,90*e);if(t)for(;e*(n-=3*e*f)>=-180;)c.point(n,e*-o(s(n*E/2),r)*S);c.lineEnd(),c.polygonEnd()},u},a.scale(218.695).center([0,28.0974])}function j(t,e){var r=y(e/2),n=P(1-r*r),i=1+n*s(t/=2),a=g(t)*n/i,o=r/i,l=a*a,u=o*o;return[4/3*a*(3+l-3*u),4/3*o*(3+3*l-u)]}function U(){return(0,n.A)(j).scale(66.1603)}R.invert=function(t,e){if(!(t*t+4*e*e>b*b+m)){var r=t,n=e,a=25;do{var o,l=g(r),u=g(r/2),c=s(r/2),f=g(n),h=s(n),p=g(2*n),d=f*f,v=h*h,y=u*u,x=1-v*c*c,_=x?C(h*c)*P(o=1/x):o=0,w=2*_*h*u-t,T=_*f-e,A=o*(v*y+_*h*c*d),k=o*(.5*l*p-2*_*f*u),M=.25*o*(p*u-_*f*v*l),S=o*(d*c+_*y*h),E=k*M-S*A;if(!E)break;var L=(T*k-w*S)/E,O=(w*M-T*A)/E;r-=L,n-=O}while((i(L)>m||i(O)>m)&&--a>0);return[r,n]}},j.invert=function(t,e){if(e*=3/8,!(t*=3/8)&&i(e)>1)return null;var r=1+t*t+e*e,n=P((r-P(r*r-4*e*e))/2),a=L(n)/3,l=n?function(t){return c(t+P(t*t-1))}(i(e/n))/3:function(t){return c(t+P(t*t+1))}(i(t))/3,u=s(a),f=I(l),h=f*f-u*u;return[2*v(t)*o(O(l)*u,.25-h),2*v(e)*o(f*g(a),.25+h)]};var V=P(8),H=c(1+A);function q(t,e){var r=i(e);return rx&&--u>0);return[t/(s(o)*(V-1/g(o))),v(e)*o]};var Y=r(44635);function W(t){var e=2*b/t;function r(t,r){var n=(0,Y.j)(t,r);if(i(t)>_){var a=o(n[1],n[0]),l=P(n[0]*n[0]+n[1]*n[1]),u=e*d((a-_)/e)+_,c=o(g(a-=u),2-s(a));a=u+L(b/l*g(c))-c,n[0]=l*s(a),n[1]=l*g(a)}return n}return r.invert=function(t,r){var n=P(t*t+r*r);if(n>_){var i=o(r,t),l=e*d((i-_)/e)+_,u=i>l?-1:1,c=n*s(l-i),f=1/y(u*C((c-b)/P(b*(b-2*c)+n*n)));i=l+2*a((f+u*P(f*f-3))/3),t=n*s(i),r=n*g(i)}return Y.j.invert(t,r)},r}function Z(){var t=5,e=(0,n.U)(W),r=e(t),i=r.stream,a=.01,l=-s(a*E),u=g(a*E);return r.lobes=function(r){return arguments.length?e(t=+r):t},r.stream=function(e){var n=r.rotate(),c=i(e),f=(r.rotate([0,0]),i(e));return r.rotate(n),c.sphere=function(){f.polygonStart(),f.lineStart();for(var e=0,r=360/t,n=2*b/t,i=90-180/t,c=_;e0&&i(n)>m);return s<0?NaN:r}function tt(t,e,r){return void 0===e&&(e=40),void 0===r&&(r=x),function(n,a,o,s){var l,u,c;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var f=0;fl)o-=u/=2,s-=c/=2;else{l=v;var g=(o>0?-1:1)*r,y=(s>0?-1:1)*r,m=t(o+g,s),x=t(o,s+y),b=(m[0]-h[0])/g,_=(m[1]-h[1])/g,w=(x[0]-h[0])/y,T=(x[1]-h[1])/y,A=T*b-_*w,k=(i(A)<.5?.5:1)/A;if(o+=u=(d*w-p*T)*k,s+=c=(p*_-d*b)*k,i(u)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return e.invert=tt(e),e}function rt(){return(0,n.A)(et()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function nt(t,e){var r,n=t*g(e),a=30;do{e-=r=(e+g(e)-n)/(1+s(e))}while(i(r)>m&&--a>0);return e/2}function it(t,e,r){function n(n,i){return[t*n*s(i=nt(r,i)),e*g(i)]}return n.invert=function(n,i){return i=L(i/e),[n/(t*s(i)),L((2*i+g(2*i))/r)]},n}K.invert=function(t,e){var r=2*L(e/2);return[t*s(r/2)/s(r),r]};var at=it(A/_,A,b);function ot(){return(0,n.A)(at).scale(169.529)}var st=2.00276,lt=1.11072;function ut(t,e){var r=nt(b,e);return[st*t/(1/s(e)+lt/s(r)),(e+A*g(r))/st]}function ct(){return(0,n.A)(ut).scale(160.857)}function ft(t){var e=0,r=(0,n.U)(t),i=r(e);return i.parallel=function(t){return arguments.length?r(e=t*E):e*S},i}function ht(t,e){return[t*s(e),e]}function pt(){return(0,n.A)(ht).scale(152.63)}function dt(t){if(!t)return ht;var e=1/y(t);function r(r,n){var i=e+t-n,a=i?r*s(n)/i:i;return[i*g(a),e-i*s(a)]}return r.invert=function(r,n){var i=P(r*r+(n=e-n)*n),a=e+t-i;return[i/s(a)*o(r,n),a]},r}function vt(){return ft(dt).scale(123.082).center([0,26.1441]).parallel(45)}function gt(t){function e(e,r){var n=_-r,i=n?e*t*g(n)/n:n;return[n*g(i)/t,_-n*s(i)]}return e.invert=function(e,r){var n=e*t,i=_-r,a=P(n*n+i*i),s=o(n,i);return[(a?a/g(a):1)*s/t,_-a]},e}function yt(){var t=.5,e=(0,n.U)(gt),r=e(t);return r.fraction=function(r){return arguments.length?e(t=+r):t},r.scale(158.837)}ut.invert=function(t,e){var r,n,a=st*e,o=e<0?-w:w,l=25;do{n=a-A*g(o),o-=r=(g(2*o)+2*o-b*g(n))/(2*s(2*o)+2+b*s(n)*A*s(o))}while(i(r)>m&&--l>0);return n=a-A*g(o),[t*(1/s(n)+lt/s(o))/st,n]},ht.invert=function(t,e){return[t/s(e),e]};var mt=it(1,4/b,b);function xt(){return(0,n.A)(mt).scale(152.63)}var bt=r(43623),_t=r(97469);function wt(t,e,r,n,a,l){var u,c=s(l);if(i(t)>1||i(l)>1)u=C(r*a+e*n*c);else{var f=g(t/2),h=g(l/2);u=2*L(P(f*f+e*n*h*h))}return i(u)>m?[u,o(n*g(l),e*a-r*n*c)]:[0,0]}function Tt(t,e,r){return C((t*t+e*e-r*r)/(2*t*e))}function At(t){return t-2*b*u((t+b)/(2*b))}function kt(t,e,r){for(var n,i=[[t[0],t[1],g(t[1]),s(t[1])],[e[0],e[1],g(e[1]),s(e[1])],[r[0],r[1],g(r[1]),s(r[1])]],a=i[2],o=0;o<3;++o,a=n)n=i[o],a.v=wt(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=Tt(i[0].v[0],i[2].v[0],i[1].v[0]),u=Tt(i[0].v[0],i[1].v[0],i[2].v[0]),c=b-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var f=[i[2].point[0]=i[0].point[0]+i[2].v[0]*s(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*g(l))];return function(t,e){var r,n=g(e),a=s(e),o=new Array(3);for(r=0;r<3;++r){var l=i[r];if(o[r]=wt(e-l[1],l[3],l[2],a,n,t-l[0]),!o[r][0])return l.point;o[r][1]=At(o[r][1]-l.v[1])}var h=f.slice();for(r=0;r<3;++r){var p=2==r?0:r+1,d=Tt(i[r].v[0],o[r][0],o[p][0]);o[r][1]<0&&(d=-d),r?1==r?(d=u-d,h[0]-=o[r][0]*s(d),h[1]-=o[r][0]*g(d)):(d=c-d,h[0]+=o[r][0]*s(d),h[1]+=o[r][0]*g(d)):(h[0]+=o[r][0]*s(d),h[1]-=o[r][0]*g(d))}return h[0]/=3,h[1]/=3,h}}function Mt(t){return t[0]*=E,t[1]*=E,t}function St(){return Et([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function Et(t,e,r){var i=(0,bt.A)({type:"MultiPoint",coordinates:[t,e,r]}),a=[-i[0],-i[1]],o=(0,_t.A)(a),s=kt(Mt(o(t)),Mt(o(e)),Mt(o(r)));s.invert=tt(s);var l=(0,n.A)(s).rotate(a),u=l.center;return delete l.rotate,l.center=function(t){return arguments.length?u(o(t)):o.invert(u())},l.clipAngle(90)}function Lt(t,e){var r=P(1-g(e));return[2/k*t*r,k*(1-r)]}function Ct(){return(0,n.A)(Lt).scale(95.6464).center([0,30])}function Pt(t){var e=y(t);function r(t,r){return[t,(t?t/g(t):1)*(g(r)*s(t)-e*s(r))]}return r.invert=e?function(t,r){t&&(r*=g(t)/t);var n=s(t);return[t,2*o(P(n*n+e*e-r*r)-n,e-r)]}:function(t,e){return[t,L(t?e*y(t)/t:e)]},r}function Ot(){return ft(Pt).scale(249.828).clipAngle(90)}Lt.invert=function(t,e){var r=(r=e/k-1)*r;return[r>0?t*P(b/r)/2:0,L(1-r)]};var It=P(3);function Dt(t,e){return[It*t*(2*s(2*e/3)-1)/k,It*k*g(e/3)]}function zt(){return(0,n.A)(Dt).scale(156.19)}function Rt(t){var e=s(t);function r(t,r){return[t*e,g(r)/e]}return r.invert=function(t,r){return[t/e,L(r*e)]},r}function Ft(){return ft(Rt).parallel(38.58).scale(195.044)}function Bt(t){var e=s(t);function r(t,r){return[t*e,(1+e)*y(r/2)]}return r.invert=function(t,r){return[t/e,2*a(r/(1+e))]},r}function Nt(){return ft(Bt).scale(124.75)}function jt(t,e){var r=P(8/(3*b));return[r*t*(1-i(e)/b),r*e]}function Ut(){return(0,n.A)(jt).scale(165.664)}function Vt(t,e){var r=P(4-3*g(i(e)));return[2/P(6*b)*t*r,v(e)*P(2*b/3)*(2-r)]}function Ht(){return(0,n.A)(Vt).scale(165.664)}function qt(t,e){var r=P(b*(4+b));return[2/r*t*(1+P(1-4*e*e/(b*b))),4/r*e]}function Gt(){return(0,n.A)(qt).scale(180.739)}function Yt(t,e){var r=(2+_)*g(e);e/=2;for(var n=0,a=1/0;n<10&&i(a)>m;n++){var o=s(e);e-=a=(e+g(e)*(o+2)-r)/(2*o*(1+o))}return[2/P(b*(4+b))*t*(1+s(e)),2*P(b/(4+b))*g(e)]}function Wt(){return(0,n.A)(Yt).scale(180.739)}function Zt(t,e){return[t*(1+s(e))/P(2+b),2*e/P(2+b)]}function Xt(){return(0,n.A)(Zt).scale(173.044)}function Jt(t,e){for(var r=(1+_)*g(e),n=0,a=1/0;n<10&&i(a)>m;n++)e-=a=(e+g(e)-r)/(1+s(e));return r=P(2+b),[t*(1+s(e))/r,2*e/r]}function Kt(){return(0,n.A)(Jt).scale(173.044)}Dt.invert=function(t,e){var r=3*L(e/(It*k));return[k*t/(It*(2*s(2*r/3)-1)),r]},jt.invert=function(t,e){var r=P(8/(3*b)),n=e/r;return[t/(r*(1-i(n)/b)),n]},Vt.invert=function(t,e){var r=2-i(e)/P(2*b/3);return[t*P(6*b)/(2*r),v(e)*L((4-r*r)/3)]},qt.invert=function(t,e){var r=P(b*(4+b))/2;return[t*r/(1+P(1-e*e*(4+b)/(4*b))),e*r/2]},Yt.invert=function(t,e){var r=e*P((4+b)/b)/2,n=L(r),i=s(n);return[t/(2/P(b*(4+b))*(1+i)),L((n+r*(i+2))/(2+_))]},Zt.invert=function(t,e){var r=P(2+b),n=e*r/2;return[r*t/(1+s(n)),n]},Jt.invert=function(t,e){var r=1+_,n=P(r/2);return[2*t*n/(1+s(e*=n)),L((e+g(e))/r)]};var $t=3+2*A;function Qt(t,e){var r=g(t/=2),n=s(t),i=P(s(e)),o=s(e/=2),l=g(e)/(o+A*n*i),u=P(2/(1+l*l)),f=P((A*o+(n+r)*i)/(A*o+(n-r)*i));return[$t*(u*(f-1/f)-2*c(f)),$t*(u*l*(f+1/f)-2*a(l))]}function te(){return(0,n.A)(Qt).scale(62.5271)}Qt.invert=function(t,e){if(!(r=j.invert(t/1.2,1.065*e)))return null;var r,n=r[0],o=r[1],l=20;t/=$t,e/=$t;do{var u=n/2,p=o/2,d=g(u),v=s(u),y=g(p),x=s(p),b=s(o),w=P(b),k=y/(x+A*v*w),M=k*k,S=P(2/(1+M)),E=(A*x+(v+d)*w)/(A*x+(v-d)*w),L=P(E),C=L-1/L,O=L+1/L,I=S*C-2*c(L)-t,D=S*k*O-2*a(k)-e,z=y&&T*w*d*M/y,R=(A*v*x+w)/(2*(x+A*v*w)*(x+A*v*w)*w),F=-.5*k*S*S*S,B=F*z,N=F*R,U=(U=2*x+A*w*(v-d))*U*L,V=(A*v*x*w+b)/U,H=-A*d*y/(w*U),q=C*B-2*V/L+S*(V+V/E),G=C*N-2*H/L+S*(H+H/E),Y=k*O*B-2*z/(1+M)+S*O*z+S*k*(V-V/E),W=k*O*N-2*R/(1+M)+S*O*R+S*k*(H-H/E),Z=G*Y-W*q;if(!Z)break;var X=(D*G-I*W)/Z,J=(I*Y-D*q)/Z;n-=X,o=f(-_,h(_,o-J))}while((i(X)>m||i(J)>m)&&--l>0);return i(i(o)-_)n){var h=P(f),p=o(c,u),v=r*d(p/r),y=p-v,x=t*s(y),w=(t*g(y)-y*g(x))/(_-x),T=de(y,w),A=(b-t)/ve(T,x,b);u=h;var k,M=50;do{u-=k=(t+ve(T,x,u)*A-h)/(T(u)*A)}while(i(k)>m&&--M>0);c=y*g(u),u<_&&(c-=w*(u-_));var S=g(v),E=s(v);l[0]=u*E-c*S,l[1]=u*S+c*E}return l}return a.invert=function(e,a){var l=e*e+a*a;if(l>n){var u=P(l),c=o(a,e),f=r*d(c/r),h=c-f;e=u*s(h),a=u*g(h);for(var p=e-_,v=g(e),y=a/v,m=e<_?1/0:0,w=10;;){var T=t*g(y),A=t*s(y),k=g(A),M=_-A,S=(T-y*k)/M,E=de(y,S);if(i(m)m||i(p)>m)&&--y>0);return[d,v]},c}var me=ye(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function xe(){return(0,n.A)(me).scale(149.995)}var be=ye(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function _e(){return(0,n.A)(be).scale(153.93)}var we=ye(5/6*b,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Te(){return(0,n.A)(we).scale(130.945)}function Ae(t,e){var r=t*t,n=e*e;return[t*(1-.162388*n)*(.87-952426e-9*r*r),e*(1+n/12)]}function ke(){return(0,n.A)(Ae).scale(131.747)}Ae.invert=function(t,e){var r,n=t,a=e,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-e)/(1+s/4)}while(i(r)>m&&--o>0);o=50,t/=1-.162388*s;do{var l=(l=n*n)*l;n-=r=(n*(.87-952426e-9*l)-t)/(.87-.00476213*l)}while(i(r)>m&&--o>0);return[n,a]};var Me=ye(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Se(){return(0,n.A)(Me).scale(131.087)}function Ee(t){var e=t(_,0)[0]-t(-_,0)[0];function r(r,n){var i=r>0?-.5:.5,a=t(r+i*b,n);return a[0]-=i*e,a}return t.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=t.invert(r+i*e,n),o=a[0]-i*b;return o<-b?o+=2*b:o>b&&(o-=2*b),a[0]=o,a}),r}function Le(t,e){var r=v(t),n=v(e),a=s(e),l=s(t)*a,u=g(t)*a,c=g(n*e);t=i(o(u,c)),e=L(l),i(t-_)>m&&(t%=_);var f=function(t,e){if(e===_)return[0,0];var r,n,a=g(e),o=a*a,l=o*o,u=1+l,c=1+3*l,f=1-l,h=L(1/P(u)),p=f+o*u*h,d=(1-a)/p,v=P(d),y=d*u,x=P(y),w=v*f;if(0===t)return[0,-(w+o*x)];var T,A=s(e),k=1/A,M=2*a*A,S=(-p*A-(1-a)*((-3*o+h*c)*M))/(p*p),E=-k*M,C=-k*(o*u*S+d*c*M),O=-2*k*(f*(.5*S/v)-2*o*v*M),I=4*t/b;if(t>.222*b||e.175*b){if(r=(w+o*P(y*(1+l)-w*w))/(1+l),t>b/4)return[r,r];var D=r,z=.5*r;r=.5*(z+D),n=50;do{var R=r*(O+E*P(y-r*r))+C*L(r/x)-I;if(!R)break;R<0?z=r:D=r,r=.5*(z+D)}while(i(D-z)>m&&--n>0)}else{r=m,n=25;do{var F=r*r,B=P(y-F),N=O+E*B,j=r*N+C*L(r/x)-I;r-=T=B?j/(N+(C-E*F)/B):0}while(i(T)>m&&--n>0)}return[r,-w-o*P(y-r*r)]}(t>b/4?_-t:t,e);return t>b/4&&(c=f[0],f[0]=-f[1],f[1]=-c),f[0]*=r,f[1]*=-n,f}function Ce(){return(0,n.A)(Ee(Le)).scale(239.75)}function Pe(t,e){var r,n,o,u,c,f;if(e=1-m)return r=(1-e)/4,o=1/(n=I(t)),[(u=((f=l(2*(f=t)))-1)/(f+1))+r*((c=n*O(t))-t)/(n*n),o-r*u*o*(c-t),o+r*u*o*(c+t),2*a(l(t))-_+r*(c-t)/n];var h=[1,0,0,0,0,0,0,0,0],p=[P(e),0,0,0,0,0,0,0,0],d=0;for(n=P(1-e),c=1;i(p[d]/h[d])>m&&d<8;)r=h[d++],p[d]=(r-n)/2,h[d]=(r+n)/2,n=P(r*n),c*=2;o=c*h[d]*t;do{o=(L(u=p[d]*g(n=o)/h[d])+o)/2}while(--d);return[g(o),u=s(o),u/s(o-n),o]}function Oe(t,e){if(!e)return t;if(1===e)return c(y(t/2+w));for(var r=1,n=P(1-e),o=P(e),s=0;i(o)>m;s++){if(t%b){var l=a(n*y(t)/r);l<0&&(l+=b),t+=l+~~(t/b)*b}else t+=t;o=(r+n)/2,n=P(r*n),o=((r=o)-n)/2}return t/(p(2,s)*r)}function Ie(t,e){var r=(A-1)/(A+1),n=P(1-r*r),u=Oe(_,n*n),f=c(y(b/4+i(e)/2)),h=l(-1*f)/P(r),p=function(t,e){var r=t*t,n=e+1,i=1-r-e*e;return[.5*((t>=0?_:-_)-o(i,2*t)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(h*s(-1*t),h*g(-1*t)),d=function(t,e,r){var n=i(t),o=O(i(e));if(n){var s=1/g(n),l=1/(y(n)*y(n)),u=-(l+r*(o*o*s*s)-1+r),c=(-u+P(u*u-(r-1)*l*4))/2;return[Oe(a(1/P(c)),r)*v(t),Oe(a(P((c/l-1)/r)),1-r)*v(e)]}return[0,Oe(a(o),1-r)*v(e)]}(p[0],p[1],n*n);return[-d[1],(e>=0?1:-1)*(.5*u-d[0])]}function De(){return(0,n.A)(Ee(Ie)).scale(151.496)}Le.invert=function(t,e){i(t)>1&&(t=2*v(t)-t),i(e)>1&&(e=2*v(e)-e);var r=v(t),n=v(e),a=-r*t,l=-n*e,u=l/a<1,c=function(t,e){for(var r=0,n=1,a=.5,o=50;;){var l=a*a,u=P(a),c=L(1/P(1+l)),f=1-l+a*(1+l)*c,h=(1-u)/f,p=P(h),d=h*(1+l),v=p*(1-l),g=P(d-t*t),y=e+v+a*g;if(i(n-r)0?r=a:n=a,a=.5*(r+n)}if(!o)return null;var m=L(u),_=s(m),w=1/_,T=2*u*_,A=(-f*_-(-3*a+c*(1+3*l))*T*(1-u))/(f*f);return[b/4*(t*(-2*w*((1-l)*(.5*A/p)-2*a*p*T)+-w*T*g)+-w*(a*(1+l)*A+h*(1+3*l)*T)*L(t/P(d))),m]}(u?l:a,u?a:l),f=c[0],h=c[1],p=s(h);return u&&(f=-_-f),[r*(o(g(f)*p,-g(h))+b),n*L(s(f)*p)]},Ie.invert=function(t,e){var r,n,i,s,u,f,h=(A-1)/(A+1),p=P(1-h*h),d=(n=-t,i=p*p,(r=.5*Oe(_,p*p)-e)?(s=Pe(r,i),n?(f=(u=Pe(n,1-i))[1]*u[1]+i*s[0]*s[0]*u[0]*u[0],[[s[0]*u[2]/f,s[1]*s[2]*u[0]*u[1]/f],[s[1]*u[1]/f,-s[0]*s[2]*u[0]*u[2]/f],[s[2]*u[1]*u[2]/f,-i*s[0]*s[1]*u[0]/f]]):[[s[0],0],[s[1],0],[s[2],0]]):[[0,(u=Pe(n,1-i))[0]/u[1]],[1/u[1],0],[u[2]/u[1],0]]),v=function(t,e){var r=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/r,(t[1]*e[0]-t[0]*e[1])/r]}(d[0],d[1]);return[o(v[1],v[0])/-1,2*a(l(-.5*c(h*v[0]*v[0]+h*v[1]*v[1])))-_]};var ze=r(29752);function Re(t){var e=g(t),r=s(t),n=Fe(t);function a(t,a){var o=n(t,a);t=o[0],a=o[1];var l=g(a),u=s(a),c=s(t),f=C(e*l+r*u*c),h=g(f),p=i(h)>m?f/h:1;return[p*r*g(t),(i(t)>_?p:-p)*(e*u-r*l*c)]}return n.invert=Fe(-t),a.invert=function(t,r){var i=P(t*t+r*r),a=-g(i),l=s(i),u=i*l,c=-r*a,f=i*e,h=P(u*u+c*c-f*f),p=o(u*f+c*h,c*f-u*h),d=(i>_?-1:1)*o(t*a,i*s(p)*l+r*g(p)*a);return n.invert(d,p)},a}function Fe(t){var e=g(t),r=s(t);return function(t,n){var i=s(n),a=s(t)*i,l=g(t)*i,u=g(n);return[o(l,a*r-u*e),L(u*r+a*e)]}}function Be(){var t=0,e=(0,n.U)(Re),r=e(t),i=r.rotate,a=r.stream,o=(0,ze.A)();return r.parallel=function(n){if(!arguments.length)return t*S;var i=r.rotate();return e(t=n*E).rotate(i)},r.rotate=function(e){return arguments.length?(i.call(r,[e[0],e[1]-t*S]),o.center([-e[0],-e[1]]),r):((e=i.call(r))[1]+=t*S,e)},r.stream=function(t){return(t=a(t)).sphere=function(){t.polygonStart();var e,r=o.radius(89.99)().coordinates[0],n=r.length-1,i=-1;for(t.lineStart();++i=0;)t.point((e=r[i])[0],e[1]);t.lineEnd(),t.polygonEnd()},t},r.scale(79.4187).parallel(45).clipAngle(179.999)}var Ne=r(22208),je=r(98683),Ue=L(1-1/3)*S,Ve=Rt(0);function He(t){var e=Ue*E,r=Lt(b,e)[0]-Lt(-b,e)[0],n=Ve(0,e)[1],a=Lt(0,e)[1],o=k-a,s=M/t,l=4/M,c=n+o*o*4/M;function p(p,d){var v,g=i(d);if(g>e){var y=h(t-1,f(0,u((p+b)/s)));(v=Lt(p+=b*(t-1)/t-y*s,g))[0]=v[0]*M/r-M*(t-1)/(2*t)+y*M/t,v[1]=n+4*(v[1]-a)*o/M,d<0&&(v[1]=-v[1])}else v=Ve(p,d);return v[0]*=l,v[1]/=c,v}return p.invert=function(e,p){e/=l;var d=i(p*=c);if(d>n){var v=h(t-1,f(0,u((e+b)/s)));e=(e+b*(t-1)/t-v*s)*r/M;var g=Lt.invert(e,.25*(d-n)*M/o+a);return g[0]-=b*(t-1)/t-v*s,p<0&&(g[1]=-g[1]),g}return Ve.invert(e,p)},p}function qe(t,e){return[t,1&e?90-m:Ue]}function Ge(t,e){return[t,1&e?-90+m:-Ue]}function Ye(t){return[t[0]*(1-m),t[1]]}function We(){var t=4,e=(0,n.U)(He),r=e(t),i=r.stream;return r.lobes=function(r){return arguments.length?e(t=+r):t},r.stream=function(e){var n=r.rotate(),a=i(e),o=(r.rotate([0,0]),i(e));return r.rotate(n),a.sphere=function(){var e,r;(0,je.A)((e=180/t,r=[].concat((0,Ne.y1)(-180,180+e/2,e).map(qe),(0,Ne.y1)(180,-180-e/2,-e).map(Ge)),{type:"Polygon",coordinates:[180===e?r.map(Ye):r]}),o)},a},r.scale(239.75)}function Ze(t){var e,r=1+t,n=L(g(1/r)),a=2*P(b/(e=b+4*n*r)),l=.5*a*(r+P(t*(2+t))),u=t*t,c=r*r;function f(f,h){var p,d,v=1-g(h);if(v&&v<2){var y,m=_-h,w=25;do{var T=g(m),A=s(m),k=n+o(T,r-A),M=1+c-2*r*A;m-=y=(m-u*n-r*T+M*k-.5*v*e)/(2*r*T*k)}while(i(y)>x&&--w>0);p=a*P(M),d=f*k/b}else p=a*(t+v),d=f*n/b;return[p*g(d),l-p*s(d)]}return f.invert=function(t,i){var s=t*t+(i-=l)*i,f=(1+c-s/(a*a))/(2*r),h=C(f),p=g(h),d=n+o(p,r-f);return[L(t/P(s))*b/d,L(1-2*(h-u*n-r*p+(1+c-2*r*f)*d)/e)]},f}function Xe(){var t=1,e=(0,n.U)(Ze),r=e(t);return r.ratio=function(r){return arguments.length?e(t=+r):t},r.scale(167.774).center([0,18.67])}var Je=.7109889596207567,Ke=.0528035274542;function $e(t,e){return e>-Je?((t=at(t,e))[1]+=Ke,t):ht(t,e)}function Qe(){return(0,n.A)($e).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function tr(t,e){return i(e)>Je?((t=at(t,e))[1]-=e>0?Ke:-Ke,t):ht(t,e)}function er(){return(0,n.A)(tr).scale(152.63)}function rr(t,e,r,n){var i=P(4*b/(2*r+(1+t-e/2)*g(2*r)+(t+e)/2*g(4*r)+e/2*g(6*r))),a=P(n*g(r)*P((1+t*s(2*r)+e*s(4*r))/(1+t+e))),o=r*u(1);function l(r){return P(1+t*s(2*r)+e*s(4*r))}function u(n){var i=n*r;return(2*i+(1+t-e/2)*g(2*i)+(t+e)/2*g(4*i)+e/2*g(6*i))/r}function c(t){return l(t)*g(t)}var f=function(t,e){var n=r*Q(u,o*g(e)/r,e/b);isNaN(n)&&(n=r*v(e));var c=i*l(n);return[c*a*t/b*s(n),c/a*g(n)]};return f.invert=function(t,e){var n=Q(c,e*a/i);return[t*b/(s(n)*i*a*l(n)),L(r*u(n/r)/o)]},0===r&&(i=P(n/b),(f=function(t,e){return[t*i,g(e)/i]}).invert=function(t,e){return[t/i,L(e*i)]}),f}function nr(){var t=1,e=0,r=45*E,i=2,a=(0,n.U)(rr),o=a(t,e,r,i);return o.a=function(n){return arguments.length?a(t=+n,e,r,i):t},o.b=function(n){return arguments.length?a(t,e=+n,r,i):e},o.psiMax=function(n){return arguments.length?a(t,e,r=+n*E,i):r*S},o.ratio=function(n){return arguments.length?a(t,e,r,i=+n):i},o.scale(180.739)}function ir(t,e,r,n,i,a,o,s,l,u,c){if(c.nanEncountered)return NaN;var f,h,p,d,v,g,y,m,x,b;if(h=t(e+.25*(f=r-e)),p=t(r-.25*f),isNaN(h))c.nanEncountered=!0;else{if(!isNaN(p))return b=((g=(d=f*(n+4*h+i)/12)+(v=f*(i+4*p+a)/12))-o)/15,u>l?(c.maxDepthCount++,g+b):Math.abs(b)t?r=n:e=n,n=e+r>>1}while(n>e);var i=u[n+1]-u[n];return i&&(i=(t-u[n+1])/i),(n+1+i)/s}var h=2*f(1)/b*o/r,d=function(t,e){var r=f(i(g(e))),a=n(r)*t;return r/=h,[a,e>=0?r:-r]};return d.invert=function(t,e){var r;return i(e*=h)<1&&(r=v(e)*L(a(i(e))*o)),[t/n(i(e)),r]},d}function sr(){var t=0,e=2.5,r=1.183136,i=(0,n.U)(or),a=i(t,e,r);return a.alpha=function(n){return arguments.length?i(t=+n,e,r):t},a.k=function(n){return arguments.length?i(t,e=+n,r):e},a.gamma=function(n){return arguments.length?i(t,e,r=+n):r},a.scale(152.63)}function lr(t,e){return i(t[0]-e[0])a[o][2][0];++o);var l=t(r-a[o][1][0],n);return l[0]+=t(a[o][1][0],i*n>i*a[o][0][1]?a[o][0][1]:n)[0],l}r?o.invert=r(o):t.invert&&(o.invert=function(r,n){for(var i=a[+(n<0)],s=e[+(n<0)],l=0,u=i.length;l=0;--s)r=(e=t[1][s])[0][0],n=e[0][1],i=e[1][1],a=e[2][0],o=e[2][1],l.push(ur([[a-m,o-m],[a-m,i+m],[r+m,i+m],[r+m,n-m]],30));return{type:"Polygon",coordinates:[(0,Ne.Am)(l)]}}(r),e=r.map(function(t){return t.map(function(t){return[[t[0][0]*E,t[0][1]*E],[t[1][0]*E,t[1][1]*E],[t[2][0]*E,t[2][1]*E]]})}),a=e.map(function(e){return e.map(function(e){var r,n=t(e[0][0],e[0][1])[0],i=t(e[2][0],e[2][1])[0],a=t(e[1][0],e[0][1])[1],o=t(e[1][0],e[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})}),s):e.map(function(t){return t.map(function(t){return[[t[0][0]*S,t[0][1]*S],[t[1][0]*S,t[1][1]*S],[t[2][0]*S,t[2][1]*S]]})})},null!=e&&s.lobes(e),s}$e.invert=function(t,e){return e>-Je?at.invert(t,e-Ke):ht.invert(t,e)},tr.invert=function(t,e){return i(e)>Je?at.invert(t,e+(e>0?Ke:-Ke)):ht.invert(t,e)};var fr=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function hr(){return cr(ut,fr).scale(160.857)}var pr=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function dr(){return cr(tr,pr).scale(152.63)}var vr=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function gr(){return cr(at,vr).scale(169.529)}var yr=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function mr(){return cr(at,yr).scale(169.529).rotate([20,0])}var xr=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function br(){return cr($e,xr,tt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var _r=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function wr(){return cr(ht,_r).scale(152.63).rotate([-20,0])}function Tr(t,e){return[3/M*t*P(b*b/3-e*e),e]}function Ar(){return(0,n.A)(Tr).scale(158.837)}function kr(t){function e(e,r){if(i(i(r)-_)2)return null;var a=(e/=2)*e,s=(r/=2)*r,l=2*r/(1+a+s);return l=p((1+l)/(1-l),1/t),[o(2*e,1-a-s)/t,L((l-1)/(l+1))]},e}function Mr(){var t=.5,e=(0,n.U)(kr),r=e(t);return r.spacing=function(r){return arguments.length?e(t=+r):t},r.scale(124.75)}Tr.invert=function(t,e){return[M/3*t/P(b*b/3-e*e),e]};var Sr=b/A;function Er(t,e){return[t*(1+P(s(e)))/2,e/(s(e/2)*s(t/6))]}function Lr(){return(0,n.A)(Er).scale(97.2672)}function Cr(t,e){var r=t*t,n=e*e;return[t*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),e*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function Pr(){return(0,n.A)(Cr).scale(139.98)}function Or(t,e){return[g(t)/s(e),y(e)*s(t)]}function Ir(){return(0,n.A)(Or).scale(144.049).clipAngle(89.999)}function Dr(t){var e=s(t),r=y(w+t/2);function n(n,a){var o=a-t,s=i(o)=0;)h=(f=t[c])[0]+l*(i=h)-u*p,p=f[1]+l*p+u*i;return[h=l*(i=h)-u*p,p=l*p+u*i]}return r.invert=function(r,n){var l=20,u=r,c=n;do{for(var f,h=e,p=t[h],d=p[0],v=p[1],y=0,x=0;--h>=0;)y=d+u*(f=y)-c*x,x=v+u*x+c*f,d=(p=t[h])[0]+u*(f=d)-c*v,v=p[1]+u*v+c*f;var b,_,w=(y=d+u*(f=y)-c*x)*y+(x=v+u*x+c*f)*x;u-=b=((d=u*(f=d)-c*v-r)*y+(v=u*v+c*f-n)*x)/w,c-=_=(v*y-d*x)/w}while(i(b)+i(_)>m*m&&--l>0);if(l){var T=P(u*u+c*c),A=2*a(.5*T),k=g(A);return[o(u*k,T*s(A)),T?L(c*k/T):0]}},r}Er.invert=function(t,e){var r=i(t),n=i(e),a=m,o=_;nm||i(x)>m)&&--a>0);return a&&[r,n]},Or.invert=function(t,e){var r=t*t,n=e*e+1,i=r+n,a=t?T*P((i-P(i*i-4*r))/r):1/P(n);return[L(t*a),v(e)*C(a)]},Rr.invert=function(t,e){return[t,2.5*a(l(.8*e))-.625*b]};var Nr=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],jr=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Ur=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Vr=[[.9245,0],[0,0],[.01943,0]],Hr=[[.721316,0],[0,0],[-.00881625,-.00617325]];function qr(){return Xr(Nr,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Gr(){return Xr(jr,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Yr(){return Xr(Ur,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Wr(){return Xr(Vr,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Zr(){return Xr(Hr,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Xr(t,e){var r=(0,n.A)(Br(t)).rotate(e).clipAngle(90),i=(0,_t.A)(e),a=r.center;return delete r.rotate,r.center=function(t){return arguments.length?a(i(t)):i.invert(a())},r}var Jr=P(6),Kr=P(7);function $r(t,e){var r=L(7*g(e)/(3*Jr));return[Jr*t*(2*s(2*r/3)-1)/Kr,9*g(r/3)/Kr]}function Qr(){return(0,n.A)($r).scale(164.859)}function tn(t,e){for(var r,n=(1+T)*g(e),a=e,o=0;o<25&&(a-=r=(g(a/2)+g(a)-n)/(.5*s(a/2)+s(a)),!(i(r)x&&--l>0);return[t/(.84719-.13063*(n=s*s)+(o=n*(a=n*n))*o*(.05494*n-.04515-.02326*a+.00331*o)),s]},ln.invert=function(t,e){for(var r=e/2,n=0,a=1/0;n<10&&i(a)>m;++n){var o=s(e/2);e-=a=(e-y(e/2)-r)/(1-.5/(o*o))}return[2*t/(1+s(e)),e]};var cn=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function fn(){return cr(J(1/0),cn).rotate([20,0]).scale(152.63)}function hn(t,e){var r=g(e),n=s(e),a=v(t);if(0===t||i(e)===_)return[0,e];if(0===e)return[t,0];if(i(t)===_)return[t*n,_*r];var o=b/(2*t)-2*t/b,l=2*e/b,u=(1-l*l)/(r-l),c=o*o,f=u*u,h=1+c/f,p=1+f/c,d=(o*r/u-o/2)/h,y=(f*r/c+u/2)/p,m=y*y-(f*r*r/c+u*r-1)/p;return[_*(d+P(d*d+n*n/h)*a),_*(y+P(m<0?0:m)*v(-e*o)*a)]}function pn(){return(0,n.A)(hn).scale(127.267)}hn.invert=function(t,e){var r=(t/=_)*t,n=r+(e/=_)*e,i=b*b;return[t?(n-1+P((1-n)*(1-n)+4*r))/(2*t)*_:0,Q(function(t){return n*(b*g(t)-2*t)*b+4*t*t*(e-g(t))+2*b*t-i*e},0)]};var dn=1.0148,vn=.23185,gn=-.14499,yn=.02406,mn=dn,xn=5*vn,bn=7*gn,_n=9*yn,wn=1.790857183;function Tn(t,e){var r=e*e;return[t,e*(dn+r*r*(vn+r*(gn+yn*r)))]}function An(){return(0,n.A)(Tn).scale(139.319)}function kn(t,e){if(i(e)wn?e=wn:e<-1.790857183&&(e=-1.790857183);var r,n=e;do{var a=n*n;n-=r=(n*(dn+a*a*(vn+a*(gn+yn*a)))-e)/(mn+a*a*(xn+a*(bn+_n*a)))}while(i(r)>m);return[t,n]},kn.invert=function(t,e){if(i(e)m&&--o>0);return l=y(a),[(i(e)=0;)if(n=e[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(e.face,r.face),i=(c=n.map(r.project),f=n.map(e.project),h=Cn(c[1],c[0]),p=Cn(f[1],f[0]),d=function(t,e){return o(t[0]*e[1]-t[1]*e[0],t[0]*e[0]+t[1]*e[1])}(h,p),v=Pn(h)/Pn(p),Ln([1,0,c[0][0],0,1,c[0][1]],Ln([v,0,0,0,v,0],Ln([s(d),g(d),0,-g(d),s(d),0],[1,0,-f[0][0],0,1,-f[0][1]]))));e.transform=r.transform?Ln(r.transform,i):i;for(var a=r.edges,l=0,u=a.length;l0?[-e[0],0]:[180-e[0],180])};var e=Bn.map(function(e){return{face:e,project:t(e)}});return[-1,0,0,1,0,1,4,5].forEach(function(t,r){var n=e[t];n&&(n.children||(n.children=[])).push(e[r])}),On(e[0],function(t,r){return e[t<-b/2?r<0?6:4:t<0?r<0?2:0:tn^p>n&&r<(h-u)*(n-c)/(p-c)+u&&(i=!i)}return i}(t[0],r))return t.push(e),!0})||t.push([e])}),ti=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}};function ii(t){var e=t(_,0)[0]-t(-_,0)[0];function r(r,n){var a=i(r)<_,o=t(a?r:r>0?r-b:r+b,n),s=(o[0]-o[1])*T,l=(o[0]+o[1])*T;if(a)return[s,l];var u=e*T,c=s>0^l>0?-1:1;return[c*s-v(l)*u,c*l-v(s)*u]}return t.invert&&(r.invert=function(r,n){var a=(r+n)*T,o=(n-r)*T,s=i(a)<.5*e&&i(o)<.5*e;if(!s){var l=e*T,u=a>0^o>0?-1:1,c=-u*r+(o>0?1:-1)*l,f=-u*n+(a>0?1:-1)*l;a=(-c-f)*T,o=(c-f)*T}var h=t.invert(a,o);return s||(h[0]+=a>0?b:-b),h}),(0,n.A)(r).rotate([-90,-90,45]).clipAngle(179.999)}function ai(){return ii(Le).scale(176.423)}function oi(){return ii(Ie).scale(111.48)}function si(t,e){if(!(0<=(e=+e)&&e<=20))throw new Error("invalid digits");function r(t){var r=t.length,n=2,i=new Array(r);for(i[0]=+t[0].toFixed(e),i[1]=+t[1].toFixed(e);n2||a[0]!=e[0]||a[1]!=e[1])&&(n.push(a),e=a)}return 1===n.length&&t.length>1&&n.push(r(t[t.length-1])),n}function a(t){return t.map(i)}function o(t){if(null==t)return t;var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(o)};break;case"Point":e={type:"Point",coordinates:r(t.coordinates)};break;case"MultiPoint":e={type:t.type,coordinates:n(t.coordinates)};break;case"LineString":e={type:t.type,coordinates:i(t.coordinates)};break;case"MultiLineString":case"Polygon":e={type:t.type,coordinates:a(t.coordinates)};break;case"MultiPolygon":e={type:"MultiPolygon",coordinates:t.coordinates.map(a)};break;default:return t}return null!=t.bbox&&(e.bbox=t.bbox),e}function s(t){var e={type:"Feature",properties:t.properties,geometry:o(t.geometry)};return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),e}if(null!=t)switch(t.type){case"Feature":return s(t);case"FeatureCollection":var l={type:"FeatureCollection",features:t.features.map(s)};return null!=t.bbox&&(l.bbox=t.bbox),l;default:return o(t)}return t}function li(t){var e=g(t);function r(r,n){var i=e?y(r*e/2)/e:r/2;if(!n)return[2*i,-t];var o=2*a(i*g(n)),l=1/y(n);return[g(o)*l,n+(1-s(o))*l-t]}return r.invert=function(r,n){if(i(n+=t)m&&--c>0);var d=r*(f=y(u)),v=y(i(n)0?_:-_)*(f+o*(d-l)/2+o*o*(d-2*f+l)/2)]}function hi(){return(0,n.A)(fi).scale(152.63)}function pi(t,e){var r=function(t){function e(e,r){var n=s(r),i=(t-1)/(t-n*s(e));return[i*n*g(e),i*g(r)]}return e.invert=function(e,r){var n=e*e+r*r,i=P(n),a=(t-P(1-n*(t+1)/(t-1)))/((t-1)/i+i/(t-1));return[o(e*a,i*P(1-a*a)),i?L(r*a/i):0]},e}(t);if(!e)return r;var n=s(e),i=g(e);function a(e,a){var o=r(e,a),s=o[1],l=s*i/(t-1)+n;return[o[0]*n/l,s/l]}return a.invert=function(e,a){var o=(t-1)/(t-1-a*i);return r.invert(o*e,o*a*n)},a}function di(){var t=2,e=0,r=(0,n.U)(pi),i=r(t,e);return i.distance=function(n){return arguments.length?r(t=+n,e):t},i.tilt=function(n){return arguments.length?r(t,e=n*E):e*S},i.scale(432.147).clipAngle(C(1/t)*S-1e-6)}ci.forEach(function(t){t[1]*=1.0144}),fi.invert=function(t,e){var r=e/_,n=90*r,a=h(18,i(n/5)),o=f(0,u(a));do{var s=ci[o][1],l=ci[o+1][1],c=ci[h(19,o+2)][1],p=c-s,d=c-2*l+s,v=2*(i(r)-l)/p,g=d/p,y=v*(1-g*v*(1-2*g*v));if(y>=0||1===o){n=(e>=0?5:-5)*(y+a);var m,b=50;do{y=(a=h(18,i(n)/5))-(o=u(a)),s=ci[o][1],l=ci[o+1][1],c=ci[h(19,o+2)][1],n-=(m=(e>=0?_:-_)*(l+y*(c-s)/2+y*y*(c-2*l+s)/2)-e)*S}while(i(m)>x&&--b>0);break}}while(--o>=0);var w=ci[o][0],T=ci[o+1][0],A=ci[h(19,o+2)][0];return[t/(T+y*(A-w)/2+y*y*(A-2*T+w)/2),n*E]};var vi=1e-4,gi=1e4,yi=-180,mi=yi+vi,xi=180,bi=xi-vi,_i=-90,wi=_i+vi,Ti=90,Ai=Ti-vi;function ki(t){return t.length>0}function Mi(t){return t===_i||t===Ti?[0,t]:[yi,(e=t,Math.floor(e*gi)/gi)];var e}function Si(t){var e=t[0],r=t[1],n=!1;return e<=mi?(e=yi,n=!0):e>=bi&&(e=xi,n=!0),r<=wi?(r=_i,n=!0):r>=Ai&&(r=Ti,n=!0),n?[e,r]:t}function Ei(t){return t.map(Si)}function Li(t,e,r){for(var n=0,i=t.length;n=bi||c<=wi||c>=Ai){a[o]=Si(l);for(var f=o+1;fmi&&pwi&&d=s)break;r.push({index:-1,polygon:e,ring:a=a.slice(f-1)}),a[0]=Mi(a[0][1]),o=-1,s=a.length}}}}function Ci(t){var e,r,n,i,a,o,s=t.length,l={},u={};for(e=0;e0?b-l:l)*S],c=(0,n.A)(t(s)).rotate(u),f=(0,_t.A)(u),h=c.center;return delete c.rotate,c.center=function(t){return arguments.length?h(f(t)):f.invert(h())},c.clipAngle(90)}function Fi(t){var e=s(t);function r(t,r){var n=(0,Rn.T)(t,r);return n[0]*=e,n}return r.invert=function(t,r){return Rn.T.invert(t/e,r)},r}function Bi(){return Ni([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Ni(t,e){return Ri(Fi,t,e)}function ji(t){if(!(t*=2))return Y.j;var e=-t/2,r=-e,n=t*t,i=y(r),a=.5/g(r);function l(i,a){var o=C(s(a)*s(i-e)),l=C(s(a)*s(i-r));return[((o*=o)-(l*=l))/(2*t),(a<0?-1:1)*P(4*n*l-(n-o+l)*(n-o+l))/(2*t)]}return l.invert=function(t,n){var l,u,c=n*n,f=s(P(c+(l=t+e)*l)),h=s(P(c+(l=t+r)*l));return[o(u=f-h,l=(f+h)*i),(n<0?-1:1)*C(P(l*l+u*u)*a)]},l}function Ui(){return Vi([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function Vi(t,e){return Ri(ji,t,e)}function Hi(t,e){if(i(e)m&&--l>0);return[v(t)*(P(a*a+4)+a)*b/4,_*s]};var ta=4*b+3*P(3),ea=2*P(2*b*P(3)/ta),ra=it(ea*P(3)/b,ea,ta/6);function na(){return(0,n.A)(ra).scale(176.84)}function ia(t,e){return[t*P(1-3*e*e/(b*b)),e]}function aa(){return(0,n.A)(ia).scale(152.63)}function oa(t,e){var r=s(e),n=s(t)*r,i=1-n,a=s(t=o(g(t)*r,-g(e))),l=g(t);return[l*(r=P(1-n*n))-a*i,-a*r-l*i]}function sa(){return(0,n.A)(oa).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)}function la(t,e){var r=R(t,e);return[(r[0]+t/_)/2,(r[1]+e)/2]}function ua(){return(0,n.A)(la).scale(158.837)}ia.invert=function(t,e){return[t/P(1-3*e*e/(b*b)),e]},oa.invert=function(t,e){var r=(t*t+e*e)/-2,n=P(-r*(2+r)),i=e*r+t*n,a=t*r-e*n,s=P(a*a+i*i);return[o(n*i,s*(1+r)),s?-L(n*a/s):0]},la.invert=function(t,e){var r=t,n=e,a=25;do{var o,l=s(n),u=g(n),c=g(2*n),f=u*u,h=l*l,p=g(r),d=s(r/2),v=g(r/2),y=v*v,x=1-h*d*d,b=x?C(l*d)*P(o=1/x):o=0,w=.5*(2*b*l*v+r/_)-t,T=.5*(b*u+n)-e,A=.5*o*(h*y+b*l*d*f)+.5/_,k=o*(p*c/4-b*u*v),M=.125*o*(c*v-b*u*h*p),S=.5*o*(f*d+b*y*l)+.5,E=k*M-S*A,L=(T*k-w*S)/E,O=(w*M-T*A)/E;r-=L,n-=O}while((i(L)>m||i(O)>m)&&--a>0);return[r,n]}},72804:function(t){t.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+f*n,t[7]=l*i+h*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=f*i-s*n,t[11]=h*i-l*n,t}},72930:function(t,e,r){"use strict";t.exports=r(59817)()?r(62019).Symbol:r(48771)},73125:function(t,e,r){"use strict";r.d(e,{Cx:function(){return c},EV:function(){return i},W8:function(){return o},ep:function(){return l},jf:function(){return a},ly:function(){return u},r8:function(){return s}});var n=r(18901);function i(t){return[(0,n.FP)(t[1],t[0]),(0,n.qR)(t[2])]}function a(t){var e=t[0],r=t[1],i=(0,n.gn)(r);return[i*(0,n.gn)(e),i*(0,n.F8)(e),(0,n.F8)(r)]}function o(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function s(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function l(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function u(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function c(t){var e=(0,n.RZ)(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}},73147:function(t,e,r){var n=r(50260),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),h(n,t,n.depth)}function c(t,e){var r=u.styles[e];return r?"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m":t}function f(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&k(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return x(i)||(i=h(t,i,n)),i}var a=function(t,e){if(b(e))return t.stylize("undefined","undefined");if(x(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}(t,r);if(a)return a;var o=Object.keys(r),s=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(r)),A(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return p(r);if(0===o.length){if(k(r)){var l=r.name?": "+r.name:"";return t.stylize("[Function"+l+"]","special")}if(_(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(T(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return p(r)}var u,c="",f=!1,w=["{","}"];return v(r)&&(f=!0,w=["[","]"]),k(r)&&(c=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(c=" "+RegExp.prototype.toString.call(r)),T(r)&&(c=" "+Date.prototype.toUTCString.call(r)),A(r)&&(c=" "+p(r)),0!==o.length||f&&0!=r.length?n<0?_(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),u=f?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(u,c,w)):w[0]+c+w[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),L(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=y(r)?h(t,l.value,null):h(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").slice(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),b(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function v(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function y(t){return null===t}function m(t){return"number"==typeof t}function x(t){return"string"==typeof t}function b(t){return void 0===t}function _(t){return w(t)&&"[object RegExp]"===M(t)}function w(t){return"object"==typeof t&&null!==t}function T(t){return w(t)&&"[object Date]"===M(t)}function A(t){return w(t)&&("[object Error]"===M(t)||t instanceof Error)}function k(t){return"function"==typeof t}function M(t){return Object.prototype.toString.call(t)}function S(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!o[t])if(s.test(t)){var r=n.pid;o[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else o[t]=function(){};return o[t]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(68397),e.isArray=v,e.isBoolean=g,e.isNull=y,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=x,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=b,e.isRegExp=_,e.types.isRegExp=_,e.isObject=w,e.isDate=T,e.types.isDate=T,e.isError=A,e.types.isNativeError=A,e.isFunction=k,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(49513);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(r=[S((t=new Date).getHours()),S(t.getMinutes()),S(t.getSeconds())].join(":"),[t.getDate(),E[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(28480),e._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var C="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(C&&t[C]){var e;if("function"!=typeof(e=t[C]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,C,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise(function(t,n){e=t,r=n}),i=[],a=0;at[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]o.width||u>o.height)&&(o=c)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},73317:function(t,e,r){"use strict";var n=r(28209),i=r(31164),a=r(99012).axisHoverFormat,o=r(79335),s=r(72198),l=r(8357).extendFlat,u=r(7458).overrideAll,c=r(879).DASHES,f=i.line,h=i.marker,p=h.line,d=t.exports=u({x:i.x,x0:i.x0,dx:i.dx,y:i.y,y0:i.y0,dy:i.dy,xperiod:i.xperiod,yperiod:i.yperiod,xperiod0:i.xperiod0,yperiod0:i.yperiod0,xperiodalignment:i.xperiodalignment,yperiodalignment:i.yperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),text:i.text,hovertext:i.hovertext,textposition:i.textposition,textfont:i.textfont,mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:f.color,width:f.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:s(c),dflt:"solid"}},marker:l({},o("marker"),{symbol:h.symbol,angle:h.angle,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,opacity:h.opacity,colorbar:h.colorbar,line:l({},o("marker.line"),{width:p.width})}),connectgaps:i.connectgaps,fill:l({},i.fill,{dflt:"none"}),fillcolor:i.fillcolor,selected:{marker:i.selected.marker,textfont:i.selected.textfont},unselected:{marker:i.unselected.marker,textfont:i.unselected.textfont},opacity:n.opacity},"calc","nested");d.x.editType=d.y.editType=d.x0.editType=d.y0.editType="calc+clearAxisTypes",d.hovertemplate=i.hovertemplate,d.texttemplate=i.texttemplate},73342:function(t,e,r){"use strict";var n=r(77371),i=1/0,a=i,o=-i,s=o,l={point:function(t,e){to&&(o=t),es&&(s=e)},lineStart:n.A,lineEnd:n.A,polygonStart:n.A,polygonEnd:n.A,result:function(){var t=[[i,a],[o,s]];return o=s=-(a=i=1/0),t}};e.A=l},73396:function(t,e,r){"use strict";var n=r(16534),i=r(5159),a=r(37070),o=r(46982),s=r(15181),l=s.strTranslate,u=r(88191),c=r(69562),f=r(3071),h=r(28730),p=r(5126).OPPOSITE_SIDE,d=/ [XY][0-9]* /;t.exports={draw:function(t,e,r){var v,g=r.propContainer,y=r.propName,m=r.placeholder,x=r.traceIndex,b=r.avoid||{},_=r.attributes,w=r.transform,T=r.containerGroup,A=t._fullLayout,k=1,M=!1,S=g.title,E=(S&&S.text?S.text:"").trim(),L=S&&S.font?S.font:{},C=L.family,P=L.size,O=L.color;"title.text"===y?v="titleText":-1!==y.indexOf("axis")?v="axisTitleText":y.indexOf(!0)&&(v="colorbarTitleText");var I=t._context.edits[v];""===E?k=0:E.replace(d," % ")===m.replace(d," % ")&&(k=.2,M=!0,I||(E="")),r._meta?E=s.templateString(E,r._meta):A._meta&&(E=s.templateString(E,A._meta));var D,z=E||I;T||(T=s.ensureSingle(A._infolayer,"g","g-"+e),D=A._hColorbarMoveTitle);var R=T.selectAll("text").data(z?[0]:[]);if(R.enter().append("text"),R.text(E).attr("class",e),R.exit().remove(),!z)return T;function F(t){s.syncOrAsync([B,N],t)}function B(e){var r;return!w&&D&&(w={}),w?(r="",w.rotate&&(r+="rotate("+[w.rotate,_.x,_.y]+")"),(w.offset||D)&&(r+=l(0,(w.offset||0)-(D||0)))):r=null,e.attr("transform",r),e.style({"font-family":C,"font-size":n.round(P,2)+"px",fill:c.rgb(O),opacity:k*c.opacity(O),"font-weight":a.fontWeight}).attr(_).call(f.convertToTspans,t),a.previousPromises(t)}function N(e){var r=n.select(e.node().parentNode);if(b&&b.selection&&b.side&&E){r.attr("transform",null);var a=p[b.side],o="left"===b.side||"top"===b.side?-1:1,c=i(b.pad)?b.pad:2,f=u.bBox(r.node()),h={t:0,b:0,l:0,r:0},d=t._fullLayout._reservedMargin;for(var v in d)for(var y in d[v]){var m=d[v][y];h[y]=Math.max(h[y],m)}var x={left:h.l,top:h.t,right:A.width-h.r,bottom:A.height-h.b},_=b.maxShift||o*(x[b.side]-f[b.side]),w=0;if(_<0)w=_;else{var T=b.offsetLeft||0,k=b.offsetTop||0;f.left-=T,f.right-=T,f.top-=k,f.bottom-=k,b.selection.each(function(){var t=u.bBox(this);s.bBoxIntersect(f,t,c)&&(w=Math.max(w,o*(t[b.side]-f[a])+c))}),w=Math.min(_,w),g._titleScoot=Math.abs(w)}if(w>0||_<0){var M={left:[-w,0],right:[w,0],top:[0,-w],bottom:[0,w]}[b.side];r.attr("transform",l(M[0],M[1]))}}}return R.call(F),I&&(E?R.on(".opacity",null):(k=0,M=!0,R.text(m).on("mouseover.opacity",function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)})),R.call(f.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?o.call("_guiRestyle",t,y,e,x):o.call("_guiRelayout",t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(F)}).on("input",function(t){this.text(t||" ").call(f.positionText,_.x,_.y)})),R.classed("js-placeholder",M),T}}},73431:function(t,e,r){"use strict";t.exports={attributes:r(1798),supplyDefaults:r(82769),crossTraceDefaults:r(61608),calc:r(43116),plot:r(83326).plot,layerName:"contourlayer",style:r(62468),colorbar:r(60469),hoverPoints:r(55835),moduleType:"trace",name:"histogram2dcontour",basePlotModule:r(29435),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}},73553:function(t,e,r){"use strict";var n=r(15181),i=r(28418),a=r(52948),o=r(4868),s=r(68478),l=r(54563),u=r(46190),c=r(6680).PTS_LINESONLY,f=r(73990);function h(t,e,r,n){var i,a=n("r"),o=n("theta");if(a)o?i=Math.min(a.length,o.length):(i=a.length,n("theta0"),n("dtheta"));else{if(!o)return 0;i=e.theta.length,n("r0"),n("dr")}return e._length=i,i}t.exports={handleRThetaDefaults:h,supplyDefaults:function(t,e,r,p){function d(r,i){return n.coerce(t,e,f,r,i)}var v=h(0,e,0,d);if(v){d("thetaunit"),d("mode",v0)do{o.point(0===s||3===s?t:r,s>1?u:e)}while((s=(s+a+4)%4)!==l);else o.point(i[0],i[1])}function h(i,a){return(0,n.tn)(i[0]-t)0?0:3:(0,n.tn)(i[0]-r)0?2:1:(0,n.tn)(i[1]-e)0?1:0:a>0?3:2}function p(t,e){return d(t.x,e.x)}function d(t,e){var r=h(t,1),n=h(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(n){var h,d,v,g,y,m,x,b,_,w,T,A=n,k=(0,i.A)(),M={point:S,lineStart:function(){M.point=E,d&&d.push(v=[]),w=!0,_=!1,x=b=NaN},lineEnd:function(){h&&(E(g,y),m&&_&&k.rejoin(),h.push(k.result())),M.point=S,_&&A.lineEnd()},polygonStart:function(){A=k,h=[],d=[],T=!0},polygonEnd:function(){var e=function(){for(var e=0,r=0,n=d.length;ru&&(f-i)*(u-a)>(h-a)*(t-i)&&++e:h<=u&&(f-i)*(u-a)<(h-a)*(t-i)&&--e;return e}(),r=T&&e,i=(h=(0,o.Am)(h)).length;(r||i)&&(n.polygonStart(),r&&(n.lineStart(),f(null,null,1,n),n.lineEnd()),i&&(0,a.A)(h,p,e,f,n),n.polygonEnd()),A=n,h=d=v=null}};function S(t,e){c(t,e)&&A.point(t,e)}function E(n,i){var a=c(n,i);if(d&&v.push([n,i]),w)g=n,y=i,m=a,w=!1,a&&(A.lineStart(),A.point(n,i));else if(a&&_)A.point(n,i);else{var o=[x=Math.max(l,Math.min(s,x)),b=Math.max(l,Math.min(s,b))],f=[n=Math.max(l,Math.min(s,n)),i=Math.max(l,Math.min(s,i))];!function(t,e,r,n,i,a){var o,s=t[0],l=t[1],u=0,c=1,f=e[0]-s,h=e[1]-l;if(o=r-s,f||!(o>0)){if(o/=f,f<0){if(o0){if(o>c)return;o>u&&(u=o)}if(o=i-s,f||!(o<0)){if(o/=f,f<0){if(o>c)return;o>u&&(u=o)}else if(f>0){if(o0)){if(o/=h,h<0){if(o0){if(o>c)return;o>u&&(u=o)}if(o=a-l,h||!(o<0)){if(o/=h,h<0){if(o>c)return;o>u&&(u=o)}else if(h>0){if(o0&&(t[0]=s+u*f,t[1]=l+u*h),c<1&&(e[0]=s+c*f,e[1]=l+c*h),!0}}}}}(o,f,t,e,r,u)?a&&(A.lineStart(),A.point(n,i),T=!1):(_||(A.lineStart(),A.point(o[0],o[1])),A.point(f[0],f[1]),a||A.lineEnd(),T=!1)}x=n,b=i,_=a}return M}}},74160:function(t,e,r){"use strict";var n=r(99603).readPaths,i=r(96989),a=r(7826).clearOutlineControllers,o=r(69562),s=r(88191),l=r(92444).arrayEditor,u=r(53812),c=u.getPathString;function f(t){var e=t._fullLayout;for(var r in a(t),e._selectionLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].selectionLayer;n&&n.selectAll("path").remove()}for(var i=0;i=0;A--){var k=r.append("path").attr(g).style("opacity",A?.1:y).call(o.stroke,x).call(o.fill,m).call(s.dashLine,A?"solid":_,A?4+b:b);if(d(k,t,a),w){var M=l(t.layout,"selections",a);k.style({cursor:"move"});var S={element:k.node(),plotinfo:p,gd:t,editHelpers:M,isActiveSelection:!0},E=n(u,t);i(E,k,S)}else k.style("pointer-events",A?"all":"none");T[A]=k}var L=T[0];T[1].node().addEventListener("click",function(){return function(t,e){if(h(t)){var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void v(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=v,f(t)}}}(t,L)})}(t._fullLayout._selectionLayer)}function d(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function v(t){h(t)&&t._fullLayout._activeSelectionIndex>=0&&(a(t),delete t._fullLayout._activeSelectionIndex,f(t))}t.exports={draw:f,drawOne:p,activateLastSelection:function(t){if(h(t)){var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=v,f(t)}}}},74176:function(t){"use strict";t.exports=function(t,e,r,n,i){var a=e-2,o=r-2;return n&&i?function(e,r,n){var i,s,l,u,c,f;e||(e=[]);var h=Math.max(0,Math.min(Math.floor(r),a)),p=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-h)),v=Math.max(0,Math.min(1,n-p));h*=3,p*=3;var g=d*d,y=g*d,m=1-d,x=m*m,b=x*m,_=v*v,w=_*v,T=1-v,A=T*T,k=A*T;for(f=0;f=10)return null;for(var r=1/0,a=-1/0,o=t.length,s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(maskTexture,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=r(46683).maxDimensionCount,s=r(15181),l=new Uint8Array(4),u=new Uint8Array(4),c={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function h(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var u=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*u,a.offset=2*l*n,e(a),l*n+u>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),i=0,a=0;ac&&(c=t[i].dim1.canvasX,o=i);0===s&&f(A,0,0,r.canvasWidth,r.canvasHeight);var p=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&n2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-u)*(i-c)/(o-c)+u-n>t&&(s=!s),a=u,o=c}return s}};return e}},76252:function(t,e,r){"use strict";var n=r(42964);t.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},76347:function(t){"use strict";t.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},76492:function(t,e,r){"use strict";var n=r(46982),i=r(37070),a=r(93003),o=r(98248),s=r(87099).eraseActiveShape,l=r(15181),u=l._,c=t.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=a.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var p,d="in"===l?.5:2,v=(1+d)/2,g=(1-d)/2;for(i=0;i4*e&&y--){var w=o+p,T=s+v,A=u+g,k=(0,l.RZ)(w*w+T*T+A*A),M=(0,l.qR)(A/=k),S=(0,l.tn)((0,l.tn)(A)-1)e||(0,l.tn)((x*P+b*O)/_-.5)>.3||o*p+s*v+u*g2?t[2]%360*l.F2:0,V()):[L*l.uj,C*l.uj,P*l.uj]},j.angle=function(t){return arguments.length?(O=t%360*l.F2,V()):O*l.uj},j.reflectX=function(t){return arguments.length?(I=t?-1:1,V()):I<0},j.reflectY=function(t){return arguments.length?(D=t?-1:1,V()):D<0},j.precision=function(t){return arguments.length?(x=v(b,N=t*t),H()):(0,l.RZ)(N)},j.fitExtent=function(t,e){return(0,f.sp)(j,t,e)},j.fitSize=function(t,e){return(0,f.Hv)(j,t,e)},j.fitWidth=function(t,e){return(0,f.G0)(j,t,e)},j.fitHeight=function(t,e){return(0,f.FL)(j,t,e)},function(){return e=t.apply(this,arguments),j.invert=e.invert&&U,V()}}},76613:function(t,e,r){"use strict";var n=r(89953);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},76780:function(t,e,r){"use strict";var n=r(16534),i=r(69562),a=r(15181),o=r(95304),s=r(70394).resizeText,l=r(78999);function u(t,e,r,n,s){var u,c,f=(s||{}).hovered,h=e.data.data,p=h.i,d=h.color,v=o.isHierarchyRoot(e),g=1;if(f)u=r._hovered.marker.line.color,c=r._hovered.marker.line.width;else if(v&&d===r.root.color)g=100,u="rgba(0,0,0,0)",c=0;else if(u=a.castOption(r,p,"marker.line.color")||i.defaultLine,c=a.castOption(r,p,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var y=r.marker.depthfade;if(y){var m,x=i.combine(i.addOpacity(r._backgroundColor,.75),d);if(!0===y){var b=o.getMaxDepth(r);m=isFinite(b)?o.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else m=e.data.depth-r._entryDepth,r._atRootLevel||m++;if(m>0)for(var _=0;_v&&(y=Math.max(y,Math.abs(t[a][o]-d)/(g-v))))}return y}t.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},77042:function(t,e,r){"use strict";var n=r(46982),i=r(15181);t.exports=function(t,e,r,a){var o=r("x"),s=r("open"),l=r("high"),u=r("low"),c=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],a),s&&l&&u&&c){var f=Math.min(s.length,l.length,u.length,c.length);return o&&(f=Math.min(f,i.minRowLength(o))),e._length=f,f}}},77184:function(t){"use strict";t.exports=RangeError},77196:function(t,e,r){"use strict";var n=r(46982).traceIs,i=r(50446);function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}t.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(function(t,e){if("-"===t.type){var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(u)if("histogram"!==u.type||l!=={v:"y",h:"x"}[u.orientation||"v"]){var c=l+"calendar",f=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};if("box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0),h.autotypenumbers=t.autotypenumbers,o(u,l)){var p=a(u),d=[];for(r=0;r=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},77656:function(t,e,r){"use strict";var n=r(15181),i=r(52543);t.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("treemapcolorway",e.colorway),r("extendtreemapcolors")}},77828:function(t){"use strict";t.exports=function(t,e,r){return e&&r?function(e,r,n,i,a){var o,s,l,u,c,f;e||(e=[]),r*=3,n*=3;var h=i*i,p=1-i,d=p*p,v=p*i*2,g=-3*d,y=3*(d-v),m=3*(v-h),x=3*h,b=a*a,_=b*a,w=1-a,T=w*w,A=T*w;for(f=0;f-1?i(e):null;if(r&&r.name){var s,l,u,c,f=t.indexOf("%n");if(f>-1)return a>-1?(f>a?(s=o,u=a,l=r.name,c=f):(s=r.name,u=f,l=o,c=a),t.slice(0,u)+s+t.slice(u+2,c)+l+t.slice(c+2)):t.slice(0,f)+r.name+t.slice(f+2)}return a>-1?t.slice(0,a)+o+t.slice(a+2):t}},78030:function(t,e,r){"use strict";var n=r(99555),i=r(76056),a=i([n("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&a(t,".prototype.")>-1?i([r]):r}},78032:function(t,e,r){"use strict";var n=r(91300),i=r(83998),a=r(18610),o=r(13625),s=r(39555),l=r(38604),u=r(93230),c=r(34820),f=c.float32,h=c.fract32,p=r(33253),d=r(56895),v=r(94857);function g(t,e){if(!(this instanceof g))return new g(t,e);if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=t._gl,this.regl=t,this.passes=[],this.shaders=g.shaders.has(t)?g.shaders.get(t):g.shaders.set(t,g.createShaders(t)).get(t),this.update(e)}t.exports=g,g.dashMult=2,g.maxPatternLength=256,g.precisionThreshold=3e6,g.maxPoints=1e4,g.maxLines=2048,g.shaders=new p,g.createShaders=function(t){var e,r=t.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),n={primitive:"triangle strip",instances:t.prop("count"),count:4,offset:0,uniforms:{miterMode:function(t,e){return"round"===e.join?2:1},miterLimit:t.prop("miterLimit"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),thickness:t.prop("thickness"),dashTexture:t.prop("dashTexture"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),dashLength:t.prop("dashLength"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},depth:t.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:function(t,e){return!e.overlay}},stencil:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport")},i=t(a({vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n}\n\nvoid main() {\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scale * viewport.zw);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},n));try{e=t(a({cull:{enable:!0,face:"back"},vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\nuniform float miterLimit, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIFF = 1e-6;\n\n// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n// TODO: precalculate dot products, normalize things beforehead etc.\n// TODO: refactor to rectangular algorithm\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nbool isNaN( float val ){\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\n vec2 adjustedScale;\n adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;\n adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;\n\n vec2 scaleRatio = adjustedScale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t// collapsed/unidirectional segment cases\n\t// FIXME: there should be more elegant solution\n\tvec2 prevTanDiff = abs(prevTangent - currTangent);\n\tvec2 nextTanDiff = abs(nextTangent - currTangent);\n\tif (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=i}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:"\nprecision highp float;\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n",frag:"\nprecision highp float;\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n",uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:e}},g.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},g.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},g.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach(function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>g.precisionThreshold||e.scale[1]*e.viewport.height>g.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=g.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))}),this},g.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,c=this.gl;if(t.forEach(function(t,p){var y=e.passes[p];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=o(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),y||(e.passes[p]=y={id:p,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=a({},g.defaults,t)),null!=t.thickness&&(y.thickness=parseFloat(t.thickness)),null!=t.opacity&&(y.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(y.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(y.overlay=!!t.overlay,p=z});(O=O.slice(0,R)).push(z)}for(var F=function(t){var e=A.slice(2*D,2*O[t]).concat(z?A.slice(2*z):[]),r=(y.hole||[]).map(function(e){return e-z+(O[t]-D)}),n=l(e,r);n=n.map(function(e){return e+D+(e+D>1,c=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},e.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,u-=8);t[r+p-d]|=128*v}},78290:function(t,e,r){"use strict";t.exports=r(96361)},78463:function(t,e,r){"use strict";r.d(e,{A:function(){return o},P:function(){return a}});var n=r(76610),i=r(18901);function a(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function o(){return(0,n.A)(a).scale(175.295)}a.invert=function(t,e){var r,n=e,a=25;do{var o=n*n,s=o*o;n-=r=(n*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-e)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while((0,i.tn)(r)>i.Ni&&--a>0);return[t/(.8707+(o=n*n)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),n]}},78475:function(t){t.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-u*n,t[1]=o*i-c*n,t[2]=s*i-f*n,t[3]=l*i-h*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+f*i,t[11]=l*n+h*i,t}},78534:function(t,e,r){"use strict";var n=r(15181),i=r(82945),a=r(79444).N,o=r(92444),s=r(46716),l=r(74563),u=r(5005),c=r(31357),f=r(14736),h=r(25124);function p(t,e){function r(r,a){return n.coerce(t,e,i.gauge.steps,r,a)}r("color"),r("line.color"),r("line.width"),r("range"),r("thickness")}t.exports={supplyDefaults:function(t,e,r,d){function v(r,a){return n.coerce(t,e,i,r,a)}a(e,d,v),v("mode"),e._hasNumber=-1!==e.mode.indexOf("number"),e._hasDelta=-1!==e.mode.indexOf("delta"),e._hasGauge=-1!==e.mode.indexOf("gauge");var g=v("value");e._range=[0,"number"==typeof g?1.5*g:1];var y,m,x,b,_,w,T=new Array(2);function A(t,e){return n.coerce(x,b,i.gauge,t,e)}function k(t,e){return n.coerce(_,w,i.gauge.axis,t,e)}if(e._hasNumber&&(v("number.valueformat"),v("number.font.color",d.font.color),v("number.font.family",d.font.family),v("number.font.size"),void 0===e.number.font.size&&(e.number.font.size=l.defaultNumberFontSize,T[0]=!0),v("number.prefix"),v("number.suffix"),y=e.number.font.size),e._hasDelta&&(v("delta.font.color",d.font.color),v("delta.font.family",d.font.family),v("delta.font.size"),void 0===e.delta.font.size&&(e.delta.font.size=(e._hasNumber?.5:1)*(y||l.defaultNumberFontSize),T[1]=!0),v("delta.reference",e.value),v("delta.relative"),v("delta.valueformat",e.delta.relative?"2%":""),v("delta.increasing.symbol"),v("delta.increasing.color"),v("delta.decreasing.symbol"),v("delta.decreasing.color"),v("delta.position"),v("delta.prefix"),v("delta.suffix"),m=e.delta.font.size),e._scaleNumbers=(!e._hasNumber||T[0])&&(!e._hasDelta||T[1])||!1,v("title.font.color",d.font.color),v("title.font.family",d.font.family),v("title.font.size",.25*(y||m||l.defaultNumberFontSize)),v("title.text"),e._hasGauge){(x=t.gauge)||(x={}),b=o.newContainer(e,"gauge"),A("shape"),(e._isBullet="bullet"===e.gauge.shape)||v("title.align","center"),(e._isAngular="angular"===e.gauge.shape)||v("align","center"),A("bgcolor",d.paper_bgcolor),A("borderwidth"),A("bordercolor"),A("bar.color"),A("bar.line.color"),A("bar.line.width"),A("bar.thickness",l.valueThickness*("bullet"===e.gauge.shape?.5:1)),s(x,b,{name:"steps",handleItemDefaults:p}),A("threshold.value"),A("threshold.thickness"),A("threshold.line.width"),A("threshold.line.color"),_={},x&&(_=x.axis||{}),w=o.newContainer(b,"axis"),k("visible"),e._range=k("range",e._range);var M={outerTicks:!0};u(_,w,k,"linear"),h(_,w,k,"linear",M),f(_,w,k,"linear",M),c(_,w,k,M)}else v("title.align","center"),v("align","center"),e._isAngular=e._isBullet=!1;e._length=null}}},78692:function(t,e,r){"use strict";var n,i=r(50260);function a(t,e,r){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(59487),s=Symbol("lastResolve"),l=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function v(t){var e=t[s];if(null!==e){var r=t[p].read();null!==r&&(t[f]=null,t[s]=null,t[l]=null,e(d(r,!1)))}}function g(t){i.nextTick(v,t)}var y=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((a(n={get stream(){return this[p]},next:function(){var t=this,e=this[u];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(e,r){i.nextTick(function(){t[u]?r(t[u]):e(d(void 0,!0))})});var r,n=this[f];if(n)r=new Promise(function(t,e){return function(r,n){t.then(function(){e[c]?r(d(void 0,!0)):e[h](r,n)},n)}}(n,this));else{var a=this[p].read();if(null!==a)return Promise.resolve(d(a,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,function(){return this}),a(n,"return",function(){var t=this;return new Promise(function(e,r){t[p].destroy(null,function(t){t?r(t):e(d(void 0,!0))})})}),n),y);t.exports=function(t){var e,r=Object.create(m,(a(e={},p,{value:t,writable:!0}),a(e,s,{value:null,writable:!0}),a(e,l,{value:null,writable:!0}),a(e,u,{value:null,writable:!0}),a(e,c,{value:t._readableState.endEmitted,writable:!0}),a(e,h,{value:function(t,e){var n=r[p].read();n?(r[f]=null,r[s]=null,r[l]=null,t(d(n,!1))):(r[s]=t,r[l]=e)},writable:!0}),e));return r[f]=null,o(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[l];return null!==e&&(r[f]=null,r[s]=null,r[l]=null,e(t)),void(r[u]=t)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[l]=null,n(d(void 0,!0))),r[c]=!0}),t.on("readable",g.bind(null,r)),r}},78782:function(t,e,r){"use strict";r.d(e,{Ay:function(){return x},B0:function(){return h},Y7:function(){return d}});var n,i,a,o,s,l=r(62747),u=r(18901),c=r(77371),f=r(98683),h=(0,l.A)(),p=(0,l.A)(),d={point:c.A,lineStart:c.A,lineEnd:c.A,polygonStart:function(){h.reset(),d.lineStart=v,d.lineEnd=g},polygonEnd:function(){var t=+h;p.add(t<0?u.FA+t:t),this.lineStart=this.lineEnd=this.point=c.A},sphere:function(){p.add(u.FA)}};function v(){d.point=y}function g(){m(n,i)}function y(t,e){d.point=m,n=t,i=e,t*=u.F2,e*=u.F2,a=t,o=(0,u.gn)(e=e/2+u.gz),s=(0,u.F8)(e)}function m(t,e){t*=u.F2,e=(e*=u.F2)/2+u.gz;var r=t-a,n=r>=0?1:-1,i=n*r,l=(0,u.gn)(e),c=(0,u.F8)(e),f=s*c,p=o*l+f*(0,u.gn)(i),d=f*n*(0,u.F8)(i);h.add((0,u.FP)(d,p)),a=t,o=l,s=c}function x(t){return p.reset(),(0,f.A)(t,d),2*p}},78920:function(t,e,r){"use strict";var n=r(6537),i=r(97507),a=Function.prototype.call;t.exports=function(t,e){var r={},o=arguments[2];return n(e),i(t,function(t,n,i,s){r[n]=a.call(e,o,t,n,i,s)}),r}},78945:function(t){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"−"}},78999:function(t,e,r){"use strict";var n=r(88191),i=r(69562);t.exports=function(t,e,r,a,o){var s=e.data.data,l=s.i,u=o||s.color;if(l>=0){e.i=s.i;var c=r.marker;c.pattern&&c.colors&&c.pattern.shape||(c.color=u,e.color=u),n.pointStyle(t,r,a,e)}else i.fill(t,u)}},79066:function(t,e,r){var n=r(18610),i=r(9915);n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n=(r=r||{}).dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,u=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;x+n1}),c=function(t,e,r,n){var i=""+e;if(u(t,n))for(;i.length1},x=function(t,r){var n=m(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(k).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){m("m");var t=l.call(b,e.substring(k));return k+=t.length,t}return x("m")},w=function(t,r,n,a){for(var o=m(t,a)?n:r,s=0;s-1){p=1,d=v;for(var E=this.daysInMonth(h,p);d>E;E=this.daysInMonth(h,p))p++,d-=E}return f>-1?this.fromJD(f):this.newDate(h,p,d)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},79095:function(t,e,r){"use strict";var n=r(5159);t.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},79130:function(t,e){"use strict";e.z=function(t,e){for(var r,n,i=0;i=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),v=Math.ceil(d.length/p),g=0;o.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function x(t){return m?t.transition():t}var b=r.xaxis,_=r.yaxis,w=f[0].trace,T=w.line,A=n.select(d),k=o(A,"g","errorbars"),M=o(A,"g","lines"),S=o(A,"g","points"),E=o(A,"g","text");if(i.getComponentMethod("errorbars","plot")(t,k,r,v),!0===w.visible){var L,C;x(A).style("opacity",w.opacity);var P=w.fill.charAt(w.fill.length-1);"x"!==P&&"y"!==P&&(P=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=A;var O,I,D="",z=[],R=w._prevtrace;R&&(D=R._prevRevpath||"",C=R._nextFill,z=R._polygons);var F,B,N,j,U,V,H,q="",G="",Y=[],W=a.noop;if(L=w._ownFill,u.hasLines(w)||"none"!==w.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(T.shape)?(F=l.steps(T.shape),B=l.steps(T.shape.split("").reverse().join(""))):F=B="spline"===T.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),T.smoothing):l.smoothopen(t,T.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return B(t.reverse())},Y=c(f,{xaxis:b,yaxis:_,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,backoff:T.backoff,simplify:T.simplify,fill:w.fill}),H=w._polygons=new Array(Y.length),g=0;g0,g=f(t,e,r);(c=i.selectAll("g.trace").data(g,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each(function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,u=[];a._ownfill&&u.push("_ownFill"),a._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each(function(t){a[t]=null}).remove(),c.order().each(function(t){a[t]=o(n.select(this),"path","js-fill")})})}(t,c,e),v?(u&&(h=u()),n.transition().duration(a.duration).ease(a.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){i.selectAll("g.trace").each(function(r,n){p(t,n,e,r,g,this,a)})})):c.each(function(r,n){p(t,n,e,r,g,this,a)}),d&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},79923:function(t,e,r){"use strict";var n=r(69562),i=r(92444),a=r(15181),o=r(13516),s=r(14736),l=r(25124),u=r(31357),c=r(5005),f=r(16361),h=r(4964),p=["aaxis","baxis","caxis"];function d(t,e,r,a){var o,s,l,u=r("bgcolor"),c=r("sum");a.bgColor=n.combine(u,a.paper_bgcolor);for(var f=0;f=c&&(h.min=0,d.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function v(t,e,r,n){var i=h[e._name];function o(r,n){return a.coerce(t,e,i,r,n)}o("uirevision",n.uirevision),e.type="linear";var p=o("color"),d=p!==i.color.dflt?p:r.font.color,v=e._name.charAt(0).toUpperCase(),g="Component "+v,y=o("title.text",g);e._hovertitle=y===g?y:v,a.coerceFont(o,"title.font",{family:r.font.family,size:a.bigFont(r.font.size),color:d}),o("min"),c(t,e,o,"linear"),l(t,e,o,"linear"),s(t,e,o,"linear"),u(t,e,o,{outerTicks:!0}),o("showticklabels")&&(a.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:d}),o("tickangle"),o("tickformat")),f(t,e,o,{dfltColor:p,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),o("hoverformat"),o("layer")}t.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:h,handleDefaults:d,font:e.font,paper_bgcolor:e.paper_bgcolor})}},80033:function(t){function e(t,e,r){var n=[];return t.forEach(function(t){var i=(t.myFill.above?8:0)+(t.myFill.below?4:0)+(t.otherFill&&t.otherFill.above?2:0)+(t.otherFill&&t.otherFill.below?1:0);0!==e[i]&&n.push({id:r?r.segmentId():-1,start:t.start,end:t.end,myFill:{above:1===e[i],below:2===e[i]},otherFill:null})}),r&&r.selected(n),n}var r={union:function(t,r){return e(t,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],r)},intersect:function(t,r){return e(t,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],r)},difference:function(t,r){return e(t,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],r)},differenceRev:function(t,r){return e(t,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],r)},xor:function(t,r){return e(t,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],r)}};t.exports=r},80079:function(t,e,r){"use strict";t.exports={moduleType:"trace",name:"ohlc",basePlotModule:r(29435),categories:["cartesian","svg","showLegend"],meta:{},attributes:r(52270),supplyDefaults:r(49241),calc:r(23850).calc,plot:r(4824),style:r(45298),hoverPoints:r(65409).hoverPoints,selectPoints:r(44483)}},80144:function(t,e,r){"use strict";["*heatmapgl* trace is deprecated!","Please consider switching to the *heatmap* or *image* trace types.","Alternatively you could contribute/sponsor rewriting this trace type","based on cartesian features and using regl framework."].join(" "),t.exports={attributes:r(64579),supplyDefaults:r(70212),colorbar:r(62731),calc:r(60306),plot:r(86903),moduleType:"trace",name:"heatmapgl",basePlotModule:r(4562),categories:["gl","gl2d","2dMap"],meta:{}}},80177:function(t,e,r){"use strict";var n=r(16534),i=r(15181),a=r(46982),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},u={cursor:"auto"};function c(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function f(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],u=o._fullLayout,c=u[n],f={},h={};function p(t,e){f[n+"."+t]=i.nestedProperty(l,t).get(),a.call("_storeDirectGUIEdit",s,u._preGUI,f);var r=i.nestedProperty(c,t);r.get()!==e&&(r.set(e),i.nestedProperty(l,t).set(e),h[n+"."+t]=e)}r(p),p("projection.scale",e.scale()/t.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",h)}function h(t,e){var r=c(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",function(){n.select(this).style(l)}).on("zoom",function(){e.scale(n.event.scale).translate(n.event.translate),t.render(!0);var r=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})}).on("zoomend",function(){n.select(this).style(u),f(t,e,i)}),r}function p(t,e){var r,i,a,o,s,h,p,d,v,g=c(0,e);function y(t){return e.invert(t)}function m(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",function(){n.select(this).style(l),r=n.mouse(this),i=e.rotate(),a=e.translate(),o=i,s=y(r)}).on("zoom",function(){if(h=n.mouse(this),function(t){var r=y(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(r))return g.scale(e.scale()),void g.translate(e.translate());e.scale(n.event.scale),e.translate([a[0],n.event.translate[1]]),s?y(h)&&(d=y(h),p=[o[0]+(d[0]-s[0]),i[1],i[2]],e.rotate(p),o=p):s=y(r=h),v=!0,t.render(!0);var l=e.rotate(),u=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":u[0],"geo.center.lat":u[1],"geo.projection.rotation.lon":-l[0]})}).on("zoomend",function(){n.select(this).style(u),v&&f(t,e,m)}),g}function d(t,e){var r,i={r:e.rotate(),k:e.scale()},a=c(0,e),h=function(t){for(var e=0,r=arguments.length,i=[];++ed?(a=(f>0?90:-90)-p,i=0):(a=Math.asin(f/d)*s-p,i=Math.sqrt(d*d-f*f));var v=180-a-2*p,y=(Math.atan2(h,c)-Math.atan2(u,i))*s,x=(Math.atan2(h,c)-Math.atan2(u,-i))*s;return g(r[0],r[1],a,y)<=g(r[0],r[1],v,x)?[a,y,r[2]]:[v,x,r[2]]}(T,r,E);isFinite(A[0])&&isFinite(A[1])&&isFinite(A[2])||(A=E),e.rotate(A),E=A}}else r=v(e,M=b);h.of(this,arguments)({type:"zoom"})}),k=h.of(this,arguments),p++||k({type:"zoomstart"})}).on("zoomend",function(){var r;n.select(this).style(u),d.call(a,"zoom",null),r=h.of(this,arguments),--p||r({type:"zoomend"}),f(t,e,y)}).on("zoom.redraw",function(){t.render(!0);var r=e.rotate();t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})}),n.rebind(a,h,"on")}function v(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*o,r=t[1]*o,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function g(t,e,r,n){var i=y(r-t),a=y(n-e);return Math.sqrt(i*i+a*a)}function y(t){return(t%360+540)%360-180}function m(t,e,r){var n=r*o,i=t.slice(),a=0===e?1:0,s=2===e?1:2,l=Math.cos(n),u=Math.sin(n);return i[a]=t[a]*l-t[s]*u,i[s]=t[s]*l+t[a]*u,i}function x(t,e){for(var r=0,n=0,i=t.length;n_[0]._length||lt<0||lt>w[0]._length)return d.unhoverRaw(t,e)}else st="xpx"in e?e.xpx:_[0]._length/2,lt="ypx"in e?e.ypx:w[0]._length/2;if(e.pointerX=st+_[0]._offset,e.pointerY=lt+w[0]._offset,q="xval"in e?y.flat(l,e.xval):y.p2c(_,st),G="yval"in e?y.flat(l,e.yval):y.p2c(w,lt),!i(q[0])||!i(G[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var ft=1/0;function ht(t,r){for(W=0;Wrt&&(nt.splice(0,rt),ft=nt[0].distance),m&&0!==H&&0===nt.length){et.distance=H,et.index=!1;var f=X._module.hoverPoints(et,Q,tt,"closest",{hoverLayer:c._hoverlayer});if(f&&(f=f.filter(function(t){return t.spikeDistance<=H})),f&&f.length){var h,d=f.filter(function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap});if(d.length){var v=d[0];i(v.x0)&&i(v.y0)&&(h=dt(v),(!at.vLinePoint||at.vLinePoint.spikeDistance>h.spikeDistance)&&(at.vLinePoint=h))}var g=f.filter(function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap});if(g.length){var x=g[0];i(x.x0)&&i(x.y0)&&(h=dt(x),(!at.hLinePoint||at.hLinePoint.spikeDistance>h.spikeDistance)&&(at.hLinePoint=h))}}}}}function pt(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)kt-1;Mt--)Ct(nt[Mt]);nt=St,mt()}var Pt=t._hoverdata,Ot=[],It=U(t),Dt=V(t);for(Y=0;Y1||nt.length>1)||"closest"===I&&ot&&nt.length>1,Wt=p.combine(c.plot_bgcolor||p.background,c.paper_bgcolor),Zt=O(nt,{gd:t,hovermode:I,rotateLabels:Yt,bgColor:Wt,container:c._hoverlayer,outerContainer:c._paper.node(),commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance}),Xt=Zt.hoverLabels;if(y.isUnifiedHover(I)||(function(t,e,r,n){var i,a,o,s,l,u,c,f=e?"xa":"ya",h=e?"ya":"xa",p=0,d=1,v=t.size(),g=new Array(v),y=0,m=n.minX,x=n.maxX,b=n.minY,_=n.maxY,w=function(t){return t*r._invScaleX},A=function(t){return t*r._invScaleY};function k(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;i=!1}if(i){var n=0;for(s=0;se.pmax&&n++;for(s=t.length-1;s>=0&&!(n<=0);s--)(u=t[s]).pos>e.pmax-1&&(u.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(u=t[s]).pos+u.dp+u.size>e.pmax&&(u.del=!0,n--)}}}for(t.each(function(t){var n=t[f],i=t[h],a="x"===n._id.charAt(0),o=n.range;0===y&&o&&o[0]>o[1]!==a&&(d=-1);var s=0,l=a?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var u,c,p=D(t,e),v=t.anchor,k="end"===v?-1:1;if("middle"===v)c=(u=t.crossPos+(a?A(p.y-t.by/2):w(t.bx/2+t.tx2width/2)))+(a?A(t.by):w(t.bx));else if(a)c=(u=t.crossPos+A(M+p.y)-A(t.by/2-M))+A(t.by);else{var S=w(k*M+p.x),E=S+w(k*t.bx);u=t.crossPos+Math.min(S,E),c=t.crossPos+Math.max(S,E)}a?void 0!==b&&void 0!==_&&Math.min(c,_)-Math.max(u,b)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==m&&void 0!==x&&Math.min(c,x)-Math.max(u,m)>1&&("top"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}g[y++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?T:1)/2,pmin:s,pmax:l}]}),g.sort(function(t,e){return t[0].posref-e[0].posref||d*(e[0].traceIndex-t[0].traceIndex)});!i&&p<=v;){for(p++,i=!0,s=0;s.01&&L.pmin===C.pmin&&L.pmax===C.pmax){for(l=E.length-1;l>=0;l--)E[l].dp+=a;for(S.push.apply(S,E),g.splice(s+1,1),c=0,l=S.length-1;l>=0;l--)c+=S[l].dp;for(o=c/S.length,l=S.length-1;l>=0;l--)S[l].dp-=o;i=!1}else s++}g.forEach(k)}for(s=g.length-1;s>=0;s--){var P=g[s];for(l=P.length-1;l>=0;l--){var O=P[l],I=O.datum;I.offset=O.dp,I.del=O.del}}}(Xt,Yt,c,Zt.commonLabelBoundingBox),z(Xt,Yt,c._invScaleX,c._invScaleY)),s&&s.tagName){var Jt=g.getComponentMethod("annotations","hasClickToShow")(t,Ot);f(n.select(s),Jt?"pointer":"")}s&&!a&&function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Pt)&&(Pt&&t.emit("plotly_unhover",{event:e,points:Pt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:q,yvals:G}))}(t,e,r,a,s)})},e.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=U(i),o=V(i),s=!1,l=O(t.map(function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,u=t.eventData;if(u){var c=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),d=Math.max(s,l),v=t.trace;if(g.traceIs(v,"gl3d")){var y=i._fullLayout[v.scene]._scene.container,m=y.offsetLeft,x=y.offsetTop;c+=m,f+=m,h+=x,d+=x}u.bbox={x0:c+o,x1:f+o,y0:h+a,y1:d+a},e.inOut_bbox&&e.inOut_bbox.push(u.bbox)}else u=!1;return{color:t.color||p.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:u}}),{gd:i,hovermode:"closest",rotateLabels:s,bgColor:e.bgColor||p.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}).hoverLabels,u=0,c=0;return l.sort(function(t,e){return t.y0-e.y0}).each(function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function O(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,u=e.rotateLabels,f=e.bgColor,d=e.container,v=e.outerContainer,w=e.commonLabelOpts||{};if(0===t.length)return[[]];var T=e.fontFamily||m.HOVERFONT,A=e.fontSize||m.HOVERFONTSIZE,k=t[0],E=k.xa,L=k.ya,P=a.charAt(0),O=P+"Label",D=k[O];if(void 0===D&&"multicategory"===E.type)for(var z=0;zi.width-b?(g=i.width-b,e.attr("d","M"+(b-M)+",0L"+b+","+x+M+"v"+x+(2*S+m.height)+"H-"+b+"V"+x+M+"H"+(b-2*M)+"Z")):e.attr("d","M0,0L"+M+","+x+M+"H"+b+"v"+x+(2*S+m.height)+"H-"+b+"V"+x+M+"H-"+M+"Z"),W.minX=g-b,W.maxX=g+b,"top"===E.side?(W.minY=y-(2*S+m.height),W.maxY=y-S):(W.minY=y+S,W.maxY=y+(2*S+m.height))}else{var _,C,P;"right"===L.side?(_="start",C=1,P="",g=E._offset+E._length):(_="end",C=-1,P="-",g=E._offset),y=L._offset+(k.y0+k.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+P+M+","+M+"V"+(S+m.height/2)+"h"+P+(2*S+m.width)+"V-"+(S+m.height/2)+"H"+P+M+"V-"+M+"Z"),W.minY=y-(S+m.height/2),W.maxY=y+(S+m.height/2),"right"===L.side?(W.minX=g+M,W.maxX=g+M+(2*S+m.width)):(W.minX=g-M-(2*S+m.width),W.maxX=g-M);var O,I=m.height/2,z=F-m.top-I,R="clip"+i._uid+"commonlabel"+L._id;if(g=0?lt:ut+ht=0?ut:bt+ht=0?ot:st+pt=0?st:_t+pt=0,"top"!==t.idealAlign&&G||!Y?G?(O+=R/2,t.anchor="start"):t.anchor="middle":(O-=R/2,t.anchor="end"),t.crossPos=O;else{if(t.pos=O,G=P+z/2+W<=B,Y=P-z/2-W>=0,"left"!==t.idealAlign&&G||!Y)if(G)P+=z/2,t.anchor="start";else{t.anchor="middle";var Z=W/2,X=P+Z-B,J=P-Z;X>0&&(P-=X),J<0&&(P+=-J)}else P-=z/2,t.anchor="end";t.crossPos=P}w.attr("text-anchor",t.anchor),E&&k.attr("text-anchor",t.anchor),e.attr("transform",s(P,O)+(u?l(_):""))}),{hoverLabels:wt,commonLabelBoundingBox:W}}function I(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=N(t.name,t.nameLength));var u=r.charAt(0),c="x"===u?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[u+"Label"]===i?l=t[c+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[u+"Label"]!==i&&(h[u+"other"]=h[u+"Val"],h[u+"otherLabel"]=h[u+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(P,function(e,r){return s=N(r,t.nameLength),""})}return[l,s]}function D(t,e){var r=0,n=t.offset;return e&&(n*=-k,r=t.offset*A),{x:r,y:n}}function z(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each(function(t){var r=n.select(this);if(t.del)return r.remove();var i,s,l,u,f=r.select("text.nums"),p=t.anchor,d="end"===p?-1:1,v=(u=(l=(s={start:1,end:-1,middle:0}[(i=t).anchor])*(M+S))+s*(i.txwidth+S),"middle"===i.anchor&&(l-=i.tx2width/2,u+=i.txwidth/2+S),{alignShift:s,textShiftX:l,text2ShiftX:u}),g=D(t,e),y=g.x,m=g.y,x="middle"===p;r.select("path").attr("d",x?"M-"+a(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(d*M+y)+","+o(M+m)+"v"+o(t.by/2-M)+"h"+a(d*t.bx)+"v-"+o(t.by)+"H"+a(d*M+y)+"V"+o(m-M)+"Z");var b=y+v.textShiftX,_=m+t.ty0-t.by/2+S,w=t.textAlign||"auto";"auto"!==w&&("left"===w&&"start"!==p?(f.attr("text-anchor","start"),b=x?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===w&&"end"!==p&&(f.attr("text-anchor","end"),b=x?t.bx/2-t.tx2width/2-S:t.bx+S)),f.call(c.positionText,a(b),o(_)),t.tx2width&&(r.select("text.name").call(c.positionText,a(v.text2ShiftX+v.alignShift*S+y),o(m+t.ty0-t.by/2+S)),r.select("rect").call(h.setRect,a(v.text2ShiftX+(v.alignShift-1)*t.tx2width/2+y),o(m-t.by/2-1),a(t.tx2width),o(t.by+2)))})}function R(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var u=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var i=u(r,n);l(i)&&(t[e]=i)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:v.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:v.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=v.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+v.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=v.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+v.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+h,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function F(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||c){var d=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var g,y,m=e.hLinePoint;n=m&&m.xa,"cursor"===(i=m&&m.ya).spikesnap?(g=u.pointerX,y=u.pointerY):(g=n._offset+m.x,y=i._offset+m.y);var x,b,_=a.readability(m.color,d)<1.5?p.contrast(d):m.color,w=i.spikemode,T=i.spikethickness,A=i.spikecolor||_,k=v.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,b=g),-1!==w.indexOf("across")){var M=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(M=Math.min(M,i.position),S=Math.max(S,i.position)),x=l.l+M*l.w,b=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:y,y2:y,"stroke-width":T,stroke:A,"stroke-dasharray":h.dashStyle(i.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:y,y2:y,"stroke-width":T+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==i.side?T:-T),cy:y,r:T,fill:A}).classed("spikeline",!0)}if(f){var E,L,C=e.vLinePoint;n=C&&C.xa,i=C&&C.ya,"cursor"===n.spikesnap?(E=u.pointerX,L=u.pointerY):(E=n._offset+C.x,L=i._offset+C.y);var P,O,I=a.readability(C.color,d)<1.5?p.contrast(d):C.color,D=n.spikemode,z=n.spikethickness,R=n.spikecolor||I,F=v.getPxPosition(t,n);if(-1!==D.indexOf("toaxis")||-1!==D.indexOf("across")){if(-1!==D.indexOf("toaxis")&&(P=F,O=L),-1!==D.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),P=l.t+(1-N)*l.h,O=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:O,"stroke-width":z,stroke:R,"stroke-dasharray":h.dashStyle(n.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:O,"stroke-width":z+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==D.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==n.side?z:-z),r:z,fill:R}).classed("spikeline",!0)}}}function B(t,e){return!e||e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint}function N(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function j(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var u=s[t+"End"];void 0===u&&(u=s[t]);var c=u-l;"end"===o?i+=c:"middle"===o&&(i+=c/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function U(t){return t.offsetTop+t.clientTop}function V(t){return t.offsetLeft+t.clientLeft}function H(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.left,a=n.top,s=i+n.width,l=a+n.height,u=o.apply3DTransform(r._invTransform)(i,a),c=o.apply3DTransform(r._invTransform)(s,l),f=u[0],h=u[1],p=c[0],d=c[1];return{x:f,y:h,width:p-f,height:d-h,top:Math.min(h,d),left:Math.min(f,p),right:Math.max(f,p),bottom:Math.max(h,d)}}},80515:function(t,e,r){"use strict";var n=r(28398),i=r(86692),a=r(34802);t.exports=function(){return a(n,i,arguments)}},80594:function(t,e,r){"use strict";var n=r(15181),i=r(45728).dfltConfig,a={add:function(t,e,r,n,a){var o,s;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},s=t.undoQueue.index,t.autoplay?t.undoQueue.inSequence||(t.autoplay=!1):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(s,t.undoQueue.queue.length-s,o),t.undoQueue.index+=1):o=t.undoQueue.queue[s-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(n),o.redo.args.push(a)),t.undoQueue.queue.length>i.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r0?o-4:o;for(r=0;r>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[c++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,s=0,l=n-i;sl?l:s+o));return 1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function u(t,e,r){for(var n,i=[],a=e;a1&&(i*=y=Math.sqrt(y),s*=y);var m=i*i,x=s*s,b=(u==c?-1:1)*Math.sqrt(Math.abs((m*x-m*g*g-x*v*v)/(m*g*g+x*v*v)));b==1/0&&(b=1);var _=b*i*g/s+(t+f)/2,w=b*-s*v/i+(n+h)/2,T=Math.asin(((n-w)/s).toFixed(9)),A=Math.asin(((h-w)/s).toFixed(9));(T=t<_?e-T:T)<0&&(T=2*e+T),(A=f<_?e-A:A)<0&&(A=2*e+A),c&&T>A&&(T-=2*e),!c&&A>T&&(A-=2*e)}if(Math.abs(A-T)>r){var k=A,M=f,S=h;A=T+r*(c&&A>T?1:-1);var E=a(f=_+i*Math.cos(A),h=w+s*Math.sin(A),i,s,l,0,c,M,S,[A,k,_,w])}var L=Math.tan((A-T)/4),C=4/3*i*L,P=4/3*s*L,O=[2*t-(t+C*Math.sin(T)),2*n-(n-P*Math.cos(T)),f+C*Math.sin(A),h-P*Math.cos(A),f,h];if(p)return O;E&&(O=O.concat(E));for(var I=0;I7&&(r.push(y.splice(0,7)),y.unshift("C"));break;case"S":var x=p,b=d;"C"!=e&&"S"!=e||(x+=x-o,b+=b-l),y=["C",x,b,y[1],y[2],y[3],y[4]];break;case"T":"Q"==e||"T"==e?(f=2*p-f,h=2*d-h):(f=p,h=d),y=i(p,d,f,h,y[1],y[2]);break;case"Q":f=y[1],h=y[2],y=i(p,d,y[1],y[2],y[3],y[4]);break;case"L":y=n(p,d,y[1],y[2]);break;case"H":y=n(p,d,y[1],d);break;case"V":y=n(p,d,p,y[1]);break;case"Z":y=n(p,d,u,c)}e=m,p=y[y.length-2],d=y[y.length-1],y.length>4?(o=y[y.length-4],l=y[y.length-3]):(o=p,l=d),r.push(y)}return r}},81623:function(t,e,r){"use strict";t.exports=r(98766)()?Array.from:r(62134)},81855:function(t,e,r){"use strict";var n=r(15181),i=r(46982),a=r(92444).arrayEditor;function o(t,e){var r,n,i,a,o,l,u,c=t._fullLayout.annotations,f=[],h=[],p=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(u.length||c.length){for(r=0;r0?h+u:u;return{ppad:u,ppadplus:c?d:v,ppadminus:c?v:d}}return{ppad:u}}function c(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,f,h=1/0,p=-1/0,d=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lp&&(p=f)));return p>=h?[h,p]:void 0}}t.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o0}function T(t){t.each(function(t){m.stroke(n.select(this),t.line.color)}).each(function(t){m.fill(n.select(this),t.color)}).style("stroke-width",function(t){return t.line.width})}function A(t,e,r){var n=t._fullLayout,i=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),a={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(t,e){return o.coerce(i,a,y,t,e)}return v(i,a,l,s,n),g(i,a,l,s),a}function k(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function M(t,e,r,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(a);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",t).call(p.convertToTspans,i).call(f.font,e),f.bBox(o.node())}function S(t,e,r,n,i,a){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=o.aggNums(a,null,[t[s].value,n],2);return t[s].value=l,l}t.exports=function(t,e,r,v){var g,y=t._fullLayout;w(r)&&v&&(g=v()),o.makeTraceGroups(y._indicatorlayer,e,"trace").each(function(e){var v,E,L,C,P,O=e[0].trace,I=n.select(this),D=O._hasGauge,z=O._isAngular,R=O._isBullet,F=O.domain,B={w:y._size.w*(F.x[1]-F.x[0]),h:y._size.h*(F.y[1]-F.y[0]),l:y._size.l+y._size.w*F.x[0],r:y._size.r+y._size.w*(1-F.x[1]),t:y._size.t+y._size.h*(1-F.y[1]),b:y._size.b+y._size.h*F.y[0]},N=B.l+B.w/2,j=B.t+B.h/2,U=Math.min(B.w/2,B.h),V=h.innerRadius*U,H=O.align||"center";if(E=j,D){if(z&&(v=N,E=j+U/2,L=function(t){return function(t,e){return[e/Math.sqrt(t.width/2*(t.width/2)+t.height*t.height),t,e]}(t,.9*V)}),R){var q=h.bulletPadding,G=1-h.bulletNumberDomainSize+q;v=B.l+(G+(1-G)*b[H])*B.w,L=function(t){return k(t,(h.bulletNumberDomainSize-q)*B.w,B.h)}}}else v=B.l+b[H]*B.w,L=function(t){return k(t,B.w,B.h)};!function(t,e,r,i){var u,c,h,v=r[0].trace,g=i.numbersX,y=i.numbersY,T=v.align||"center",k=x[T],E=i.transitionOpts,L=i.onComplete,C=o.ensureSingle(e,"g","numbers"),P=[];v._hasNumber&&P.push("number"),v._hasDelta&&(P.push("delta"),"left"===v.delta.position&&P.reverse());var O=C.selectAll("text").data(P);function I(e,r,n,i){if(!e.match("s")||n>=0==i>=0||r(n).slice(-1).match(_)||r(i).slice(-1).match(_))return r;var a=e.slice().replace("s","f").replace(/\d+/,function(t){return parseInt(t)-1}),o=A(t,{tickformat:a});return function(t){return Math.abs(t)<1?d.tickText(o,t).text:r(t)}}O.enter().append("text"),O.attr("text-anchor",function(){return k}).attr("class",function(t){return t}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),O.exit().remove();var D,z=v.mode+v.align;if(v._hasDelta&&(D=function(){var e=A(t,{tickformat:v.delta.valueformat},v._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=v.delta.suffix,s=v.delta.prefix,l=function(t){return v.delta.relative?t.relativeDelta:t.delta},u=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?v.delta.increasing.symbol:v.delta.decreasing.symbol)+s+e(t)+o},h=function(t){return t.delta>=0?v.delta.increasing.color:v.delta.decreasing.color};void 0===v._deltaLastValue&&(v._deltaLastValue=l(r[0]));var g=C.select("text.delta");function y(){g.text(u(l(r[0]),i)).call(m.fill,h(r[0])).call(p.convertToTspans,t)}return g.call(f.font,v.delta.font).call(m.fill,h({delta:v._deltaLastValue})),w(E)?g.transition().duration(E.duration).ease(E.easing).tween("text",function(){var t=n.select(this),e=l(r[0]),o=v._deltaLastValue,s=I(v.delta.valueformat,i,o,e),c=a(o,e);return v._deltaLastValue=e,function(e){t.text(u(c(e),s)),t.call(m.fill,h({delta:c(e)}))}}).each("end",function(){y(),L&&L()}).each("interrupt",function(){y(),L&&L()}):y(),c=M(u(l(r[0]),i),v.delta.font,k,t),g}(),z+=v.delta.position+v.delta.font.size+v.delta.font.family+v.delta.valueformat,z+=v.delta.increasing.symbol+v.delta.decreasing.symbol,h=c),v._hasNumber&&(function(){var e=A(t,{tickformat:v.number.valueformat},v._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=v.number.suffix,s=v.number.prefix,l=C.select("text.number");function c(){var e="number"==typeof r[0].y?s+i(r[0].y)+o:"-";l.text(e).call(f.font,v.number.font).call(p.convertToTspans,t)}w(E)?l.transition().duration(E.duration).ease(E.easing).each("end",function(){c(),L&&L()}).each("interrupt",function(){c(),L&&L()}).attrTween("text",function(){var t=n.select(this),e=a(r[0].lastY,r[0].y);v._lastValue=r[0].y;var l=I(v.number.valueformat,i,r[0].lastY,r[0].y);return function(r){t.text(s+l(e(r))+o)}}):c(),u=M(s+i(r[0].y)+o,v.number.font,k,t)}(),z+=v.number.font.size+v.number.font.family+v.number.valueformat+v.number.suffix+v.number.prefix,h=u),v._hasDelta&&v._hasNumber){var R,F,B=[(u.left+u.right)/2,(u.top+u.bottom)/2],N=[(c.left+c.right)/2,(c.top+c.bottom)/2],j=.75*v.delta.font.size;"left"===v.delta.position&&(R=S(v,"deltaPos",0,-1*(u.width*b[v.align]+c.width*(1-b[v.align])+j),z,Math.min),F=B[1]-N[1],h={width:u.width+c.width+j,height:Math.max(u.height,c.height),left:c.left+R,right:u.right,top:Math.min(u.top,c.top+F),bottom:Math.max(u.bottom,c.bottom+F)}),"right"===v.delta.position&&(R=S(v,"deltaPos",0,u.width*(1-b[v.align])+c.width*b[v.align]+j,z,Math.max),F=B[1]-N[1],h={width:u.width+c.width+j,height:Math.max(u.height,c.height),left:u.left,right:c.right+R,top:Math.min(u.top,c.top+F),bottom:Math.max(u.bottom,c.bottom+F)}),"bottom"===v.delta.position&&(R=null,F=c.height,h={width:Math.max(u.width,c.width),height:u.height+c.height,left:Math.min(u.left,c.left),right:Math.max(u.right,c.right),top:u.bottom-u.height,bottom:u.bottom+c.height}),"top"===v.delta.position&&(R=null,F=u.top,h={width:Math.max(u.width,c.width),height:u.height+c.height,left:Math.min(u.left,c.left),right:Math.max(u.right,c.right),top:u.bottom-u.height-c.height,bottom:u.bottom}),D.attr({dx:R,dy:F})}(v._hasNumber||v._hasDelta)&&C.attr("transform",function(){var t=i.numbersScaler(h);z+=t[2];var e,r=S(v,"numbersScale",1,t[0],z,Math.min);v._scaleNumbers||(r=1),e=v._isAngular?y-r*h.bottom:y-r*(h.top+h.bottom)/2,v._numbersTop=r*h.top+e;var n=h[T];"center"===T&&(n=(h.left+h.right)/2);var a=g-r*n;return a=S(v,"numbersTranslate",0,a,z,Math.max),l(a,e)+s(r)})}(t,I,e,{numbersX:v,numbersY:E,numbersScaler:L,transitionOpts:r,onComplete:g}),D&&(C={range:O.gauge.axis.range,color:O.gauge.bgcolor,line:{color:O.gauge.bordercolor,width:0},thickness:1},P={range:O.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:O.gauge.bordercolor,width:O.gauge.borderwidth},thickness:1});var Y=I.selectAll("g.angular").data(z?e:[]);Y.exit().remove();var W=I.selectAll("g.angularaxis").data(z?e:[]);W.exit().remove(),z&&function(t,e,r,a){var o,s,f,h,p=r[0].trace,v=a.size,g=a.radius,y=a.innerRadius,m=a.gaugeBg,x=a.gaugeOutline,b=[v.l+v.w/2,v.t+v.h/2+g/2],_=a.gauge,k=a.layer,M=a.transitionOpts,S=a.onComplete,E=Math.PI/2;function L(t){var e=p.gauge.axis.range[0],r=(t-e)/(p.gauge.axis.range[1]-e)*Math.PI-E;return r<-E?-E:r>E?E:r}function C(t){return n.svg.arc().innerRadius((y+g)/2-t/2*(g-y)).outerRadius((y+g)/2+t/2*(g-y)).startAngle(-E)}function P(t){t.attr("d",function(t){return C(t.thickness).startAngle(L(t.range[0])).endAngle(L(t.range[1]))()})}_.enter().append("g").classed("angular",!0),_.attr("transform",l(b[0],b[1])),k.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),k.selectAll("g.xangularaxistick,path,text").remove(),(o=A(t,p.gauge.axis)).type="linear",o.range=p.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var O=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},I={},D=d.makeLabelFns(o,0).labelStandoff;I.xFn=function(t){var e=O(t);return Math.cos(e)*D},I.yFn=function(t){var e=O(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(D+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*c)},I.anchorFn=function(t){var e=O(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},I.heightFn=function(t,e,r){var n=O(t);return-.5*(1+Math.sin(n))*r};var z=function(t){return l(b[0]+g*Math.cos(t),b[1]-g*Math.sin(t))};f=function(t){return z(O(t))};if(s=d.calcTicks(o),h=d.getTickSigns(o)[2],o.visible){h="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;d.drawTicks(t,o,{vals:s,layer:k,path:"M"+h*R+",0h"+h*o.ticklen,transFn:function(t){var e=O(t);return z(e)+"rotate("+-u(e)+")"}}),d.drawLabels(t,o,{vals:s,layer:k,transFn:f,labelFns:I})}var F=[m].concat(p.gauge.steps),B=_.selectAll("g.bg-arc").data(F);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(P).call(T),B.exit().remove();var N=C(p.gauge.bar.thickness),j=_.selectAll("g.value-arc").data([p.gauge.bar]);j.enter().append("g").classed("value-arc",!0).append("path");var U,V,H,q=j.select("path");w(M)?(q.transition().duration(M.duration).ease(M.easing).each("end",function(){S&&S()}).each("interrupt",function(){S&&S()}).attrTween("d",(U=N,V=L(r[0].lastY),H=L(r[0].y),function(){var t=i(V,H);return function(e){return U.endAngle(t(e))()}})),p._lastValue=r[0].y):q.attr("d","number"==typeof r[0].y?N.endAngle(L(r[0].y)):"M0,0Z"),q.call(T),j.exit().remove(),F=[];var G=p.gauge.threshold.value;(G||0===G)&&F.push({range:[G,G],color:p.gauge.threshold.color,line:{color:p.gauge.threshold.line.color,width:p.gauge.threshold.line.width},thickness:p.gauge.threshold.thickness});var Y=_.selectAll("g.threshold-arc").data(F);Y.enter().append("g").classed("threshold-arc",!0).append("path"),Y.select("path").call(P).call(T),Y.exit().remove();var W=_.selectAll("g.gauge-outline").data([x]);W.enter().append("g").classed("gauge-outline",!0).append("path"),W.select("path").call(P).call(T),W.exit().remove()}(t,0,e,{radius:U,innerRadius:V,gauge:Y,layer:W,size:B,gaugeBg:C,gaugeOutline:P,transitionOpts:r,onComplete:g});var Z=I.selectAll("g.bullet").data(R?e:[]);Z.exit().remove();var X=I.selectAll("g.bulletaxis").data(R?e:[]);X.exit().remove(),R&&function(t,e,r,n){var i,a,o,s,u,c=r[0].trace,f=n.gauge,p=n.layer,v=n.gaugeBg,g=n.gaugeOutline,y=n.size,x=c.domain,b=n.transitionOpts,_=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",l(y.l,y.t)),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var k=y.h,M=c.gauge.bar.thickness*k,S=x.x[0],E=x.x[0]+(x.x[1]-x.x[0])*(c._hasNumber||c._hasDelta?1-h.bulletNumberDomainSize:1);function L(t){t.attr("width",function(t){return Math.max(0,i.c2p(t.range[1])-i.c2p(t.range[0]))}).attr("x",function(t){return i.c2p(t.range[0])}).attr("y",function(t){return.5*(1-t.thickness)*k}).attr("height",function(t){return t.thickness*k})}(i=A(t,c.gauge.axis))._id="xbulletaxis",i.domain=[S,E],i.setScale(),a=d.calcTicks(i),o=d.makeTransTickFn(i),s=d.getTickSigns(i)[2],u=y.t+y.h,i.visible&&(d.drawTicks(t,i,{vals:"inside"===i.ticks?d.clipEnds(i,a):a,layer:p,path:d.makeTickPath(i,u,s),transFn:o}),d.drawLabels(t,i,{vals:a,layer:p,transFn:o,labelFns:d.makeLabelFns(i,u)}));var C=[v].concat(c.gauge.steps),P=f.selectAll("g.bg-bullet").data(C);P.enter().append("g").classed("bg-bullet",!0).append("rect"),P.select("rect").call(L).call(T),P.exit().remove();var O=f.selectAll("g.value-bullet").data([c.gauge.bar]);O.enter().append("g").classed("value-bullet",!0).append("rect"),O.select("rect").attr("height",M).attr("y",(k-M)/2).call(T),w(b)?O.select("rect").transition().duration(b.duration).ease(b.easing).each("end",function(){_&&_()}).each("interrupt",function(){_&&_()}).attr("width",Math.max(0,i.c2p(Math.min(c.gauge.axis.range[1],r[0].y)))):O.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(c.gauge.axis.range[1],r[0].y))):0),O.exit().remove();var I=r.filter(function(){return c.gauge.threshold.value||0===c.gauge.threshold.value}),D=f.selectAll("g.threshold-bullet").data(I);D.enter().append("g").classed("threshold-bullet",!0).append("line"),D.select("line").attr("x1",i.c2p(c.gauge.threshold.value)).attr("x2",i.c2p(c.gauge.threshold.value)).attr("y1",(1-c.gauge.threshold.thickness)/2*k).attr("y2",(1-(1-c.gauge.threshold.thickness)/2)*k).call(m.stroke,c.gauge.threshold.line.color).style("stroke-width",c.gauge.threshold.line.width),D.exit().remove();var z=f.selectAll("g.gauge-outline").data([g]);z.enter().append("g").classed("gauge-outline",!0).append("rect"),z.select("rect").call(L).call(T),z.exit().remove()}(t,0,e,{gauge:Z,layer:X,size:B,gaugeBg:C,gaugeOutline:P,transitionOpts:r,onComplete:g});var J=I.selectAll("text.title").data(e);J.exit().remove(),J.enter().append("text").classed("title",!0),J.attr("text-anchor",function(){return R?x.right:x[O.title.align]}).text(O.title.text).call(f.font,O.title.font).call(p.convertToTspans,t),J.attr("transform",function(){var t,e=B.l+B.w*b[O.title.align],r=h.titlePadding,n=f.bBox(J.node());return D?(z&&(t=O.gauge.axis.visible?f.bBox(W.node()).top-r-n.bottom:B.t+B.h/2-U/2-n.bottom-r),R&&(t=E-(n.top+n.bottom)/2,e=B.l-h.bulletPadding*B.w)):t=O._numbersTop-r-n.bottom,l(e,t)})})}},82339:function(t,e,r){"use strict";t.exports=r(6852)},82492:function(t){"use strict";t.exports=function(t,e){if(!e)return t;var r=1/Math.abs(e),n=r>1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},82706:function(t,e,r){"use strict";t.exports=r(29977)},82734:function(t){t.exports=function(t,e,r,n){var i,a,o,s,l,u,c,f,h,p,d,v,g,y,m,x,b,_,w,T,A,k,M,S,E=n[0],L=n[1],C=n[2],P=Math.sqrt(E*E+L*L+C*C);return Math.abs(P)<1e-6?null:(E*=P=1/P,L*=P,C*=P,i=Math.sin(r),o=1-(a=Math.cos(r)),s=e[0],l=e[1],u=e[2],c=e[3],f=e[4],h=e[5],p=e[6],d=e[7],v=e[8],g=e[9],y=e[10],m=e[11],x=E*E*o+a,b=L*E*o+C*i,_=C*E*o-L*i,w=E*L*o-C*i,T=L*L*o+a,A=C*L*o+E*i,k=E*C*o+L*i,M=L*C*o-E*i,S=C*C*o+a,t[0]=s*x+f*b+v*_,t[1]=l*x+h*b+g*_,t[2]=u*x+p*b+y*_,t[3]=c*x+d*b+m*_,t[4]=s*w+f*T+v*A,t[5]=l*w+h*T+g*A,t[6]=u*w+p*T+y*A,t[7]=c*w+d*T+m*A,t[8]=s*k+f*M+v*S,t[9]=l*k+h*M+g*S,t[10]=u*k+p*M+y*S,t[11]=c*k+d*M+m*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}},82769:function(t,e,r){"use strict";var n=r(15181),i=r(49210),a=r(5651),o=r(53125),s=r(20762),l=r(1798);t.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}i(t,e,c,u),!1!==e.visible&&(a(t,e,c,function(r){return n.coerce2(t,e,l,r)}),o(t,e,c,u),c("xhoverformat"),c("yhoverformat"),c("hovertemplate"),e.contours&&"heatmap"===e.contours.coloring&&s(c,u))}},82797:function(t){"use strict";t.exports={mod:function(t,e){var r=t%e;return r<0?r+e:r},modHalf:function(t,e){return Math.abs(t)>e/2?t-Math.round(t/e)*e:t}}},82881:function(t,e,r){"use strict";var n=r(15181),i=r(13516),a=r(46716),o=r(75958);function s(t,e,r,n){r("accesstoken",n.accessToken),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch");var i=r("bounds.west"),o=r("bounds.east"),s=r("bounds.south"),u=r("bounds.north");void 0!==i&&void 0!==o&&void 0!==s&&void 0!==u||delete e.bounds,a(t,e,{name:"layers",handleItemDefaults:l}),e._input=t}function l(t,e){function r(r,i){return n.coerce(t,e,o.layers,r,i)}if(r("visible")){var i,a=r("sourcetype"),s="raster"===a||"image"===a;r("source"),r("sourceattribution"),"vector"===a&&r("sourcelayer"),"image"===a&&r("coordinates"),s&&(i="raster");var l=r("type",i);s&&"raster"!==l&&(l=e.type="raster",n.log("Source types *raster* and *image* must drawn *raster* layer type.")),r("below"),r("color"),r("opacity"),r("minzoom"),r("maxzoom"),"circle"===l&&r("circle.radius"),"line"===l&&(r("line.width"),r("line.dash")),"fill"===l&&r("fill.outlinecolor"),"symbol"===l&&(r("symbol.icon"),r("symbol.iconsize"),r("symbol.text"),n.coerceFont(r,"symbol.textfont"),r("symbol.textposition"),r("symbol.placement"))}}t.exports=function(t,e,r){i(t,e,r,{type:"mapbox",attributes:o,handleDefaults:s,partition:"y",accessToken:e._mapboxAccessToken})}},82945:function(t,e,r){"use strict";var n=r(8357).extendFlat,i=r(8357).extendDeep,a=r(7458).overrideAll,o=r(37565),s=r(24761),l=r(79444).u,u=r(94257),c=r(92444).templatedArray,f=r(11881),h=r(99012).descriptionOnlyNumbers,p=o({editType:"plot",colorEditType:"plot"}),d={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:s.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},v={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},g=c("step",i({},d,{range:v}));t.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:l({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:n({},p,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:h("value")},font:n({},p,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:h("value")},increasing:{symbol:{valType:"string",dflt:f.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:f.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:f.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:f.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:n({},p,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:i({},d,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:s.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:a({range:v,visible:n({},u.visible,{dflt:!0}),tickmode:u.minor.tickmode,nticks:u.nticks,tick0:u.tick0,dtick:u.dtick,tickvals:u.tickvals,ticktext:u.ticktext,ticks:n({},u.ticks,{dflt:"outside"}),ticklen:u.ticklen,tickwidth:u.tickwidth,tickcolor:u.tickcolor,ticklabelstep:u.ticklabelstep,showticklabels:u.showticklabels,labelalias:u.labelalias,tickfont:o({}),tickangle:u.tickangle,tickformat:u.tickformat,tickformatstops:u.tickformatstops,tickprefix:u.tickprefix,showtickprefix:u.showtickprefix,ticksuffix:u.ticksuffix,showticksuffix:u.showticksuffix,separatethousands:u.separatethousands,exponentformat:u.exponentformat,minexponent:u.minexponent,showexponent:u.showexponent,editType:"plot"},"plot"),steps:g,threshold:{line:{color:n({},d.line.color,{}),width:n({},d.line.width,{dflt:1}),editType:"plot"},thickness:n({},d.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}},82988:function(t,e,r){"use strict";var n=r(74349),i=r(31164).line,a=r(28209),o=r(99012).axisHoverFormat,s=r(38532).rb,l=r(38532).ay,u=r(86152),c=r(8357).extendFlat,f=r(69562);function h(t){return{marker:{color:c({},n.marker.color,{arrayOk:!1,editType:"style"}),line:{color:c({},n.marker.line.color,{arrayOk:!1,editType:"style"}),width:c({},n.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}t.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),hovertext:n.hovertext,hovertemplate:s({},{keys:u.eventDataKeys}),hoverinfo:c({},a.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:l({editType:"plot"},{keys:u.eventDataKeys.concat(["label"])}),text:n.text,textposition:n.textposition,insidetextanchor:n.insidetextanchor,textangle:n.textangle,textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:n.outsidetextfont,constraintext:n.constraintext,cliponaxis:n.cliponaxis,orientation:n.orientation,offset:n.offset,width:n.width,increasing:h(),decreasing:h(),totals:h(),connector:{line:{color:c({},i.color,{dflt:f.defaultLine}),width:c({},i.width,{editType:"plot"}),dash:i.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup}},83002:function(t,e,r){"use strict";var n=r(5159);t.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,i){var a=i[e];return n(a)?(a=Number(a),r[t]+=a,a):0},avg:function(t,e,r,i,a){var o=i[e];return n(o)&&(o=Number(o),r[t]+=o,a[t]++),0},min:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]>a){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]=e})}(e);for(var r,i=n(t).components.filter(function(t){return t.length>1}),a=1/0,o=0;o-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,r){r(new v("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,P(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=f.destroy,k.prototype._undestroy=f.undestroy,k.prototype._destroy=function(t,e){e(t)}},83157:function(t,e,r){"use strict";t.exports=r(85926)},83326:function(t,e,r){"use strict";var n=r(16534),i=r(15181),a=r(88191),o=r(44236),s=r(3071),l=r(26446),u=r(18687),c=r(9168),f=r(64973),h=r(94813),p=r(29120),d=r(52003),v=r(874),g=r(47912),y=g.LABELOPTIMIZER;function m(t,e){var r,n,o,s,l,u,c="",f=0,h=t.edgepaths.map(function(t,e){return e}),p=!0;function d(t){return Math.abs(t[1]-e[0][1])<.01}function v(t){return Math.abs(t[1]-e[2][1])<.01}function g(t){return Math.abs(t[0]-e[0][0])<.01}function y(t){return Math.abs(t[0]-e[2][0])<.01}for(;h.length;){for(u=a.smoothopen(t.edgepaths[f],t.smoothing),c+=p?u:u.replace(/^M/,"L"),h.splice(h.indexOf(f),1),r=t.edgepaths[f][t.edgepaths[f].length-1],s=-1,o=0;o<4;o++){if(!r){i.log("Missing end?",f,t);break}for(d(r)&&!y(r)?n=e[1]:g(r)?n=e[0]:v(r)?n=e[3]:y(r)&&(n=e[2]),l=0;l=0&&(n=m,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-m[1])<.01&&(m[0]-r[0])*(n[0]-m[0])>=0&&(n=m,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,m)}if(r=n,s>=0)break;c+="L"+n}if(s===t.edgepaths.length){i.log("unclosed perimeter path");break}f=s,(p=-1===h.indexOf(f))&&(f=h[0],c+="Z")}for(f=0;fn.center?n.right-s:s-n.left)/(c+Math.abs(Math.sin(u)*o)),p=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(u)*o);if(h<1||p<1)return 1/0;var d=y.EDGECOST*(1/(h-1)+1/(p-1));d+=y.ANGLECOST*u*u;for(var v=s-c,g=l-f,m=s+c,x=l+f,b=0;b2*y.MAXCOST)break;p&&(s/=2),l=(o=u-s/2)+1.5*s}if(h<=y.MAXCOST)return c},e.addLabelData=function(t,e,r,n){var i=e.fontSize,a=e.width+i/3,o=Math.max(0,e.height-i/3),s=t.x,l=t.y,u=t.theta,c=Math.sin(u),f=Math.cos(u),h=function(t,e){return[s+t*f-e*c,l+t*c+e*f]},p=[h(-a/2,-o/2),h(-a/2,o/2),h(a/2,o/2),h(a/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:u,level:e.level,width:a,height:o}),n.push(p)},e.drawLabels=function(t,e,r,a,o){var l=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,i=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:i,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+i+")"}).call(s.convertToTspans,r)}),o){for(var u="",c=0;ce},83998:function(t){"use strict";t.exports=function(t,e){if(!t||null==t.length)throw Error("Argument should be an array");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;ni&&(i=t[o]),t[o]r?r:t}t.exports=function(t,e,r){var y=e._fullLayout;r||(r=y.legend);var m="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return m?n:Math.min(i,r)};function T(t,a,o){var c=t[0].trace,f=c.marker||{},h=f.line||{},p=o?c.visible&&c.type===o:i.traceIs(c,"bar"),d=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(p?[t]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),d.exit().remove(),d.each(function(t){var i=n.select(this),a=t[0],o=w(a.mlw,f.line,5,2);i.style("stroke-width",o+"px");var p=a.mcc;if(!r._inHover&&"mc"in a){var d=u(f),v=d.mid;void 0===v&&(v=(d.max+d.min)/2),p=s.tryColorscale(f,"")(v)}var y=p||a.mc||f.color,m=f.pattern,x=m&&s.getPatternAttr(m.shape,0,"");if(x){var b=s.getPatternAttr(m.bgcolor,0,null),_=s.getPatternAttr(m.fgcolor,0,null),T=m.fgopacity,A=g(m.size,8,10),k=g(m.solidity,.5,1),M="legend-"+c.uid;i.call(s.pattern,"legend",e,M,x,A,k,p,m.fillmode,b,_,T)}else i.call(l.fill,y);o&&l.stroke(i,a.mlc||h.color)})}function A(t,r,o){var s=t[0],l=s.trace,u=o?l.visible&&l.type===o:i.traceIs(l,o),c=n.select(r).select("g.legendpoints").selectAll("path.legend"+o).data(u?[t]:[]);if(c.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var p=l.marker||{},d=w(h(p.line.width,s.pts),p.line,5,2),v="pieLike",g=a.minExtend(l,{marker:{line:{width:d}}},v),y=a.minExtend(s,{trace:g},v);f(c,y,g,e)}}t.each(function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,u=t[0].height;if("middle"!==s&&l&&u){var c={top:1,bottom:-1}[s]*(.5*(l-u+3));i.attr("transform",o(0,c))}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=i.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(function(t){var r,i=t[0].trace,o=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),c.exit().remove(),c.each(function(t,o){var c,f=n.select(this),h=u(i),p=h.colorscale,v=h.reversescale;if(p){if(!r){var g=p.length;c=0===o?p[v?g-1:0][1]:1===o?p[v?0:g-1][1]:p[Math.floor((g-1)/2)][1]}}else{var y=i.vertexcolor||i.facecolor||i.color;c=a.isArrayOrTypedArray(y)?y[o]||y[0]:y}f.attr("d",t[0]),c?f.call(l.fill,c):f.call(function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,d(v,"radial"===r),p,"fill")}})})}).each(function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,T(t,this,"waterfall")}var a=[];e.visible&&r&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each(function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)})}).each(function(t){T(t,this,"funnel")}).each(function(t){T(t,this)}).each(function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each(function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var u=a.minExtend(r,{marker:{size:m?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,u,e)}})}).each(function(t){A(t,this,"funnelarea")}).each(function(t){A(t,this,"pie")}).each(function(t){var r,i,o=v(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,p=o.showGradientFill,g=o.anyFill,y=o.anyLine,m=t[0],b=m.trace,_=u(b),T=_.colorscale,A=_.reversescale,k=c.hasMarkers(b)||!g?"M5,0":y?"M5,-2":"M5,-3",M=n.select(this),S=M.select(".legendfill").selectAll("path").data(l||p?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",k+"h"+x+"v6h-"+x+"z").call(function(t){if(t.size())if(l)s.fillGroupStyle(t,e);else{var r="legendfill-"+b.uid;s.gradient(t,e,r,d(A),T,"fill")}}),f||h){var E=w(void 0,b.line,10,5);i=a.minExtend(b,{line:{width:E}}),r=[a.minExtend(m,{trace:i})]}var L=M.select(".legendlines").selectAll("path").data(f||h?[r]:[]);L.enter().append("path").classed("js-line",!0),L.exit().remove(),L.attr("d",k+(h?"l"+x+",0.0001":"h"+x)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+b.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(A),T,"stroke")}})}).each(function(t){var r,i,o=v(t),l=o.anyFill,u=o.anyLine,f=o.showLine,h=o.showMarker,p=t[0],d=p.trace,g=!h&&!u&&!l&&c.hasText(d);function y(t,e,r,n){var i=a.nestedProperty(d,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(m&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(t){return p._distinct&&p.index&&t[p.index]?t[p.index]:t[0]}if(h||g||f){var b={},w={};if(h){b.mc=y("marker.color",x),b.mx=y("marker.symbol",x),b.mo=y("marker.opacity",a.mean,[.2,1]),b.mlc=y("marker.line.color",x),b.mlw=y("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=y("marker.size",a.mean,[2,16],12);b.ms=T,w.marker.size=T}f&&(w.line={width:y("line.width",x,[0,10],5)}),g&&(b.tx="Aa",b.tp=y("textposition",x),b.ts=10,b.tc=y("textfont.color",x),b.tf=y("textfont.family",x)),r=[a.minExtend(p,b)],(i=a.minExtend(d,w)).selectedpoints=null,i.texttemplate=null}var A=n.select(this).select("g.legendpoints"),k=A.selectAll("path.scatterpts").data(h?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(s.pointStyle,i,e),h&&(r[0].mrc=3);var M=A.selectAll("g.pointtext").data(g?r:[]);M.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),M.exit().remove(),M.selectAll("text").call(s.textPointStyle,i,e)}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)})})}},85797:function(t,e,r){"use strict";var n,i=r(42424),a=r(38304),o=r(41365),s=r(72930),l=r(51220),u=Object.defineProperty;n=t.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?a.call(e,"key+value")?"key+value":a.call(e,"key")?"key":"value":"value",u(this,"__kind__",o("",e))},i&&i(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),u(n.prototype,s.toStringTag,o("c","Array Iterator"))},85882:function(t,e,r){"use strict";var n=r(16534),i=r(69562),a=r(88191),o=r(44236);function s(t,e){var r=e[0].trace,s=e[0].node3.selectAll(".choroplethlocation"),l=r.marker||{},u=l.line||{},c=o.makeColorScaleFuncFromTrace(r);s.each(function(t){n.select(this).attr("fill",c(t.z)).call(i.stroke,t.mlc||u.color).call(a.dashLine,"",t.mlw||u.width||0).style("opacity",l.opacity)}),a.selectedPointStyle(s,r)}t.exports={style:function(t,e){e&&s(0,e)},styleOnSelect:function(t,e){var r=e[0].node3,n=e[0].trace;n.selectedpoints?a.selectedPointStyle(r.selectAll(".choroplethlocation"),n):s(0,e)}}},85926:function(t,e,r){"use strict";t.exports={moduleType:"trace",name:"barpolar",basePlotModule:r(16665),categories:["polar","bar","showLegend"],attributes:r(29245),layoutAttributes:r(28600),supplyDefaults:r(67914),supplyLayoutDefaults:r(96015),calc:r(1105).calc,crossTraceCalc:r(1105).crossTraceCalc,plot:r(89191),colorbar:r(23814),formatLabels:r(90812),style:r(18095).style,styleOnSelect:r(18095).styleOnSelect,hoverPoints:r(14476),selectPoints:r(40668),meta:{}}},86047:function(t,e,r){"use strict";var n=r(5159),i=r(78945).BADNUM,a=r(80924),o=r(66335),s=r(64433),l=r(2524).calcMarkerSize;t.exports=function(t,e){for(var r=t._fullLayout,u=e.subplot,c=r[u].realaxis,f=r[u].imaginaryaxis,h=c.makeCalcdata(e,"real"),p=f.makeCalcdata(e,"imag"),d=e._length,v=new Array(d),g=0;g=0;j--)F=M.clipsegments[j],B=i([],F.x,_.c2p),N=i([],F.y,w.c2p),B.reverse(),N.reverse(),V.push(a(B,N,F.bicubic));var H="M"+V.join("L")+"Z";!function(t,e,r,n,o,l){var u,c,f,h,p=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(h=0;h=0&&(h=L,d=v):Math.abs(f[1]-h[1])=0&&(h=L,d=v):s.log("endpt to newendpt is not vert. or horz.",f,h,L)}if(d>=0)break;m+=S(f,h),f=h}if(d===e.edgepaths.length){s.log("unclosed perimeter path");break}c=d,(b=-1===x.indexOf(c))&&(c=x[0],m+=S(f,h)+"Z",f=null)}for(c=0;cv&&(n.max=v),n.len=n.max-n.min}function g(t,e){var r,n=0,o=.1;return(Math.abs(t[0]-l)9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var u=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,u)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!_(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function _(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry)if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else{var c=t._module;if(c||(c=(n.modules[t.type||a.type.dflt]||{})._module),!c)return!1;if(!(i=(r=c.attributes)&&r[o])){var f=c.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return b(i,e,s)},e.getLayoutValObject=function(t,e){var r=function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var u;for(r=0;r_?(M=p,C="y0",S=_,P="y1"):(M=_,C="y1",S=p,P="y0"),$(n),et(l,r),function(t,e,r){var n=e.xref,i=e.yref,a=o.getFromId(r,n),s=o.getFromId(r,i),l="";"paper"===n||a.autorange||(l+=n),"paper"===i||s.autorange||(l+=i),h.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),K.moveFn="move"===z?Q:tt,K.altKey=n.altKey)},doneFn:function(){b(t)||(v(e),rt(l),T(e,t,r),i.call("_guiRelayout",t,c.getUpdateObj()))},clickFn:function(){b(t)||rt(l)}};function $(r){if(b(t))z=null;else if(B)z="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=K.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!N&&i>10&&a>10&&!r.shiftKey?d.getCursor(o/i,1-s/a):"move";v(e,l),z=l.split("-")[0]}}function Q(n,i){if("path"===r.type){var a=function(t){return t},o=a,c=a;R?j("xanchor",r.xanchor=Z(w+n)):(o=function(t){return Z(Y(t)+n)},V&&"date"===V.type&&(o=y.encodeDate(o))),F?j("yanchor",r.yanchor=X(k+i)):(c=function(t){return X(W(t)+i)},q&&"date"===q.type&&(c=y.encodeDate(c))),j("path",r.path=A(D,o,c))}else R?j("xanchor",r.xanchor=Z(w+n)):(j("x0",r.x0=Z(f+n)),j("x1",r.x1=Z(x+n))),F?j("yanchor",r.yanchor=X(k+i)):(j("y0",r.y0=X(p+i)),j("y1",r.y1=X(_+i)));e.attr("d",m(t,r)),et(l,r),u(t,s,r,U)}function tt(n,i){if(N){var a=function(t){return t},o=a,c=a;R?j("xanchor",r.xanchor=Z(w+n)):(o=function(t){return Z(Y(t)+n)},V&&"date"===V.type&&(o=y.encodeDate(o))),F?j("yanchor",r.yanchor=X(k+i)):(c=function(t){return X(W(t)+i)},q&&"date"===q.type&&(c=y.encodeDate(c))),j("path",r.path=A(D,o,c))}else if(B){if("resize-over-start-point"===z){var h=f+n,d=F?p-i:p+i;j("x0",r.x0=R?h:Z(h)),j("y0",r.y0=F?d:X(d))}else if("resize-over-end-point"===z){var v=x+n,g=F?_-i:_+i;j("x1",r.x1=R?v:Z(v)),j("y1",r.y1=F?g:X(g))}}else{var b=function(t){return-1!==z.indexOf(t)},T=b("n"),H=b("s"),G=b("w"),J=b("e"),K=T?M+i:M,$=H?S+i:S,Q=G?E+n:E,tt=J?L+n:L;F&&(T&&(K=M-i),H&&($=S-i)),(!F&&$-K>10||F&&K-$>10)&&(j(C,r[C]=F?K:X(K)),j(P,r[P]=F?$:X($))),tt-Q>10&&(j(O,r[O]=R?Q:Z(Q)),j(I,r[I]=R?tt:Z(tt)))}e.attr("d",m(t,r)),et(l,r),u(t,s,r,U)}function et(t,e){(R||F)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=Y(R?e.xanchor:a.midRange(r?[e.x0,e.x1]:y.extractPathCoords(e.path,g.paramIsX))),o=W(F?e.yanchor:a.midRange(r?[e.y0,e.y1]:y.extractPathCoords(e.path,g.paramIsY)));if(i=y.roundPositionForSharpStrokeRendering(i,1),o=y.roundPositionForSharpStrokeRendering(o,1),R&&F){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(R){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function rt(t){t.selectAll(".visual-cue").remove()}d.init(K),J.node().onmousemove=$}(t,F,c,e,r,z):!0===c.editable&&F.style("pointer-events",I||f.opacity(L)*E<=.5?"stroke":"all");F.node().addEventListener("click",function(){return function(t,e){if(_(t)){var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void k(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=k,x(t)}}}(t,F)})}c._input&&!0===c.visible&&("below"!==c.layer?M(t._fullLayout._shapeUpperLayer):"paper"===c.xref||"paper"===c.yref?M(t._fullLayout._shapeLowerLayer):w._hadPlotinfo?M((w.mainplotinfo||w).shapelayer):M(t._fullLayout._shapeLowerLayer))}function T(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");h.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function A(t,e,r){return t.replace(g.segmentRE,function(t){var n=0,i=t.charAt(0),a=g.paramIsX[i],o=g.paramIsY[i],s=g.numParams[i];return i+t.substr(1).replace(g.paramRE,function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t})})}function k(t){_(t)&&t._fullLayout._activeShapeIndex>=0&&(c(t),delete t._fullLayout._activeShapeIndex,x(t))}t.exports={draw:x,drawOne:w,eraseActiveShape:function(t){if(_(t)){c(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(t){if(o(t))t=+t;else if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=x.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=w||t>=400?0:Math.floor(Math.max(t,0))};var A={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},M=a("~f"),S={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:A},horizontalreversed:{node:"linearGradient",attrs:A,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};x.gradient=function(t,e,r,a,o,l){for(var c=o.length,f=S[a],h=new Array(c),p=0;p=0&&void 0===t.i&&(t.i=o.i),e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?s.opacity:t.mo),n.ms2mrc){var c;c="various"===t.ms||"various"===s.size?3:n.ms2mrc(t.ms),t.mrc=c,n.selectedSizeFn&&(c=t.mrc=n.selectedSizeFn(t));var f=x.symbolNumber(t.mx||s.symbol)||0;t.om=f%200>=100;var h=rt(t,r),p=G(t,r);e.attr("d",T(f,c,h,p))}var d,v,g,y=!1;if(t.so)g=l.outlierwidth,v=l.outliercolor,d=s.outliercolor;else{var m=(l||{}).width;g=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,v="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(l.color)?u.defaultLine:l.color,i.isArrayOrTypedArray(s.color)&&(d=u.defaultLine,y=!0),d="mc"in t?t.mcc=n.markerScale(t.mc):s.color||s.colors||"rgba(0,0,0,0)",n.selectedColorFn&&(d=n.selectedColorFn(t))}if(t.om)e.call(u.stroke,d).style({"stroke-width":(g||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:g)+"px");var b=s.gradient,_=t.mgt;_?y=!0:_=b&&b.type,i.isArrayOrTypedArray(_)&&(_=_[0],S[_]||(_=0));var w=s.pattern,A=w&&x.getPatternAttr(w.shape,t.i,"");if(_&&"none"!==_){var k=t.mgc;k?y=!0:k=b.color;var M=r.uid;y&&(M+="-"+t.i),x.gradient(e,a,M,_,[[0,k],[1,d]],"fill")}else if(A){var E=!1,L=w.fgcolor;!L&&o&&o.color&&(L=o.color,E=!0);var C=x.getPatternAttr(L,t.i,o&&o.color||null),P=x.getPatternAttr(w.bgcolor,t.i,null),O=w.fgopacity,I=x.getPatternAttr(w.size,t.i,8),D=x.getPatternAttr(w.solidity,t.i,.3);E=E||t.mcc||i.isArrayOrTypedArray(w.shape)||i.isArrayOrTypedArray(w.bgcolor)||i.isArrayOrTypedArray(w.fgcolor)||i.isArrayOrTypedArray(w.size)||i.isArrayOrTypedArray(w.solidity);var z=r.uid;E&&(z+="-"+t.i),x.pattern(e,"point",a,z,A,I,D,t.mcc,w.fillmode,P,C,O)}else i.isArrayOrTypedArray(d)?u.fill(e,d[t.i]):u.fill(e,d);g&&u.stroke(e,v)}},x.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=x.tryColorscale(r,""),e.lineScale=x.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?y(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,x.makeSelectedPointStyleFns(t)),e},x.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},u=a.opacity,c=o.opacity,f=s.opacity,h=void 0!==c,p=void 0!==f;(i.isArrayOrTypedArray(u)||h||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?h?c:e:p?f:v*e});var d=a.color,g=o.color,y=s.color;(g||y)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?g||e:y||e});var m=a.size,x=o.size,b=s.size,_=void 0!==x,w=void 0!==b;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||m/2;return t.selected?_?x/2:e:w?b/2:e}),e},x.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:c||(l?e:u.addOpacity(e,v))},e},x.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push(function(t,e){t.style("opacity",r.selectedOpacityFn(e))}),r.selectedColorFn&&a.push(function(t,e){u.fill(t,r.selectedColorFn(e))}),r.selectedSizeFn&&a.push(function(t,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);t.attr("d",T(x.symbolNumber(a),o,rt(n,e),G(n,e))),n.mrc2=o}),a.length&&t.each(function(t){for(var e=n.select(this),r=0;r0?r:0}function I(t,e,r){return r&&(t=N(t)),e?z(t[1]):D(t[0])}function D(t){var e=n.round(t,2);return E=e,e}function z(t){var e=n.round(t,2);return L=e,e}function R(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),u=Math.pow(o*o+s*s,.25),c=(u*u*i-l*l*o)*n,f=(u*u*a-l*l*s)*n,h=3*u*(l+u),p=3*l*(l+u);return[[D(e[0]+(h&&c/h)),z(e[1]+(h&&f/h))],[D(e[0]-(p&&c/p)),z(e[1]-(p&&f/p))]]}x.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=x.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each(function(t){var o=n.select(this),u=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(u||0===u){if(s){var c=e._module.formatLabels,f=c?c(t,e,l):{},p={};m(p,e,t.i);var d=e._meta||{};u=i.texttemplateString(u,f,l._d3locale,p,t,d)}var v=t.tp||e.textposition,g=O(t,e),y=a?a(t):t.tc||e.textfont.color;o.call(x.font,t.tf||e.textfont.family,g,y).text(u).call(h.convertToTspans,r).call(P,v,g,t.mrc)}else o.remove()})}},x.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedTextStyleFns(e);t.each(function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=O(t,e);u.fill(i,a);var c=l.traceIs(e,"bar-like");P(i,o,s,t.mrc2||t.mrc,c)})}},x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=u||w>=f&&w<=u)&&(T<=h&&T>=c||T>=h&&T<=c)&&(t=[w,T])}return t}x.steps=function(t){var e=F[t]||B;return function(t){for(var r="M"+D(t[0][0])+","+z(t[0][1]),n=t.length,i=1;i=1e4&&(x.savedBBoxes={},j=0),r&&(x.savedBBoxes[r]=g),j++,i.extendFlat({},g)},x.setClipUrl=function(t,e,r){t.attr("clip-path",V(e,r))},x.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||0,y:+e[1]||0}},x.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=f(e,r)).trim(),t[i]("transform",a),a},x.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||1,y:+e[1]||1}},x.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var H=/\s*sc.*/;x.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each(function(){var t=(this.getAttribute("transform")||"").replace(H,"");t=(t+=n).trim(),this.setAttribute("transform",t)})}};var q=/translate\([^)]*\)\s*$/;function G(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}x.setTextPointsScale=function(t,e,r){t&&t.each(function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(q);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}})},x.getMarkerStandoff=G;var Y,W,Z,X,J,K,$=Math.atan2,Q=Math.cos,tt=Math.sin;function et(t,e){var r=e[0],n=e[1];return[r*Q(t)-n*tt(t),r*tt(t)+n*Q(t)]}function rt(t,e){var r,n,i=t.ma;void 0===i&&(i=e.marker.angle||0);var a=e.marker.angleref;if("previous"===a||"north"===a){if(e._geo){var s=e._geo.project(t.lonlat);r=s[0],n=s[1]}else{var l=e._xA,u=e._yA;if(!l||!u)return 90;r=l.c2p(t.x),n=u.c2p(t.y)}if(e._geo){var c,f=t.lonlat[0],h=t.lonlat[1],p=e._geo.project([f,h+1e-5]),d=e._geo.project([f+1e-5,h]),v=$(d[1]-n,d[0]-r),g=$(p[1]-n,p[0]-r);if("north"===a)c=i/180*Math.PI;else if("previous"===a){var y=f/180*Math.PI,m=h/180*Math.PI,x=Y/180*Math.PI,b=W/180*Math.PI,_=x-y,w=Q(b)*tt(_),T=tt(b)*Q(m)-Q(b)*tt(m)*Q(_);c=-$(w,T)-Math.PI,Y=f,W=h}var A=et(v,[Q(c),0]),k=et(g,[tt(c),0]);i=$(A[1]+k[1],A[0]+k[0])/Math.PI*180,"previous"!==a||K===e.uid&&t.i===J+1||(i=null)}if("previous"===a&&!e._geo)if(K===e.uid&&t.i===J+1&&o(r)&&o(n)){var M=r-Z,S=n-X,E=e.line&&e.line.shape||"",L=E.slice(E.length-1);"h"===L&&(S=0),"v"===L&&(M=0),i+=$(S,M)/Math.PI*180+90}else i=null}return Z=r,X=n,J=t.i,K=e.uid,i}x.getMarkerAngle=rt},88273:function(t,e,r){"use strict";var n=r(50260);function i(t,e){o(t,e),a(t)}function a(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function o(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(o,this,t)):n.nextTick(o,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(a,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(a,r),e(t)):n.nextTick(a,r)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},88326:function(t,e,r){"use strict";var n=r(93003),i=r(28418),a=r(46982),o=r(51676).isUnifiedHover,s=r(32525),l=r(76492),u=r(61012).DRAW_MODES,c=r(15181).extendDeep;t.exports=function(t){var e=t._fullLayout,r=t._context,f=e._modeBar;if(r.displayModeBar||r.watermark){if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var h,p=r.modeBarButtons;h=Array.isArray(p)&&p.length?function(t){for(var e=c([],t),r=0;r1?(O=["toggleHover"],I=["resetViews"]):y?(P=["zoomInGeo","zoomOutGeo"],O=["hoverClosestGeo"],I=["resetGeo"]):g?(O=["hoverClosest3d"],I=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(P=["zoomInMapbox","zoomOutMapbox"],O=["toggleHover"],I=["resetViewMapbox"]):b?O=["hoverClosestGl2d"]:m?O=["hoverClosestPie"]:k?(O=["hoverClosestCartesian","hoverCompareCartesian"],I=["resetViewSankey"]):O=["toggleHover"],v&&(O=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]),(function(t){for(var e=0;e=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(r))for(e=0;e=55296&&g<=56319&&(v+=t[++p]),l.call(e,y,v,f),!h);++p);else u.call(t,function(t){return l.call(e,y,t,f),h})}},88870:function(t){"use strict";t.exports=function(t,e,r,n,i){var a=(t-r)/(n-r),o=a+e/(n-r),s=(a+o)/2;return"left"===i||"bottom"===i?a:"center"===i||"middle"===i?s:"right"===i||"top"===i?o:a<2/3-s?a:o>4/3-s?o:s}},88890:function(t,e,r){"use strict";e.version=r(16845).version,r(89494),r(29269);for(var n=r(46982),i=e.register=n.register,a=r(2378),o=Object.keys(a),s=0;s=0;r--){var i=e[r];n.removeLayer(c.layerIds[i])}t||n.removeSource(c.sourceIds.circle)}(t):function(t){for(var e=o.nonCluster,r=e.length-1;r>=0;r--){var i=e[r];n.removeLayer(c.layerIds[i]),t||n.removeSource(c.sourceIds[i])}}(t)}function h(t){l?function(t){t||c.addSource("circle",a.circle,e.cluster);for(var r=o.cluster,n=0;n=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},t.exports=function(t,e){var r,n,a,l=e[0].trace,u=l.cluster&&l.cluster.enabled,c=!0!==l.visible,f=new s(t,l.uid,u,c),h=i(t.gd,e),p=f.below=t.belowLookup["trace-"+l.uid];if(u)for(f.addSource("circle",h.circle,l.cluster),r=0;r0?(u=o,c=l):(u=l,c=o);var f=[s.findEnclosingVertexAngles(u,t.vangles)[0],(u+c)/2,s.findEnclosingVertexAngles(c,t.vangles)[1]];return s.pathPolygonAnnulus(n,i,u,c,f,e,r)}:function(t,n,i,o){return a.pathAnnulus(t,n,i,o,e,r)}}(e),d=e.layers.frontplot.select("g.barlayer");a.makeTraceGroups(d,r,"trace bars").each(function(){var r=n.select(this),s=a.ensureSingle(r,"g","points").selectAll("g.point").data(a.identity);s.enter().append("g").style("vector-effect",l?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each(function(t){var e,r=n.select(this),o=t.rp0=f.c2p(t.s0),s=t.rp1=f.c2p(t.s1),l=t.thetag0=h.c2g(t.p0),d=t.thetag1=h.c2g(t.p1);if(i(o)&&i(s)&&i(l)&&i(d)&&o!==s&&l!==d){var v=f.c2g(t.s1),g=(l+d)/2;t.ct=[u.c2p(v*Math.cos(g)),c.c2p(v*Math.sin(g))],e=p(o,s,l,d)}else e="M0,0Z";a.ensureSingle(r,"path").attr("d",e)}),o.setClipUrl(r,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)})}},89196:function(t,e,r){"use strict";var n=r(5159),i=r(15181),a=i.dateTime2ms,o=i.incrementMonth,s=r(78945).ONEAVGMONTH;t.exports=function(t,e,r,i){if("date"!==e.type)return{vals:i};var l=t[r+"periodalignment"];if(!l)return{vals:i};var u,c=t[r+"period"];if(n(c)){if((c=+c)<=0)return{vals:i}}else if("string"==typeof c&&"M"===c.charAt(0)){var f=+c.substring(1);if(!(f>0&&Math.round(f)===f))return{vals:i};u=f}for(var h=e.calendar,p="start"===l,d="end"===l,v=t[r+"period0"],g=a(v,h)||0,y=[],m=[],x=[],b=i.length,_=0;_k;)A=o(A,-u,h);for(;A<=k;)A=o(A,u,h);T=o(A,-u,h)}else{for(A=g+(w=Math.round((k-g)/c))*c;A>k;)A-=c;for(;A<=k;)A+=c;T=A-c}y[_]=p?T:d?A:(T+A)/2,m[_]=T,x[_]=A}return{vals:y,starts:m,ends:x}}},89318:function(t){"use strict";t.exports=Math.max},89358:function(t,e,r){"use strict";var n=r(8357).extendFlat;e.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},e.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0;return[r,e?r+e.rows.length:0]}(t);return(t.values||[]).slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},89374:function(t,e,r){"use strict";var n=r(15181).maxRowLength;t.exports=function(t){var e,r,i,a,o,s,l,u,c=[],f={},h=[],p=t[0],d=[],v=[0,0,0],g=n(t);for(r=0;r=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||v)[2]+(f[[r+1,i]]||v)[2]+(f[[r,i-1]]||v)[2]+(f[[r,i+1]]||v)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}},89494:function(t,e,r){var n;!function(i,a){a[i]=a[i]||function(){"use strict";var t,e,r,n=Object.prototype.toString,i="undefined"!=typeof setImmediate?function(t){return setImmediate(t)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(t,e,r,n){return Object.defineProperty(t,e,{value:r,writable:!0,configurable:!1!==n})}}catch(e){t=function(t,e,r){return t[e]=r,t}}function a(t,n){r.add(t,n),e||(e=i(r.drain))}function o(t){var e,r=typeof t;return null==t||"object"!=r&&"function"!=r||(e=t.then),"function"==typeof e&&e}function s(){for(var t=0;t0&&a(s,r))}catch(t){c.call(new h(r),t)}}}function c(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&a(s,e))}function f(t,e,r,n){for(var i=0;ie[2]&&(e[2]=l[u+0]),l[u+1]>e[3]&&(e[3]=l[u+1]);return e}},89953:function(t,e,r){"use strict";var n=r(49188),i=r(42964),a=r(8374),o=r(72930).iterator,s=Array.isArray;t.exports=function(t){return!(!i(t)||!s(t)&&!a(t)&&!n(t)&&"function"!=typeof t[o])}},90057:function(t){"use strict";function e(t,r,n){var i=0|t[n];if(i<=0)return[];var a,o=new Array(i);if(n===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",function(t,e,i){var a,s,l,u,f;if(void 0===o&&(o=r(14222)),o("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(s="not ",e.substr(0,4)===s)?(a="must not be",e=e.replace(/^not /,"")):a="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-9,r)===e}(t," argument"))l="The ".concat(t," ").concat(a," ").concat(c(e,"type"));else{var h=("number"!=typeof f&&(f=0),f+1>(u=t).length||-1===u.indexOf(".",f)?"argument":"property");l='The "'.concat(t,'" ').concat(h," ").concat(a," ").concat(c(e,"type"))}return l+". Received type ".concat(n(i))},TypeError),u("ERR_INVALID_ARG_VALUE",function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(73147));var i=s.inspect(e);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(i)},TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",function(t,e,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")},TypeError),u("ERR_MISSING_ARGS",function(){for(var t=arguments.length,e=new Array(t),n=0;n0,"At least one arg needs to be specified");var i="The ",a=e.length;switch(e=e.map(function(t){return'"'.concat(t,'"')}),a){case 1:i+="".concat(e[0]," argument");break;case 2:i+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:i+=e.slice(0,a-1).join(", "),i+=", and ".concat(e[a-1]," arguments")}return"".concat(i," must be specified")},TypeError),t.exports.codes=l},90438:function(t,e,r){"use strict";var n=r(16534),i=r(38533),a=r(64815),o=r(61426),s=r(73157),l=r(94963),u=r(13616),c=r(10194),f=r(23716),h=r(23255),p=Object.keys(i),d={"ISO-3":l,"USA-states":l,"country names":function(t){for(var e=0;e0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;ri&&(i=u,e=l)}else e=r;return o.default(e).geometry.coordinates}(c),n.fIn=t,n.fOut=c,s.push(c)}else u.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++},50)})}for(var o=0;oi-Math.floor(i)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Persian",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chahārshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return o(this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=0;if(t>0)for(var s=1;s0?t-1:t)+a+this.jdEpoch-1},fromJD:function(t){var e=475+((t=Math.floor(t)+.5)-this.toJD(475,1,1))/365.242197,r=Math.floor(e);r<=0&&r--,t>this.toJD(r,12,o(r)?30:29)&&0===++r&&r++;var n=t-this.toJD(r,1,1)+1,i=n<=186?Math.ceil(n/31):Math.ceil((n-6)/30),a=t-this.toJD(r,i,1)+1;return this.newDate(r,i,a)}}),n.calendars.persian=a,n.calendars.jalali=a},90508:function(t){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},90701:function(t,e,r){"use strict";var n=r(5159),i=r(78945).BADNUM,a=r(80924),o=r(66335),s=r(64433),l=r(15181)._;function u(t){return t&&"string"==typeof t}t.exports=function(t,e){var r,c=Array.isArray(e.locations),f=c?e.locations.length:e._length,h=new Array(f);r=e.geojson?function(t){return u(t)||n(t)}:u;for(var p=0;p0?1:-1}},91300:function(t,e,r){"use strict";var n=r(74443),i=r(34726),a=r(49149);t.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(a(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=i(Math.floor(255*t[0]),0,255),r[1]=i(Math.floor(255*t[1]),0,255),r[2]=i(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),r)}},91371:function(t){"use strict";t.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each(function(t){t.regl&&t.regl.clear({color:!0,depth:!0})})}},91727:function(t,e,r){"use strict";t.exports=r(13408)},91907:function(t,e,r){"use strict";var n=r(15181).isArrayOrTypedArray;t.exports=function(t,e,r,i){var a,o,s,l,u,c,f,h,p,d,v,g,y,m=n(r)?"a":"b",x=("a"===m?t.aaxis:t.baxis).smoothing,b="a"===m?t.a2i:t.b2j,_="a"===m?r:i,w="a"===m?i:r,T="a"===m?e.a.length:e.b.length,A="a"===m?e.b.length:e.a.length,k=Math.floor("a"===m?t.b2j(w):t.a2i(w)),M="a"===m?function(e){return t.evalxy([],e,k)}:function(e){return t.evalxy([],k,e)};x&&(s=Math.max(0,Math.min(A-2,k)),l=k-s,o="a"===m?function(e,r){return t.dxydi([],e,s,r,l)}:function(e,r){return t.dxydj([],s,e,l,r)});var S=b(_[0]),E=b(_[1]),L=S0?Math.floor:Math.ceil,O=L>0?Math.ceil:Math.floor,I=L>0?Math.min:Math.max,D=L>0?Math.max:Math.min,z=P(S+C),R=O(E-C),F=[[f=M(S)]];for(a=z;a*L=0&&"[object Function]"===e.call(t.callee)),n}},92169:function(t,e,r){"use strict";var n=r(79758);t.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var a=e.xaxis,o=e.yaxis,s={xaxis:a,yaxis:o,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},l=e.layers.frontplot.select("g.scatterlayer"),u=0;ur.r2l(B)&&(j=o.tickIncrement(j,b.size,!0,p)),D.start=r.l2r(j),F||i.nestedProperty(e,y+".start").set(D.start)}var U=b.end,V=r.r2l(I.end),H=void 0!==V;if((b.endFound||H)&&V!==r.r2l(U)){var q=H?V:i.aggNums(Math.max,null,d);D.end=r.l2r(q),H||i.nestedProperty(e,y+".start").set(D.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[y]=i.extendFlat({},e[y]||{}),delete e._input[G],delete e[G]),[D,d]}t.exports={calc:function(t,e){var r,a,p,d,v=[],g=[],y="h"===e.orientation,m=o.getFromId(t,y?e.yaxis:e.xaxis),x=y?"y":"x",b={x:"y",y:"x"}[x],_=e[x+"calendar"],w=e.cumulative,T=h(t,e,m,x),A=T[0],k=T[1],M="string"==typeof A.size,S=[],E=M?S:A,L=[],C=[],P=[],O=0,I=e.histnorm,D=e.histfunc,z=-1!==I.indexOf("density");w.enabled&&z&&(I=I.replace(/ ?density$/,""),z=!1);var R,F="max"===D||"min"===D?null:0,B=l.count,N=u[I],j=!1,U=function(t){return m.r2c(t,0,_)};for(i.isArrayOrTypedArray(e[b])&&"count"!==D&&(R=e[b],j="avg"===D,B=l[D]),r=U(A.start),p=U(A.end)+(r-o.tickIncrement(r,A.size,!1,_))/1e6;r=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(g,w.direction,w.currentbin);var K=Math.min(v.length,g.length),$=[],Q=0,tt=K-1;for(r=0;r=Q;r--)if(g[r]){tt=r;break}for(r=Q;r<=tt;r++)if(n(v[r])&&n(g[r])){var et={p:v[r],s:g[r],b:0};w.enabled||(et.pts=P[r],Y?et.ph0=et.ph1=P[r].length?k[P[r][0]]:v[r]:(e._computePh=!0,et.ph0=q(S[r]),et.ph1=q(S[r+1],!0))),$.push(et)}return 1===$.length&&($[0].width1=o.tickIncrement($[0].p,A.size,!1,_)-$[0].p),s($,e),i.isArrayOrTypedArray(e.selectedpoints)&&i.tagSelected($,e,X),$},calcAllAutoBins:h}},92444:function(t,e,r){"use strict";var n=r(15181),i=r(28209),a="templateitemname",o={name:{valType:"string",editType:"none"}};function s(t){return t&&"string"==typeof t}function l(t){var e=t.length-1;return"s"!==t.charAt(e)&&n.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}o[a]={valType:"string",editType:"calc"},e.templatedArray=function(t,e){return e._isLinkedToArray=t,e.name=o.name,e[a]=o[a],e},e.traceTemplater=function(t){var e,r,a={};for(e in t)r=t[e],Array.isArray(r)&&r.length&&(a[e]=0);return{newTrace:function(o){var s={type:e=n.coerce(o,{},i,"type"),_template:null};if(e in a){r=t[e];var l=a[e]%r.length;a[e]++,s._template=r[l]}return s}}},e.newContainer=function(t,e,r){var i=t._template,a=i&&(i[e]||r&&i[r]);return n.isPlainObject(a)||(a=null),t[e]={_template:a}},e.arrayTemplater=function(t,e,r){var n=t._template,i=n&&n[l(e)],o=n&&n[e];Array.isArray(o)&&o.length||(o=[]);var u={};return{newItem:function(t){var e={name:t.name,_input:t},n=e[a]=t[a];if(!s(n))return e._template=i,e;for(var l=0;l=i&&(r._input||{})._templateitemname;s&&(o=i);var l,u=e+"["+o+"]";function c(){l={},s&&(l[u]={},l[u][a]=s)}function f(t,e){s?n.nestedProperty(l[u],t).set(e):l[u+"."+t]=e}function h(){var t=l;return c(),t}return c(),{modifyBase:function(t,e){l[t]=e},modifyItem:f,getUpdateObj:h,applyUpdate:function(e,r){e&&f(e,r);var i=h();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},92446:function(t,e,r){"use strict";var n=r(16534),i=r(15181),a=r(88191),o=r(78945).BADNUM,s=r(3095),l=r(70394).clearMinTextSize;t.exports=function(t,e,r,u){var c=t._fullLayout;l("waterfall",c),s.plot(t,e,r,u,{mode:c.waterfallmode,norm:c.waterfallmode,gap:c.waterfallgap,groupgap:c.waterfallgroupgap}),function(t,e,r,s){var l=e.xaxis,u=e.yaxis;i.makeTraceGroups(s,r,"trace bars").each(function(r){var s=n.select(this),c=r[0].trace,f=i.ensureSingle(s,"g","lines");if(c.connector&&c.connector.visible){var h="h"===c.orientation,p=c.connector.mode,d=f.selectAll("g.line").data(i.identity);d.enter().append("g").classed("line",!0),d.exit().remove();var v=d.size();d.each(function(r,s){if(s===v-1||r.cNext){var c=function(t,e,r,n){var i=[],a=[],o=n?e:r,s=n?r:e;return i[0]=o.c2p(t.s0,!0),a[0]=s.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),a[1]=s.c2p(t.p1,!0),i[2]=o.c2p(t.nextS0,!0),a[2]=s.c2p(t.nextP0,!0),n?[i,a]:[a,i]}(r,l,u,h),f=c[0],d=c[1],g="";f[0]!==o&&d[0]!==o&&f[1]!==o&&d[1]!==o&&("spanning"===p&&!r.isSum&&s>0&&(g+=h?"M"+f[0]+","+d[1]+"V"+d[0]:"M"+f[1]+","+d[0]+"H"+f[0]),"between"!==p&&(r.isSum||s0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:a,len:o}}function c(t,e,r,n,i){n("marker.line.width")&&n("marker.line.color",i?void 0:r.paper_bgcolor);var a=n("marker.colors");l(n,"marker.pattern",a),t.marker&&!e.marker.pattern.fgcolor&&(e.marker.pattern.fgcolor=t.marker.colors),e.marker.pattern.bgcolor||(e.marker.pattern.bgcolor=r.paper_bgcolor)}t.exports={handleLabelsAndValues:u,handleMarkerDefaults:c,supplyDefaults:function(t,e,r,n){function l(r,n){return i.coerce(t,e,a,r,n)}var f=u(l("labels"),l("values")),h=f.len;if(e._hasLabels=f.hasLabels,e._hasValues=f.hasValues,!e._hasLabels&&e._hasValues&&(l("label0"),l("dlabel")),h){e._length=h,c(t,e,n,l,!0),l("scalegroup");var p,d=l("text"),v=l("texttemplate");if(v||(p=l("textinfo",Array.isArray(d)?"text+percent":"percent")),l("hovertext"),l("hovertemplate"),v||p&&"none"!==p){var g=l("textposition");s(t,e,n,l,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&l("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&l("insidetextorientation")}o(e,n,l);var y=l("hole");if(l("title.text")){var m=l("title.position",y?"middle center":"top center");y||"middle center"!==m||(e.title.position="top center"),i.coerceFont(l,"title.font",n.font)}l("sort"),l("direction"),l("rotation"),l("pull")}else e.visible=!1}}},92983:function(t,e,r){var n=r(72123);t.exports=function(t,e,r,i){var a,o,s,l,u,c,f,h,p,d,v=e[0],g=e[1],y=e[2],m=i[0],x=i[1],b=i[2],_=r[0],w=r[1],T=r[2];return Math.abs(v-_)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-T)<1e-6?n(t):(f=v-_,h=g-w,p=y-T,a=x*(p*=d=1/Math.sqrt(f*f+h*h+p*p))-b*(h*=d),o=b*(f*=d)-m*p,s=m*h-x*f,(d=Math.sqrt(a*a+o*o+s*s))?(a*=d=1/d,o*=d,s*=d):(a=0,o=0,s=0),l=h*s-p*o,u=p*a-f*s,c=f*o-h*a,(d=Math.sqrt(l*l+u*u+c*c))?(l*=d=1/d,u*=d,c*=d):(l=0,u=0,c=0),t[0]=a,t[1]=l,t[2]=f,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=s,t[9]=c,t[10]=p,t[11]=0,t[12]=-(a*v+o*g+s*y),t[13]=-(l*v+u*g+c*y),t[14]=-(f*v+h*g+p*y),t[15]=1,t)}},93003:function(t,e,r){"use strict";var n=r(46982),i=r(29278);function a(t,e){if(e&&e.length)for(var r=0;rn?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},e.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},e.isLinked=function(t,e){return a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},93024:function(t,e,r){"use strict";var n=r(78945).BADNUM;e.calcTraceToLineCoords=function(t){for(var e=t[0].trace.connectgaps,r=[],i=[],a=0;a0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},e.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},e.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},n.prototype.read_uint16=function(t){var r=this.input;if(t+2>r.length)throw e("unexpected EOF","EBADDATA");return this.big_endian?256*r[t]+r[t+1]:r[t]+256*r[t+1]},n.prototype.read_uint32=function(t){var r=this.input;if(t+4>r.length)throw e("unexpected EOF","EBADDATA");return this.big_endian?16777216*r[t]+65536*r[t+1]+256*r[t+2]+r[t+3]:r[t]+256*r[t+1]+65536*r[t+2]+16777216*r[t+3]},n.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},n.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},n.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return this.read_uint32(e);case 9:return 0|this.read_uint32(e);default:return null}},n.prototype.scan_ifd=function(t,n,i){var a=this.read_uint16(n);n+=2;for(var o=0;othis.input.length)throw e("unexpected EOF","EBADDATA");for(var d=[],v=h,g=0;g0&&(this.ifds_to_read.push({id:s,offset:d[0]}),p=!0),!1===i({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:u,entry_offset:n+this.start,data_length:f,data_offset:h+this.start,value:d,is_subifd_link:p}))return void(this.aborted=!0);n+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(n)})},t.exports.ExifParser=n,t.exports.get_orientation=function(t){var e=0;try{return new n(t,0,t.length).each(function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1}),e}catch(t){return-1}}},93712:function(t,e,r){"use strict";var n=r(9285);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},93746:function(t,e,r){"use strict";var n=r(15181),i=r(21669),a=r(76591),o=r(93335).IMAGE_URL_PREFIX;t.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("source"),e.source&&!e.source.match(o)&&delete e.source,e._hasSource=!!e.source;var s,l=r("z");e._hasZ=!(void 0===l||!l.length||!l[0]||!l[0].length),e._hasZ||e._hasSource?(r("x0"),r("y0"),r("dx"),r("dy"),e._hasZ?(r("colormodel","rgb"),r("zmin",(s=a.colormodel[e.colormodel]).zminDflt||s.min),r("zmax",s.zmaxDflt||s.max)):e._hasSource&&(e.colormodel="rgba256",s=a.colormodel[e.colormodel],e.zmin=s.zminDflt,e.zmax=s.zmaxDflt),r("zsmooth"),r("text"),r("hovertext"),r("hovertemplate"),e._length=null):e.visible=!1}},93789:function(t){"use strict";function e(t,e){if("string"!=typeof t)return[t];var r=[t];"string"==typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],i=e.escape||"___",a=!!e.flat;n.forEach(function(t){var e=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function a(e,a,o){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),i+s+i}r.forEach(function(t,n){for(var i,o=0;t!=i;)if(i=t,t=t.replace(e,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t}),n=n.reverse(),r=r.map(function(e){return n.forEach(function(r){e=e.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),t[0]+"$1"+t[1])}),e})});var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function t(e,r,n){for(var i,a=[],s=0;i=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(e.slice(0,i.index)),a.push(t(r[i[1]],r)),e=e.slice(i.index+i[0].length)}return a.push(e),a}(r[0],r)}function r(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",i=t[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=i,i=i.replace(a,s)}return i}return t.reduce(function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r},"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function n(t,n){return Array.isArray(t)?r(t,n):e(t,n)}n.parse=e,n.stringify=r,t.exports=n},93950:function(t,e,r){var n,i=r(50260);self,n=function(){return function(){var t={7386:function(t,e,r){t.exports={alpha_shape:r(2350),convex_hull:r(5537),delaunay_triangulate:r(4419),gl_cone3d:r(1140),gl_error3d:r(3110),gl_heatmap2d:r(6386),gl_line3d:r(6086),gl_mesh3d:r(8116),gl_plot2d:r(2117),gl_plot3d:r(1059),gl_pointcloud2d:r(8271),gl_scatter3d:r(2182),gl_select_box:r(6623),gl_spikes2d:r(3050),gl_streamtube3d:r(7307),gl_surface3d:r(3754),ndarray:r(5050),ndarray_linear_interpolate:r(3581)}},2146:function(t,e,r){"use strict";function n(t,e){for(var r=0;rf)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}function p(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return g(t)}return d(t,e,r)}function d(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|b(t,e),n=h(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(tt(t,Uint8Array)){var e=new Uint8Array(t);return m(e.buffer,e.byteOffset,e.byteLength)}return y(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+s(t));if(tt(t,ArrayBuffer)||t&&tt(t.buffer,ArrayBuffer))return m(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(tt(t,SharedArrayBuffer)||t&&tt(t.buffer,SharedArrayBuffer)))return m(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return p.from(n,e,r);var i=function(t){if(p.isBuffer(t)){var e=0|x(t.length),r=h(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||et(t.length)?h(0):y(t):"Buffer"===t.type&&Array.isArray(t.data)?y(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return p.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+s(t))}function v(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function g(t){return v(t),h(t<0?0:0|x(t))}function y(t){for(var e=t.length<0?0:0|x(t.length),r=h(e),n=0;n=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|t}function b(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||tt(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+s(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(i)return n?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function _(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return z(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return D(this,e,r);case"base64":return C(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function w(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function T(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),et(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=p.from(e,n)),p.isBuffer(e))return 0===e.length?-1:A(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):A(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function A(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a,o=e.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function C(t,e,r){return 0===e&&r===t.length?l.fromByteArray(t):l.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,u=void 0,c=void 0,f=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(l=t[i+1]))&&(f=(31&a)<<6|63&l)>127&&(o=f);break;case 3:l=t[i+1],u=t[i+2],128==(192&l)&&128==(192&u)&&(f=(15&a)<<12|(63&l)<<6|63&u)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&(f=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn.length?(p.isBuffer(a)||(a=p.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!p.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},p.byteLength=b,p.prototype._isBuffer=!0,p.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},c&&(p.prototype[c]=p.prototype.inspect),p.prototype.compare=function(t,e,r,n,i){if(tt(t,Uint8Array)&&(t=p.from(t,t.offset,t.byteLength)),!p.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+s(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),l=Math.min(a,o),u=this.slice(n,i),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return k(this,t,e,r);case"utf8":case"utf-8":return M(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,i,a){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function N(t,e,r,n,i){W(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function j(t,e,r,n,i){W(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function U(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function V(t,e,r,n,i){return e=+e,r>>>=0,i||U(t,0,r,4),u.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,i){return e=+e,r>>>=0,i||U(t,0,r,8),u.write(t,e,r,n,52,8),r+8}p.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||F(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||F(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},p.prototype.readUint8=p.prototype.readUInt8=function(t,e){return t>>>=0,e||F(t,1,this.length),this[t]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(t,e){return t>>>=0,e||F(t,2,this.length),this[t]|this[t+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(t,e){return t>>>=0,e||F(t,2,this.length),this[t]<<8|this[t+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(t,e){return t>>>=0,e||F(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(t,e){return t>>>=0,e||F(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},p.prototype.readBigUInt64LE=nt(function(t){Z(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);var n=e+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,24),i=this[++t]+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);var n=e*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t],i=this[++t]*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,e>>>=0,r||F(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},p.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||F(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},p.prototype.readInt8=function(t,e){return t>>>=0,e||F(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},p.prototype.readInt16LE=function(t,e){t>>>=0,e||F(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt16BE=function(t,e){t>>>=0,e||F(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt32LE=function(t,e){return t>>>=0,e||F(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},p.prototype.readInt32BE=function(t,e){return t>>>=0,e||F(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},p.prototype.readBigInt64LE=nt(function(t){Z(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);var n=this[t+4]+this[t+5]*Math.pow(2,8)+this[t+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);var n=(e<<24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t];return(BigInt(n)<>>=0,e||F(t,4,this.length),u.read(this,t,!0,23,4)},p.prototype.readFloatBE=function(t,e){return t>>>=0,e||F(t,4,this.length),u.read(this,t,!1,23,4)},p.prototype.readDoubleLE=function(t,e){return t>>>=0,e||F(t,8,this.length),u.read(this,t,!0,52,8)},p.prototype.readDoubleBE=function(t,e){return t>>>=0,e||F(t,8,this.length),u.read(this,t,!1,52,8)},p.prototype.writeUintLE=p.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},p.prototype.writeUint8=p.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,255,0),this[e]=255&t,e+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},p.prototype.writeBigUInt64LE=nt(function(t){return N(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=nt(function(t){return j(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>>=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o|0)-s&255;return e+r},p.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},p.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},p.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},p.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},p.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},p.prototype.writeBigInt64LE=nt(function(t){return N(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=nt(function(t){return j(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeFloatLE=function(t,e,r){return V(this,t,e,!0,r)},p.prototype.writeFloatBE=function(t,e,r){return V(this,t,e,!1,r)},p.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},p.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},p.prototype.copy=function(t,e,r,n){if(!p.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function W(t,e,r,n,i,a){if(t>r||t3?0===e||e===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(e).concat(s," and <= ").concat(r).concat(s),new q.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){Z(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||X(e,t.length-(r+1))}(n,i,a)}function Z(t,e){if("number"!=typeof t)throw new q.ERR_INVALID_ARG_TYPE(e,"number",t)}function X(t,e,r){if(Math.floor(t)!==t)throw Z(t,r),new q.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new q.ERR_BUFFER_OUT_OF_BOUNDS;throw new q.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(e),t)}G("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(s(e))},TypeError),G("ERR_OUT_OF_RANGE",function(t,e,r){var n='The value of "'.concat(t,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=Y(String(r)):"bigint"==typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=Y(i)),i+="n"),n+" It must be ".concat(e,". Received ").concat(i)},RangeError);var J=/[^+/0-9A-Za-z-_]/g;function K(t,e){var r;e=e||1/0;for(var n=t.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function $(t){return l.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Q(t,e,r,n){var i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function tt(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function et(t){return t!=t}var rt=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}();function nt(t){return"undefined"==typeof BigInt?it:t}function it(){throw new Error("BigInt not supported")}},2321:function(t){"use strict";t.exports=i,t.exports.isMobile=i,t.exports.default=i;var e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(t){t||(t={});var i=t.ua;if(i||"undefined"==typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!=typeof i)return!1;var a=e.test(i)&&!r.test(i)||!!t.tablet&&n.test(i);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},3910:function(t,e){"use strict";e.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,a=s(t),o=a[0],l=a[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,l)),c=0,f=l>0?o-4:o;for(r=0;r>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[c++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,s=0,l=n-i;sl?l:s+o));return 1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function u(t,e,r){for(var n,i=[],a=e;a>1,c=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},e.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,u-=8);t[r+p-d]|=128*v}},1152:function(t,e,r){"use strict";t.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=n(),f=i(),h=a();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new o({turntable:c,orbit:f,matrix:h},u)};var n=r(3440),i=r(7774),a=r(9298);function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;s.flush=function(t){for(var e=this._controllerList,r=0;r0?u=u.ushln(f):f<0&&(c=c.ushln(-f)),s(u,c)}},234:function(t,e,r){"use strict";var n=r(3218);t.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},4275:function(t,e,r){"use strict";var n=r(1928);t.exports=function(t){return t.cmp(new n(0))}},9958:function(t,e,r){"use strict";var n=r(4275);t.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}},3218:function(t,e,r){"use strict";r(1928),t.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},5514:function(t,e,r){"use strict";var n=r(1928),i=r(8362);t.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},8524:function(t,e,r){"use strict";var n=r(5514),i=r(4275);t.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}},2813:function(t,e,r){"use strict";var n=r(1928);t.exports=function(t){return new n(t)}},3962:function(t,e,r){"use strict";var n=r(8524);t.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},4951:function(t,e,r){"use strict";var n=r(4275);t.exports=function(t){return n(t[0])*n(t[1])}},4354:function(t,e,r){"use strict";var n=r(8524);t.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},7999:function(t,e,r){"use strict";var n=r(9958),i=r(1112);t.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=i(s)+4;return u*(s+(h=n(l.ushln(c).divRound(r)))*Math.pow(2,-c))}var f=r.bitLength()-l.bitLength()+53,h=n(l.ushln(f).divRound(r));return f<1023?u*h*Math.pow(2,-f):u*(h*=Math.pow(2,-1023))*Math.pow(2,1023-f)}},5070:function(t){"use strict";function e(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function r(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function n(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function i(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function a(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}t.exports={ge:function(t,r,n,i,a){return o(t,r,n,i,a,e)},gt:function(t,e,n,i,a){return o(t,e,n,i,a,r)},lt:function(t,e,r,i,a){return o(t,e,r,i,a,n)},le:function(t,e,r,n,a){return o(t,e,r,n,a,i)},eq:function(t,e,r,n,i){return o(t,e,r,n,i,a)}}},2288:function(t,e){"use strict";function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,1+((t|=t>>>8)|t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},1928:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=a:e.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6601).Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function u(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=l(t,e,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,f=67108863&l,h=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=h;p++){var d=u-p|0;c+=(o=(i=0|t.words[d])*(a=0|e.words[p])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],p=h[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var v=d.modn(p).toString(t);r=(d=d.idivn(p)).isZero()?v+r:c[u-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,p=0|o[1],d=8191&p,v=p>>>13,g=0|o[2],y=8191&g,m=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],T=8191&w,A=w>>>13,k=0|o[5],M=8191&k,S=k>>>13,E=0|o[6],L=8191&E,C=E>>>13,P=0|o[7],O=8191&P,I=P>>>13,D=0|o[8],z=8191&D,R=D>>>13,F=0|o[9],B=8191&F,N=F>>>13,j=0|s[0],U=8191&j,V=j>>>13,H=0|s[1],q=8191&H,G=H>>>13,Y=0|s[2],W=8191&Y,Z=Y>>>13,X=0|s[3],J=8191&X,K=X>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ft=8191&ct,ht=ct>>>13,pt=0|s[9],dt=8191&pt,vt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(u+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;u=((a=Math.imul(h,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(d,U),i=(i=Math.imul(d,V))+Math.imul(v,U)|0,a=Math.imul(v,V);var yt=(u+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,q)|0))<<13)|0;u=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,V))+Math.imul(m,U)|0,a=Math.imul(m,V),n=n+Math.imul(d,q)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(v,q)|0,a=a+Math.imul(v,G)|0;var mt=(u+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,W)|0))<<13)|0;u=((a=a+Math.imul(h,Z)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(y,q)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(m,q)|0,a=a+Math.imul(m,G)|0,n=n+Math.imul(d,W)|0,i=(i=i+Math.imul(d,Z)|0)+Math.imul(v,W)|0,a=a+Math.imul(v,Z)|0;var xt=(u+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;u=((a=a+Math.imul(h,K)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(A,U)|0,a=Math.imul(A,V),n=n+Math.imul(b,q)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,Z)|0,n=n+Math.imul(d,J)|0,i=(i=i+Math.imul(d,K)|0)+Math.imul(v,J)|0,a=a+Math.imul(v,K)|0;var bt=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(A,q)|0,a=a+Math.imul(A,G)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,Z)|0,n=n+Math.imul(y,J)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,K)|0,n=n+Math.imul(d,Q)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,tt)|0;var _t=(u+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;u=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(S,q)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(A,W)|0,a=a+Math.imul(A,Z)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(v,rt)|0,a=a+Math.imul(v,nt)|0;var wt=(u+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;u=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(I,U)|0,a=Math.imul(I,V),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,q)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,Z)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(A,J)|0,a=a+Math.imul(A,K)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ot)|0)+Math.imul(v,at)|0,a=a+Math.imul(v,ot)|0;var Tt=(u+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ut)|0)+Math.imul(h,lt)|0))<<13)|0;u=((a=a+Math.imul(h,ut)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(z,U),i=(i=Math.imul(z,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(I,q)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,Z)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,Z)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ut)|0)+Math.imul(v,lt)|0,a=a+Math.imul(v,ut)|0;var At=(u+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;u=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,V))+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(z,q)|0,i=(i=i+Math.imul(z,G)|0)+Math.imul(R,q)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(I,W)|0,a=a+Math.imul(I,Z)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(A,rt)|0,a=a+Math.imul(A,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(y,lt)|0,i=(i=i+Math.imul(y,ut)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ut)|0,n=n+Math.imul(d,ft)|0,i=(i=i+Math.imul(d,ht)|0)+Math.imul(v,ft)|0,a=a+Math.imul(v,ht)|0;var kt=(u+(n=n+Math.imul(f,dt)|0)|0)+((8191&(i=(i=i+Math.imul(f,vt)|0)+Math.imul(h,dt)|0))<<13)|0;u=((a=a+Math.imul(h,vt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,G))+Math.imul(N,q)|0,a=Math.imul(N,G),n=n+Math.imul(z,W)|0,i=(i=i+Math.imul(z,Z)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,Z)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,K)|0,n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(A,at)|0,a=a+Math.imul(A,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ut)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ut)|0,n=n+Math.imul(y,ft)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(m,ft)|0,a=a+Math.imul(m,ht)|0;var Mt=(u+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,vt)|0)+Math.imul(v,dt)|0))<<13)|0;u=((a=a+Math.imul(v,vt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,Z))+Math.imul(N,W)|0,a=Math.imul(N,Z),n=n+Math.imul(z,J)|0,i=(i=i+Math.imul(z,K)|0)+Math.imul(R,J)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(I,Q)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ut)|0)+Math.imul(A,lt)|0,a=a+Math.imul(A,ut)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0;var St=(u+(n=n+Math.imul(y,dt)|0)|0)+((8191&(i=(i=i+Math.imul(y,vt)|0)+Math.imul(m,dt)|0))<<13)|0;u=((a=a+Math.imul(m,vt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,J),i=(i=Math.imul(B,K))+Math.imul(N,J)|0,a=Math.imul(N,K),n=n+Math.imul(z,Q)|0,i=(i=i+Math.imul(z,tt)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ut)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(A,ft)|0,a=a+Math.imul(A,ht)|0;var Et=(u+(n=n+Math.imul(b,dt)|0)|0)+((8191&(i=(i=i+Math.imul(b,vt)|0)+Math.imul(_,dt)|0))<<13)|0;u=((a=a+Math.imul(_,vt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,Q),i=(i=Math.imul(B,tt))+Math.imul(N,Q)|0,a=Math.imul(N,tt),n=n+Math.imul(z,rt)|0,i=(i=i+Math.imul(z,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ut)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ut)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(S,ft)|0,a=a+Math.imul(S,ht)|0;var Lt=(u+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,vt)|0)+Math.imul(A,dt)|0))<<13)|0;u=((a=a+Math.imul(A,vt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(z,at)|0,i=(i=i+Math.imul(z,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ut)|0)+Math.imul(I,lt)|0,a=a+Math.imul(I,ut)|0,n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(u+(n=n+Math.imul(M,dt)|0)|0)+((8191&(i=(i=i+Math.imul(M,vt)|0)+Math.imul(S,dt)|0))<<13)|0;u=((a=a+Math.imul(S,vt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,at),i=(i=Math.imul(B,ot))+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(z,lt)|0,i=(i=i+Math.imul(z,ut)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ut)|0,n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(I,ft)|0,a=a+Math.imul(I,ht)|0;var Pt=(u+(n=n+Math.imul(L,dt)|0)|0)+((8191&(i=(i=i+Math.imul(L,vt)|0)+Math.imul(C,dt)|0))<<13)|0;u=((a=a+Math.imul(C,vt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(B,lt),i=(i=Math.imul(B,ut))+Math.imul(N,lt)|0,a=Math.imul(N,ut),n=n+Math.imul(z,ft)|0,i=(i=i+Math.imul(z,ht)|0)+Math.imul(R,ft)|0,a=a+Math.imul(R,ht)|0;var Ot=(u+(n=n+Math.imul(O,dt)|0)|0)+((8191&(i=(i=i+Math.imul(O,vt)|0)+Math.imul(I,dt)|0))<<13)|0;u=((a=a+Math.imul(I,vt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(B,ft),i=(i=Math.imul(B,ht))+Math.imul(N,ft)|0,a=Math.imul(N,ht);var It=(u+(n=n+Math.imul(z,dt)|0)|0)+((8191&(i=(i=i+Math.imul(z,vt)|0)+Math.imul(R,dt)|0))<<13)|0;u=((a=a+Math.imul(R,vt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Dt=(u+(n=Math.imul(B,dt))|0)+((8191&(i=(i=Math.imul(B,vt))+Math.imul(N,dt)|0))<<13)|0;return u=((a=Math.imul(N,vt))+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,l[0]=gt,l[1]=yt,l[2]=mt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Tt,l[8]=At,l[9]=kt,l[10]=Mt,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=Pt,l[16]=Ot,l[17]=It,l[18]=Dt,0!==u&&(l[19]=u,r.length++),r};function v(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=p),a.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?d(this,t,e):n<63?p(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):v(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=i);u--){var f=0|this.words[u];this.words[u]=c<<26-a|f>>>a,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var h=0,p=1;0===(e.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var d=0,v=1;0===(r.words[0]&v)&&d<26;++d,v<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0===(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0===(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new T(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(x,m),x.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,a=o}a>>>=22,t.words[i-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new b;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return y[t]=e,e},T.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},T.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},T.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},T.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var f=this.pow(c,i),h=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=o;0!==p.cmp(s);){for(var v=p,g=0;0!==v.cmp(s);g++)v=v.redSqr();n(g=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var f=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},T.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},T.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new A(t)},i(A,T),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},2692:function(t){"use strict";t.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(c<=0)){var f,h=i.mallocDouble(2*c*s),p=i.mallocInt32(s);if((s=l(t,c,h,p))>0){if(1===c&&n)a.init(s),f=a.sweepComplete(c,r,0,s,h,p,0,s,h,p);else{var d=i.mallocDouble(2*c*u),v=i.mallocInt32(u);(u=l(e,c,d,v))>0&&(a.init(s+u),f=1===c?a.sweepBipartite(c,r,0,s,h,p,0,u,d,v):o(c,r,n,s,h,p,u,d,v),i.free(d),i.free(v))}i.free(h),i.free(p)}return f}}}function c(t,e){n.push([t,e])}},7333:function(t,e){"use strict";function r(t){return t?function(t,e,r,n,i,a,o,s,l,u,c){return i-n>l-s?function(t,e,r,n,i,a,o,s,l,u,c){for(var f=2*t,h=n,p=f*n;hu-l?n?function(t,e,r,n,i,a,o,s,l,u,c){for(var f=2*t,h=n,p=f*n;h0;){var D=(O-=1)*b,z=w[D],R=w[D+1],F=w[D+2],B=w[D+3],N=w[D+4],j=w[D+5],U=O*_,V=T[U],H=T[U+1],q=1&j,G=!!(16&j),Y=c,W=S,Z=L,X=C;if(q&&(Y=L,W=C,Z=c,X=S),!(2&j&&R>=(F=g(t,z,R,F,Y,W,H))||4&j&&(R=y(t,z,R,F,Y,W,V))>=F)){var J=F-R,K=N-B;if(G){if(t*J*(J+K)=p0)&&!(p1>=hi)"),v=c("lo===p0"),g=c("lo>>1,h=2*t,p=f,d=s[h*f+e];u=x?(p=m,d=x):y>=_?(p=g,d=y):(p=b,d=_):x>=_?(p=m,d=x):_>=y?(p=g,d=y):(p=b,d=_);for(var w=h*(c-1),T=h*p,A=0;Ar&&i[f+e]>u;--c,f-=o){for(var h=f,p=f+o,d=0;dh;++h,l+=s)if(i[l+f]===o)if(c===h)c+=1,u+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[u],i[u++]=d}var v=a[h];a[h]=a[c],a[c++]=v}return c},"loh;++h,l+=s)if(i[l+f]p;++p){var d=i[l+p];i[l+p]=i[u],i[u++]=d}var v=a[h];a[h]=a[c],a[c++]=v}return c},"lo<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,u=l,c=r,f=t+e,h=r;n>h;++h,l+=s)if(i[l+f]<=o)if(c===h)c+=1,u+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[u],i[u++]=d}var v=a[h];a[h]=a[c],a[c++]=v}return c},"hi<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,u=l,c=r,f=t+e,h=r;n>h;++h,l+=s)if(i[l+f]<=o)if(c===h)c+=1,u+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[u],i[u++]=d}var v=a[h];a[h]=a[c],a[c++]=v}return c},"lop;++p,l+=s){var d=i[l+f],v=i[l+h];if(dg;++g){var y=i[l+g];i[l+g]=i[u],i[u++]=y}var m=a[p];a[p]=a[c],a[c++]=m}}return c},"lo<=p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,u=l,c=r,f=e,h=t+e,p=r;n>p;++p,l+=s){var d=i[l+f],v=i[l+h];if(d<=o&&o<=v)if(c===p)c+=1,u+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[u],i[u++]=y}var m=a[p];a[p]=a[c],a[c++]=m}}return c},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,i,a,o,s){for(var l=2*t,u=l*r,c=u,f=r,h=e,p=t+e,d=r;n>d;++d,u+=l){var v=i[u+h],g=i[u+p];if(!(v>=o||s>=g))if(f===d)f+=1,c+=l;else{for(var y=0;l>y;++y){var m=i[u+y];i[u+y]=i[c],i[c++]=m}var x=a[d];a[d]=a[f],a[f++]=x}}return f}}},309:function(t){"use strict";t.exports=function(t,n){n<=4*e?r(0,n-1,t):u(0,n-1,t)};var e=32;function r(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var u=r[l-2],c=r[l-1];if(ur[e+1])}function l(t,e,r,n){var i=n[t*=2];return i>1,g=v-h,y=v+h,m=p,x=g,b=v,_=y,w=d,T=t+1,A=c-1,k=0;s(m,x,f)&&(k=m,m=x,x=k),s(_,w,f)&&(k=_,_=w,w=k),s(m,b,f)&&(k=m,m=b,b=k),s(x,b,f)&&(k=x,x=b,b=k),s(m,_,f)&&(k=m,m=_,_=k),s(b,_,f)&&(k=b,b=_,_=k),s(x,w,f)&&(k=x,x=w,w=k),s(x,b,f)&&(k=x,x=b,b=k),s(_,w,f)&&(k=_,_=w,w=k);for(var M=f[2*x],S=f[2*x+1],E=f[2*_],L=f[2*_+1],C=2*m,P=2*b,O=2*w,I=2*p,D=2*v,z=2*d,R=0;R<2;++R){var F=f[C+R],B=f[P+R],N=f[O+R];f[I+R]=F,f[D+R]=B,f[z+R]=N}i(g,t,f),i(y,c,f);for(var j=T;j<=A;++j)if(l(j,M,S,f))j!==T&&n(j,T,f),++T;else if(!l(j,E,L,f))for(;;){if(l(A,E,L,f)){l(A,M,S,f)?(a(j,T,A,f),++T,--A):(n(j,A,f),--A);break}if(--A>>1;a(d,S);var E=0,L=0;for(T=0;T=o)v(c,f,L--,C=C-o|0);else if(C>=0)v(l,u,E--,C);else if(C<=-o){C=-C-o|0;for(var P=0;P>>1;a(d,E);var L=0,C=0,P=0;for(A=0;A>1==d[2*A+3]>>1&&(I=2,A+=1),O<0){for(var D=-(O>>1)-1,z=0;z>1)-1,0===I?v(l,u,L--,D):1===I?v(c,f,C--,D):2===I&&v(h,p,P--,D)}},scanBipartite:function(t,e,r,n,i,s,c,f,h,p,y,m){var x=0,b=2*t,_=e,w=e+t,T=1,A=1;n?A=o:T=o;for(var k=i;k>>1;a(d,L);var C=0;for(k=0;k=o?(O=!n,M-=o):(O=!!n,M-=1),O)g(l,u,C++,M);else{var I=m[M],D=b*M,z=y[D+e+1],R=y[D+e+1+t];t:for(var F=0;F>>1;a(d,T);var A=0;for(x=0;x=o)l[A++]=b-o;else{var M=p[b-=1],S=g*b,E=h[S+e+1],L=h[S+e+1+t];t:for(var C=0;C=0;--C)if(l[C]===b){for(D=C+1;D0;){for(var p=r.pop(),d=(c=-1,f=-1,l=o[s=r.pop()],1);d=0||(e.flip(s,p),i(t,e,r,c,s,f),i(t,e,r,s,f,c),i(t,e,r,f,p,c),i(t,e,r,p,c,f))}}},7098:function(t,e,r){"use strict";var n,i=r(5070);function a(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}t.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i0||l.length>0;){for(;s.length>0;){var p=s.pop();if(u[p]!==-i){u[p]=i,c[p];for(var d=0;d<3;++d){var v=h[3*p+d];v>=0&&0===u[v]&&(f[3*p+d]?l.push(v):(s.push(v),u[v]=i))}}}var g=l;l=s,s=g,l.length=0,i=-i}var y=function(t,e,r){for(var n=0,i=0;i1&&i(r[h[p-2]],r[h[p-1]],a)>0;)t.push([h[p-1],h[p-2],o]),p-=1;h.length=p,h.push(o);var d=f.upperIds;for(p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)<0;)t.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function c(t,e){var r;return(r=t.a[0]d[0]&&i.push(new o(d,p,2,l),new o(p,d,1,l))}i.sort(s);for(var v=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([v,1],[v,0],-1,[],[],[],[])],y=[],m=(l=0,i.length);l=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;ne[2]?1:0)}function y(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[c=(S=n[a])[0]],b=x[0],_=x[1],w=t[b],T=t[_];if((w[0]-T[0]||w[1]-T[1])<0){var A=b;b=_,_=A}x[0]=b;var k,M=x[1]=S[1];for(i&&(k=x[2]);a>0&&n[a-1][0]===c;){var S,E=(S=n[--a])[1];i?e.push([M,E,k]):e.push([M,E]),M=E}i?e.push([M,_,k]):e.push([M,_])}return h}(t,e,h,v,r),m=d(t,g);return y(e,m,r),!!m||h.length>0||v.length>0}},5528:function(t,e,r){"use strict";t.exports=function(t,e,r,n){var a=s(e,t),f=s(n,r),h=c(a,f);if(0===o(h))return null;var p=c(f,s(t,r)),d=i(p,h),v=u(a,d);return l(t,v)};var n=r(3962),i=r(9189),a=r(4354),o=r(4951),s=r(6695),l=r(7584),u=r(4469);function c(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},5692:function(t){t.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},9156:function(t,e,r){"use strict";var n=r(5692),i=r(3578);function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}t.exports=function(t){var e,r,l,u,c,f,h,p,d,v;if(t||(t={}),p=(t.nshades||72)-1,h=t.format||"hex",(f=t.colormap)||(f="jet"),"string"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");c=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);c=f.slice()}if(c.length>p+1)throw new Error(f+" map requires nshades to be at least size "+c.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=c.map(function(t){return Math.round(t.index*p)}),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var g=c.map(function(t,e){var r=c[e].index,n=c[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n}),y=[];for(v=0;v0||l(t,e,a)?-1:1:0===s?u>0||l(t,e,r)?1:-1:i(u-s)}var f=n(t,e,r);return f>0?o>0&&n(t,e,a)>0?1:-1:f<0?o>0||n(t,e,a)>0?1:-1:n(t,e,a)>0||l(t,e,r)?1:-1};var n=r(417),i=r(7538),a=r(87),o=r(2019),s=r(9662);function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),u=a(r[1],-e[1]),c=s(o(n,l),o(i,u));return c[c.length-1]>=0}},7538:function(t){"use strict";t.exports=function(t){return t<0?-1:t>0?1:0}},9209:function(t){t.exports=function(t,n){var i=t.length,a=t.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return t[0]-n[0];case 2:return t[0]+t[1]-n[0]-n[1]||e(t[0],t[1])-e(n[0],n[1]);case 3:var o=t[0]+t[1],s=n[0]+n[1];if(a=o+t[2]-(s+n[2]))return a;var l=e(t[0],t[1]),u=e(n[0],n[1]);return e(l,t[2])-e(u,n[2])||e(l+t[2],o)-e(u+n[2],s);case 4:var c=t[0],f=t[1],h=t[2],p=t[3],d=n[0],v=n[1],g=n[2],y=n[3];return c+f+h+p-(d+v+g+y)||e(c,f,h,p)-e(d,v,g,y,d)||e(c+f,c+h,c+p,f+h,f+p,h+p)-e(d+v,d+g,d+y,v+g,v+y,g+y)||e(c+f+h,c+f+p,c+h+p,f+h+p)-e(d+v+g,d+v+y,d+g+y,v+g+y);default:for(var m=t.slice().sort(r),x=n.slice().sort(r),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},8722:function(t,e,r){"use strict";t.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=r(2183),i=r(2153)},9680:function(t){"use strict";t.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var p=t.length-1;p>=0;--p)a[p]=u*t[p]+c*e[p]+f*r[p]+h*n[p];return a}return u*t+c*e+f*r+h*n},t.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}},4419:function(t,e,r){"use strict";var n=r(2183),i=r(1215);function a(t,e){this.point=t,this.index=e}function o(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=y[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&s)for(c=0;c<_.length;++c)h=(b=_[c])[0],b[0]=b[1],b[1]=h;return _}},8362:function(t){var e=!1;if("undefined"!=typeof Float64Array){var r=new Float64Array(1),n=new Uint32Array(r.buffer);r[0]=1,e=!0,1072693248===n[1]?(t.exports=function(t){return r[0]=t,[n[0],n[1]]},t.exports.pack=function(t,e){return n[0]=t,n[1]=e,r[0]},t.exports.lo=function(t){return r[0]=t,n[0]},t.exports.hi=function(t){return r[0]=t,n[1]}):1072693248===n[0]?(t.exports=function(t){return r[0]=t,[n[1],n[0]]},t.exports.pack=function(t,e){return n[1]=t,n[0]=e,r[0]},t.exports.lo=function(t){return r[0]=t,n[1]},t.exports.hi=function(t){return r[0]=t,n[0]}):e=!1}if(!e){var i=new Buffer(8);t.exports=function(t){return i.writeDoubleLE(t,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},t.exports.pack=function(t,e){return i.writeUInt32LE(t,0,!0),i.writeUInt32LE(e,4,!0),i.readDoubleLE(0,!0)},t.exports.lo=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(0,!0)},t.exports.hi=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(4,!0)}}t.exports.sign=function(e){return t.exports.hi(e)>>>31},t.exports.exponent=function(e){return(t.exports.hi(e)<<1>>>21)-1023},t.exports.fraction=function(e){var r=t.exports.lo(e),n=t.exports.hi(e),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},t.exports.denormalized=function(e){return!(2146435072&t.exports.hi(e))}},3094:function(t){"use strict";function e(t,r,n){var i=0|t[n];if(i<=0)return[];var a,o=new Array(i);if(n===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=r-1){h=l.length-1;var d=t-e[r-1];for(p=0;p=r-1)for(var c=s.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)n.push(a(l[f-1],u[f-1],arguments[f])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var p=a(u[h-1],c[h-1],arguments[h]);n.push(p),i.push((p-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,f=c>1e-6?1/c:0;this._time.push(t);for(var h=r;h>0;--h){var p=arguments[h];n.push(a(l[h-1],u[h-1],n[o++]+p)),i.push(p*f)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--f)n.push(a(l[f],u[f],n[o]+c*i[o])),i.push(0),o+=1}}},7080:function(t){"use strict";function e(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function r(t){return new e(t._color,t.key,t.value,t.left,t.right,t._count)}function n(t,r){return new e(t,r.key,r.value,r.left,r.right,r._count)}function i(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function a(t,e){this._compare=t,this.root=e}t.exports=function(t){return new a(t||p,null)};var o=a.prototype;function s(t,e){var r;return e.left&&(r=s(t,e.left))?r:(r=t(e.key,e.value))||(e.right?s(t,e.right):void 0)}function l(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left&&(i=l(t,e,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(t,e,r,n.right)}function u(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=u(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return u(t,e,r,n,i.right)}function c(t,e){this.tree=t,this._stack=e}Object.defineProperty(o,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(o,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(t,r){for(var o=this._compare,s=this.root,l=[],u=[];s;){var c=o(t,s.key);l.push(s),u.push(c),s=c<=0?s.left:s.right}l.push(new e(0,t,r,null,null,1));for(var f=l.length-2;f>=0;--f)s=l[f],u[f]<=0?l[f]=new e(s._color,s.key,s.value,l[f+1],s.right,s._count+1):l[f]=new e(s._color,s.key,s.value,s.left,l[f+1],s._count+1);for(f=l.length-1;f>1;--f){var h=l[f-1];if(s=l[f],1===h._color||1===s._color)break;var p=l[f-2];if(p.left===h)if(h.left===s){if(!(d=p.right)||0!==d._color){p._color=0,p.left=h.right,h._color=1,h.right=p,l[f-2]=h,l[f-1]=s,i(p),i(h),f>=3&&((v=l[f-3]).left===p?v.left=h:v.right=h);break}h._color=1,p.right=n(1,d),p._color=0,f-=1}else{if(!(d=p.right)||0!==d._color){h.right=s.left,p._color=0,p.left=s.right,s._color=1,s.left=h,s.right=p,l[f-2]=s,l[f-1]=h,i(p),i(h),i(s),f>=3&&((v=l[f-3]).left===p?v.left=s:v.right=s);break}h._color=1,p.right=n(1,d),p._color=0,f-=1}else if(h.right===s){if(!(d=p.left)||0!==d._color){p._color=0,p.right=h.left,h._color=1,h.left=p,l[f-2]=h,l[f-1]=s,i(p),i(h),f>=3&&((v=l[f-3]).right===p?v.right=h:v.left=h);break}h._color=1,p.left=n(1,d),p._color=0,f-=1}else{var d;if(!(d=p.left)||0!==d._color){var v;h.left=s.right,p._color=0,p.right=s.left,s._color=1,s.right=h,s.left=p,l[f-2]=s,l[f-1]=h,i(p),i(h),i(s),f>=3&&((v=l[f-3]).right===p?v.right=s:v.left=s);break}h._color=1,p.left=n(1,d),p._color=0,f-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return s(t,this.root);case 2:return l(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return u(e,r,this._compare,t,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new c(this,t)}}),Object.defineProperty(o,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new c(this,t)}}),o.at=function(t){if(t<0)return new c(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new c(this,[])},o.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new c(this,n);r=i<=0?r.left:r.right}return new c(this,[])},o.remove=function(t){var e=this.find(t);return e?e.remove():this},o.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var f=c.prototype;function h(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function p(t,e){return te?1:0}Object.defineProperty(f,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(f,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),f.clone=function(){return new c(this.tree,this._stack.slice())},f.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var o=new Array(t.length),s=t[t.length-1];o[o.length-1]=new e(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=t.length-2;l>=0;--l)(s=t[l]).left===t[l+1]?o[l]=new e(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var u=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var c=o[u-1];for(o.push(new e(s._color,c.key,c.value,s.left,s.right,s._count)),o[u-1].key=s.key,o[u-1].value=s.value,l=o.length-2;l>=u;--l)s=o[l],o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);o[u-1].left=o[u]}if(0===(s=o[o.length-1])._color){var f=o[o.length-2];for(f.left===s?f.left=null:f.right===s&&(f.right=null),o.pop(),l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((a=t[l-1]).left===e){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,e._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((u=t[l-2]).left===a?u.left=o:u.right=o),void(t[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((u=t[l-2]).left===a?u.left=s:u.right=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((u=t[l-2]).left===a?u.left=o:u.right=o),t[l-1]=o,t[l]=a,l+11&&((u=t[l-2]).right===a?u.right=o:u.left=o),void(t[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((u=t[l-2]).right===a?u.right=s:u.left=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var u;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((u=t[l-2]).right===a?u.right=o:u.left=o),t[l-1]=o,t[l]=a,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(f,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(f,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),f.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(f,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),f.update=function(t){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new e(i._color,i.key,t,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new e(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new e(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},f.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(f,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},7453:function(t,e,r){"use strict";t.exports=function(t,e){var r=new c(t);return r.update(e),r};var n=r(9557),i=r(1681),a=r(1011),o=r(2864),s=r(8468),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function c(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont="sans-serif",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(t)}var f=c.prototype;function h(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}f.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,a=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),u=e.bind(this,!0,function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),c=!1,f=!1;if("bounds"in t)for(var h=t.bounds,p=0;p<2;++p)for(var d=0;d<3;++d)h[p][d]!==this.bounds[p][d]&&(f=!0),this.bounds[p][d]=h[p][d];if("ticks"in t)for(r=t.ticks,c=!0,this.autoTicks=!1,p=0;p<3;++p)this.tickSpacing[p]=0;else a("tickSpacing")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),f=!0,c=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),c=!0),c){for(p=0;p<3;++p)r[p].sort(function(t,e){return t.x-e.x});s.equal(r,this.ticks)?c=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(c=!0),a("tickSize"),a("tickAngle"),a("tickPad"),u("tickColor");var v=l("labels");l("labelFont")&&(v=!0),o("labelEnable"),a("labelSize"),a("labelPad"),u("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),u("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),u("lineTickColor"),o("gridEnable"),a("gridWidth"),u("gridColor"),o("zeroEnable"),u("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),u("backgroundColor"),this._text?this._text&&(v||c)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=n(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var p=[new h,new h,new h];function d(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,u=n[e],c=0;c<3;++c)if(e!==c){var f=a,h=s,p=o,d=l;u&1<0?(p[c]=-1,d[c]=0):(p[c]=0,d[c]=1)}}var v=[0,0,0],g={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var y=[0,0,0],m=[0,0,0],x=[0,0,0];f.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,c=o(r,n,i,a,s),f=c.cubeEdges,h=c.axis,b=n[12],_=n[13],w=n[14],T=n[15],A=(s?2:1)*this.pixelRatio*(i[3]*b+i[7]*_+i[11]*w+i[15]*T)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=f[k],this.lastCubeProps.axis[k]=h[k];var M=p;for(k=0;k<3;++k)d(p[k],k,this.bounds,f,h);e=this.gl;var S,E,L,C=v;for(k=0;k<3;++k)this.backgroundEnable[k]?C[k]=h[k]:C[k]=0;for(this._background.draw(r,n,i,a,C,this.backgroundColor),this._lines.bind(r,n,i,this),k=0;k<3;++k){var P=[0,0,0];h[k]>0?P[k]=a[1][k]:P[k]=a[0][k];for(var O=0;O<2;++O){var I=(k+1+O)%3,D=(k+1+(1^O))%3;this.gridEnable[I]&&this._lines.drawGrid(I,D,this.bounds,P,this.gridColor[I],this.gridWidth[I]*this.pixelRatio)}for(O=0;O<2;++O)I=(k+1+O)%3,D=(k+1+(1^O))%3,this.zeroEnable[D]&&Math.min(a[0][D],a[1][D])<=0&&Math.max(a[0][D],a[1][D])>=0&&this._lines.drawZero(I,D,this.bounds,P,this.zeroLineColor[D],this.zeroLineWidth[D]*this.pixelRatio)}for(k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,M[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,M[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);var z=u(y,M[k].primalMinor),R=u(m,M[k].mirrorMinor),F=this.lineTickLength;for(O=0;O<3;++O){var B=A/r[5*O];z[O]*=F[O]*B,R[O]*=F[O]*B}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,M[k].primalOffset,z,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,M[k].mirrorOffset,R,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}function N(t){(L=[0,0,0])[t]=1}function j(t,e,r){var n=(t+1)%3,i=(t+2)%3,a=e[n],o=e[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?N(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&N(i)}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),k=0;k<3;++k){var U=M[k].primalMinor,V=M[k].mirrorMinor,H=u(x,M[k].primalOffset);for(O=0;O<3;++O)this.lineTickEnable[k]&&(H[O]+=A*U[O]*Math.max(this.lineTickLength[O],0)/r[5*O]);var q=[0,0,0];if(q[k]=1,this.tickEnable[k]){for(-3600===this.tickAngle[k]?(this.tickAngle[k]=0,this.tickAlign[k]="auto"):this.tickAlign[k]=-1,E=1,"auto"===(S=[this.tickAlign[k],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),L=[0,0,0],j(k,U,V),O=0;O<3;++O)H[O]+=A*U[O]*this.tickPad[O]/r[5*O];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],H,this.tickColor[k],q,L,S)}if(this.labelEnable[k]){for(E=0,L=[0,0,0],this.labels[k].length>4&&(N(k),E=1),"auto"===(S=[this.labelAlign[k],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),O=0;O<3;++O)H[O]+=A*U[O]*this.labelPad[O]/r[5*O];H[k]+=.5*(a[0][k]+a[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],H,this.labelColor[k],[0,0,0],L,S)}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},1011:function(t,e,r){"use strict";t.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,f=[0,0,0],h=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=p,h[l]=p;for(var d=-1;d<=1;d+=2){f[u]=d;for(var v=-1;v<=1;v+=2)f[c]=v,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var g=u;u=c,c=g}var y=n(t,new Float32Array(e)),m=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:y,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:t.FLOAT,size:3,offset:12,stride:24}],m),b=a(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(t,y,x,b)};var n=r(5827),i=r(2944),a=r(1943).bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},2864:function(t,e,r){"use strict";t.exports=function(t,e,r,a,p){i(s,e,t),i(s,r,s);for(var m=0,x=0;x<2;++x){c[2]=a[x][2];for(var b=0;b<2;++b){c[1]=a[b][1];for(var _=0;_<2;++_)c[0]=a[_][0],h(l[m],c,s),m+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],A=0;A<3;++A)u[x][A]=l[x][A]/T;p&&(u[x][2]*=-1),T<0&&(w<0||u[x][2]E&&(w|=1<E&&(w|=1<u[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x)(N=R^1<u[B][0]&&(B=N))}var j=v;j[0]=j[1]=j[2]=0,j[n.log2(F^R)]=R&F,j[n.log2(R^B)]=R&B;var U=7^B;U===w||U===z?(U=7^F,j[n.log2(B^U)]=U&B):j[n.log2(F^U)]=U&F;var V=g,H=w;for(k=0;k<3;++k)V[k]=H&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);e.f=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);e.bg=function(t){return i(t,u,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},9557:function(t,e,r){"use strict";t.exports=function(t,e,r,i,o,l){var u=n(t),f=a(t,[{buffer:u,size:3}]),h=s(t);h.attributes.position.location=0;var p=new c(t,h,u,f);return p.update(e,r,i,o,l),p};var n=r(5827),a=r(2944),o=r(875),s=r(1943).f,l=window||i.global||{},u=l.__TEXT_CACHE||{};function c(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}l.__TEXT_CACHE={};var f=c.prototype,h=[0,0];f.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,h[0]=this.gl.drawingBufferWidth,h[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=h},f.unbind=function(){this.vao.unbind()},f.update=function(t,e,r,n,i){var a=[];function s(t,e,r,n,i,s){var l=u[r];l||(l=u[r]={});var c=l[e];c||(c=l[e]=function(t,e){try{return o(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,h=c.positions,p=c.cells,d=0,v=p.length;d=0;--y){var m=h[g[y]];a.push(f*m[0],-f*m[1],t)}}for(var l=[0,0,0],c=[0,0,0],f=[0,0,0],h=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){f[d]=a.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r[d],12,1.25,p),h[d]=(a.length/3|0)-f[d],l[d]=a.length/3|0;for(var v=0;v=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var f=""+u;f.length=t[0][i];--o)a.push({x:o*e[i],text:r(e[i],o)});n.push(a)}return n},e.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function c(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,t.data,e):this.length=u(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=u(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(t,"uint16"):c(t,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=u(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},t.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},1140:function(t,e,r){"use strict";var n=r(2858);t.exports=function(t,e){var r=t.positions,i=t.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,u=1/0,c=-1/0,f=1/0,h=-1/0,p=null,d=null,v=[],g=1/0,y=!1,m=0;mo&&(o=n.length(b)),m){var _=2*n.distance(p,x)/(n.length(d)+n.length(b));_?(g=Math.min(g,_),y=!1):y=!0}y||(p=x,d=b),v.push(b)}var w=[s,u,f],T=[l,c,h];e&&(e[0]=w,e[1]=T),0===o&&(o=1);var A=1/o;isFinite(g)||(g=1),a.vectorScale=g;var k=t.coneSize||.5;t.absoluteConeSize&&(k=t.absoluteConeSize*A),a.coneScale=k,m=0;for(var M=0;m=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(t){this.pickId=t},p.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=c({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return u(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],f=[];this.cells=r,this.positions=n,this.vectors=i;var h=t.meshColor||[1,1,1,1],p=t.vertexIntensity,d=1/0,v=-1/0;if(p)if(t.vertexIntensityBounds)d=+t.vertexIntensityBounds[0],v=+t.vertexIntensityBounds[1];else for(var g=0;g0){var v=this.triShader;v.bind(),v.uniforms=u,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||f,n=t.view||f,i=t.projection||f,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},t.exports=function(t,e,r){var s=r.shaders;1===arguments.length&&(t=(e=t).gl);var l=function(t,e){var r=n(t,e.meshShader.vertex,e.meshShader.fragment,null,e.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(t,s),c=function(t,e){var r=n(t,e.pickShader.vertex,e.pickShader.fragment,null,e.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(t,s),f=o(t,u(new Uint8Array([255,255,255,255]),[1,1,4]));f.generateMipmap(),f.minFilter=t.LINEAR_MIPMAP_LINEAR,f.magFilter=t.LINEAR;var p=i(t),d=i(t),v=i(t),g=i(t),y=i(t),m=new h(t,f,l,c,p,d,y,v,g,a(t,[{buffer:p,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:v,type:t.FLOAT,size:4},{buffer:g,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:4}]),r.traceType||"cone");return m.update(e),m}},7234:function(t,e,r){var n=r(6832),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},1950:function(t){t.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},6603:function(t,e,r){var n=r(1950);t.exports=function(t){return n[t]}},3110:function(t,e,r){"use strict";t.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var u=new s(e,r,o,l);return u.update(t),u};var n=r(5827),i=r(2944),a=r(7667),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function u(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],u=n[15],c=(t._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*u)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]*this.pixelRatio),r.capSize=this.capSize[f]*c,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var c=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function f(t,e,r,n){for(var i=c[n],a=0;a0&&((p=c.slice())[s]+=d[1][s],i.push(c[0],c[1],c[2],v[0],v[1],v[2],v[3],0,0,0,p[0],p[1],p[2],v[0],v[1],v[2],v[3],0,0,0),u(this.bounds,p),o+=2+f(i,p,v,s)))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},7667:function(t,e,r){"use strict";var n=r(6832),i=r(5158),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},4234:function(t,e,r){"use strict";var n=r(8931);t.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=t.getExtension("WEBGL_draw_buffers");if(!l&&u&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;ac||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&p&&(h=t.FLOAT);var v=!0;"depth"in n&&(v=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new d(t,e,r,h,f,v,g,u)};var i,a,o,s,l=null;function u(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function c(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function d(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var d=0;d1&&s.drawBuffersWEBGL(l[o]);var m=r.getExtension("WEBGL_depth_texture");m?d?t.depth=h(r,i,a,m.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):v&&(t.depth=h(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):v&&d?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):v?t._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),y=0;yi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=u(n),o=0;o>8*p&255;this.pickOffset=r,i.bind();var d=i.uniforms;d.viewTransform=t,d.pickOffset=e,d.shape=this.shape;var v=i.attributes;return this.positionBuffer.bind(),v.position.pointer(),this.weightBuffer.bind(),v.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),v.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},f.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||i(e[0]),o=t.y||i(e[1]),s=t.z||new Float32Array(e[0]*e[1]),l=!1!==t.zsmooth;this.xData=r,this.yData=o;var u,c,f,p,d=t.colorLevels||[0],v=t.colorValues||[0,0,0,1],g=d.length,y=this.bounds;l?(u=y[0]=r[0],c=y[1]=o[0],f=y[2]=r[r.length-1],p=y[3]=o[o.length-1]):(u=y[0]=r[0]+(r[1]-r[0])/2,c=y[1]=o[0]+(o[1]-o[0])/2,f=y[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,p=y[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var m=1/(f-u),x=1/(p-c),b=e[0],_=e[1];this.shape=[b,_];var w=(l?(b-1)*(_-1):b*_)*(h.length>>>1);this.numVertices=w;for(var T=a.mallocUint8(4*w),A=a.mallocFloat32(2*w),k=a.mallocUint8(2*w),M=a.mallocUint32(w),S=0,E=l?b-1:b,L=l?_-1:_,C=0;C max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];e.createShader=function(t){return i(t,a,o,null,l)},e.createPickShader=function(t){return i(t,a,s,null,l)}},6086:function(t,e,r){"use strict";t.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=f(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=h(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),c=u(new Array(1024),[256,1,4]),p=0;p<1024;++p)c.data[p]=255;var d=a(e,c);d.wrap=e.REPEAT;var v=new y(e,r,o,s,l,d);return v.update(t),v};var n=r(5827),i=r(2944),a=r(8931),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(5070),u=r(5050),c=r(248),f=c.createShader,h=c.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function v(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function y(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var m=y.prototype;m.isTransparent=function(){return this.hasAlpha},m.isOpaque=function(){return!this.hasAlpha},m.pickSlots=1,m.setPickBase=function(t){this.pickId=t},m.drawTransparent=m.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,clipBounds:v(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},m.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,pickId:this.pickId,clipBounds:v(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},m.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,c=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],h=t.position||t.positions;if(h){var p=t.color||t.colors||[0,0,0,1],v=t.lineWidth||1,g=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);c+=2,g=!0}continue t}f[0][r]=Math.min(f[0][r],b[r],_[r]),f[1][r]=Math.max(f[1][r],b[r],_[r])}Array.isArray(p[0])?(y=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],m=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):y=m=p,3===y.length&&(y=[y[0],y[1],y[2],1]),3===m.length&&(m=[m[0],m[1],m[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),x=Array.isArray(v)?v.length>e-1?v[e-1]:v.length>0?v[v.length-1]:[0,0,0,1]:v;var T=s;if(s+=d(b,_),g){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,y[0],y[1],y[2],y[3]);c+=2,g=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,y[0],y[1],y[2],y[3],b[0],b[1],b[2],_[0],_[1],_[2],T,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,m[0],m[1],m[2],m[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,m[0],m[1],m[2],m[3]),c+=4}}if(this.buffer.update(i),a.push(s),o.push(h[h.length-1].slice()),this.bounds=f,this.vertexCount=c,this.points=o,this.arcLength=a,"dashes"in t){var A=t.dashes.slice();for(A.unshift(0),e=1;e1.0001)return null;y+=g[f]}return Math.abs(y-1)>.001?null:[h,s(t,g),g]}},2056:function(t,e,r){var n=r(6832),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.pointShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},e.pickShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},e.pointPickShader={vertex:h,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},e.contourShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},8116:function(t,e,r){"use strict";var n=r(5158),i=r(5827),a=r(2944),o=r(8931),s=r(115),l=r(104),u=r(7437),c=r(5050),f=r(9156),h=r(7212),p=r(5306),d=r(2056),v=r(4340),g=d.meshShader,y=d.wireShader,m=d.pointShader,x=d.pickShader,b=d.pointPickShader,_=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,v,g,y,m,x,b,_,T,A,k,M,S){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=g,this.edgeUVs=y,this.edgeIds=v,this.edgeVAO=m,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=T,this.pointSizes=A,this.pointIds=b,this.pointVAO=k,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var A=T.prototype;function k(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function M(t){var e=n(t,m.vertex,m.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function S(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function E(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function L(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}A.isOpaque=function(){return!this.hasAlpha},A.isTransparent=function(){return this.hasAlpha},A.pickSlots=1,A.setPickBase=function(t){this.pickId=t},A.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},A.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},A.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;ai[A]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=g[t],r.uniforms.angle=y[t],a.drawArrays(a.TRIANGLES,i[A],i[k]-i[A]))),m[t]&&T&&(c[1^t]-=M*p*x[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=b[t],r.uniforms.angle=_[t],a.drawArrays(a.TRIANGLES,w,T)),c[1^t]=M*s[2+(1^t)]-1,d[t+2]&&(c[1^t]+=M*p*v[t+2],Ai[A]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=g[t+2],r.uniforms.angle=y[t+2],a.drawArrays(a.TRIANGLES,i[A],i[k]-i[A]))),m[t+2]&&T&&(c[1^t]+=M*p*x[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=b[t+2],r.uniforms.angle=_[t+2],a.drawArrays(a.TRIANGLES,w,T))}),v.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)e[c]=2*(o[c]*u-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),v.bind=(h=[0,0],p=[0,0],d=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,i=t.screenBox,a=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,u=.5*(n[o+2]+n[o]),c=n[o+2]-n[o],f=a[o],v=a[o+2]-f,g=i[o],y=i[o+2]-g;p[o]=2*l/c*v/y,h[o]=2*(s-u)/c*v/y}d[1]=2*t.pixelRatio/(i[3]-i[1]),d[0]=d[1]*(i[3]-i[1])/(i[2]-i[0]),e.uniforms.dataScale=p,e.uniforms.dataShift=h,e.uniforms.textScale=d,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),v.update=function(t){var e,r,n,i,o,s=[],l=t.ticks,u=t.bounds;for(o=0;o<2;++o){var c=[Math.floor(s.length/3)],f=[-1/0],h=l[o];for(e=0;e=0){var v=e[d]-n[d]*(e[d+2]-e[d])/(n[d+2]-n[d]);0===d?o.drawLine(v,e[1],v,e[3],p[d],h[d]):o.drawLine(e[0],v,e[2],v,p[d],h[d])}}for(d=0;d=0;--t)this.objects[t].dispose();for(this.objects.length=0,t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},u.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},u.removeObject=function(t){for(var e=this.objects,r=0;rMath.abs(e))u.rotate(a,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*i*e/window.innerHeight*(a-u.lastT())/20;u.pan(a,0,0,f*(Math.exp(o)-1))}}},!0)},d.enableMouseListeners(),d};var n=r(8161),i=r(1152),a=r(6145),o=r(6475),s=r(2565),l=r(5233)},8245:function(t,e,r){var n=r(6832),i=r(5158),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},1059:function(t,e,r){"use strict";var n=r(4296),i=r(7453),a=r(2771),o=r(6496),s=r(2611),l=r(4234),u=r(8126),c=r(6145),f=r(1120),h=r(5268),p=r(8245),d=r(2321)({tablet:!0,featureDetect:!0});function v(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function g(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}return e>0?(r=Math.round(Math.pow(10,e)),Math.ceil(t/r)*r):Math.ceil(t)}function y(t){return"boolean"!=typeof t||t}t.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;e||(e=document.createElement("canvas"),t.container?t.container.appendChild(e):document.body.appendChild(e));var r=t.gl;if(r||(t.glOptions&&(d=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d})),!r)throw new Error("webgl not supported");var m=t.bounds||[[-10,-10,-10],[10,10,10]],x=new v,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),_=p(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},A=t.axes||{},k=i(r,A);k.enable=!A.disable;var M=t.spikes||{},S=o(r,M),E=[],L=[],C=[],P=[],O=!0,I=!0,D={view:null,projection:new Array(16),model:new Array(16),_ortho:!1},z=(I=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),R=t.cameraObject||n(e,T),F={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:R,axes:k,axesPixels:null,spikes:S,bounds:m,objects:E,shape:z,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:y(t.autoResize),autoBounds:y(t.autoBounds),autoScale:!!t.autoScale,autoCenter:y(t.autoCenter),clipToBounds:y(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:D,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,I=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},B=[r.drawingBufferWidth/F.pixelRatio|0,r.drawingBufferHeight/F.pixelRatio|0];function N(){if(!F._stopped&&F.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*F.pixelRatio),a=0|Math.ceil(n*F.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",O=!0}}}function j(){for(var t=E.length,e=P.length,n=0;n0&&0===C[e-1];)C.pop(),P.pop().dispose()}function U(){if(F.contextLost)return!0;r.isContextLost()&&(F.contextLost=!0,F.mouseListener.enabled=!1,F.selection.object=null,F.oncontextloss&&F.oncontextloss())}F.autoResize&&N(),window.addEventListener("resize",N),F.update=function(t){F._stopped||(t=t||{},O=!0,I=!0)},F.add=function(t){F._stopped||(t.axes=k,E.push(t),L.push(-1),O=!0,I=!0,j())},F.remove=function(t){if(!F._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),L.pop(),O=!0,I=!0,j())}},F.dispose=function(){if(!F._stopped&&(F._stopped=!0,window.removeEventListener("resize",N),e.removeEventListener("webglcontextlost",U),F.mouseListener.enabled=!1,!F.contextLost)){k.dispose(),S.dispose();for(var t=0;tx.distance)continue;for(var u=0;u 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n"]),e.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),e.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},8271:function(t,e,r){"use strict";var n=r(5158),i=r(5827),a=r(5306),o=r(8023);function s(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}t.exports=function(t,e){var r=t.gl,a=new s(t,i(r),i(r),n(r,o.pointVertex,o.pointFragment),n(r,o.pickVertex,o.pickFragment));return a.update(e),t.addObject(a),a};var l,u,c=s.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:a.mallocFloat32(s.length),u=o?t.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),e=0;e>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,i),c=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/a,l[4]=2/o,l[6]=-2*i[0]/a-1,l[7]=-2*i[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=c<5,r.uniforms.pointSize=c,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(u[0]=255&t,u[1]=t>>8&255,u[2]=t>>16&255,u[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=u,this.pickOffset=t);var f=n.getParameter(n.BLEND),h=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),h&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),h&&n.enable(n.DITHER),t+this.pointCount}),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},6093:function(t){t.exports=function(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],f=e[2],h=e[3],p=r[0],d=r[1],v=r[2],g=r[3];return(a=u*p+c*d+f*v+h*g)<0&&(a=-a,p=-p,d=-d,v=-v,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*p,t[1]=s*c+l*d,t[2]=s*f+l*v,t[3]=s*h+l*g,t}},8240:function(t){"use strict";t.exports=function(t){return t||0===t?t.toString():""}},4123:function(t,e,r){"use strict";var n=r(875);t.exports=function(t,e,r){var a=i[e];if(a||(a=i[e]={}),t in a)return a[t];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(t,o);o.triangles=!1;var l,u,c=n(t,o);if(r&&1!==r){for(l=0;l max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * view * model * vec4(position, 1);\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),u=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:c},h={vertex:o,fragment:l,attributes:c},p={vertex:s,fragment:l,attributes:c},d={vertex:a,fragment:u,attributes:c},v={vertex:o,fragment:u,attributes:c},g={vertex:s,fragment:u,attributes:c};function y(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}e.createPerspective=function(t){return y(t,f)},e.createOrtho=function(t){return y(t,h)},e.createProject=function(t){return y(t,p)},e.createPickPerspective=function(t){return y(t,d)},e.createPickOrtho=function(t){return y(t,v)},e.createPickProject=function(t){return y(t,g)}},2182:function(t,e,r){"use strict";var n=r(3596),i=r(5827),a=r(2944),o=r(5306),s=r(104),l=r(9282),u=r(4123),c=r(8240),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function p(t,e,r,n){return h(n,n),h(n,n),h(n,n)}function d(t,e){this.index=t,this.dataCoordinate=this.position=e}function v(t){return!0===t||t>1?1:t}function g(t,e,r,n,i,a,o,s,l,u,c,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=u,this.pickOrthoShader=c,this.pickProjectShader=f,this.points=[],this._selectResult=new d(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}t.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),u=l.createPickOrtho(e),c=l.createPickProject(e),f=i(e),h=i(e),p=i(e),d=i(e),v=new g(e,r,n,o,f,h,p,d,a(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:h,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),s,u,c);return v.update(t),v};var y=g.prototype;y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},y.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var m=[0,0],x=[0,0,0],b=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],T=f.slice(),A=[0,0,0],k=[[0,0,0],[0,0,0]];function M(t){return t[0]=t[1]=t[2]=0,t}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function E(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}var L=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function C(t,e,r,n,i,a,o){var l=r.gl;if((a===r.projectHasAlpha||o)&&function(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,u=r.model||f,c=r.view||f,h=r.projection||f,d=e.axesBounds,v=function(t){for(var e=k,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],m[0]=2/o.drawingBufferWidth,m[1]=2/o.drawingBufferHeight,t.bind(),l.view=c,l.projection=h,l.screenSize=m,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=v,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var g=0;g<3;++g)if(a[g]){l.scale=e.projectScale[g],l.opacity=e.projectOpacity[g];for(var y=T,L=0;L<16;++L)y[L]=0;for(L=0;L<4;++L)y[5*L]=1;y[5*g]=0,i[g]<0?y[12+g]=d[0][g]:y[12+g]=d[1][g],s(y,u,y),l.model=y;var C=(g+1)%3,P=(g+2)%3,O=M(x),I=M(b);O[C]=1,I[P]=1;var D=p(0,0,0,S(_,O)),z=p(0,0,0,S(w,I));if(Math.abs(D[1])>Math.abs(z[1])){var R=D;D=z,z=R,R=O,O=I,I=R;var F=C;C=P,P=F}D[0]<0&&(O[C]=-1),z[1]>0&&(I[P]=-1);var B=0,N=0;for(L=0;L<4;++L)B+=Math.pow(u[4*C+L],2),N+=Math.pow(u[4*P+L],2);O[C]/=Math.sqrt(B),I[P]/=Math.sqrt(N),l.axes[0]=O,l.axes[1]=I,l.fragClipBounds[0]=E(A,v[0],g,-1e8),l.fragClipBounds[1]=E(A,v[1],g,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}(e,r,n,i),a===r.hasAlpha||o){t.bind();var u=t.uniforms;u.model=n.model||f,u.view=n.view||f,u.projection=n.projection||f,m[0]=2/l.drawingBufferWidth,m[1]=2/l.drawingBufferHeight,u.screenSize=m,u.highlightId=r.highlightId,u.highlightScale=r.highlightScale,u.fragClipBounds=L,u.clipBounds=r.axes.bounds,u.opacity=r.opacity,u.pickGroup=r.pickId/255,u.pixelRatio=i,r.vao.bind(),r.vao.draw(l.TRIANGLES,r.vertexCount),r.lineWidth>0&&(l.lineWidth(r.lineWidth*i),r.vao.draw(l.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function P(t,e,r,i){var a;a=Array.isArray(t)?e=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},y.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},y.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in t){Array.isArray(t.projectOpacity)?this.projectOpacity=t.projectOpacity.slice():(r=+t.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=v(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=v(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l=t.font||"normal",u=t.alignment||[0,0];if(2===u.length)i=u[0],a=u[1];else for(i=[],a=[],n=0;n0){var I=0,D=x,z=[0,0,0,1],R=[0,0,0,1],F=Array.isArray(p)&&Array.isArray(p[0]),B=Array.isArray(y)&&Array.isArray(y[0]);t:for(n=0;n<_;++n){for(m+=1,w=s[n],T=0;T<3;++T){if(isNaN(w[T])||!isFinite(w[T]))continue t;f[T]=Math.max(f[T],w[T]),c[T]=Math.min(c[T],w[T])}A=(N=P(h,n,l,this.pixelRatio)).mesh,k=N.lines,M=N.bounds;var N,j=N.visible;if(j)if(Array.isArray(p)){if(3===(U=F?n0?1-M[0][0]:Y<0?1+M[1][0]:1,W*=W>0?1-M[0][1]:W<0?1+M[1][1]:1],X=A.cells||[],J=A.positions||[];for(T=0;T0){var y=r*c;o.drawBox(f-y,h-y,p+y,h+y,a),o.drawBox(f-y,d-y,p+y,d+y,a),o.drawBox(f-y,h-y,f+y,d+y,a),o.drawBox(p-y,h-y,p+y,d+y,a)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},2611:function(t,e,r){"use strict";t.exports=function(t,e){var r=e[0],a=e[1];return new l(t,n(t,r,a,{}),i.mallocUint8(r*a*4))};var n=r(4234),i=r(5306),a=r(5050),o=r(2288).nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var u=l.prototype;Object.defineProperty(u,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var T=0|w.type.charAt(w.type.length-1),A=new Array(T),k=0;k=0;)M+=1;_[m]=M}var S=new Array(r.length);function E(){h.program=o.program(p,h._vref,h._fref,b,_);for(var t=0;t=0){if((d=h.charCodeAt(h.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,p[0],i,d,a,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var d;if((d=h.charCodeAt(h.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+h);l(t,e,p,i,d,a,f)}}}return a};var n=r(9068);function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}});var o=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,i){return void 0===r.length?t.vertexAttrib3f(e,r,n,i):t.vertexAttrib3fv(e,r)},function(t,e,r,n,i,a){return void 0===r.length?t.vertexAttrib4f(e,r,n,i,a):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,a,s,l){var u=o[a],c=new i(t,e,r,n,a,u);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),u(t,n[r],e),e},get:function(){return c},enumerable:!0})}function l(t,e,r,n,i,a,o){for(var l=new Array(i),u=new Array(i),c=0;c4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+m);t["uniformMatrix"+y+"fv"](s[f],!1,h);break}throw new i("","Unknown uniform data type for "+name+": "+m)}if((y=m.charCodeAt(m.length-1)-48)<2||y>4)throw new i("","Invalid data type");switch(m.charAt(0)){case"b":case"i":t["uniform"+y+"iv"](s[f],h);break;case"v":t["uniform"+y+"fv"](s[f],h);break;default:throw new i("","Unrecognized data type for vector "+name+": "+m)}}}}}}function u(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,u(a,i)):r.push([a,i])}return r}function c(t,e,n){if("object"==typeof n){var u=f(n);Object.defineProperty(t,e,{get:a(u),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:(c=n,function(t,e,r){return t.getUniform(e.program,r[c])}),set:l(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[n].type);var c}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7307:function(t,e,r){"use strict";var n=r(2858),i=r(4020),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e){var r,n=t.length;for(r=0;re)return r-1}return r},s=function(t,e,r){return tr?r:t},l=function(t){var e=1/0;t.sort(function(t,e){return t-e});for(var r=t.length,n=1;nf-1||m>h-1||x>p-1)return n.create();var b,_,w,T,A,k,M=a[0][d],S=a[0][y],E=a[1][v],L=a[1][m],C=a[2][g],P=(l-M)/(S-M),O=(u-E)/(L-E),I=(c-C)/(a[2][x]-C);switch(isFinite(P)||(P=.5),isFinite(O)||(O=.5),isFinite(I)||(I=.5),r.reversedX&&(d=f-1-d,y=f-1-y),r.reversedY&&(v=h-1-v,m=h-1-m),r.reversedZ&&(g=p-1-g,x=p-1-x),r.filled){case 5:A=g,k=x,w=v*p,T=m*p,b=d*p*h,_=y*p*h;break;case 4:A=g,k=x,b=d*p,_=y*p,w=v*p*f,T=m*p*f;break;case 3:w=v,T=m,A=g*h,k=x*h,b=d*h*p,_=y*h*p;break;case 2:w=v,T=m,b=d*h,_=y*h,A=g*h*f,k=x*h*f;break;case 1:b=d,_=y,A=g*f,k=x*f,w=v*f*p,T=m*f*p;break;default:b=d,_=y,w=v*f,T=m*f,A=g*f*h,k=x*f*h}var D=i[b+w+A],z=i[b+w+k],R=i[b+T+A],F=i[b+T+k],B=i[_+w+A],N=i[_+w+k],j=i[_+T+A],U=i[_+T+k],V=n.create(),H=n.create(),q=n.create(),G=n.create();n.lerp(V,D,B,P),n.lerp(H,z,N,P),n.lerp(q,R,j,P),n.lerp(G,F,U,P);var Y=n.create(),W=n.create();n.lerp(Y,V,q,O),n.lerp(W,H,G,O);var Z=n.create();return n.lerp(Z,Y,W,I),Z}(e,t,p)},v=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=d(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=d(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=d(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},g=[],y=e[0][0],m=e[0][1],x=e[0][2],b=e[1][0],_=e[1][1],w=e[1][2],T=function(t){var e=t[0],r=t[1],n=t[2];return!(eb||r_||nw)},A=10*n.distance(e[0],e[1])/u,k=A*A,M=1,S=0,E=r.length;E>1&&(M=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,u=0;uS&&(S=F),z.push(F),g.push({points:P,velocities:O,divergences:z});for(var B=0;B<100*u&&P.lengthk&&n.scale(N,N,A/Math.sqrt(j)),n.add(N,N,C),I=d(N),n.squaredDistance(D,N)-k>-1e-4*k&&(P.push(N),D=N,O.push(I),R=v(N,I),F=n.length(R),isFinite(F)&&F>S&&(S=F),z.push(F)),C=N}}var U=function(t,e,r,a){for(var o=0,s=0;s0)for(T=0;T<8;T++){var A=(T+1)%8;u.push(h[T],p[T],p[A],p[A],h[A],h[T]),f.push(m,y,y,y,m,m),d.push(v,g,g,g,v,v);var k=u.length;c.push([k-6,k-5,k-4],[k-3,k-2,k-1])}var M=h;h=p,p=M;var S=m;m=y,y=S;var E=v;v=g,g=E}return{positions:u,cells:c,vectors:f,vertexIntensity:d}}(t,r,a,o)}),f=[],h=[],p=[],d=[];for(s=0;s max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color — in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);e.createShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},e.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},3754:function(t,e,r){"use strict";t.exports=function(t){var e=t.gl,r=m(e),n=b(e),s=x(e),l=_(e),u=i(e),c=a(e,[{buffer:u,size:4,stride:w,offset:0},{buffer:u,size:3,stride:w,offset:16},{buffer:u,size:3,stride:w,offset:28}]),f=i(e),h=a(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),p=i(e),d=a(e,[{buffer:p,size:2,type:e.FLOAT}]),v=o(e,1,S,e.RGBA,e.UNSIGNED_BYTE);v.minFilter=e.LINEAR,v.magFilter=e.LINEAR;var g=new E(e,[0,0],[[0,0,0],[0,0,0]],r,n,u,c,v,s,l,f,h,p,d,[0,0,0]),y={levels:[[],[],[]]};for(var T in t)y[T]=t[T];return y.colormap=y.colormap||"jet",g.update(y),g};var n=r(2288),i=r(5827),a=r(2944),o=r(8931),s=r(5306),l=r(9156),u=r(7498),c=r(7382),f=r(5050),h=r(4162),p=r(104),d=r(7437),v=r(5070),g=r(9144),y=r(9054),m=y.createShader,x=y.createContourShader,b=y.createPickShader,_=y.createPickContourShader,w=40,T=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],A=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],k=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function M(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=k[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var S=256;function E(t,e,r,n,i,a,o,l,u,c,h,p,d,v,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new M([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=v,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var L=E.prototype;L.genColormap=function(t,e){var r=!1,n=c([l({colormap:t,nshades:S,format:"rgba"}).map(function(t,n){var i=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]})]);return u.divseq(n,255),this.hasAlphaScale=r,n},L.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},L.isOpaque=function(){return!this.isTransparent()},L.pickSlots=1,L.setPickBase=function(t){this.pickId=t};var C=[0,0,0],P={showSurface:!1,showContour:!1,projections:[T.slice(),T.slice(),T.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function O(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||C,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=P.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],p(l,t.model,l);var u=P.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return P.showSurface=o,P.showContour=s,P}var I={model:T,view:T,projection:T,inverseModel:T.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},D=T.slice(),z=[1,0,0,0,1,0,0,0,1];function R(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=I;n.model=t.model||T,n.view=t.view||T,n.projection=t.projection||T,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=z,n.vertexColor=this.vertexColor;var s=D;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var u=s[12+i];for(o=0;o<3;++o)u+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=u/l}var c=O(n,this);if(c.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=c.projections[i],this._shader.uniforms.clipBounds=c.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),i=0;i<3;++i)for(f.uniforms.permutation=k[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var f=c?a:1-a,h=0;h<2;++h)for(var p=i+c,d=s+h,g=f*(h?l:1-l),y=0;y<3;++y)u[y]+=this._field[y].get(p,d)*g;for(var m=this._pickResult.level,x=0;x<3;++x)if(m[x]=v.le(this.contourLevels[x],u[x]),m[x]<0)this.contourLevels[x].length>0&&(m[x]=0);else if(m[x]Math.abs(_-u[x])&&(m[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},L.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();u.assign(t.lo(1,1).hi(r[0],r[1]),e),u.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),u.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),u.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),u.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))},L.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=B(t.contourWidth,Number)),"showContour"in t&&(this.showContour=B(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=B(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=j(t.contourColor)),"contourProject"in t&&(this.contourProject=B(t.contourProject,function(t){return B(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=j(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=B(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=B(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var u=l[o];for(y=0;y<2;++y)if(u.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],u)}}else if(t.ticks){var c=t.ticks;if(!Array.isArray(c)||2!==c.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=c[o];if((Array.isArray(p)||p.length)&&(p=f(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var d=f(p.data,a);d.stride[o]=p.stride[0],d.stride[1^o]=0,this.padField(this._field[o],d)}}else{for(o=0;o<2;++o){var v=[0,0];v[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],v,0)}this._field[0].set(0,0,0);for(var y=0;y0){for(var xt=0;xt<5;++xt)$.pop();U-=1}continue t}$.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[Q]=et,this._contourCounts[Q]=rt}var bt=s.mallocFloat($.length);for(o=0;o<$.length;++o)bt[o]=$[o];this._contourBuffer.update(bt),s.freeFloat(bt)}},L.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var t=0;t<3;++t)s.freeFloat(this._field[t].data)},L.highlight=function(t){var e,r;if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(e=0;e<3;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;for(r=this.snapToData?t.dataCoordinate:t.position,e=0;e<3;++e)r[e]-=this.objectOffset[e];if(this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,a=s.mallocFloat(12*i[0]*i[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var l=(o+1)%3,u=(o+2)%3,c=this._field[o],f=this._field[l],p=this._field[u],d=h(c,r[o]),v=d.cells,g=d.positions;for(this._dynamicOffsets[o]=n,e=0;es||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=d(o,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,l=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,l=!1,r="uint8");var f,p,g=0;if(2===o.length)g=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])g=t.ALPHA;else if(2===o[2])g=t.LUMINANCE_ALPHA;else if(3===o[2])g=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,l=!1);var y=e.size;if(l)f=0===e.offset&&e.data.length===y?e.data:e.data.subarray(e.offset,e.offset+y);else{var m=[o[2],o[2]*o[0],1];p=a.malloc(y,r);var x=n(p,o,m,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?i.assign(x,e):c(x,e),f=p.subarray(0,y)}var b=v(t);return t.texImage2D(t.TEXTURE_2D,0,g,o[0],o[1],0,g,u,f),l||a.free(p),new h(t,b,o[0],o[1],g,u)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function u(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var c=function(t,e){i.muls(t,e,255)};function f(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function h(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var p=h.prototype;function d(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function v(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function g(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new h(t,o,e,r,n,i)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return f(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return f(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,f(this,this._shape[0],t),t}}}),p.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},p.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l);else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,u,f){var h=f.dtype,p=f.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var v=0,g=0,y=d(p,f.stride.slice());if("float32"===h?v=t.FLOAT:"float64"===h?(v=t.FLOAT,y=!1,h="float32"):"uint8"===h?v=t.UNSIGNED_BYTE:(v=t.UNSIGNED_BYTE,y=!1,h="uint8"),2===p.length)g=t.LUMINANCE,p=[p[0],p[1],1],f=n(f.data,p,[f.stride[0],f.stride[1],1],f.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])g=t.ALPHA;else if(2===p[2])g=t.LUMINANCE_ALPHA;else if(3===p[2])g=t.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}p[2]}if(g!==t.LUMINANCE&&g!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var m=f.size,x=u.indexOf(o)<0;if(x&&u.push(o),v===l&&y)0===f.offset&&f.data.length===m?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,f.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,f.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,f.data.subarray(f.offset,f.offset+m)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,f.data.subarray(f.offset,f.offset+m));else{var b;b=l===t.FLOAT?a.mallocFloat32(m):a.mallocUint8(m);var _=n(b,p,[p[2],p[2]*p[0],1]);v===t.FLOAT&&l===t.UNSIGNED_BYTE?c(_,f):i.assign(_,f),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,b.subarray(0,m)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,b.subarray(0,m)),l===t.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},3056:function(t){"use strict";t.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=r(5415),i=r(899),a=r(9305)},8827:function(t){t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},7622:function(t){t.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},8782:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},8501:function(t){t.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},903:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},5981:function(t,e,r){t.exports=r(8288)},8288:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},8629:function(t,e,r){t.exports=r(7979)},7979:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},9305:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},154:function(t){t.exports=1e-6},4932:function(t,e,r){t.exports=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(154)},5777:function(t){t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},3306:function(t){t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},7447:function(t,e,r){t.exports=function(t,e,r,i,a,o){var s,l;for(e||(e=3),r||(r=0),l=i?Math.min(i*e+r,t.length):t.length,s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},6660:function(t){t.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},392:function(t){t.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=e[0],t[1]=i+o*u-s*l,t[2]=a+o*l+s*u,t}},3222:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=i+s*l+o*u,t[1]=e[1],t[2]=a+s*u-o*l,t}},3388:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=i+o*u-s*l,t[1]=a+o*l+s*u,t[2]=e[2],t}},1624:function(t){t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},5685:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},6722:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},831:function(t){t.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},5294:function(t,e,r){t.exports=r(6403)},3303:function(t,e,r){t.exports=r(4337)},6403:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},4337:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},8921:function(t,e,r){t.exports=r(911)},911:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},9908:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},3255:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},6568:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,h=u*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=c*u+p*-o+f*-l-h*-s,t[1]=f*u+p*-s+h*-o-c*-l,t[2]=h*u+p*-l+c*-s-f*-o,t}},3433:function(t){t.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},1413:function(t){t.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},3470:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},5313:function(t){t.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},5446:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},205:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},4242:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},5680:function(t){t.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},4020:function(t,e,r){t.exports={create:r(5313),clone:r(1413),fromValues:r(5680),copy:r(3470),set:r(6453),add:r(3433),subtract:r(2705),multiply:r(746),divide:r(205),min:r(2170),max:r(3030),scale:r(5510),scaleAndAdd:r(4224),distance:r(5446),squaredDistance:r(1542),length:r(8177),squaredLength:r(9037),negate:r(6459),inverse:r(8057),normalize:r(381),dot:r(4242),lerp:r(8746),random:r(3770),transformMat4:r(6342),transformQuat:r(5022)}},8057:function(t){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},8177:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},8746:function(t){t.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},3030:function(t){t.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},2170:function(t){t.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},746:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},6459:function(t){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},381:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t}},3770:function(t,e,r){var n=r(381),i=r(5510);t.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},5510:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},4224:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},6453:function(t){t.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},1542:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},9037:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},2705:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},6342:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},5022:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,h=u*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=c*u+p*-o+f*-l-h*-s,t[1]=f*u+p*-s+h*-o-c*-l,t[2]=h*u+p*-l+c*-s-f*-o,t[3]=e[3],t}},9365:function(t,e,r){var n=r(8096),i=r(7896);t.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return N(r),P+=r.length,(S=S.slice(r.length)).length}}function W(){return/[^a-fA-F0-9]/.test(e)?(N(S.join("")),M=l,A):(S.push(e),r=e,A+1)}function Z(){return"."===e||/[eE]/.test(e)?(S.push(e),M=v,r=e,A+1):"x"===e&&1===S.length&&"0"===S[0]?(M=_,S.push(e),r=e,A+1):/[^\d]/.test(e)?(N(S.join("")),M=l,A):(S.push(e),r=e,A+1)}function X(){return"f"===e&&(S.push(e),r=e,A+=1),/[eE]/.test(e)?(S.push(e),r=e,A+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(N(S.join("")),M=l,A):(S.push(e),r=e,A+1)}function J(){if(/[^\d\w_]/.test(e)){var t=S.join("");return M=B[t]?m:F[t]?y:g,N(S.join("")),M=l,A}return S.push(e),r=e,A+1}};var n=r(399),i=r(9746),a=r(9525),o=r(9458),s=r(3585),l=999,u=9999,c=0,f=1,h=2,p=3,d=4,v=5,g=6,y=7,m=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3585:function(t,e,r){var n=r(9525);n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),t.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},9525:function(t){t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},9458:function(t,e,r){var n=r(399);t.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},399:function(t){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},9746:function(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},8096:function(t,e,r){var n=r(3193);t.exports=function(t,e){var r=n(e),i=[];return(i=i.concat(r(t))).concat(r(null))}},6832:function(t){t.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n0;)for(var s=(t=o.pop()).adjacent,l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,f=0;f<=r;++f){var h=c[f];i[f]=h<0?e:a[h]}var p=this.orient();if(p>0)return u;u.lastVisited=-n,0===p&&o.push(u)}}return null},c.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];for(s.lastVisited=r,c=0;c<=n;++c){var f=u[c];if(!(f.lastVisited>=r)){var h=a[c];a[c]=t;var p=this.orient();if(a[c]=h,p<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},c.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var h=[];f.length>0;){var p=(e=f.pop()).vertices,d=e.adjacent,v=p.indexOf(r);if(!(v<0))for(var g=0;g<=n;++g)if(g!==v){var y=d[g];if(y.boundary&&!(y.lastVisited>=r)){var m=y.vertices;if(y.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)m[b]<0?(x=b,l[b]=t):l[b]=i[m[b]];if(this.orient()>0){m[x]=r,y.boundary=!1,u.push(y),f.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var _=y.adjacent,w=p.slice(),T=d.slice(),A=new a(w,T,!0);c.push(A);var k=_.indexOf(e);if(!(k<0))for(_[k]=A,T[v]=y,w[g]=-1,T[g]=e,d[g]=A,A.flip(),b=0;b<=n;++b){var M=w[b];if(!(M<0||M===r)){for(var S=new Array(n-1),E=0,L=0;L<=n;++L){var C=w[L];C<0||L===b||(S[E++]=C)}h.push(new o(S,A,b))}}}}}for(h.sort(s),g=0;g+1=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},9014:function(t,e,r){"use strict";var n=r(5070);function i(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}t.exports=function(t){return t&&0!==t.length?new y(g(t)):new y(null)};var a=i.prototype;function o(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function s(t,e){var r=g(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function u(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function c(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function h(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var r=n.ge(this.leftPoints,t,d),i=n.ge(this.rightPoints,t,v);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},a.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?u(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?u(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,t,d);athis.mid?this.right&&(r=this.right.queryPoint(t,e))?r:f(this.rightPoints,t,e):h(this.leftPoints,e);var r},a.queryInterval=function(t,e,r){var n;return tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r))?n:ethis.mid?f(this.rightPoints,t,r):h(this.leftPoints,r)};var m=y.prototype;m.insert=function(t){this.root?this.root.insert(t):this.root=new i(t[0],null,null,[t],[t])},m.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},m.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},m.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(m,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(m,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},9560:function(t){"use strict";t.exports=function(t){for(var e=new Array(t),r=0;r13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},3578:function(t){t.exports=function(t,e,r){return t*(1-r)+e*r}},7191:function(t,e,r){var n=r(4690),i=r(9823),a=r(7332),o=r(7787),s=r(7437),l=r(2142),u={length:r(4693),normalize:r(899),dot:r(9305),cross:r(903)},c=i(),f=i(),h=[0,0,0,0],p=[[0,0,0],[0,0,0],[0,0,0]],d=[0,0,0];function v(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}t.exports=function(t,e,r,i,g,y){if(e||(e=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),g||(g=[0,0,0,1]),y||(y=[0,0,0,1]),!n(c,t))return!1;if(a(f,c),f[3]=0,f[7]=0,f[11]=0,f[15]=1,Math.abs(o(f)<1e-8))return!1;var m,x,b,_,w,T,A,k=c[3],M=c[7],S=c[11],E=c[12],L=c[13],C=c[14],P=c[15];if(0!==k||0!==M||0!==S){if(h[0]=k,h[1]=M,h[2]=S,h[3]=P,!s(f,f))return!1;l(f,f),m=g,b=f,_=(x=h)[0],w=x[1],T=x[2],A=x[3],m[0]=b[0]*_+b[4]*w+b[8]*T+b[12]*A,m[1]=b[1]*_+b[5]*w+b[9]*T+b[13]*A,m[2]=b[2]*_+b[6]*w+b[10]*T+b[14]*A,m[3]=b[3]*_+b[7]*w+b[11]*T+b[15]*A}else g[0]=g[1]=g[2]=0,g[3]=1;if(e[0]=E,e[1]=L,e[2]=C,function(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}(p,c),r[0]=u.length(p[0]),u.normalize(p[0],p[0]),i[0]=u.dot(p[0],p[1]),v(p[1],p[1],p[0],1,-i[0]),r[1]=u.length(p[1]),u.normalize(p[1],p[1]),i[0]/=r[1],i[1]=u.dot(p[0],p[2]),v(p[2],p[2],p[0],1,-i[1]),i[2]=u.dot(p[1],p[2]),v(p[2],p[2],p[1],1,-i[2]),r[2]=u.length(p[2]),u.normalize(p[2],p[2]),i[1]/=r[2],i[2]/=r[2],u.cross(d,p[1],p[2]),u.dot(p[0],d)<0)for(var O=0;O<3;O++)r[O]*=-1,p[O][0]*=-1,p[O][1]*=-1,p[O][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+p[0][0]-p[1][1]-p[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-p[0][0]+p[1][1]-p[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-p[0][0]-p[1][1]+p[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+p[0][0]+p[1][1]+p[2][2],0)),p[2][1]>p[1][2]&&(y[0]=-y[0]),p[0][2]>p[2][0]&&(y[1]=-y[1]),p[1][0]>p[0][1]&&(y[2]=-y[2]),!0}},4690:function(t){t.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},7649:function(t,e,r){var n=r(1868),i=r(1102),a=r(7191),o=r(7787),s=r(1116),l=f(),u=f(),c=f();function f(){return{translate:h(),scale:h(1),skew:h(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function h(t){return[t||0,t||0,t||0]}t.exports=function(t,e,r,f){if(0===o(e)||0===o(r))return!1;var h=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion);return!(!h||!p||(n(c.translate,l.translate,u.translate,f),n(c.skew,l.skew,u.skew,f),n(c.scale,l.scale,u.scale,f),n(c.perspective,l.perspective,u.perspective,f),s(c.quaternion,l.quaternion,u.quaternion,f),i(t,c.translate,c.scale,c.skew,c.perspective,c.quaternion),0))}},1102:function(t,e,r){var n={identity:r(9947),translate:r(998),multiply:r(104),create:r(9823),scale:r(3668),fromRotationTranslation:r(7280)},i=(n.create(),n.create());t.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},9298:function(t,e,r){"use strict";var n=r(5070),i=r(7649),a=r(7437),o=r(6109),s=r(7115),l=r(5240),u=r(3012),c=r(998),f=(r(3668),r(899)),h=[0,0,0];function p(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}t.exports=function(t){return new p((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var d=p.prototype;d.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)o[u]=s[l++];else{var c=e[r+1]-e[r],h=(l=16*r,this.prevMatrix),p=!0;for(u=0;u<16;++u)h[u]=s[l++];var d=this.nextMatrix;for(u=0;u<16;++u)d[u]=s[l++],p=p&&h[u]===d[u];if(c<1e-6||p)for(u=0;u<16;++u)o[u]=h[u];else i(o,h,d,(t-e[r])/c)}var v=this.computedUp;v[0]=o[1],v[1]=o[5],v[2]=o[9],f(v,v);var g=this.computedInverse;a(g,o);var y=this.computedEye,m=g[15];y[0]=g[12]/m,y[1]=g[13]/m,y[2]=g[14]/m;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(u=0;u<3;++u)x[u]=y[u]-o[2+4*u]*b}},d.idle=function(t){if(!(t1&&n(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&n(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var f=0,h=(i=0,o.length);i0;--p)r[f++]=s[p];return r};var n=r(417)[3]},6145:function(t,e,r){"use strict";t.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==i||c!==a||l(s))&&(r=0|t,i=u||0,a=c||0,e&&e(r,i,a,o))}function c(t){u(0,t)}function f(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function h(t){l(t)&&e&&e(r,i,a,o)}function p(t){0===n.buttons(t)?u(0,t):u(r,t)}function d(t){u(r|n.buttons(t),t)}function v(t){u(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",d),t.addEventListener("mouseup",v),t.addEventListener("mouseleave",c),t.addEventListener("mouseenter",c),t.addEventListener("mouseout",c),t.addEventListener("mouseover",c),t.addEventListener("blur",f),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}g();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(e){e?g():s&&(s=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",d),t.removeEventListener("mouseup",v),t.removeEventListener("mouseleave",c),t.removeEventListener("mouseenter",c),t.removeEventListener("mouseout",c),t.removeEventListener("mouseover",c),t.removeEventListener("blur",f),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(4110)},2565:function(t){var e={left:0,top:0};t.exports=function(t,r,n){r=r||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=t.clientX||0,o=t.clientY||0,s=(i=r)===window||i===document||i===document.body?e:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},4110:function(t,e){"use strict";function r(t){return t.target||t.srcElement||window}e.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1< 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var o=t.getters||[],s=new Array(a),l=0;l=0?s[l]=!0:s[l]=!1;return function(t,e,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,0,r,s)};var i={"false,0,1":function(t,e,r,n,i){return function(a,o,s,l){var u,c=0|a.shape[0],f=0|a.shape[1],h=a.data,p=0|a.offset,d=0|a.stride[0],v=0|a.stride[1],g=p,y=0|-d,m=0,x=0|-v,b=0,_=-d-v|0,w=0,T=0|d,A=v-d*c|0,k=0,M=0,S=0,E=2*c|0,L=n(E),C=n(E),P=0,O=0,I=-1,D=-1,z=0,R=0|-c,F=0|c,B=0,N=-c-1|0,j=c-1|0,U=0,V=0,H=0;for(k=0;k0){if(M=1,L[P++]=r(h[g],o,s,l),g+=T,c>0)for(k=1,u=h[g],O=L[P]=r(u,o,s,l),z=L[P+I],B=L[P+R],U=L[P+N],O===z&&O===B&&O===U||(m=h[g+y],b=h[g+x],w=h[g+_],t(k,M,u,m,b,w,O,z,B,U,o,s,l),V=C[P]=S++),P+=1,g+=T,k=2;k0)for(k=1,u=h[g],O=L[P]=r(u,o,s,l),z=L[P+I],B=L[P+R],U=L[P+N],O===z&&O===B&&O===U||(m=h[g+y],b=h[g+x],w=h[g+_],t(k,M,u,m,b,w,O,z,B,U,o,s,l),V=C[P]=S++,U!==B&&e(C[P+R],V,b,w,B,U,o,s,l)),P+=1,g+=T,k=2;k0){if(k=1,L[P++]=r(h[g],o,s,l),g+=T,f>0)for(M=1,u=h[g],O=L[P]=r(u,o,s,l),B=L[P+R],z=L[P+I],U=L[P+N],O===B&&O===z&&O===U||(m=h[g+y],b=h[g+x],w=h[g+_],t(k,M,u,m,b,w,O,B,z,U,o,s,l),V=C[P]=S++),P+=1,g+=T,M=2;M0)for(M=1,u=h[g],O=L[P]=r(u,o,s,l),B=L[P+R],z=L[P+I],U=L[P+N],O===B&&O===z&&O===U||(m=h[g+y],b=h[g+x],w=h[g+_],t(k,M,u,m,b,w,O,B,z,U,o,s,l),V=C[P]=S++,U!==B&&e(C[P+R],V,w,m,U,B,o,s,l)),P+=1,g+=T,M=2;M2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),t.pick(0,-1,1).lo(1).hi(a[1]-2)),e(t.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),t.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),e(t.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),t.pick(-1,0,0).lo(1).hi(a[0]-2)),e(t.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),t.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),e(t.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),t.set(0,0,0,0),t.set(0,0,1,0),t.set(a[0]-1,0,0,0),t.set(a[0]-1,0,1,0),t.set(0,a[1]-1,0,0),t.set(0,a[1]-1,1,0),t.set(a[0]-1,a[1]-1,0,0),t.set(a[0]-1,a[1]-1,1,0),t}}t.exports=function(t,e,r){return Array.isArray(r)||(r=n(e.dimension,"string"==typeof r?r:"clamp")),0===e.size?t:0===e.dimension?(t.set(0),t):function(t){var e=t.join();if(a=c[e])return a;for(var r=t.length,n=[f,h],i=1;i<=r;++i)n.push(p(i));var a=d.apply(void 0,n);return c[e]=a,a}(r)(t,e)}},3581:function(t){"use strict";function e(t,e){var r=Math.floor(e),n=e-r,i=0<=r&&r0;){x<64?(l=x,x=0):(l=64,x-=64);for(var b=0|t[1];b>0;){b<64?(u=b,b=0):(u=64,b-=64),n=y+x*f+b*h,o=m+x*d+b*v;var _=0,w=0,T=0,A=p,k=f-c*p,M=h-l*f,S=g,E=d-c*g,L=v-l*d;for(T=0;T0;){v<64?(l=v,v=0):(l=64,v-=64);for(var g=0|t[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=p+v*c+g*u,o=d+v*h+g*f;var y=0,m=0,x=c,b=u-l*c,_=h,w=f-l*h;for(m=0;m0;){m<64?(u=m,m=0):(u=64,m-=64);for(var x=0|t[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var b=0|t[1];b>0;){b<64?(l=b,b=0):(l=64,b-=64),n=g+m*h+x*c+b*f,o=y+m*v+x*p+b*d;var _=0,w=0,T=0,A=h,k=c-u*h,M=f-s*c,S=v,E=p-u*v,L=d-s*p;for(T=0;Tr;){y=0,m=v-o;e:for(g=0;gb)break e;m+=f,y+=h}for(y=v,m=v-o,g=0;g>1,q=H-j,G=H+j,Y=U,W=q,Z=H,X=G,J=V,K=i+1,$=a-1,Q=!0,tt=0,et=0,rt=0,nt=f,it=e(nt),at=e(nt);k=l*Y,M=l*W,N=s;t:for(A=0;A0){g=Y,Y=W,W=g;break t}if(rt<0)break t;N+=p}k=l*X,M=l*J,N=s;t:for(A=0;A0){g=X,X=J,J=g;break t}if(rt<0)break t;N+=p}k=l*Y,M=l*Z,N=s;t:for(A=0;A0){g=Y,Y=Z,Z=g;break t}if(rt<0)break t;N+=p}k=l*W,M=l*Z,N=s;t:for(A=0;A0){g=W,W=Z,Z=g;break t}if(rt<0)break t;N+=p}k=l*Y,M=l*X,N=s;t:for(A=0;A0){g=Y,Y=X,X=g;break t}if(rt<0)break t;N+=p}k=l*Z,M=l*X,N=s;t:for(A=0;A0){g=Z,Z=X,X=g;break t}if(rt<0)break t;N+=p}k=l*W,M=l*J,N=s;t:for(A=0;A0){g=W,W=J,J=g;break t}if(rt<0)break t;N+=p}k=l*W,M=l*Z,N=s;t:for(A=0;A0){g=W,W=Z,Z=g;break t}if(rt<0)break t;N+=p}k=l*X,M=l*J,N=s;t:for(A=0;A0){g=X,X=J,J=g;break t}if(rt<0)break t;N+=p}for(k=l*Y,M=l*W,S=l*Z,E=l*X,L=l*J,C=l*U,P=l*H,O=l*V,B=0,N=s,A=0;A0)){if(rt<0){for(k=l*b,M=l*K,S=l*$,N=s,A=0;A0)for(;;){for(_=s+$*l,B=0,A=0;A0)){for(_=s+$*l,B=0,A=0;AV){t:for(;;){for(_=s+K*l,B=0,N=s,A=0;A1&&n?s(r,n[0],n[1]):s(r)}(t,e,l);return n(l,u)}},8729:function(t,e,r){"use strict";var n=r(8139),i={};t.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},5050:function(t,e,r){var n=r(4780),i="undefined"!=typeof Float64Array;function a(t,e){return t[0]-e[0]}function o(){var t,e=this.stride,r=new Array(e.length);for(t=0;t=0&&(e+=a*(r=0|t),i-=r),new n(this.data,i,a,e)},i.step=function(t){var e=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"==typeof t&&((a=0|t)<0?(i+=r*(e-1),e=o(-e/a)):e=o(e/a),r*=a),new n(this.data,e,r,i)},i.transpose=function(t){t=void 0===t?0:0|t;var e=this.shape,r=this.stride;return new n(this.data,e[t],r[t],this.offset)},i.pick=function(t){var r=[],n=[],i=this.offset;return"number"==typeof t&&t>=0?i=i+this.stride[0]*t|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,e[r.length+1])(this.data,r,n,i)},function(t,e,r,i){return new n(t,e[0],r[0],i)}},2:function(t,e,r){function n(t,e,r,n,i,a){this.data=t,this.shape=[e,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=t,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(e,r,n){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]=n},i.get=function(e,r){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]},i.index=function(t,e){return this.offset+this.stride[0]*t+this.stride[1]*e},i.hi=function(t,e){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,this.stride[0],this.stride[1],this.offset)},i.lo=function(t,e){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof t&&t>=0&&(r+=s*(i=0|t),a-=i),"number"==typeof e&&e>=0&&(r+=l*(i=0|e),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(t,e){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,u=Math.ceil;return"number"==typeof t&&((l=0|t)<0?(s+=a*(r-1),r=u(-r/l)):r=u(r/l),a*=l),"number"==typeof e&&((l=0|e)<0?(s+=o*(i-1),i=u(-i/l)):i=u(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(t,e){t=void 0===t?0:0|t,e=void 0===e?1:0|e;var r=this.shape,i=this.stride;return new n(this.data,r[t],r[e],i[t],i[e],this.offset)},i.pick=function(t,r){var n=[],i=[],a=this.offset;return"number"==typeof t&&t>=0?a=a+this.stride[0]*t|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"==typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,e[n.length+1])(this.data,n,i,a)},function(t,e,r,i){return new n(t,e[0],e[1],r[0],r[1],i)}},3:function(t,e,r){function n(t,e,r,n,i,a,o,s){this.data=t,this.shape=[e,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=t,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var t=Math.abs(this.stride[0]),e=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return t>e?e>r?[2,1,0]:t>r?[1,2,0]:[1,0,2]:t>r?[2,0,1]:r>e?[0,1,2]:[0,2,1]}}),i.set=function(e,r,n,i){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(e,r,n){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]},i.index=function(t,e,r){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r},i.hi=function(t,e,r){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(t,e,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.stride[0],c=this.stride[1],f=this.stride[2];return"number"==typeof t&&t>=0&&(i+=u*(a=0|t),o-=a),"number"==typeof e&&e>=0&&(i+=c*(a=0|e),s-=a),"number"==typeof r&&r>=0&&(i+=f*(a=0|r),l-=a),new n(this.data,o,s,l,u,c,f,i)},i.step=function(t,e,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],u=this.stride[2],c=this.offset,f=0,h=Math.ceil;return"number"==typeof t&&((f=0|t)<0?(c+=s*(i-1),i=h(-i/f)):i=h(i/f),s*=f),"number"==typeof e&&((f=0|e)<0?(c+=l*(a-1),a=h(-a/f)):a=h(a/f),l*=f),"number"==typeof r&&((f=0|r)<0?(c+=u*(o-1),o=h(-o/f)):o=h(o/f),u*=f),new n(this.data,i,a,o,s,l,u,c)},i.transpose=function(t,e,r){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[t],i[e],i[r],a[t],a[e],a[r],this.offset)},i.pick=function(t,r,n){var i=[],a=[],o=this.offset;return"number"==typeof t&&t>=0?o=o+this.stride[0]*t|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"==typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,e[i.length+1])(this.data,i,a,o)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],r[0],r[1],r[2],i)}},4:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,u){this.data=t,this.shape=[e,r,n,i],this.stride=[a,o,s,l],this.offset=0|u}var i=n.prototype;return i.dtype=t,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(e,r,n,i){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(t,e,r,n){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n},i.hi=function(t,e,r,i){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(t,e,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],u=this.shape[2],c=this.shape[3],f=this.stride[0],h=this.stride[1],p=this.stride[2],d=this.stride[3];return"number"==typeof t&&t>=0&&(a+=f*(o=0|t),s-=o),"number"==typeof e&&e>=0&&(a+=h*(o=0|e),l-=o),"number"==typeof r&&r>=0&&(a+=p*(o=0|r),u-=o),"number"==typeof i&&i>=0&&(a+=d*(o=0|i),c-=o),new n(this.data,s,l,u,c,f,h,p,d,a)},i.step=function(t,e,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],u=this.stride[0],c=this.stride[1],f=this.stride[2],h=this.stride[3],p=this.offset,d=0,v=Math.ceil;return"number"==typeof t&&((d=0|t)<0?(p+=u*(a-1),a=v(-a/d)):a=v(a/d),u*=d),"number"==typeof e&&((d=0|e)<0?(p+=c*(o-1),o=v(-o/d)):o=v(o/d),c*=d),"number"==typeof r&&((d=0|r)<0?(p+=f*(s-1),s=v(-s/d)):s=v(s/d),f*=d),"number"==typeof i&&((d=0|i)<0?(p+=h*(l-1),l=v(-l/d)):l=v(l/d),h*=d),new n(this.data,a,o,s,l,u,c,f,h,p)},i.transpose=function(t,e,r,i){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[t],a[e],a[r],a[i],o[t],o[e],o[r],o[i],this.offset)},i.pick=function(t,r,n,i){var a=[],o=[],s=this.offset;return"number"==typeof t&&t>=0?s=s+this.stride[0]*t|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"==typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,e[a.length+1])(this.data,a,o,s)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],r[0],r[1],r[2],r[3],i)}},5:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,u,c,f){this.data=t,this.shape=[e,r,n,i,a],this.stride=[o,s,l,u,c],this.offset=0|f}var i=n.prototype;return i.dtype=t,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a,o){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(e,r,n,i,a){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(t,e,r,n,i){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(t,e,r,i,a){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,"number"!=typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(t,e,r,i,a){var o=this.offset,s=0,l=this.shape[0],u=this.shape[1],c=this.shape[2],f=this.shape[3],h=this.shape[4],p=this.stride[0],d=this.stride[1],v=this.stride[2],g=this.stride[3],y=this.stride[4];return"number"==typeof t&&t>=0&&(o+=p*(s=0|t),l-=s),"number"==typeof e&&e>=0&&(o+=d*(s=0|e),u-=s),"number"==typeof r&&r>=0&&(o+=v*(s=0|r),c-=s),"number"==typeof i&&i>=0&&(o+=g*(s=0|i),f-=s),"number"==typeof a&&a>=0&&(o+=y*(s=0|a),h-=s),new n(this.data,l,u,c,f,h,p,d,v,g,y,o)},i.step=function(t,e,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.shape[3],c=this.shape[4],f=this.stride[0],h=this.stride[1],p=this.stride[2],d=this.stride[3],v=this.stride[4],g=this.offset,y=0,m=Math.ceil;return"number"==typeof t&&((y=0|t)<0?(g+=f*(o-1),o=m(-o/y)):o=m(o/y),f*=y),"number"==typeof e&&((y=0|e)<0?(g+=h*(s-1),s=m(-s/y)):s=m(s/y),h*=y),"number"==typeof r&&((y=0|r)<0?(g+=p*(l-1),l=m(-l/y)):l=m(l/y),p*=y),"number"==typeof i&&((y=0|i)<0?(g+=d*(u-1),u=m(-u/y)):u=m(u/y),d*=y),"number"==typeof a&&((y=0|a)<0?(g+=v*(c-1),c=m(-c/y)):c=m(c/y),v*=y),new n(this.data,o,s,l,u,c,f,h,p,d,v,g)},i.transpose=function(t,e,r,i,a){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[t],o[e],o[r],o[i],o[a],s[t],s[e],s[r],s[i],s[a],this.offset)},i.pick=function(t,r,n,i,a){var o=[],s=[],l=this.offset;return"number"==typeof t&&t>=0?l=l+this.stride[0]*t|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,e[o.length+1])(this.data,o,s,l)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],e[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(t,e){var r=-1===e?"T":String(e),n=s[r];return-1===e?n(t):0===e?n(t,u[t][0]):n(t,u[t],o)}var u={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};t.exports=function(t,e,r,a){if(void 0===t)return(0,u.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===a)for(a=0,s=0;s>>0;t.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);return e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},115:function(t,e){e.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var b=i[u],_=1/Math.sqrt(g*m);for(x=0;x<3;++x){var w=(x+1)%3,T=(x+2)%3;b[x]+=_*(y[w]*v[T]-y[T]*v[w])}}}for(o=0;oa)for(_=1/Math.sqrt(A),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},e.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(p):0,u=0;u<3;++u)h[u]*=p;i[o]=h}return i}},567:function(t){"use strict";t.exports=function(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(f>0){var f=Math.sqrt(c+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,u);f=Math.sqrt(2*h-c+1),e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}},7774:function(t,e,r){"use strict";t.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),c(r=[].slice.call(r,0,4),r);var i=new f(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i};var n=r(8444),i=r(3012),a=r(5950),o=r(7437),s=r(567);function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function c(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=u(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function f(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var h=f.prototype;h.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},h.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;c(e,e);var r=this.computedMatrix;a(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,f=0;f<3;++f)u+=r[l+4*f]*i[f];r[12+l]=-u}},h.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},h.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},h.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},h.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],u=l(a,o,s);a/=u,o/=u,s/=u;var c=i[0],f=i[4],h=i[8],p=c*a+f*o+h*s,d=l(c-=a*p,f-=o*p,h-=s*p);c/=d,f/=d,h/=d;var v=i[2],g=i[6],y=i[10],m=v*a+g*o+y*s,x=v*c+g*f+y*h,b=l(v-=m*a+x*c,g-=m*o+x*f,y-=m*s+x*h);v/=b,g/=b,y/=b;var _=c*e+a*r,w=f*e+o*r,T=h*e+s*r;this.center.move(t,_,w,T);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+n),this.radius.set(t,Math.log(A))},h.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],c=i[1],f=i[5],h=i[9],p=i[2],d=i[6],v=i[10],g=e*a+r*c,y=e*o+r*f,m=e*s+r*h,x=-(d*m-v*y),b=-(v*g-p*m),_=-(p*y-d*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),T=u(x,b,_,w);T>1e-6?(x/=T,b/=T,_/=T,w/=T):(x=b=_=0,w=1);var A=this.computedRotation,k=A[0],M=A[1],S=A[2],E=A[3],L=k*w+E*x+M*_-S*b,C=M*w+E*b+S*x-k*_,P=S*w+E*_+k*b-M*x,O=E*w-k*x-M*b-S*_;if(n){x=p,b=d,_=v;var I=Math.sin(n)/l(x,b,_);x*=I,b*=I,_*=I,O=O*(w=Math.cos(e))-(L=L*w+O*x+C*_-P*b)*x-(C=C*w+O*b+P*x-L*_)*b-(P=P*w+O*_+L*b-C*x)*_}var D=u(L,C,P,O);D>1e-6?(L/=D,C/=D,P/=D,O/=D):(L=C=P=0,O=1),this.rotation.set(t,L,C,P,O)},h.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),c(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,u=0;u<3;++u)l+=Math.pow(r[u]-e[u],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},h.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},h.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),c(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,u=n[14]/i;this.recalcMatrix(t);var f=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*f,l-n[6]*f,u-n[10]*f),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},h.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},h.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},h.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},h.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},h.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},4930:function(t,e,r){"use strict";var n=r(6184);t.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},4405:function(t){t.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},4166:function(t,e,r){"use strict";t.exports=function(t,e){for(var r=0|e.length,i=t.length,a=[new Array(r),new Array(r)],o=0;o0){o=a[c][r][0],l=c;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=a[f][r],p=0;p0&&(o=d,s=v,l=f)}return i||o&&u(o,l),s}function f(t,r){var i=a[r][t][0],o=[t];u(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=c(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],f=t,h=o[1],p=c(l,f,!0);if(n(e[l],e[f],e[h],e[p])<0)break;o.push(t),s=c(l,f)}return o}function h(t,e){return e[1]===e[e.length-1]}for(o=0;o0;){a[0][o].length;var v=f(o,p);h(0,v)?d.push.apply(d,v):(d.length>0&&l.push(d),d=v)}d.length>0&&l.push(d)}return l};var n=r(9398)},3959:function(t,e,r){"use strict";t.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){i[p=o.pop()]=!1;var u=r[p];for(s=0;s0})).length,g=new Array(v),y=new Array(v);for(p=0;p0;){var B=R.pop(),N=E[B];l(N,function(t,e){return t-e});var j,U=N.length,V=F[B];for(0===V&&(j=[H=d[B]]),p=0;p=0||(F[q]=1^V,R.push(q),0===V&&(z(H=d[q])||(H.reverse(),j.push(H))))}0===V&&r.push(j)}return r};var n=r(8348),i=r(4166),a=r(211),o=r(9660),s=r(9662),l=r(1215),u=r(3959);function c(t,e){for(var r=new Array(t),n=0;n0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,u=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(u>0)a=a.left;else{if(!(u<0))return 0;s=1,a=a.right}}return s}}(y.slabs,y.coordinates);return 0===a.length?m:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),m)};var n=r(417)[3],i=r(4385),a=r(9014),o=r(5070);function s(){return!0}function l(t){for(var e={},r=0;r=u?(A=1,m=u+2*h+d):m=h*(A=-h/u)+d):(A=0,p>=0?(k=0,m=d):-p>=f?(k=1,m=f+2*p+d):m=p*(k=-p/f)+d);else if(k<0)k=0,h>=0?(A=0,m=d):-h>=u?(A=1,m=u+2*h+d):m=h*(A=-h/u)+d;else{var M=1/T;m=(A*=M)*(u*A+c*(k*=M)+2*h)+k*(c*A+f*k+2*p)+d}else A<0?(b=f+p)>(x=c+h)?(_=b-x)>=(w=u-2*c+f)?(A=1,k=0,m=u+2*h+d):m=(A=_/w)*(u*A+c*(k=1-A)+2*h)+k*(c*A+f*k+2*p)+d:(A=0,b<=0?(k=1,m=f+2*p+d):p>=0?(k=0,m=d):m=p*(k=-p/f)+d):k<0?(b=u+h)>(x=c+p)?(_=b-x)>=(w=u-2*c+f)?(k=1,A=0,m=f+2*p+d):m=(A=1-(k=_/w))*(u*A+c*k+2*h)+k*(c*A+f*k+2*p)+d:(k=0,b<=0?(A=1,m=u+2*h+d):h>=0?(A=0,m=d):m=h*(A=-h/u)+d):(_=f+p-c-h)<=0?(A=0,k=1,m=f+2*p+d):_>=(w=u-2*c+f)?(A=1,k=0,m=u+2*h+d):m=(A=_/w)*(u*A+c*(k=1-A)+2*h)+k*(c*A+f*k+2*p)+d;var S=1-A-k;for(l=0;l0){var u=t[r-1];if(0===n(s,u)&&a(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},6184:function(t){"use strict";var e,r="";t.exports=function(t,n){if("string"!=typeof t)throw new TypeError("expected a string");if(1===n)return t;if(2===n)return t+t;var i=t.length*n;if(e!==t||void 0===e)e=t,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=t),n>>=1,t+=t;return r=(r+=t).substr(0,i)}},8161:function(t,e,r){t.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},402:function(t){"use strict";t.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],f=e[2]-n[2],p=r[2]-n[2],d=a*u,v=o*l,g=o*s,y=i*u,m=i*l,x=a*s,b=c*(d-v)+f*(g-y)+p*(m-x),_=7771561172376103e-31*((Math.abs(d)+Math.abs(v))*Math.abs(c)+(Math.abs(g)+Math.abs(y))*Math.abs(f)+(Math.abs(m)+Math.abs(x))*Math.abs(p));return b>_||-b>_?b:h(t,e,r,n)}];function d(t){var e=p[t.length];return e||(e=p[t.length]=c(t.length)),e.apply(void 0,t)}function v(t,e,r,n,i,a,o){return function(e,r,s,l,u){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return i(e,r,s);case 4:return a(e,r,s,l);case 5:return o(e,r,s,l,u)}for(var c=new Array(arguments.length),f=0;f0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],f=Math.min(u,c);if(Math.max(u,c)=n?(i=f,(l+=1)=n?(i=f,(l+=1)>1,u=e[2*l+1];if(u===a)return l;a>1,u=e[2*l+1];if(u===a)return l;a>1,u=e[2*l+1];if(u===a)return l;a0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,1+((t|=t>>>8)|t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},6656:function(t,e,r){"use strict";var n=r(9392),i=r(9521);function a(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||i(t[0],t[1])-i(e[0],e[1]);case 3:var a=t[0]+t[1],o=e[0]+e[1];if(s=a+t[2]-(o+e[2]))return s;var s,l=i(t[0],t[1]),u=i(e[0],e[1]);return(s=i(l,t[2])-i(u,e[2]))||i(l+t[2],a)-i(u+e[2],o);default:var c=t.slice(0);c.sort();var f=e.slice(0);f.sort();for(var h=0;h>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function c(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[g],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],i=(1<>>c&1&&u.push(i[c]);e.push(u)}return s(e)},e.skeleton=f,e.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function x(t){for(var e=y(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=m(t);if(!(r>=0&&e0){var t=A[0];return g(0,M-1),M-=1,x(0),t}return-1}function w(t,e){var r=A[t];return u[r]===e?t:(u[r]=-1/0,b(t),_(),u[r]=e,b((M+=1)-1))}function T(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),k[e]>=0&&w(k[e],v(e)),k[r]>=0&&w(k[r],v(r))}}var A=[],k=new Array(a);for(f=0;f>1;f>=0;--f)x(f);for(;;){var S=_();if(S<0||u[S]>r)break;T(S)}var E=[];for(f=0;f=0&&r>=0&&e!==r){var n=k[e],i=k[r];n!==i&&C.push([n,i])}}),i.unique(i.normalize(C)),{positions:E,edges:C}};var n=r(417),i=r(6656)},6638:function(t,e,r){"use strict";t.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),u=n(r,a,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=n(s,o,a),u=n(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return a[0]-s[0]};var n=r(417);function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,i=c.value):(i=c.value,s=c.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return i;p=f[h]}}if(p.start)if(s){var d=a(s[0],s[1],[t[0],p.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(i=p.index)}else i=p.index;else p.y!==t[1]&&(i=p.index)}}}return i}},4670:function(t,e,r){"use strict";var n=r(9130),i=r(9662);function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&c<0){var f=o(s,c,l,i);r.push(f),n.push(f.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=c}return{positive:r,negative:n}},t.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u>=0&&r.push(s.slice()),n=u}return r},t.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},8974:function(t,e,r){var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(t){return function(t,e){var r,n,o,s,l,u,c,f,h,p=1,d=t.length,v="";for(n=0;n=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?v+=r:(!i.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",r=r.toString().replace(i.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(h+r).length,l=s.width&&c>0?u.repeat(c):"",v+=s.align?h+r+l:"0"===u?h+l+r:l+h+r)}return v}(function(t){if(s[t])return s[t];for(var e,r=t,n=[],a=0;r;){if(null!==(e=i.text.exec(r)))n.push(e[0]);else if(null!==(e=i.modulo.exec(r)))n.push("%");else{if(null===(e=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){a|=1;var o=[],l=e[2],u=[];if(null===(u=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=i.key_access.exec(l)))o.push(u[1]);else{if(null===(u=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(u[1])}e[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return s[t]=n}(t),arguments)}function o(t,e){return a.apply(null,[t].concat(e||[]))}var s=Object.create(null);e.sprintf=a,e.vsprintf=o,"undefined"!=typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(e,r,e,t))||(t.exports=n))}()},4162:function(t,e,r){"use strict";t.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=i(t,e),n=r.length,a=new Array(n),o=new Array(n),s=0;sn|0},vertex:function(t,e,r,n,i,a,o,s,l,u,c,f,h){var p=(0|o)+(s<<1)+(l<<2)+(u<<3)|0;if(0!==p&&15!==p)switch(p){case 0:case 15:c.push([t-.5,e-.5]);break;case 1:c.push([t-.25-.25*(n+r-2*h)/(r-n),e-.25-.25*(i+r-2*h)/(r-i)]);break;case 2:c.push([t-.75-.25*(-n-r+2*h)/(n-r),e-.25-.25*(a+n-2*h)/(n-a)]);break;case 3:c.push([t-.5,e-.5-.5*(i+r+a+n-4*h)/(r-i+n-a)]);break;case 4:c.push([t-.25-.25*(a+i-2*h)/(i-a),e-.75-.25*(-i-r+2*h)/(i-r)]);break;case 5:c.push([t-.5-.5*(n+r+a+i-4*h)/(r-n+i-a),e-.5]);break;case 6:c.push([t-.5-.25*(-n-r+a+i)/(n-r+i-a),e-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:c.push([t-.75-.25*(a+i-2*h)/(i-a),e-.75-.25*(a+n-2*h)/(n-a)]);break;case 8:c.push([t-.75-.25*(-a-i+2*h)/(a-i),e-.75-.25*(-a-n+2*h)/(a-n)]);break;case 9:c.push([t-.5-.25*(n+r+-a-i)/(r-n+a-i),e-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:c.push([t-.5-.5*(-n-r-a-i+4*h)/(n-r+a-i),e-.5]);break;case 11:c.push([t-.25-.25*(-a-i+2*h)/(a-i),e-.75-.25*(i+r-2*h)/(r-i)]);break;case 12:c.push([t-.5,e-.5-.5*(-i-r-a-n+4*h)/(i-r+a-n)]);break;case 13:c.push([t-.75-.25*(n+r-2*h)/(r-n),e-.25-.25*(-a-n+2*h)/(a-n)]);break;case 14:c.push([t-.25-.25*(-n-r+2*h)/(n-r),e-.25-.25*(-i-r+2*h)/(i-r)])}},cell:function(t,e,r,n,i,a,o,s,l){i?s.push([t,e]):s.push([e,t])}});return function(t,e){var r=[],i=[];return n(t,r,i,e),{positions:r,cells:i}}}},o={}},6946:function(t,e,r){"use strict";t.exports=function t(e,r,i){i=i||{};var a=o[e];a||(a=o[e]={" ":{data:new Float32Array(0),shape:.2}});var s=a[r];if(!s)if(r.length<=1||!/\d/.test(r))s=a[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o0&&(f+=.02);var p=new Float32Array(c),d=0,v=-.5*f;for(h=0;hMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function h(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}var p=h.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),c=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,c+=r[a]*r[a],e[a]/=l;var f=Math.sqrt(c);for(a=0;a<3;++a)r[a]/=f;var h=this.computedToward;o(h,e,r),s(h,h);var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],v=this.computedAngle[1],g=Math.cos(d),y=Math.sin(d),m=Math.cos(v),x=Math.sin(v),b=this.computedCenter,_=g*m,w=y*m,T=x,A=-g*x,k=-y*x,M=m,S=this.computedEye,E=this.computedMatrix;for(a=0;a<3;++a){var L=_*r[a]+w*h[a]+T*e[a];E[4*a+1]=A*r[a]+k*h[a]+M*e[a],E[4*a+2]=L,E[4*a+3]=0}var C=E[1],P=E[5],O=E[9],I=E[2],D=E[6],z=E[10],R=P*z-O*D,F=O*I-C*z,B=C*D-P*I,N=u(R,F,B);for(R/=N,F/=N,B/=N,E[0]=R,E[4]=F,E[8]=B,a=0;a<3;++a)S[a]=b[a]+E[2+4*a]*p;for(a=0;a<3;++a){c=0;for(var j=0;j<3;++j)c+=E[a+4*j]*S[j];E[12+a]=-c}E[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var d=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;d[0]=i[2],d[1]=i[6],d[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)i[4*u]=o[u],i[4*u+1]=s[u],i[4*u+2]=l[u];for(a(i,i,n,d),u=0;u<3;++u)o[u]=i[4*u],s[u]=i[4*u+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=u(a,o,s);a/=l,o/=l,s/=l;var c=i[0],f=i[4],h=i[8],p=c*a+f*o+h*s,d=u(c-=a*p,f-=o*p,h-=s*p),v=(c/=d)*e+a*r,g=(f/=d)*e+o*r,y=(h/=d)*e+s*r;this.center.move(t,v,g,y);var m=Math.exp(this.computedRadius[0]);m=Math.max(1e-4,m+n),this.radius.set(t,Math.log(m))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],f=e[a+8];if(n){var h=Math.abs(s),p=Math.abs(l),d=Math.abs(f),v=Math.max(h,p,d);h===v?(s=s<0?-1:1,l=f=0):d===v?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var g=u(s,l,f);s/=g,l/=g,f/=g}var y,m,x=e[o],b=e[o+4],_=e[o+8],w=x*s+b*l+_*f,T=u(x-=s*w,b-=l*w,_-=f*w),A=l*(_/=T)-f*(b/=T),k=f*(x/=T)-s*_,M=s*b-l*x,S=u(A,k,M);if(A/=S,k/=S,M/=S,this.center.jump(t,q,G,Y),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,x,b,_),2===a){var E=e[1],L=e[5],C=e[9],P=E*x+L*b+C*_,O=E*A+L*k+C*M;y=R<0?-Math.PI/2:Math.PI/2,m=Math.atan2(O,P)}else{var I=e[2],D=e[6],z=e[10],R=I*s+D*l+z*f,F=I*x+D*b+z*_,B=I*A+D*k+z*M;y=Math.asin(c(R)),m=Math.atan2(B,F)}this.angle.jump(t,m,y),this.recalcMatrix(t);var N=e[2],j=e[6],U=e[10],V=this.computedMatrix;i(V,e);var H=V[15],q=V[12]/H,G=V[13]/H,Y=V[14]/H,W=Math.exp(this.computedRadius[0]);this.center.jump(t,q-N*W,G-j*W,Y-U*W)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=u(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],p=u(l,f,h);if(!(p<1e-6)){l/=p,f/=p,h/=p;var d=this.computedRight,v=d[0],g=d[1],y=d[2],m=i*v+a*g+o*y,x=u(v-=m*i,g-=m*a,y-=m*o);if(!(x<.01&&(x=u(v=a*h-o*f,g=o*l-i*h,y=i*f-a*l))<1e-6)){v/=x,g/=x,y/=x,this.up.set(t,i,a,o),this.right.set(t,v,g,y),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var b=a*y-o*g,_=o*v-i*y,w=i*g-a*v,T=u(b,_,w),A=i*l+a*f+o*h,k=v*l+g*f+y*h,M=(b/=T)*l+(_/=T)*f+(w/=T)*h,S=Math.asin(c(A)),E=Math.atan2(M,k),L=this.angle._state,C=L[L.length-1],P=L[L.length-2];C%=2*Math.PI;var O=Math.abs(C+2*Math.PI-E),I=Math.abs(C-E),D=Math.abs(C-2*Math.PI-E);O0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(p(t),0,t)}function v(t){return new Uint16Array(p(2*t),0,t)}function g(t){return new Uint32Array(p(4*t),0,t)}function y(t){return new Int8Array(p(t),0,t)}function m(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function b(t){return new Float32Array(p(4*t),0,t)}function _(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):d(t)}function T(t){return s?new BigUint64Array(p(8*t),0,t):null}function A(t){return l?new BigInt64Array(p(8*t),0,t):null}function k(t){return new DataView(p(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}e.free=function(t){if(a.isBuffer(t))f[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);c[r].push(t)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(t){h(t.buffer)},e.freeArrayBuffer=h,e.freeBuffer=function(t){f[n.log2(t.length)].push(t)},e.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return d(t);case"uint16":return v(t);case"uint32":return g(t);case"int8":return y(t);case"int16":return m(t);case"int32":return x(t);case"float":case"float32":return b(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return A(t);case"biguint64":return T(t);case"buffer":return M(t);case"data":case"dataview":return k(t);default:return null}return null},e.mallocArrayBuffer=p,e.mallocUint8=d,e.mallocUint16=v,e.mallocUint32=g,e.mallocInt8=y,e.mallocInt16=m,e.mallocInt32=x,e.mallocFloat32=e.mallocFloat=b,e.mallocFloat64=e.mallocDouble=_,e.mallocUint8Clamped=w,e.mallocBigUint64=T,e.mallocBigInt64=A,e.mallocDataView=k,e.mallocBuffer=M,e.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.BIGUINT64[t].length=0,u.BIGINT64[t].length=0,u.UINT8C[t].length=0,c[t].length=0,f[t].length=0}},1731:function(t){"use strict";function e(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter(function(t){return t}).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",w(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(T=0;T-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),M*=Math.pow(.75,l-s),n=n.replace("?px ",F())),k+=.25*L*(l-s)}if(!0===o.superscripts){var u=t.indexOf(d),f=r.indexOf(d),p=u>-1?parseInt(t[1+u]):0,v=f>-1?parseInt(r[1+f]):0;p!==v&&(n=n.replace(F(),"?px "),M*=Math.pow(.75,v-p),n=n.replace("?px ",F())),k-=.25*L*(v-p)}if(!0===o.bolds){var g=t.indexOf(c)>-1,m=r.indexOf(c)>-1;!g&&m&&(n=x?n.replace("italic ","italic bold "):"bold "+n),g&&!m&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=t.indexOf(h)>-1,b=r.indexOf(h)>-1;!x&&b&&(n="italic "+n),x&&!b&&(n=n.replace("italic ",""))}e.font=n}for(w=0;w",a="",o=i.length,s=a.length,l=e[0]===d||e[0]===y,u=0,c=-s;u>-1&&-1!==(u=r.indexOf(i,u))&&-1!==(c=r.indexOf(a,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var p=u+o,v=r.substr(p,c-p).indexOf(i);u=-1!==v?v:c+s}return n}function b(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function _(t,e,r,n){var i=b(t,n),a=function(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l=0?e[a]:i})},has___:{value:x(function(e){var n=m(e);return n?r in n:t.indexOf(e)>=0})},set___:{value:x(function(n,i){var a,o=m(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this})},delete___:{value:x(function(n){var i,a,o=m(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0||(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,0))})}})};v.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof v||b();var t,n=new r,i=void 0,a=!1;return t=e?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new v),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new v),i.set___(t,e)}else n.set(t,e);return this},Object.create(v.prototype,{get___:{value:x(function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)})},has___:{value:x(function(t){return n.has(t)||!!i&&i.has___(t)})},set___:{value:x(t)},delete___:{value:x(function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e})},permitHostObjects___:{value:x(function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");a=!0})}})}e&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=v.prototype,t.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),t.exports=v)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function y(t){return!(t.substr(0,8)==l&&"___"===t.substr(t.length-3))}function m(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[u];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,u,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function x(t){return t.prototype=null,Object.freeze(t)}function b(){p||"undefined"==typeof console||(p=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},9222:function(t,e,r){var n=r(7178);t.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},7178:function(t){t.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},4037:function(t,e,r){var n=r(9222);t.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},6183:function(t){"use strict";t.exports=function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=[a,o.join()].join(),l=e[s];return l||(e[s]=l=t([a,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(function(){return function(t,e,r,n,i,a){var o=t[0],s=r[0],l=[0],u=s;n|=0;var c=0,f=s;for(c=0;c=0!=p>=0&&i.push(l[0]+.5+.5*(h+p)/(h-p)),n+=f,++l[0]}}}.bind(void 0,{funcName:"zeroCrossings"}))},9584:function(t,e,r){"use strict";t.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=r(6183)},6601:function(){}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t},r(7386)}()},t.exports=n()},93952:function(t){"use strict";t.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},94018:function(t){"use strict";t.exports=function(t,e){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}},94153:function(t,e,r){"use strict";var n=r(5159),i=r(80740).isArrayOrTypedArray;e.aggNums=function(t,r,a,o){var s,l;if((!o||o>a.length)&&(o=a.length),n(r)||(r=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},94213:function(t,e,r){"use strict";var n=r(15181),i=r(26446),a=r(3071),o=r(88191),s=r(99603).readPaths,l=r(53812),u=l.getPathString,c=r(12367),f=r(5126).FROM_TL;t.exports=function(t,e,r,h){if(h.selectAll(".shape-label").remove(),r.label.text||r.label.texttemplate){var p;if(r.label.texttemplate){var d={};if("path"!==r.type){var v=i.getFromId(t,r.xref),g=i.getFromId(t,r.yref);for(var y in c){var m=c[y](r,v,g);void 0!==m&&(d[y]=m)}}p=n.texttemplateStringForShapes(r.label.texttemplate,{},t._fullLayout._d3locale,d)}else p=r.label.text;var x,b,_,w,T={"data-index":e},A=r.label.font,k=h.append("g").attr(T).classed("shape-label",!0).append("text").attr({"data-notex":1}).classed("shape-label-text",!0).text(p);if(r.path){var M=u(t,r),S=s(M,t);x=1/0,_=1/0,b=-1/0,w=-1/0;for(var E=0;E=t?e-n:n-e,-180/Math.PI*Math.atan2(i,a)}(x,_,b,w):0),k.call(function(e){return e.call(o.font,A).attr({}),a.convertToTspans(e,t),e});var U=function(t,e,r,n,i,a,o){var s,l,u,c,h=i.label.textposition,p=i.label.textangle,d=i.label.padding,v=i.type,g=Math.PI/180*a,y=Math.sin(g),m=Math.cos(g),x=i.label.xanchor,b=i.label.yanchor;if("line"===v){"start"===h?(s=t,l=e):"end"===h?(s=r,l=n):(s=(t+r)/2,l=(e+n)/2),"auto"===x&&(x="start"===h?"auto"===p?r>t?"left":rt?"right":rt?"right":rt?"left":r20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(t)?a=1:-1!==i.LEFTSTART.indexOf(t)?n=1:-1!==i.TOPSTART.indexOf(t)?a=-1:n=-1,[n,a]}(h,r,e),d=[l(t,e,[-p[0],-p[1]])],v=t.z.length,g=t.z[0].length,y=e.slice(),m=p.slice();for(c=0;c<1e4;c++){if(h>20?(h=i.CHOOSESADDLE[h][(p[0]||p[1])<0?0:1],t.crossings[f]=i.SADDLEREMAINDER[h]):delete t.crossings[f],!(p=i.NEWDELTA[h])){n.log("Found bad marching index:",h,e,t.level);break}d.push(l(t,e,p)),e[0]+=p[0],e[1]+=p[1],f=e.join(","),a(d[d.length-1],d[d.length-2],s,u)&&d.pop();var x=p[0]&&(e[0]<0||e[0]>g-2)||p[1]&&(e[1]<0||e[1]>v-2);if(e[0]===y[0]&&e[1]===y[1]&&p[0]===m[0]&&p[1]===m[1]||r&&x)break;h=t.crossings[f]}1e4===c&&n.log("Infinite loop in contour?");var b,_,w,T,A,k,M,S,E,L,C,P=a(d[0],d[d.length-1],s,u),O=0,I=.2*t.smoothing,D=[],z=0;for(c=1;c=z;c--)if((b=D[c])=z&&b+D[_]S&&E--,t.edgepaths[E]=C.concat(d,L));break}N||(t.edgepaths[S]=d.concat(L))}for(S=0;S=Math.min(O,I)&&w<=Math.max(O,I)?0:1/0}if(f=Math.min(D,z)&&T<=Math.max(D,z)?0:1/0}d=Math.sqrt(f*f+h*h),s=i[c]}}}else for(c=i.length-1;c>-1;c--)l=b[a=i[c]],u=_[a],f=m.c2p(l)-w,h=x.c2p(u)-T,(p=Math.sqrt(f*f+h*h))m&&(y=Math.max(y-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(y,p),!v){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=c},95304:function(t,e,r){"use strict";var n=r(15181),i=r(69562),a=r(71467),o=r(10088);function s(t){return t.data.data.pid}e.findEntryWithLevel=function(t,r){var n;return r&&t.eachAfter(function(t){if(e.getPtId(t)===r)return n=t.copy()}),n||t},e.findEntryWithChild=function(t,r){var n;return t.eachAfter(function(t){for(var i=t.children||[],a=0;a0)},e.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},e.isHeader=function(t,r){return!(e.isLeaf(t)||t.depth===r._maxDepth-1)},e.getParent=function(t,r){return e.findEntryWithLevel(t,s(r))},e.listPath=function(t,r){var n=t.parent;if(!n)return[];var i=r?[n.data[r]]:[n];return e.listPath(n,r).concat(i)},e.getPath=function(t){return e.listPath(t,"label").join("/")+"/"},e.formatValue=o.formatPieValue,e.formatPercent=function(t,e){var r=n.formatPercent(t,0);return"0%"===r&&(r=o.formatPiePercent(t,e)),r}},95495:function(t,e,r){"use strict";var n=r(79335),i=r(38532).rb,a=r(28209),o=r(49061),s=r(8357).extendFlat;t.exports=s({lon:o.lon,lat:o.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:o.text,hovertext:o.hovertext,hoverinfo:s({},a.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:i(),showlegend:s({},a.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))},95663:function(t,e,r){"use strict";var n=r(10097),i=r(15181).ensureArray;function a(t,e,r){var n=-.5*r[0]+1.5*e[0],i=-.5*r[1]+1.5*e[1];return[(2*n+t[0])/3,(2*i+t[1])/3]}t.exports=function(t,e,r,o,s,l){var u,c,f,h,p,d,v,g,y,m,x=r[0].length,b=r.length,_=s?3*x-2:x,w=l?3*b-2:b;for(t=i(t,w),e=i(e,w),f=0;f1&&(c=v[m-1],h=g[m-1],d=y[m-1]),e=0;ec?"-":"+")+"x")).replace("y",(f>h?"-":"+")+"y")).replace("z",(p>d?"-":"+")+"z");var L=function(){m=0,M=[],S=[],E=[]};(!m||m=0;)e+=r[n].value;else e=1;t.value=e}function l(t,e){var r,n,i,a,o,s=new h(t),l=+t.value&&(s.value=t.value),c=[s];for(null==e&&(e=u);r=c.pop();)if(l&&(r.value=+r.data.value),(i=e(r.data))&&(o=i.length))for(r.children=new Array(o),a=o-1;a>=0;--a)c.push(n=r.children[a]=new h(i[a])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(f)}function u(t){return t.children}function c(t){t.data=t.data.data}function f(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function h(t){this.data=t,this.depth=this.height=0,this.parent=null}r.r(e),r.d(e,{cluster:function(){return o},hierarchy:function(){return l},pack:function(){return O},packEnclose:function(){return d},packSiblings:function(){return S},partition:function(){return B},stratify:function(){return q},tree:function(){return K},treemap:function(){return rt},treemapBinary:function(){return nt},treemapDice:function(){return F},treemapResquarify:function(){return at},treemapSlice:function(){return $},treemapSliceDice:function(){return it},treemapSquarify:function(){return et}}),h.prototype=l.prototype={constructor:h,count:function(){return this.eachAfter(s)},each:function(t){var e,r,n,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),r=a.children)for(n=0,i=r.length;n=0;--r)i.push(e[r]);return this},sum:function(t){return this.eachAfter(function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each(function(e){t.push(e)}),t},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e},copy:function(){return l(this).eachBefore(c)}};var p=Array.prototype.slice;function d(t){for(var e,r,n=0,i=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(p.call(t))).length,a=[];n0&&r*r>n*n+i*i}function m(t,e){for(var r=0;r(o*=o)?(n=(u+o-i)/(2*u),a=Math.sqrt(Math.max(0,o/u-n*n)),r.x=t.x-n*s-a*l,r.y=t.y-n*l+a*s):(n=(u+i-o)/(2*u),a=Math.sqrt(Math.max(0,i/u-n*n)),r.x=e.x+n*s-a*l,r.y=e.y+n*l+a*s)):(r.x=e.x+r.r,r.y=e.y)}function T(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function A(t){var e=t._,r=t.next._,n=e.r+r.r,i=(e.x*r.r+r.x*e.r)/n,a=(e.y*r.r+r.y*e.r)/n;return i*i+a*a}function k(t){this._=t,this.next=null,this.previous=null}function M(t){if(!(i=t.length))return 0;var e,r,n,i,a,o,s,l,u,c,f;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(i>2))return e.r+r.r;w(r,e,n=t[2]),e=new k(e),r=new k(r),n=new k(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;s0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=E(e),r):t},r.parentId=function(t){return arguments.length?(e=E(t),r):e},r}function G(t,e){return t.parent===e.parent?1:2}function Y(t){var e=t.children;return e?e[0]:t.t}function W(t){var e=t.children;return e?e[e.length-1]:t.t}function Z(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function X(t,e,r){return t.a.parent===e.parent?t.a:r}function J(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function K(){var t=G,e=1,r=1,n=null;function i(i){var l=function(t){for(var e,r,n,i,a,o=new J(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=e.children[i]=new J(n[i],i)),r.parent=e;return(o.parent=new J(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var u=i,c=i,f=i;i.eachBefore(function(t){t.xc.x&&(c=t),t.depth>f.depth&&(f=t)});var h=u===c?1:t(u,c)/2,p=h-u.x,d=e/(c.x+h+p),v=r/(f.depth||1);i.eachBefore(function(t){t.x=(t.x+p)*d,t.y=t.depth*v})}return i}function a(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],u=a.m,c=o.m,f=s.m,h=l.m;s=W(s),a=Y(a),s&&a;)l=Y(l),(o=W(o)).a=e,(i=s.z+f-a.z-u+t(s._,a._))>0&&(Z(X(s,e,n),e,i),u+=i,c+=i),f+=s.m,u+=a.m,h+=l.m,c+=o.m;s&&!W(o)&&(o.t=s,o.m+=f-c),a&&!Y(l)&&(l.t=a,l.m+=u-h,n=e)}return n}(e,i,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],i):n?null:[e,r]},i.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],i):n?[e,r]:null},i}function $(t,e,r,n,i){for(var a,o=t.children,s=-1,l=o.length,u=t.value&&(i-r)/t.value;++sh&&(h=s),g=c*c*v,(p=Math.max(h/g,g/f))>d){c-=s;break}d=p}y.push(o={value:c,dice:l1?e:1)},r}(Q);function rt(){var t=et,e=!1,r=1,n=1,i=[0],a=L,o=L,s=L,l=L,u=L;function c(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(f),i=[0],e&&t.eachBefore(R),t}function f(e){var r=i[e.depth],n=e.x0+r,c=e.y0+r,f=e.x1-r,h=e.y1-r;f=r-1){var c=s[e];return c.x0=i,c.y0=a,c.x1=o,void(c.y1=l)}for(var f=u[e],h=n/2+f,p=e+1,d=r-1;p>>1;u[v]l-a){var m=(i*y+o*g)/n;t(e,p,g,i,a,m,l),t(p,r,y,m,a,o,l)}else{var x=(a*y+l*g)/n;t(e,p,g,i,a,o,x),t(p,r,y,i,x,o,l)}}(0,l,t.value,e,r,n,i)}function it(t,e,r,n,i){(1&t.depth?$:F)(t,e,r,n,i)}var at=function t(e){function r(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,u,c,f=-1,h=o.length,p=t.value;++f1?e:1)},r}(Q)},96303:function(t,e,r){"use strict";var n=r(16534),i=r(46982),a=r(51676).appendArrayPointValue,o=r(93441),s=r(15181),l=r(90720),u=r(95304),c=r(10088).formatPieValue;function f(t,e,r){for(var n=t.data.data,i={curveNumber:e.index,pointNumber:n.i,data:e._input,fullData:e},o=0;o"),name:k||D("name")?m.name:void 0,color:A("hoverlabel.bgcolor")||x.color,borderColor:A("hoverlabel.bordercolor"),fontFamily:A("hoverlabel.font.family"),fontSize:A("hoverlabel.font.size"),fontColor:A("hoverlabel.font.color"),nameLength:A("hoverlabel.namelength"),textAlign:A("hoverlabel.align"),hovertemplate:k,hovertemplateLabels:P,eventData:l};g&&(F.x0=E-i.rInscribed*i.rpx1,F.x1=E+i.rInscribed*i.rpx1,F.idealAlign=i.pxmid[0]<0?"left":"right"),y&&(F.x=E,F.idealAlign=E<0?"left":"right");var B=[];o.loneHover(F,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r,inOut_bbox:B}),l[0].bbox=B[0],d._hasHoverLabel=!0}if(y){var N=t.select("path.surface");h.styleOne(N,i,m,r,{hovered:!0})}d._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[f(i,m,h.eventDataKeys)],event:n.event})}}),t.on("mouseout",function(e){var i=r._fullLayout,a=r._fullData[d.index],s=n.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=n.event,r.emit("plotly_unhover",{points:[f(s,a,h.eventDataKeys)],event:n.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(o.loneUnhover(i._hoverlayer.node()),d._hasHoverLabel=!1),y){var l=t.select("path.surface");h.styleOne(l,s,a,r,{hovered:!1})}}),t.on("click",function(t){var e=r._fullLayout,a=r._fullData[d.index],s=g&&(u.isHierarchyRoot(t)||u.isLeaf(t)),c=u.getPtId(t),p=u.isEntry(t)?u.findEntryWithChild(v,c):u.findEntryWithLevel(v,c),y=u.getPtId(p),m={points:[f(t,a,h.eventDataKeys)],event:n.event};s||(m.nextLevel=y);var x=l.triggerHandler(r,"plotly_"+d.type+"click",m);if(!1!==x&&e.hovermode&&(r._hoverdata=[f(t,a,h.eventDataKeys)],o.click(r,n.event)),!s&&!1!==x&&!r._dragging&&!r._transitioning){i.call("_storeDirectGUIEdit",a,e._tracePreGUI[a.uid],{level:a.level});var b={data:[{level:y}],traces:[d.index]},_={frame:{redraw:!1,duration:h.transitionTime},transition:{duration:h.transitionTime,easing:h.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(e._hoverlayer.node()),i.call("animate",r,b,_)}})}},96361:function(t,e,r){"use strict";t.exports={attributes:r(72292),layoutAttributes:r(68047),supplyDefaults:r(70515).supplyDefaults,crossTraceDefaults:r(70515).crossTraceDefaults,supplyLayoutDefaults:r(30792),calc:r(18660),crossTraceCalc:r(96207),plot:r(84934),style:r(56156).style,hoverPoints:r(35059),eventData:r(43192),selectPoints:r(40668),moduleType:"trace",name:"funnel",basePlotModule:r(29435),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},96402:function(t){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},96568:function(t,e,r){"use strict";var n=r(49188),i=r(8374),a=r(85797),o=r(56859),s=r(76613),l=r(72930).iterator;t.exports=function(t){return"function"==typeof s(t)[l]?t[l]():n(t)?new a(t):i(t)?new o(t):new a(t)}},96757:function(t,e,r){"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=r(92107),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),u=s.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===a.call(t),n=o(t),s=e&&"[object String]"===a.call(t),h=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=u&&r;if(s&&t.length>0&&!i.call(t,0))for(var v=0;v0)for(var g=0;g1&&(2!==t.length||"Z"!==t[1][0])&&(0===C&&(t[0][0]="M"),e[L]=t,k(),M())}}()}}function V(t,r){!function(t,r){if(e.length)for(var n=0;nr.duration?(function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function g(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,u=i._length,c=l._length,f=!!e.xr1,h=!!e.yr1,p=[];if(f){var d=a.simpleMap(e.xr0,i.r2l),v=a.simpleMap(e.xr1,i.r2l),g=d[1]-d[0],y=v[1]-v[0];p[0]=(d[0]*(1-r)+r*v[0]-d[0])/(d[1]-d[0])*u,p[2]=u*(1-r+r*y/g),i.range[0]=i.l2r(d[0]*(1-r)+r*v[0]),i.range[1]=i.l2r(d[1]*(1-r)+r*v[1])}else p[0]=0,p[2]=u;if(h){var m=a.simpleMap(e.yr0,l.r2l),x=a.simpleMap(e.yr1,l.r2l),b=m[1]-m[0],_=x[1]-x[0];p[1]=(m[1]*(1-r)+r*x[1]-m[1])/(m[0]-m[1])*c,p[3]=c*(1-r+r*_/b),l.range[0]=i.l2r(m[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(m[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=c;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?u/p[2]:1,T=h?c/p[3]:1,A=f?p[0]:0,k=h?p[1]:0,M=f?p[0]/p[2]*u:0,S=h?p[1]/p[3]*c:0,E=i._offset-M,L=l._offset-S;n.clipRect.call(o.setTranslate,A,k).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,E,L).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},97261:function(t){"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(t){return String(t)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,r){var i,a,o,s,l;if("string"==typeof e&&(a="not ",e.substr(0,4)===a)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-9,r)===e}(t," argument"))o="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var u=("number"!=typeof l&&(l=0),l+1>(s=t).length||-1===s.indexOf(".",l)?"argument":"property");o='The "'.concat(t,'" ').concat(u," ").concat(i," ").concat(n(e,"type"))}return o+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.F=e},97456:function(t){var e=/[\'\"]/;t.exports=function(t){return t?(e.test(t.charAt(0))&&(t=t.substr(1)),e.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}},97469:function(t,e,r){"use strict";r.d(e,{A:function(){return c},y:function(){return o}});var n=r(10335),i=r(18901);function a(t,e){return[(0,i.tn)(t)>i.pi?t+Math.round(-t/i.FA)*i.FA:t,e]}function o(t,e,r){return(t%=i.FA)?e||r?(0,n.A)(l(t),u(e,r)):l(t):e||r?u(e,r):a}function s(t){return function(e,r){return[(e+=t)>i.pi?e-i.FA:e<-i.pi?e+i.FA:e,r]}}function l(t){var e=s(t);return e.invert=s(-t),e}function u(t,e){var r=(0,i.gn)(t),n=(0,i.F8)(t),a=(0,i.gn)(e),o=(0,i.F8)(e);function s(t,e){var s=(0,i.gn)(e),l=(0,i.gn)(t)*s,u=(0,i.F8)(t)*s,c=(0,i.F8)(e),f=c*r+l*n;return[(0,i.FP)(u*a-f*o,l*r-c*n),(0,i.qR)(f*a+u*o)]}return s.invert=function(t,e){var s=(0,i.gn)(e),l=(0,i.gn)(t)*s,u=(0,i.F8)(t)*s,c=(0,i.F8)(e),f=c*a-u*o;return[(0,i.FP)(u*a+c*o,l*r+f*n),(0,i.qR)(f*r-l*n)]},s}function c(t){function e(e){return(e=t(e[0]*i.F2,e[1]*i.F2))[0]*=i.uj,e[1]*=i.uj,e}return t=o(t[0]*i.F2,t[1]*i.F2,t.length>2?t[2]*i.F2:0),e.invert=function(e){return(e=t.invert(e[0]*i.F2,e[1]*i.F2))[0]*=i.uj,e[1]*=i.uj,e},e}a.invert=a},97499:function(t,e,r){"use strict";var n=r(16534),i=r(46982),a=r(37070),o=r(69562),s=r(88191),l=r(15181),u=l.strTranslate,c=r(3071),f=r(93003),h=r(5126),p=h.LINE_SPACING,d=h.FROM_TL,v=h.FROM_BR,g=r(63184),y=r(93291);function m(t){return t._id}function x(t,e,r){var n=l.ensureSingle(t,"rect","selector-rect",function(t){t.attr("shape-rendering","crispEdges")});n.attr({rx:g.rx,ry:g.ry}),n.call(o.stroke,e.bordercolor).call(o.fill,function(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}(e,r)).style("stroke-width",e.borderwidth+"px")}function b(t,e,r,n){var i,a;l.ensureSingle(t,"text","selector-text",function(t){t.attr("text-anchor","middle")}).call(s.font,e.font).text((i=r,a=n._fullLayout._meta,i.label?a?l.templateString(i.label,a):i.label:"all"===i.step?"all":i.count+i.step.charAt(0))).call(function(t){c.convertToTspans(t,n)})}t.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=f.list(t,"x",!0),r=[],n=0;n",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},98333:function(t){"use strict";t.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;n"),name:f.hovertemplate||-1!==h.indexOf("name")?f.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:g.castOption(_.bgcolor,t.pts)||t.color,borderColor:g.castOption(_.bordercolor,t.pts),fontFamily:g.castOption(w.family,t.pts),fontSize:g.castOption(w.size,t.pts),fontColor:g.castOption(w.color,t.pts),nameLength:g.castOption(_.namelength,t.pts),textAlign:g.castOption(_.align,t.pts),hovertemplate:g.castOption(f.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[y(t,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e,inOut_bbox:T}),t.bbox=T[0],u._hasHoverLabel=!0}u._hasHoverEvent=!0,e.emit("plotly_hover",{points:[y(t,f)],event:n.event})}}),t.on("mouseout",function(t){var r=e._fullLayout,i=e._fullData[u.index],o=n.select(this).datum();u._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[y(o,i)],event:n.event}),u._hasHoverEvent=!1),u._hasHoverLabel&&(a.loneUnhover(r._hoverlayer.node()),u._hasHoverLabel=!1)}),t.on("click",function(t){var r=e._fullLayout,i=e._fullData[u.index];e._dragging||!1===r.hovermode||(e._hoverdata=[y(t,i)],a.click(e,n.event))})}function b(t,e,r){var n=g.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=g.castOption(t._input.textfont.color,e.pts));var i=g.castOption(t.insidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,a=g.castOption(t.insidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:i,size:a}}function _(t,e){for(var r,n,i=0;ie&&e>n||r=-4;g-=2)y(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)y(Math.PI*(g+1),"tan")}if(f||p){for(g=4;g>=-4;g-=2)y(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)y(Math.PI*(g+.5),"rad")}}if(s||d||f){var m=Math.sqrt(t.width*t.width+t.height*t.height);if((a={scale:i*n*2/m,rCenter:1-i,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,a.scale>=1)return a;v.push(a)}(d||p)&&((a=T(t,n,o,l,u)).textPosAngle=(e.startangle+e.stopangle)/2,v.push(a)),(d||h)&&((a=A(t,n,o,l,u)).textPosAngle=(e.startangle+e.stopangle)/2,v.push(a));for(var x=0,b=0,_=0;_=1)break}return v[x]}function T(t,e,r,n,i){e=Math.max(0,e-2*v);var a=t.width/t.height,o=S(a,n,e,r);return{scale:2*o/t.height,rCenter:k(a,o/e),rotate:M(i)}}function A(t,e,r,n,i){e=Math.max(0,e-2*v);var a=t.height/t.width,o=S(a,n,e,r);return{scale:2*o/t.width,rCenter:k(a,o/e),rotate:M(i+Math.PI/2)}}function k(t,e){return Math.cos(e)-t*e}function M(t){return(180/Math.PI*t+720)%180-90}function S(t,e,r,n){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(t*t+n/2)+t))}function E(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function L(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function C(t,e){var r,n,i,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=O(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*t.r);var l,u=t.r/(void 0===(l=t.trace.aspectratio)?1:l),c=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(c+=u,o.x-=(1+i)*u,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?c*=2:-1!==a.title.position.indexOf("right")&&(c+=u,o.x+=(1+i)*u,s.tx-=t.titleBox.width/2),r=c/t.titleBox.width,n=P(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function P(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function O(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function I(t,e){for(var r=[],n=0;n1?c=(u=r.r)/i.aspectratio:u=(c=r.r)*i.aspectratio,l=(u*=(1+i.baseratio)/2)*c}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(a){var x=l.castOption(i,e.i,"texttemplate");if(x){var b=function(t){return{label:t.label,value:t.v,valueLabel:g.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:g.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:l.castOption(i,t.i,"customdata")}}(e),_=g.getFirstFilled(i.text,e.pts);(m(_)||""===_)&&(b.text=_),e.text=l.texttemplateString(x,b,t._fullLayout._d3locale,b,i._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=a*n-o*i,t.textY=a*i+o*n,t.noCenter=!0}t.exports={plot:function(t,e){var r=t._context.staticPlot,a=t._fullLayout,h=a._size;d("pie",a),_(e,t),I(e,h);var v=l.makeTraceGroups(a._pielayer,e,"trace").each(function(e){var d=n.select(this),v=e[0],y=v.trace;!function(t){var e,r,n,i=t[0],a=i.r,o=i.trace,s=g.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,u="px0",c="px1";if("counterclockwise"===o.direction){for(e=0;ei.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=E(r,i))}(e),d.attr("stroke-linejoin","round"),d.each(function(){var m=n.select(this).selectAll("g.slice").data(e);m.enter().append("g").classed("slice",!0),m.exit().remove();var _=[[[],[]],[[],[]]],T=!1;m.each(function(i,o){if(i.hidden)n.select(this).selectAll("path,g").remove();else{i.pointNumber=i.i,i.curveNumber=y.index,_[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var u=v.cx,c=v.cy,h=n.select(this),d=h.selectAll("path.surface").data([i]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),h.call(x,t,e),y.pull){var m=+g.castOption(y.pull,i.pts)||0;m>0&&(u+=m*i.pxmid[0],c+=m*i.pxmid[1])}i.cxFinal=u,i.cyFinal=c;var A=y.hole;if(i.v===v.vTotal){var k="M"+(u+i.px0[0])+","+(c+i.px0[1])+P(i.px0,i.pxmid,!0,1)+P(i.pxmid,i.px0,!0,1)+"Z";A?d.attr("d","M"+(u+A*i.px0[0])+","+(c+A*i.px0[1])+P(i.px0,i.pxmid,!1,A)+P(i.pxmid,i.px0,!1,A)+"Z"+k):d.attr("d",k)}else{var M=P(i.px0,i.px1,!0,1);if(A){var S=1-A;d.attr("d","M"+(u+A*i.px1[0])+","+(c+A*i.px1[1])+P(i.px1,i.px0,!1,A)+"l"+S*i.px0[0]+","+S*i.px0[1]+M+"Z")}else d.attr("d","M"+u+","+c+"l"+i.px0[0]+","+i.px0[1]+M+"Z")}z(t,i,v);var E=g.castOption(y.textposition,i.pts),C=h.selectAll("g.slicetext").data(i.text&&"none"!==E?[0]:[]);C.enter().append("g").classed("slicetext",!0),C.exit().remove(),C.each(function(){var r=l.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)}),h=l.ensureUniformFontSize(t,"outside"===E?function(t,e,r){return{color:g.castOption(t.outsidetextfont.color,e.pts)||g.castOption(t.textfont.color,e.pts)||r.color,family:g.castOption(t.outsidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,size:g.castOption(t.outsidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size}}(y,i,a.font):b(y,i,a.font));r.text(i.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,h).call(f.convertToTspans,t);var d,m=s.bBox(r.node());if("outside"===E)d=L(m,i);else if(d=w(m,i,v),"auto"===E&&d.scale<1){var x=l.ensureUniformFontSize(t,y.outsidetextfont);r.call(s.font,x),d=L(m=s.bBox(r.node()),i)}var _=d.textPosAngle,A=void 0===_?i.pxmid:D(v.r,_);if(d.targetX=u+A[0]*d.rCenter+(d.x||0),d.targetY=c+A[1]*d.rCenter+(d.y||0),R(d,m),d.outside){var k=d.targetY;i.yLabelMin=k-m.height/2,i.yLabelMid=k,i.yLabelMax=k+m.height/2,i.labelExtraX=0,i.labelExtraY=0,T=!0}d.fontSize=h.size,p(y.type,d,a),e[o].transform=d,l.setTransormAndDisplay(r,d)})}function P(t,e,r,n){var a=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*v.r+","+n*v.r+" 0 "+i.largeArc+(r?" 1 ":" 0 ")+a+","+o}});var A=n.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(A.enter().append("g").classed("titletext",!0),A.exit().remove(),A.each(function(){var e,r=l.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)}),i=y.title.text;y._meta&&(i=l.templateString(i,y._meta)),r.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,y.title.font).call(f.convertToTspans,t),e="middle center"===y.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(v):C(v,h),r.attr("transform",c(e.x,e.y)+u(Math.min(1,e.scale))+c(e.tx,e.ty))}),T&&function(t,e){var r,n,i,a,o,s,l,u,c,f,h,p,d;function v(t,e){return t.pxmid[1]-e.pxmid[1]}function y(t,e){return e.pxmid[1]-t.pxmid[1]}function m(t,r){r||(r={});var i,u,c,h,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),d=n?t.yLabelMin:t.yLabelMax,v=n?t.yLabelMax:t.yLabelMin,y=t.cyFinal+o(t.px0[1],t.px1[1]),m=p-d;if(m*l>0&&(t.labelExtraY=m),Array.isArray(e.pull))for(u=0;u=(g.castOption(e.pull,c.pts)||0)||((t.pxmid[1]-c.pxmid[1])*l>0?(m=c.cyFinal+o(c.px0[1],c.px1[1])-d-t.labelExtraY)*l>0&&(t.labelExtraY+=m):(v+t.labelExtraY-y)*l>0&&(i=3*s*Math.abs(u-f.indexOf(t)),(h=c.cxFinal+a(c.px0[0],c.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=h)))}for(n=0;n<2;n++)for(i=n?v:y,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(u=t[n][r]).sort(i),c=t[1-n][r],f=c.concat(u),p=[],h=0;hMath.abs(f)?s+="l"+f*t.pxmid[0]/t.pxmid[1]+","+f+"H"+(a+t.labelExtraX+u):s+="l"+t.labelExtraX+","+c+"v"+(f-c)+"h"+u}else s+="V"+(t.yLabelMid+t.labelExtraY)+"h"+u;l.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()})}(m,y),T&&y.automargin){var k=s.bBox(d.node()),M=y.domain,S=h.w*(M.x[1]-M.x[0]),E=h.h*(M.y[1]-M.y[0]),P=(.5*S-v.r)/h.w,O=(.5*E-v.r)/h.h;i.autoMargin(t,"pie."+y.uid+".automargin",{xl:M.x[0]-P,xr:M.x[1]+P,yb:M.y[0]-O,yt:M.y[1]+O,l:Math.max(v.cx-v.r-k.left,0),r:Math.max(k.right-(v.cx+v.r),0),b:Math.max(k.bottom-(v.cy+v.r),0),t:Math.max(v.cy-v.r-k.top,0),pad:5})}})});setTimeout(function(){v.selectAll("tspan").each(function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)},formatSliceLabel:z,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:C,prerenderTitles:_,layoutAreas:I,attachFxHandlers:x,computeTransform:R}},98379:function(t,e){"use strict";e.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},e.isVertical=function(t){return"h"!==t.orientation},e.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},98409:function(t,e,r){"use strict";function n(t){return t}function i(t,e){return"string"==typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return a(t,e)})}:a(t,e)}function a(t,e){var r=e.id,i=e.bbox,a=null==e.properties?{}:e.properties,o=function(t,e){var r=function(t){if(null==t)return n;var e,r,i=t.scale[0],a=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,n){n||(e=r=0);var l=2,u=t.length,c=new Array(u);for(c[0]=(e+=t[0])*i+o,c[1]=(r+=t[1])*a+s;l>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?d=new(f(e.dtype))(g):e.dtype&&(d=e.dtype,Array.isArray(d)&&(d.length=g));for(var y=0;yr||s>1073741824){for(var h=0;hr+i||M>n+i||S=C||o===s)){var l=m[a];void 0===s&&(s=l.length);for(var u=o;u=g&&f<=w&&h>=y&&h<=T&&P.push(c)}var p=x[a],d=p[4*o+0],v=p[4*o+1],b=p[4*o+2],_=p[4*o+3],A=function(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}(p,o+1),E=.5*i,O=a+1;e(r,n,E,O,d,v||b||_||A),e(r,n+E,E,O,v,b||_||A),e(r+E,n,E,O,b,_||A),e(r+E,n+E,E,O,_,A)}}(0,0,1,0,0,1),P},d;function E(t,e,r){for(var n=1,i=.5,a=.5,o=.5,s=0;s0)return 1<=0)return 1<=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(tr._length||y+b<0)return;c=g+b,p=y+b;break;case l:if(x="col-resize",g+b>r._length)return;c=g+b,p=y;break;case u:if(x="col-resize",y+b<0)return;c=g,p=y+b;break;default:x="ew-resize",c=v,p=v+b}if(p=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Pt,s:Ot,S:$,u:Q,U:tt,V:rt,w:nt,W:it,x:null,X:null,y:at,Y:st,Z:ut,"%":Ct},Ft={a:function(t){return p[t.getUTCDay()]},A:function(t){return h[t.getUTCDay()]},b:function(t){return v[t.getUTCMonth()]},B:function(t){return d[t.getUTCMonth()]},c:null,d:ct,e:ct,f:vt,g:Mt,G:Et,H:ft,I:ht,j:pt,L:dt,m:gt,M:yt,p:function(t){return l[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Pt,s:Ot,S:mt,u:xt,U:bt,V:wt,w:Tt,W:At,x:null,X:null,y:kt,Y:St,Z:Lt,"%":Ct},Bt={a:function(t,e,r){var n=_.exec(e.slice(r));return n?(t.w=et[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=x.exec(e.slice(r));return n?(t.w=b[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=Dt.exec(e.slice(r));return n?(t.m=zt[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.m=It[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,r,n){return Ut(t,e,r,n)},d:D,e:D,f:j,g:C,G:L,H:R,I:R,j:z,L:N,m:I,M:F,p:function(t,e,r){var n=y.exec(e.slice(r));return n?(t.p=m[n[0].toLowerCase()],r+n[0].length):-1},q:O,Q:V,s:H,S:B,u:k,U:M,V:S,w:A,W:E,x:function(t,e,n){return Ut(t,r,e,n)},X:function(t,e,r){return Ut(t,s,e,r)},y:C,Y:L,Z:P,"%":U};function Nt(t,e){return function(r){var n,i,a,o=[],s=-1,l=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++s53)return null;"w"in h||(h.w=1),"Z"in h?(l=(s=c(f(h.y,0,1))).getUTCDay(),s=l>4||0===l?n.rt.ceil(s):(0,n.rt)(s),s=i.A.offset(s,7*(h.V-1)),h.y=s.getUTCFullYear(),h.m=s.getUTCMonth(),h.d=s.getUTCDate()+(h.w+6)%7):(l=(s=u(f(h.y,0,1))).getDay(),s=l>4||0===l?a.By.ceil(s):(0,a.By)(s),s=o.A.offset(s,7*(h.V-1)),h.y=s.getFullYear(),h.m=s.getMonth(),h.d=s.getDate()+(h.w+6)%7)}else("W"in h||"U"in h)&&("w"in h||(h.w="u"in h?h.u%7:"W"in h?1:0),l="Z"in h?c(f(h.y,0,1)).getUTCDay():u(f(h.y,0,1)).getDay(),h.m=0,h.d="W"in h?(h.w+6)%7+7*h.W-(l+5)%7:h.w+7*h.U-(l+6)%7);return"Z"in h?(h.H+=h.Z/100|0,h.M+=h.Z%100,c(h)):u(h)}}function Ut(t,e,r,n){for(var i,a,o=0,s=e.length,l=r.length;o=l)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=Bt[i in g?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Rt.x=Nt(r,Rt),Rt.X=Nt(s,Rt),Rt.c=Nt(e,Rt),Ft.x=Nt(r,Ft),Ft.X=Nt(s,Ft),Ft.c=Nt(e,Ft),{format:function(t){var e=Nt(t+="",Rt);return e.toString=function(){return t},e},parse:function(t){var e=jt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Nt(t+="",Ft);return e.toString=function(){return t},e},utcParse:function(t){var e=jt(t+="",!0);return e.toString=function(){return t},e}}}var p,d,v,g={"-":"",_:" ",0:"0"},y=/^\s*\d+/,m=/^%/,x=/[\\^$*+?|[\]().{}]/g;function b(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a68?1900:2e3),r+n[0].length):-1}function P(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function O(t,e,r){var n=y.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function I(t,e,r){var n=y.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function D(t,e,r){var n=y.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function z(t,e,r){var n=y.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function R(t,e,r){var n=y.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function F(t,e,r){var n=y.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function B(t,e,r){var n=y.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function N(t,e,r){var n=y.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function j(t,e,r){var n=y.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function U(t,e,r){var n=m.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function V(t,e,r){var n=y.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function H(t,e,r){var n=y.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function q(t,e){return b(t.getDate(),e,2)}function G(t,e){return b(t.getHours(),e,2)}function Y(t,e){return b(t.getHours()%12||12,e,2)}function W(t,e){return b(1+o.A.count((0,s.A)(t),t),e,3)}function Z(t,e){return b(t.getMilliseconds(),e,3)}function X(t,e){return Z(t,e)+"000"}function J(t,e){return b(t.getMonth()+1,e,2)}function K(t,e){return b(t.getMinutes(),e,2)}function $(t,e){return b(t.getSeconds(),e,2)}function Q(t){var e=t.getDay();return 0===e?7:e}function tt(t,e){return b(a.fz.count((0,s.A)(t)-1,t),e,2)}function et(t){var e=t.getDay();return e>=4||0===e?(0,a.dt)(t):a.dt.ceil(t)}function rt(t,e){return t=et(t),b(a.dt.count((0,s.A)(t),t)+(4===(0,s.A)(t).getDay()),e,2)}function nt(t){return t.getDay()}function it(t,e){return b(a.By.count((0,s.A)(t)-1,t),e,2)}function at(t,e){return b(t.getFullYear()%100,e,2)}function ot(t,e){return b((t=et(t)).getFullYear()%100,e,2)}function st(t,e){return b(t.getFullYear()%1e4,e,4)}function lt(t,e){var r=t.getDay();return b((t=r>=4||0===r?(0,a.dt)(t):a.dt.ceil(t)).getFullYear()%1e4,e,4)}function ut(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+b(e/60|0,"0",2)+b(e%60,"0",2)}function ct(t,e){return b(t.getUTCDate(),e,2)}function ft(t,e){return b(t.getUTCHours(),e,2)}function ht(t,e){return b(t.getUTCHours()%12||12,e,2)}function pt(t,e){return b(1+i.A.count((0,l.A)(t),t),e,3)}function dt(t,e){return b(t.getUTCMilliseconds(),e,3)}function vt(t,e){return dt(t,e)+"000"}function gt(t,e){return b(t.getUTCMonth()+1,e,2)}function yt(t,e){return b(t.getUTCMinutes(),e,2)}function mt(t,e){return b(t.getUTCSeconds(),e,2)}function xt(t){var e=t.getUTCDay();return 0===e?7:e}function bt(t,e){return b(n.Hl.count((0,l.A)(t)-1,t),e,2)}function _t(t){var e=t.getUTCDay();return e>=4||0===e?(0,n.pT)(t):n.pT.ceil(t)}function wt(t,e){return t=_t(t),b(n.pT.count((0,l.A)(t),t)+(4===(0,l.A)(t).getUTCDay()),e,2)}function Tt(t){return t.getUTCDay()}function At(t,e){return b(n.rt.count((0,l.A)(t)-1,t),e,2)}function kt(t,e){return b(t.getUTCFullYear()%100,e,2)}function Mt(t,e){return b((t=_t(t)).getUTCFullYear()%100,e,2)}function St(t,e){return b(t.getUTCFullYear()%1e4,e,4)}function Et(t,e){var r=t.getUTCDay();return b((t=r>=4||0===r?(0,n.pT)(t):n.pT.ceil(t)).getUTCFullYear()%1e4,e,4)}function Lt(){return"+0000"}function Ct(){return"%"}function Pt(t){return+t}function Ot(t){return Math.floor(+t/1e3)}p=h({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),d=p.format,p.parse,v=p.utcFormat,p.utcParse},99256:function(t){"use strict";t.exports=function(t,e,r,n,i){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"zLabelVal"in e&&(t.z=e.zLabelVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var a,o=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;if(t.pointNumbers=o,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex,r._indexToPoints){a=[];for(var s=0;s1&&"boolean"!=typeof e)throw new c('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,t))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=V(t,0,1),r=V(t,-1);if("%"===e&&"%"!==r)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new u("invalid intrinsic syntax, expected opening `%`");var n=[];return U(t,q,function(t,e,r,i){n[n.length]=r?U(i,G,"$1"):e||t}),n}(t),n=r.length>0?r[0]:"",i=Y("%"+n+"%",e),a=i.name,o=i.value,s=!1,l=i.alias;l&&(n=l[0],j(r,N([0,1],l)));for(var f=1,h=!0;f=r.length){var g=_(o,p);o=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[p]}else h=B(o,p),o=o[p];h&&!s&&(I[a]=o)}}return o}},99572:function(t,e,r){"use strict";var n=r(50207),i=r(95028).calcHover;t.exports={hoverPoints:function(t,e,r){var a=t.cd[0].trace,o=t.scene.matrixOptions.cdata,s=t.xa,l=t.ya,u=s.c2p(e),c=l.c2p(r),f=t.distance,h=n.getDimIndex(a,s),p=n.getDimIndex(a,l);if(!1===h||!1===p)return[t];for(var d,v,g=o[h],y=o[p],m=f,x=0;x0&&lo._length&&(S=S.slice(0,o._length));var L,C=o.tickvals;function P(t,e){return{val:t,text:L[e]}}function O(t,e){return t.val-e.val}if(Array.isArray(C)&&C.length){L=o.ticktext,Array.isArray(L)&&L.length?L.length>C.length?L=L.slice(0,C.length):C.length>L.length&&(C=C.slice(0,L.length)):L=C.map(a(o.tickformat));for(var I=1;I=r||l>=i)return;var u=t.lineLayer.readPixel(s,i-1-l),c=0!==u[3],f=c?u[2]+256*(u[1]+256*u[0]):null,h={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==N&&(c?a.hover(h):a.unhover&&a.unhover(h),N=f)}}),B.style("opacity",function(t){return t.pick?0:1}),p.style("background","rgba(255, 255, 255, 0)");var j=p.selectAll("."+m.cn.parcoords).data(F,d);j.exit().remove(),j.enter().append("g").classed(m.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),j.attr("transform",function(t){return u(t.model.translateX,t.model.translateY)});var U=j.selectAll("."+m.cn.parcoordsControlView).data(v,d);U.enter().append("g").classed(m.cn.parcoordsControlView,!0),U.attr("transform",function(t){return u(t.model.pad.l,t.model.pad.t)});var V=U.selectAll("."+m.cn.yAxis).data(function(t){return t.dimensions},d);V.enter().append("g").classed(m.cn.yAxis,!0),U.each(function(t){I(V,t,T)}),B.each(function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=b(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}}),V.attr("transform",function(t){return u(t.xScale(t.xIndex),0)}),V.call(n.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;R.linePickActive(!1),t.x=Math.max(-m.overdrag,Math.min(t.model.width+m.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,V.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),I(V,e,T),V.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return u(t.xScale(t.xIndex),0)}),n.select(this).attr("transform",u(t.x,0)),V.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)}).on("dragend",function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,I(V,e,T),n.select(this).attr("transform",function(t){return u(t.x,0)}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),R.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex}))})),V.exit().remove();var H=V.selectAll("."+m.cn.axisOverlays).data(v,d);H.enter().append("g").classed(m.cn.axisOverlays,!0),H.selectAll("."+m.cn.axis).remove();var q=H.selectAll("."+m.cn.axis).data(v,d);q.enter().append("g").classed(m.cn.axis,!0),q.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat(function(e){return y.isOrdinal(t)?e:D(t.model.dimensions[t.visibleIndex],e)}).scale(r)),f.font(q.selectAll("text"),t.model.tickFont)}),q.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),q.selectAll("text").style("text-shadow",c.makeTextShadow(k)).style("cursor","default");var G=H.selectAll("."+m.cn.axisHeading).data(v,d);G.enter().append("g").classed(m.cn.axisHeading,!0);var Y=G.selectAll("."+m.cn.axisTitle).data(v,d);Y.enter().append("text").classed(m.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),Y.text(function(t){return t.label}).each(function(e){var r=n.select(this);f.font(r,e.model.labelFont),c.convertToTspans(r,t)}).attr("transform",function(t){var e=O(t.model.labelAngle,t.model.labelSide),r=m.axisTitleOffset;return(e.dir>0?"":u(0,2*r+t.model.height))+l(e.degrees)+u(-r*e.dx,-r*e.dy)}).attr("text-anchor",function(t){var e=O(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"});var W=H.selectAll("."+m.cn.axisExtent).data(v,d);W.enter().append("g").classed(m.cn.axisExtent,!0);var Z=W.selectAll("."+m.cn.axisExtentTop).data(v,d);Z.enter().append("g").classed(m.cn.axisExtentTop,!0),Z.attr("transform",u(0,-m.axisExtentOffset));var X=Z.selectAll("."+m.cn.axisExtentTopText).data(v,d);X.enter().append("text").classed(m.cn.axisExtentTopText,!0).call(P),X.text(function(t){return z(t,!0)}).each(function(t){f.font(n.select(this),t.model.rangeFont)});var J=W.selectAll("."+m.cn.axisExtentBottom).data(v,d);J.enter().append("g").classed(m.cn.axisExtentBottom,!0),J.attr("transform",function(t){return u(0,t.model.height+m.axisExtentOffset)});var K=J.selectAll("."+m.cn.axisExtentBottomText).data(v,d);K.enter().append("text").classed(m.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(P),K.text(function(t){return z(t,!1)}).each(function(t){f.font(n.select(this),t.model.rangeFont)}),x.ensureAxisBrush(H,k,t)}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports}return r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(23120)}()}); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/selectize/selectize.bootstrap3.css b/inst/htmlwidgets/lib/selectize/selectize.bootstrap3.css new file mode 100644 index 0000000000..6779260d71 --- /dev/null +++ b/inst/htmlwidgets/lib/selectize/selectize.bootstrap3.css @@ -0,0 +1,401 @@ +/** + * selectize.bootstrap3.css (v0.12.0) - Bootstrap 3 Theme + * Copyright (c) 2013–2015 Brian Reavis & contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this + * file except in compliance with the License. You may obtain a copy of the License at: + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF + * ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + * + * @author Brian Reavis + */ +.selectize-control.plugin-drag_drop.multi > .selectize-input > div.ui-sortable-placeholder { + visibility: visible !important; + background: #f2f2f2 !important; + background: rgba(0, 0, 0, 0.06) !important; + border: 0 none !important; + -webkit-box-shadow: inset 0 0 12px 4px #ffffff; + box-shadow: inset 0 0 12px 4px #ffffff; +} +.selectize-control.plugin-drag_drop .ui-sortable-placeholder::after { + content: '!'; + visibility: hidden; +} +.selectize-control.plugin-drag_drop .ui-sortable-helper { + -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); +} +.selectize-dropdown-header { + position: relative; + padding: 3px 12px; + border-bottom: 1px solid #d0d0d0; + background: #f8f8f8; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.selectize-dropdown-header-close { + position: absolute; + right: 12px; + top: 50%; + color: #333333; + opacity: 0.4; + margin-top: -12px; + line-height: 20px; + font-size: 20px !important; +} +.selectize-dropdown-header-close:hover { + color: #000000; +} +.selectize-dropdown.plugin-optgroup_columns .optgroup { + border-right: 1px solid #f2f2f2; + border-top: 0 none; + float: left; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.selectize-dropdown.plugin-optgroup_columns .optgroup:last-child { + border-right: 0 none; +} +.selectize-dropdown.plugin-optgroup_columns .optgroup:before { + display: none; +} +.selectize-dropdown.plugin-optgroup_columns .optgroup-header { + border-top: 0 none; +} +.selectize-control.plugin-remove_button [data-value] { + position: relative; + padding-right: 24px !important; +} +.selectize-control.plugin-remove_button [data-value] .remove { + z-index: 1; + /* fixes ie bug (see #392) */ + position: absolute; + top: 0; + right: 0; + bottom: 0; + width: 17px; + text-align: center; + font-weight: bold; + font-size: 12px; + color: inherit; + text-decoration: none; + vertical-align: middle; + display: inline-block; + padding: 1px 0 0 0; + border-left: 1px solid rgba(0, 0, 0, 0); + -webkit-border-radius: 0 2px 2px 0; + -moz-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.selectize-control.plugin-remove_button [data-value] .remove:hover { + background: rgba(0, 0, 0, 0.05); +} +.selectize-control.plugin-remove_button [data-value].active .remove { + border-left-color: rgba(0, 0, 0, 0); +} +.selectize-control.plugin-remove_button .disabled [data-value] .remove:hover { + background: none; +} +.selectize-control.plugin-remove_button .disabled [data-value] .remove { + border-left-color: rgba(77, 77, 77, 0); +} +.selectize-control { + position: relative; +} +.selectize-dropdown, +.selectize-input, +.selectize-input input { + color: #333333; + font-family: inherit; + font-size: inherit; + line-height: 20px; + -webkit-font-smoothing: inherit; +} +.selectize-input, +.selectize-control.single .selectize-input.input-active { + background: #ffffff; + cursor: text; + display: inline-block; +} +.selectize-input { + border: 1px solid #cccccc; + padding: 6px 12px; + display: inline-block; + width: 100%; + overflow: hidden; + position: relative; + z-index: 1; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-box-shadow: none; + box-shadow: none; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.selectize-control.multi .selectize-input.has-items { + padding: 5px 12px 2px; +} +.selectize-input.full { + background-color: #ffffff; +} +.selectize-input.disabled, +.selectize-input.disabled * { + cursor: default !important; +} +.selectize-input.focus { + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15); +} +.selectize-input.dropdown-active { + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.selectize-input > * { + vertical-align: baseline; + display: -moz-inline-stack; + display: inline-block; + zoom: 1; + *display: inline; +} +.selectize-control.multi .selectize-input > div { + cursor: pointer; + margin: 0 3px 3px 0; + padding: 1px 3px; + background: #efefef; + color: #333333; + border: 0 solid rgba(0, 0, 0, 0); +} +.selectize-control.multi .selectize-input > div.active { + background: #428bca; + color: #ffffff; + border: 0 solid rgba(0, 0, 0, 0); +} +.selectize-control.multi .selectize-input.disabled > div, +.selectize-control.multi .selectize-input.disabled > div.active { + color: #808080; + background: #ffffff; + border: 0 solid rgba(77, 77, 77, 0); +} +.selectize-input > input { + display: inline-block !important; + padding: 0 !important; + min-height: 0 !important; + max-height: none !important; + max-width: 100% !important; + margin: 0 !important; + text-indent: 0 !important; + border: 0 none !important; + background: none !important; + line-height: inherit !important; + -webkit-user-select: auto !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; +} +.selectize-input > input::-ms-clear { + display: none; +} +.selectize-input > input:focus { + outline: none !important; +} +.selectize-input::after { + content: ' '; + display: block; + clear: left; +} +.selectize-input.dropdown-active::before { + content: ' '; + display: block; + position: absolute; + background: #ffffff; + height: 1px; + bottom: 0; + left: 0; + right: 0; +} +.selectize-dropdown { + position: absolute; + z-index: 10; + border: 1px solid #d0d0d0; + background: #ffffff; + margin: -1px 0 0 0; + border-top: 0 none; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} +.selectize-dropdown [data-selectable] { + cursor: pointer; + overflow: hidden; +} +.selectize-dropdown [data-selectable] .highlight { + background: rgba(255, 237, 40, 0.4); + -webkit-border-radius: 1px; + -moz-border-radius: 1px; + border-radius: 1px; +} +.selectize-dropdown [data-selectable], +.selectize-dropdown .optgroup-header { + padding: 3px 12px; +} +.selectize-dropdown .optgroup:first-child .optgroup-header { + border-top: 0 none; +} +.selectize-dropdown .optgroup-header { + color: #777777; + background: #ffffff; + cursor: default; +} +.selectize-dropdown .active { + background-color: #f5f5f5; + color: #262626; +} +.selectize-dropdown .active.create { + color: #262626; +} +.selectize-dropdown .create { + color: rgba(51, 51, 51, 0.5); +} +.selectize-dropdown-content { + overflow-y: auto; + overflow-x: hidden; + max-height: 200px; +} +.selectize-control.single .selectize-input, +.selectize-control.single .selectize-input input { + cursor: pointer; +} +.selectize-control.single .selectize-input.input-active, +.selectize-control.single .selectize-input.input-active input { + cursor: text; +} +.selectize-control.single .selectize-input:after { + content: ' '; + display: block; + position: absolute; + top: 50%; + right: 17px; + margin-top: -3px; + width: 0; + height: 0; + border-style: solid; + border-width: 5px 5px 0 5px; + border-color: #333333 transparent transparent transparent; +} +.selectize-control.single .selectize-input.dropdown-active:after { + margin-top: -4px; + border-width: 0 5px 5px 5px; + border-color: transparent transparent #333333 transparent; +} +.selectize-control.rtl.single .selectize-input:after { + left: 17px; + right: auto; +} +.selectize-control.rtl .selectize-input > input { + margin: 0 4px 0 -2px !important; +} +.selectize-control .selectize-input.disabled { + opacity: 0.5; + background-color: #ffffff; +} +.selectize-dropdown, +.selectize-dropdown.form-control { + height: auto; + padding: 0; + margin: 2px 0 0 0; + z-index: 1000; + background: #ffffff; + border: 1px solid #cccccc; + border: 1px solid rgba(0, 0, 0, 0.15); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); +} +.selectize-dropdown .optgroup-header { + font-size: 12px; + line-height: 1.42857143; +} +.selectize-dropdown .optgroup:first-child:before { + display: none; +} +.selectize-dropdown .optgroup:before { + content: ' '; + display: block; + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; + margin-left: -12px; + margin-right: -12px; +} +.selectize-dropdown-content { + padding: 5px 0; +} +.selectize-dropdown-header { + padding: 6px 12px; +} +.selectize-input { + min-height: 34px; +} +.selectize-input.dropdown-active { + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.selectize-input.dropdown-active::before { + display: none; +} +.selectize-input.focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.has-error .selectize-input { + border-color: #a94442; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-error .selectize-input:focus { + border-color: #843534; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; +} +.selectize-control.multi .selectize-input.has-items { + padding-left: 9px; + padding-right: 9px; +} +.selectize-control.multi .selectize-input > div { + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.form-control.selectize-control { + padding: 0; + height: auto; + border: none; + background: none; + -webkit-box-shadow: none; + box-shadow: none; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} diff --git a/inst/htmlwidgets/lib/selectize/selectize.min.js b/inst/htmlwidgets/lib/selectize/selectize.min.js new file mode 100644 index 0000000000..fe955bc000 --- /dev/null +++ b/inst/htmlwidgets/lib/selectize/selectize.min.js @@ -0,0 +1,3 @@ +/*! selectize.js - v0.12.1 | https://github.com/brianreavis/selectize.js | Apache License (v2) */ +!function(a,b){"function"==typeof define&&define.amd?define("sifter",b):"object"==typeof exports?module.exports=b():a.Sifter=b()}(this,function(){var a=function(a,b){this.items=a,this.settings=b||{diacritics:!0}};a.prototype.tokenize=function(a){if(a=d(String(a||"").toLowerCase()),!a||!a.length)return[];var b,c,f,h,i=[],j=a.split(/ +/);for(b=0,c=j.length;c>b;b++){if(f=e(j[b]),this.settings.diacritics)for(h in g)g.hasOwnProperty(h)&&(f=f.replace(new RegExp(h,"g"),g[h]));i.push({string:j[b],regex:new RegExp(f,"i")})}return i},a.prototype.iterator=function(a,b){var c;c=f(a)?Array.prototype.forEach||function(a){for(var b=0,c=this.length;c>b;b++)a(this[b],b,this)}:function(a){for(var b in this)this.hasOwnProperty(b)&&a(this[b],b,this)},c.apply(a,[b])},a.prototype.getScoreFunction=function(a,b){var c,d,e,f;c=this,a=c.prepareSearch(a,b),e=a.tokens,d=a.options.fields,f=e.length;var g=function(a,b){var c,d;return a?(a=String(a||""),d=a.search(b.regex),-1===d?0:(c=b.string.length/a.length,0===d&&(c+=.5),c)):0},h=function(){var a=d.length;return a?1===a?function(a,b){return g(b[d[0]],a)}:function(b,c){for(var e=0,f=0;a>e;e++)f+=g(c[d[e]],b);return f/a}:function(){return 0}}();return f?1===f?function(a){return h(e[0],a)}:"and"===a.options.conjunction?function(a){for(var b,c=0,d=0;f>c;c++){if(b=h(e[c],a),0>=b)return 0;d+=b}return d/f}:function(a){for(var b=0,c=0;f>b;b++)c+=h(e[b],a);return c/f}:function(){return 0}},a.prototype.getSortFunction=function(a,c){var d,e,f,g,h,i,j,k,l,m,n;if(f=this,a=f.prepareSearch(a,c),n=!a.query&&c.sort_empty||c.sort,l=function(a,b){return"$score"===a?b.score:f.items[b.id][a]},h=[],n)for(d=0,e=n.length;e>d;d++)(a.query||"$score"!==n[d].field)&&h.push(n[d]);if(a.query){for(m=!0,d=0,e=h.length;e>d;d++)if("$score"===h[d].field){m=!1;break}m&&h.unshift({field:"$score",direction:"desc"})}else for(d=0,e=h.length;e>d;d++)if("$score"===h[d].field){h.splice(d,1);break}for(k=[],d=0,e=h.length;e>d;d++)k.push("desc"===h[d].direction?-1:1);return i=h.length,i?1===i?(g=h[0].field,j=k[0],function(a,c){return j*b(l(g,a),l(g,c))}):function(a,c){var d,e,f;for(d=0;i>d;d++)if(f=h[d].field,e=k[d]*b(l(f,a),l(f,c)))return e;return 0}:null},a.prototype.prepareSearch=function(a,b){if("object"==typeof a)return a;b=c({},b);var d=b.fields,e=b.sort,g=b.sort_empty;return d&&!f(d)&&(b.fields=[d]),e&&!f(e)&&(b.sort=[e]),g&&!f(g)&&(b.sort_empty=[g]),{options:b,query:String(a||"").toLowerCase(),tokens:this.tokenize(a),total:0,items:[]}},a.prototype.search=function(a,b){var c,d,e,f,g=this;return d=this.prepareSearch(a,b),b=d.options,a=d.query,f=b.score||g.getScoreFunction(d),a.length?g.iterator(g.items,function(a,e){c=f(a),(b.filter===!1||c>0)&&d.items.push({score:c,id:e})}):g.iterator(g.items,function(a,b){d.items.push({score:1,id:b})}),e=g.getSortFunction(d,b),e&&d.items.sort(e),d.total=d.items.length,"number"==typeof b.limit&&(d.items=d.items.slice(0,b.limit)),d};var b=function(a,b){return"number"==typeof a&&"number"==typeof b?a>b?1:b>a?-1:0:(a=h(String(a||"")),b=h(String(b||"")),a>b?1:b>a?-1:0)},c=function(a){var b,c,d,e;for(b=1,c=arguments.length;c>b;b++)if(e=arguments[b])for(d in e)e.hasOwnProperty(d)&&(a[d]=e[d]);return a},d=function(a){return(a+"").replace(/^\s+|\s+$|/g,"")},e=function(a){return(a+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},f=Array.isArray||$&&$.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},g={a:"[aÀÁÂÃÄÅàáâãäåĀāąĄ]",c:"[cÇçćĆčČ]",d:"[dđĐďĎ]",e:"[eÈÉÊËèéêëěĚĒēęĘ]",i:"[iÌÍÎÏìíîïĪī]",l:"[lłŁ]",n:"[nÑñňŇńŃ]",o:"[oÒÓÔÕÕÖØòóôõöøŌō]",r:"[rřŘ]",s:"[sŠšśŚ]",t:"[tťŤ]",u:"[uÙÚÛÜùúûüůŮŪū]",y:"[yŸÿýÝ]",z:"[zŽžżŻźŹ]"},h=function(){var a,b,c,d,e="",f={};for(c in g)if(g.hasOwnProperty(c))for(d=g[c].substring(2,g[c].length-1),e+=d,a=0,b=d.length;b>a;a++)f[d.charAt(a)]=c;var h=new RegExp("["+e+"]","g");return function(a){return a.replace(h,function(a){return f[a]}).toLowerCase()}}();return a}),function(a,b){"function"==typeof define&&define.amd?define("microplugin",b):"object"==typeof exports?module.exports=b():a.MicroPlugin=b()}(this,function(){var a={};a.mixin=function(a){a.plugins={},a.prototype.initializePlugins=function(a){var c,d,e,f=this,g=[];if(f.plugins={names:[],settings:{},requested:{},loaded:{}},b.isArray(a))for(c=0,d=a.length;d>c;c++)"string"==typeof a[c]?g.push(a[c]):(f.plugins.settings[a[c].name]=a[c].options,g.push(a[c].name));else if(a)for(e in a)a.hasOwnProperty(e)&&(f.plugins.settings[e]=a[e],g.push(e));for(;g.length;)f.require(g.shift())},a.prototype.loadPlugin=function(b){var c=this,d=c.plugins,e=a.plugins[b];if(!a.plugins.hasOwnProperty(b))throw new Error('Unable to find "'+b+'" plugin');d.requested[b]=!0,d.loaded[b]=e.fn.apply(c,[c.plugins.settings[b]||{}]),d.names.push(b)},a.prototype.require=function(a){var b=this,c=b.plugins;if(!b.plugins.loaded.hasOwnProperty(a)){if(c.requested[a])throw new Error('Plugin has circular dependency ("'+a+'")');b.loadPlugin(a)}return c.loaded[a]},a.define=function(b,c){a.plugins[b]={name:b,fn:c}}};var b={isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)}};return a}),function(a,b){"function"==typeof define&&define.amd?define("selectize",["jquery","sifter","microplugin"],b):"object"==typeof exports?module.exports=b(require("jquery"),require("sifter"),require("microplugin")):a.Selectize=b(a.jQuery,a.Sifter,a.MicroPlugin)}(this,function(a,b,c){"use strict";var d=function(a,b){if("string"!=typeof b||b.length){var c="string"==typeof b?new RegExp(b,"i"):b,d=function(a){var b=0;if(3===a.nodeType){var e=a.data.search(c);if(e>=0&&a.data.length>0){var f=a.data.match(c),g=document.createElement("span");g.className="highlight";var h=a.splitText(e),i=(h.splitText(f[0].length),h.cloneNode(!0));g.appendChild(i),h.parentNode.replaceChild(g,h),b=1}}else if(1===a.nodeType&&a.childNodes&&!/(script|style)/i.test(a.tagName))for(var j=0;j/g,">").replace(/"/g,""")},B=function(a){return(a+"").replace(/\$/g,"$$$$")},C={};C.before=function(a,b,c){var d=a[b];a[b]=function(){return c.apply(a,arguments),d.apply(a,arguments)}},C.after=function(a,b,c){var d=a[b];a[b]=function(){var b=d.apply(a,arguments);return c.apply(a,arguments),b}};var D=function(a){var b=!1;return function(){b||(b=!0,a.apply(this,arguments))}},E=function(a,b){var c;return function(){var d=this,e=arguments;window.clearTimeout(c),c=window.setTimeout(function(){a.apply(d,e)},b)}},F=function(a,b,c){var d,e=a.trigger,f={};a.trigger=function(){var c=arguments[0];return-1===b.indexOf(c)?e.apply(a,arguments):void(f[c]=arguments)},c.apply(a,[]),a.trigger=e;for(d in f)f.hasOwnProperty(d)&&e.apply(a,f[d])},G=function(a,b,c,d){a.on(b,c,function(b){for(var c=b.target;c&&c.parentNode!==a[0];)c=c.parentNode;return b.currentTarget=c,d.apply(this,[b])})},H=function(a){var b={};if("selectionStart"in a)b.start=a.selectionStart,b.length=a.selectionEnd-b.start;else if(document.selection){a.focus();var c=document.selection.createRange(),d=document.selection.createRange().text.length;c.moveStart("character",-a.value.length),b.start=c.text.length-d,b.length=d}return b},I=function(a,b,c){var d,e,f={};if(c)for(d=0,e=c.length;e>d;d++)f[c[d]]=a.css(c[d]);else f=a.css();b.css(f)},J=function(b,c){if(!b)return 0;var d=a("").css({position:"absolute",top:-99999,left:-99999,width:"auto",padding:0,whiteSpace:"pre"}).text(b).appendTo("body");I(c,d,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]);var e=d.width();return d.remove(),e},K=function(a){var b=null,c=function(c,d){var e,f,g,h,i,j,k,l;c=c||window.event||{},d=d||{},c.metaKey||c.altKey||(d.force||a.data("grow")!==!1)&&(e=a.val(),c.type&&"keydown"===c.type.toLowerCase()&&(f=c.keyCode,g=f>=97&&122>=f||f>=65&&90>=f||f>=48&&57>=f||32===f,f===q||f===p?(l=H(a[0]),l.length?e=e.substring(0,l.start)+e.substring(l.start+l.length):f===p&&l.start?e=e.substring(0,l.start-1)+e.substring(l.start+1):f===q&&"undefined"!=typeof l.start&&(e=e.substring(0,l.start)+e.substring(l.start+1))):g&&(j=c.shiftKey,k=String.fromCharCode(c.keyCode),k=j?k.toUpperCase():k.toLowerCase(),e+=k)),h=a.attr("placeholder"),!e&&h&&(e=h),i=J(e,a)+4,i!==b&&(b=i,a.width(i),a.triggerHandler("resize")))};a.on("keydown keyup update blur",c),c()},L=function(c,d){var e,f,g,h,i=this;h=c[0],h.selectize=i;var j=window.getComputedStyle&&window.getComputedStyle(h,null);if(g=j?j.getPropertyValue("direction"):h.currentStyle&&h.currentStyle.direction,g=g||c.parents("[dir]:first").attr("dir")||"",a.extend(i,{order:0,settings:d,$input:c,tabIndex:c.attr("tabindex")||"",tagType:"select"===h.tagName.toLowerCase()?v:w,rtl:/rtl/i.test(g),eventNS:".selectize"+ ++L.count,highlightedValue:null,isOpen:!1,isDisabled:!1,isRequired:c.is("[required]"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:null===d.loadThrottle?i.onSearchChange:E(i.onSearchChange,d.loadThrottle)}),i.sifter=new b(this.options,{diacritics:d.diacritics}),i.settings.options){for(e=0,f=i.settings.options.length;f>e;e++)i.registerOption(i.settings.options[e]);delete i.settings.options}if(i.settings.optgroups){for(e=0,f=i.settings.optgroups.length;f>e;e++)i.registerOptionGroup(i.settings.optgroups[e]);delete i.settings.optgroups}i.settings.mode=i.settings.mode||(1===i.settings.maxItems?"single":"multi"),"boolean"!=typeof i.settings.hideSelected&&(i.settings.hideSelected="multi"===i.settings.mode),i.initializePlugins(i.settings.plugins),i.setupCallbacks(),i.setupTemplates(),i.setup()};return e.mixin(L),c.mixin(L),a.extend(L.prototype,{setup:function(){var b,c,d,e,g,h,i,j,k,l=this,m=l.settings,n=l.eventNS,o=a(window),p=a(document),q=l.$input;if(i=l.settings.mode,j=q.attr("class")||"",b=a("
").addClass(m.wrapperClass).addClass(j).addClass(i),c=a("
").addClass(m.inputClass).addClass("items").appendTo(b),d=a('').appendTo(c).attr("tabindex",q.is(":disabled")?"-1":l.tabIndex),h=a(m.dropdownParent||b),e=a("
").addClass(m.dropdownClass).addClass(i).hide().appendTo(h),g=a("
").addClass(m.dropdownContentClass).appendTo(e),l.settings.copyClassesToDropdown&&e.addClass(j),b.css({width:q[0].style.width}),l.plugins.names.length&&(k="plugin-"+l.plugins.names.join(" plugin-"),b.addClass(k),e.addClass(k)),(null===m.maxItems||m.maxItems>1)&&l.tagType===v&&q.attr("multiple","multiple"),l.settings.placeholder&&d.attr("placeholder",m.placeholder),!l.settings.splitOn&&l.settings.delimiter){var u=l.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");l.settings.splitOn=new RegExp("\\s*"+u+"+\\s*")}q.attr("autocorrect")&&d.attr("autocorrect",q.attr("autocorrect")),q.attr("autocapitalize")&&d.attr("autocapitalize",q.attr("autocapitalize")),l.$wrapper=b,l.$control=c,l.$control_input=d,l.$dropdown=e,l.$dropdown_content=g,e.on("mouseenter","[data-selectable]",function(){return l.onOptionHover.apply(l,arguments)}),e.on("mousedown click","[data-selectable]",function(){return l.onOptionSelect.apply(l,arguments)}),G(c,"mousedown","*:not(input)",function(){return l.onItemSelect.apply(l,arguments)}),K(d),c.on({mousedown:function(){return l.onMouseDown.apply(l,arguments)},click:function(){return l.onClick.apply(l,arguments)}}),d.on({mousedown:function(a){a.stopPropagation()},keydown:function(){return l.onKeyDown.apply(l,arguments)},keyup:function(){return l.onKeyUp.apply(l,arguments)},keypress:function(){return l.onKeyPress.apply(l,arguments)},resize:function(){l.positionDropdown.apply(l,[])},blur:function(){return l.onBlur.apply(l,arguments)},focus:function(){return l.ignoreBlur=!1,l.onFocus.apply(l,arguments)},paste:function(){return l.onPaste.apply(l,arguments)}}),p.on("keydown"+n,function(a){l.isCmdDown=a[f?"metaKey":"ctrlKey"],l.isCtrlDown=a[f?"altKey":"ctrlKey"],l.isShiftDown=a.shiftKey}),p.on("keyup"+n,function(a){a.keyCode===t&&(l.isCtrlDown=!1),a.keyCode===r&&(l.isShiftDown=!1),a.keyCode===s&&(l.isCmdDown=!1)}),p.on("mousedown"+n,function(a){if(l.isFocused){if(a.target===l.$dropdown[0]||a.target.parentNode===l.$dropdown[0])return!1;l.$control.has(a.target).length||a.target===l.$control[0]||l.blur(a.target)}}),o.on(["scroll"+n,"resize"+n].join(" "),function(){l.isOpen&&l.positionDropdown.apply(l,arguments)}),o.on("mousemove"+n,function(){l.ignoreHover=!1}),this.revertSettings={$children:q.children().detach(),tabindex:q.attr("tabindex")},q.attr("tabindex",-1).hide().after(l.$wrapper),a.isArray(m.items)&&(l.setValue(m.items),delete m.items),x&&q.on("invalid"+n,function(a){a.preventDefault(),l.isInvalid=!0,l.refreshState()}),l.updateOriginalInput(),l.refreshItems(),l.refreshState(),l.updatePlaceholder(),l.isSetup=!0,q.is(":disabled")&&l.disable(),l.on("change",this.onChange),q.data("selectize",l),q.addClass("selectized"),l.trigger("initialize"),m.preload===!0&&l.onSearchChange("")},setupTemplates:function(){var b=this,c=b.settings.labelField,d=b.settings.optgroupLabelField,e={optgroup:function(a){return'
'+a.html+"
"},optgroup_header:function(a,b){return'
'+b(a[d])+"
"},option:function(a,b){return'
'+b(a[c])+"
"},item:function(a,b){return'
'+b(a[c])+"
"},option_create:function(a,b){return'
Add '+b(a.input)+"
"}};b.settings.render=a.extend({},e,b.settings.render)},setupCallbacks:function(){var a,b,c={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(a in c)c.hasOwnProperty(a)&&(b=this.settings[c[a]],b&&this.on(a,b))},onClick:function(a){var b=this;b.isFocused||(b.focus(),a.preventDefault())},onMouseDown:function(b){{var c=this,d=b.isDefaultPrevented();a(b.target)}if(c.isFocused){if(b.target!==c.$control_input[0])return"single"===c.settings.mode?c.isOpen?c.close():c.open():d||c.setActiveItem(null),!1}else d||window.setTimeout(function(){c.focus()},0)},onChange:function(){this.$input.trigger("change")},onPaste:function(b){var c=this;c.isFull()||c.isInputHidden||c.isLocked?b.preventDefault():c.settings.splitOn&&setTimeout(function(){for(var b=a.trim(c.$control_input.val()||"").split(c.settings.splitOn),d=0,e=b.length;e>d;d++)c.createItem(b[d])},0)},onKeyPress:function(a){if(this.isLocked)return a&&a.preventDefault();var b=String.fromCharCode(a.keyCode||a.which);return this.settings.create&&"multi"===this.settings.mode&&b===this.settings.delimiter?(this.createItem(),a.preventDefault(),!1):void 0},onKeyDown:function(a){var b=(a.target===this.$control_input[0],this);if(b.isLocked)return void(a.keyCode!==u&&a.preventDefault());switch(a.keyCode){case g:if(b.isCmdDown)return void b.selectAll();break;case i:return void(b.isOpen&&(a.preventDefault(),a.stopPropagation(),b.close()));case o:if(!a.ctrlKey||a.altKey)break;case n:if(!b.isOpen&&b.hasOptions)b.open();else if(b.$activeOption){b.ignoreHover=!0;var c=b.getAdjacentOption(b.$activeOption,1);c.length&&b.setActiveOption(c,!0,!0)}return void a.preventDefault();case l:if(!a.ctrlKey||a.altKey)break;case k:if(b.$activeOption){b.ignoreHover=!0;var d=b.getAdjacentOption(b.$activeOption,-1);d.length&&b.setActiveOption(d,!0,!0)}return void a.preventDefault();case h:return void(b.isOpen&&b.$activeOption&&(b.onOptionSelect({currentTarget:b.$activeOption}),a.preventDefault()));case j:return void b.advanceSelection(-1,a);case m:return void b.advanceSelection(1,a);case u:return b.settings.selectOnTab&&b.isOpen&&b.$activeOption&&(b.onOptionSelect({currentTarget:b.$activeOption}),b.isFull()||a.preventDefault()),void(b.settings.create&&b.createItem()&&a.preventDefault());case p:case q:return void b.deleteSelection(a)}return!b.isFull()&&!b.isInputHidden||(f?a.metaKey:a.ctrlKey)?void 0:void a.preventDefault()},onKeyUp:function(a){var b=this;if(b.isLocked)return a&&a.preventDefault();var c=b.$control_input.val()||"";b.lastValue!==c&&(b.lastValue=c,b.onSearchChange(c),b.refreshOptions(),b.trigger("type",c))},onSearchChange:function(a){var b=this,c=b.settings.load;c&&(b.loadedSearches.hasOwnProperty(a)||(b.loadedSearches[a]=!0,b.load(function(d){c.apply(b,[a,d])})))},onFocus:function(a){var b=this,c=b.isFocused;return b.isDisabled?(b.blur(),a&&a.preventDefault(),!1):void(b.ignoreFocus||(b.isFocused=!0,"focus"===b.settings.preload&&b.onSearchChange(""),c||b.trigger("focus"),b.$activeItems.length||(b.showInput(),b.setActiveItem(null),b.refreshOptions(!!b.settings.openOnFocus)),b.refreshState()))},onBlur:function(a,b){var c=this;if(c.isFocused&&(c.isFocused=!1,!c.ignoreFocus)){if(!c.ignoreBlur&&document.activeElement===c.$dropdown_content[0])return c.ignoreBlur=!0,void c.onFocus(a);var d=function(){c.close(),c.setTextboxValue(""),c.setActiveItem(null),c.setActiveOption(null),c.setCaret(c.items.length),c.refreshState(),(b||document.body).focus(),c.ignoreFocus=!1,c.trigger("blur")};c.ignoreFocus=!0,c.settings.create&&c.settings.createOnBlur?c.createItem(null,!1,d):d()}},onOptionHover:function(a){this.ignoreHover||this.setActiveOption(a.currentTarget,!1)},onOptionSelect:function(b){var c,d,e=this;b.preventDefault&&(b.preventDefault(),b.stopPropagation()),d=a(b.currentTarget),d.hasClass("create")?e.createItem(null,function(){e.settings.closeAfterSelect&&e.close()}):(c=d.attr("data-value"),"undefined"!=typeof c&&(e.lastQuery=null,e.setTextboxValue(""),e.addItem(c),e.settings.closeAfterSelect?e.close():!e.settings.hideSelected&&b.type&&/mouse/.test(b.type)&&e.setActiveOption(e.getOption(c))))},onItemSelect:function(a){var b=this;b.isLocked||"multi"===b.settings.mode&&(a.preventDefault(),b.setActiveItem(a.currentTarget,a))},load:function(a){var b=this,c=b.$wrapper.addClass(b.settings.loadingClass);b.loading++,a.apply(b,[function(a){b.loading=Math.max(b.loading-1,0),a&&a.length&&(b.addOption(a),b.refreshOptions(b.isFocused&&!b.isInputHidden)),b.loading||c.removeClass(b.settings.loadingClass),b.trigger("load",a)}])},setTextboxValue:function(a){var b=this.$control_input,c=b.val()!==a;c&&(b.val(a).triggerHandler("update"),this.lastValue=a)},getValue:function(){return this.tagType===v&&this.$input.attr("multiple")?this.items:this.items.join(this.settings.delimiter)},setValue:function(a,b){var c=b?[]:["change"];F(this,c,function(){this.clear(b),this.addItems(a,b)})},setActiveItem:function(b,c){var d,e,f,g,h,i,j,k,l=this;if("single"!==l.settings.mode){if(b=a(b),!b.length)return a(l.$activeItems).removeClass("active"),l.$activeItems=[],void(l.isFocused&&l.showInput());if(d=c&&c.type.toLowerCase(),"mousedown"===d&&l.isShiftDown&&l.$activeItems.length){for(k=l.$control.children(".active:last"),g=Array.prototype.indexOf.apply(l.$control[0].childNodes,[k[0]]),h=Array.prototype.indexOf.apply(l.$control[0].childNodes,[b[0]]),g>h&&(j=g,g=h,h=j),e=g;h>=e;e++)i=l.$control[0].childNodes[e],-1===l.$activeItems.indexOf(i)&&(a(i).addClass("active"),l.$activeItems.push(i));c.preventDefault()}else"mousedown"===d&&l.isCtrlDown||"keydown"===d&&this.isShiftDown?b.hasClass("active")?(f=l.$activeItems.indexOf(b[0]),l.$activeItems.splice(f,1),b.removeClass("active")):l.$activeItems.push(b.addClass("active")[0]):(a(l.$activeItems).removeClass("active"),l.$activeItems=[b.addClass("active")[0]]);l.hideInput(),this.isFocused||l.focus()}},setActiveOption:function(b,c,d){var e,f,g,h,i,j=this;j.$activeOption&&j.$activeOption.removeClass("active"),j.$activeOption=null,b=a(b),b.length&&(j.$activeOption=b.addClass("active"),(c||!y(c))&&(e=j.$dropdown_content.height(),f=j.$activeOption.outerHeight(!0),c=j.$dropdown_content.scrollTop()||0,g=j.$activeOption.offset().top-j.$dropdown_content.offset().top+c,h=g,i=g-e+f,g+f>e+c?j.$dropdown_content.stop().animate({scrollTop:i},d?j.settings.scrollDuration:0):c>g&&j.$dropdown_content.stop().animate({scrollTop:h},d?j.settings.scrollDuration:0)))},selectAll:function(){var a=this;"single"!==a.settings.mode&&(a.$activeItems=Array.prototype.slice.apply(a.$control.children(":not(input)").addClass("active")),a.$activeItems.length&&(a.hideInput(),a.close()),a.focus())},hideInput:function(){var a=this;a.setTextboxValue(""),a.$control_input.css({opacity:0,position:"absolute",left:a.rtl?1e4:-1e4}),a.isInputHidden=!0},showInput:function(){this.$control_input.css({opacity:1,position:"relative",left:0}),this.isInputHidden=!1},focus:function(){var a=this;a.isDisabled||(a.ignoreFocus=!0,a.$control_input[0].focus(),window.setTimeout(function(){a.ignoreFocus=!1,a.onFocus()},0))},blur:function(a){this.$control_input[0].blur(),this.onBlur(null,a)},getScoreFunction:function(a){return this.sifter.getScoreFunction(a,this.getSearchOptions())},getSearchOptions:function(){var a=this.settings,b=a.sortField;return"string"==typeof b&&(b=[{field:b}]),{fields:a.searchField,conjunction:a.searchConjunction,sort:b}},search:function(b){var c,d,e,f=this,g=f.settings,h=this.getSearchOptions();if(g.score&&(e=f.settings.score.apply(this,[b]),"function"!=typeof e))throw new Error('Selectize "score" setting must be a function that returns a function');if(b!==f.lastQuery?(f.lastQuery=b,d=f.sifter.search(b,a.extend(h,{score:e})),f.currentResults=d):d=a.extend(!0,{},f.currentResults),g.hideSelected)for(c=d.items.length-1;c>=0;c--)-1!==f.items.indexOf(z(d.items[c].id))&&d.items.splice(c,1);return d},refreshOptions:function(b){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;"undefined"==typeof b&&(b=!0);var t=this,u=a.trim(t.$control_input.val()),v=t.search(u),w=t.$dropdown_content,x=t.$activeOption&&z(t.$activeOption.attr("data-value"));for(g=v.items.length,"number"==typeof t.settings.maxOptions&&(g=Math.min(g,t.settings.maxOptions)),h={},i=[],c=0;g>c;c++)for(j=t.options[v.items[c].id],k=t.render("option",j),l=j[t.settings.optgroupField]||"",m=a.isArray(l)?l:[l],e=0,f=m&&m.length;f>e;e++)l=m[e],t.optgroups.hasOwnProperty(l)||(l=""),h.hasOwnProperty(l)||(h[l]=[],i.push(l)),h[l].push(k);for(this.settings.lockOptgroupOrder&&i.sort(function(a,b){var c=t.optgroups[a].$order||0,d=t.optgroups[b].$order||0;return c-d}),n=[],c=0,g=i.length;g>c;c++)l=i[c],t.optgroups.hasOwnProperty(l)&&h[l].length?(o=t.render("optgroup_header",t.optgroups[l])||"",o+=h[l].join(""),n.push(t.render("optgroup",a.extend({},t.optgroups[l],{html:o})))):n.push(h[l].join(""));if(w.html(n.join("")),t.settings.highlight&&v.query.length&&v.tokens.length)for(c=0,g=v.tokens.length;g>c;c++)d(w,v.tokens[c].regex);if(!t.settings.hideSelected)for(c=0,g=t.items.length;g>c;c++)t.getOption(t.items[c]).addClass("selected");p=t.canCreate(u),p&&(w.prepend(t.render("option_create",{input:u})),s=a(w[0].childNodes[0])),t.hasOptions=v.items.length>0||p,t.hasOptions?(v.items.length>0?(r=x&&t.getOption(x),r&&r.length?q=r:"single"===t.settings.mode&&t.items.length&&(q=t.getOption(t.items[0])),q&&q.length||(q=s&&!t.settings.addPrecedence?t.getAdjacentOption(s,1):w.find("[data-selectable]:first"))):q=s,t.setActiveOption(q),b&&!t.isOpen&&t.open()):(t.setActiveOption(null),b&&t.isOpen&&t.close())},addOption:function(b){var c,d,e,f=this;if(a.isArray(b))for(c=0,d=b.length;d>c;c++)f.addOption(b[c]);else(e=f.registerOption(b))&&(f.userOptions[e]=!0,f.lastQuery=null,f.trigger("option_add",e,b))},registerOption:function(a){var b=z(a[this.settings.valueField]);return!b||this.options.hasOwnProperty(b)?!1:(a.$order=a.$order||++this.order,this.options[b]=a,b)},registerOptionGroup:function(a){var b=z(a[this.settings.optgroupValueField]);return b?(a.$order=a.$order||++this.order,this.optgroups[b]=a,b):!1},addOptionGroup:function(a,b){b[this.settings.optgroupValueField]=a,(a=this.registerOptionGroup(b))&&this.trigger("optgroup_add",a,b)},removeOptionGroup:function(a){this.optgroups.hasOwnProperty(a)&&(delete this.optgroups[a],this.renderCache={},this.trigger("optgroup_remove",a))},clearOptionGroups:function(){this.optgroups={},this.renderCache={},this.trigger("optgroup_clear")},updateOption:function(b,c){var d,e,f,g,h,i,j,k=this;if(b=z(b),f=z(c[k.settings.valueField]),null!==b&&k.options.hasOwnProperty(b)){if("string"!=typeof f)throw new Error("Value must be set in option data");j=k.options[b].$order,f!==b&&(delete k.options[b],g=k.items.indexOf(b),-1!==g&&k.items.splice(g,1,f)),c.$order=c.$order||j,k.options[f]=c,h=k.renderCache.item,i=k.renderCache.option,h&&(delete h[b],delete h[f]),i&&(delete i[b],delete i[f]),-1!==k.items.indexOf(f)&&(d=k.getItem(b),e=a(k.render("item",c)),d.hasClass("active")&&e.addClass("active"),d.replaceWith(e)),k.lastQuery=null,k.isOpen&&k.refreshOptions(!1)}},removeOption:function(a,b){var c=this;a=z(a);var d=c.renderCache.item,e=c.renderCache.option;d&&delete d[a],e&&delete e[a],delete c.userOptions[a],delete c.options[a],c.lastQuery=null,c.trigger("option_remove",a),c.removeItem(a,b)},clearOptions:function(){var a=this;a.loadedSearches={},a.userOptions={},a.renderCache={},a.options=a.sifter.items={},a.lastQuery=null,a.trigger("option_clear"),a.clear()},getOption:function(a){return this.getElementWithValue(a,this.$dropdown_content.find("[data-selectable]"))},getAdjacentOption:function(b,c){var d=this.$dropdown.find("[data-selectable]"),e=d.index(b)+c;return e>=0&&ed;d++)if(c[d].getAttribute("data-value")===b)return a(c[d]);return a()},getItem:function(a){return this.getElementWithValue(a,this.$control.children())},addItems:function(b,c){for(var d=a.isArray(b)?b:[b],e=0,f=d.length;f>e;e++)this.isPending=f-1>e,this.addItem(d[e],c)},addItem:function(b,c){var d=c?[]:["change"];F(this,d,function(){var d,e,f,g,h,i=this,j=i.settings.mode;return b=z(b),-1!==i.items.indexOf(b)?void("single"===j&&i.close()):void(i.options.hasOwnProperty(b)&&("single"===j&&i.clear(c),"multi"===j&&i.isFull()||(d=a(i.render("item",i.options[b])),h=i.isFull(),i.items.splice(i.caretPos,0,b),i.insertAtCaret(d),(!i.isPending||!h&&i.isFull())&&i.refreshState(),i.isSetup&&(f=i.$dropdown_content.find("[data-selectable]"),i.isPending||(e=i.getOption(b),g=i.getAdjacentOption(e,1).attr("data-value"),i.refreshOptions(i.isFocused&&"single"!==j),g&&i.setActiveOption(i.getOption(g))),!f.length||i.isFull()?i.close():i.positionDropdown(),i.updatePlaceholder(),i.trigger("item_add",b,d),i.updateOriginalInput({silent:c})))))})},removeItem:function(a,b){var c,d,e,f=this;c="object"==typeof a?a:f.getItem(a),a=z(c.attr("data-value")),d=f.items.indexOf(a),-1!==d&&(c.remove(),c.hasClass("active")&&(e=f.$activeItems.indexOf(c[0]),f.$activeItems.splice(e,1)),f.items.splice(d,1),f.lastQuery=null,!f.settings.persist&&f.userOptions.hasOwnProperty(a)&&f.removeOption(a,b),d0),b.$control_input.data("grow",!c&&!d)},isFull:function(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(a){var b,c,d,e,f=this;if(a=a||{},f.tagType===v){for(d=[],b=0,c=f.items.length;c>b;b++)e=f.options[f.items[b]][f.settings.labelField]||"",d.push('");d.length||this.$input.attr("multiple")||d.push(''),f.$input.html(d.join(""))}else f.$input.val(f.getValue()),f.$input.attr("value",f.$input.val());f.isSetup&&(a.silent||f.trigger("change",f.$input.val()))},updatePlaceholder:function(){if(this.settings.placeholder){var a=this.$control_input;this.items.length?a.removeAttr("placeholder"):a.attr("placeholder",this.settings.placeholder),a.triggerHandler("update",{force:!0})}},open:function(){var a=this;a.isLocked||a.isOpen||"multi"===a.settings.mode&&a.isFull()||(a.focus(),a.isOpen=!0,a.refreshState(),a.$dropdown.css({visibility:"hidden",display:"block"}),a.positionDropdown(),a.$dropdown.css({visibility:"visible"}),a.trigger("dropdown_open",a.$dropdown))},close:function(){var a=this,b=a.isOpen;"single"===a.settings.mode&&a.items.length&&a.hideInput(),a.isOpen=!1,a.$dropdown.hide(),a.setActiveOption(null),a.refreshState(),b&&a.trigger("dropdown_close",a.$dropdown)},positionDropdown:function(){var a=this.$control,b="body"===this.settings.dropdownParent?a.offset():a.position();b.top+=a.outerHeight(!0),this.$dropdown.css({width:a.outerWidth(),top:b.top,left:b.left})},clear:function(a){var b=this;b.items.length&&(b.$control.children(":not(input)").remove(),b.items=[],b.lastQuery=null,b.setCaret(0),b.setActiveItem(null),b.updatePlaceholder(),b.updateOriginalInput({silent:a}),b.refreshState(),b.showInput(),b.trigger("clear"))},insertAtCaret:function(b){var c=Math.min(this.caretPos,this.items.length);0===c?this.$control.prepend(b):a(this.$control[0].childNodes[c]).before(b),this.setCaret(c+1)},deleteSelection:function(b){var c,d,e,f,g,h,i,j,k,l=this;if(e=b&&b.keyCode===p?-1:1,f=H(l.$control_input[0]),l.$activeOption&&!l.settings.hideSelected&&(i=l.getAdjacentOption(l.$activeOption,-1).attr("data-value")),g=[],l.$activeItems.length){for(k=l.$control.children(".active:"+(e>0?"last":"first")),h=l.$control.children(":not(input)").index(k),e>0&&h++,c=0,d=l.$activeItems.length;d>c;c++)g.push(a(l.$activeItems[c]).attr("data-value")); +b&&(b.preventDefault(),b.stopPropagation())}else(l.isFocused||"single"===l.settings.mode)&&l.items.length&&(0>e&&0===f.start&&0===f.length?g.push(l.items[l.caretPos-1]):e>0&&f.start===l.$control_input.val().length&&g.push(l.items[l.caretPos]));if(!g.length||"function"==typeof l.settings.onDelete&&l.settings.onDelete.apply(l,[g])===!1)return!1;for("undefined"!=typeof h&&l.setCaret(h);g.length;)l.removeItem(g.pop());return l.showInput(),l.positionDropdown(),l.refreshOptions(!0),i&&(j=l.getOption(i),j.length&&l.setActiveOption(j)),!0},advanceSelection:function(a,b){var c,d,e,f,g,h,i=this;0!==a&&(i.rtl&&(a*=-1),c=a>0?"last":"first",d=H(i.$control_input[0]),i.isFocused&&!i.isInputHidden?(f=i.$control_input.val().length,g=0>a?0===d.start&&0===d.length:d.start===f,g&&!f&&i.advanceCaret(a,b)):(h=i.$control.children(".active:"+c),h.length&&(e=i.$control.children(":not(input)").index(h),i.setActiveItem(null),i.setCaret(a>0?e+1:e))))},advanceCaret:function(a,b){var c,d,e=this;0!==a&&(c=a>0?"next":"prev",e.isShiftDown?(d=e.$control_input[c](),d.length&&(e.hideInput(),e.setActiveItem(d),b&&b.preventDefault())):e.setCaret(e.caretPos+a))},setCaret:function(b){var c=this;if(b="single"===c.settings.mode?c.items.length:Math.max(0,Math.min(c.items.length,b)),!c.isPending){var d,e,f,g;for(f=c.$control.children(":not(input)"),d=0,e=f.length;e>d;d++)g=a(f[d]).detach(),b>d?c.$control_input.before(g):c.$control.append(g)}c.caretPos=b},lock:function(){this.close(),this.isLocked=!0,this.refreshState()},unlock:function(){this.isLocked=!1,this.refreshState()},disable:function(){var a=this;a.$input.prop("disabled",!0),a.$control_input.prop("disabled",!0).prop("tabindex",-1),a.isDisabled=!0,a.lock()},enable:function(){var a=this;a.$input.prop("disabled",!1),a.$control_input.prop("disabled",!1).prop("tabindex",a.tabIndex),a.isDisabled=!1,a.unlock()},destroy:function(){var b=this,c=b.eventNS,d=b.revertSettings;b.trigger("destroy"),b.off(),b.$wrapper.remove(),b.$dropdown.remove(),b.$input.html("").append(d.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:d.tabindex}).show(),b.$control_input.removeData("grow"),b.$input.removeData("selectize"),a(window).off(c),a(document).off(c),a(document.body).off(c),delete b.$input[0].selectize},render:function(a,b){var c,d,e="",f=!1,g=this,h=/^[\t \r\n]*<([a-z][a-z0-9\-_]*(?:\:[a-z][a-z0-9\-_]*)?)/i;return("option"===a||"item"===a)&&(c=z(b[g.settings.valueField]),f=!!c),f&&(y(g.renderCache[a])||(g.renderCache[a]={}),g.renderCache[a].hasOwnProperty(c))?g.renderCache[a][c]:(e=g.settings.render[a].apply(this,[b,A]),("option"===a||"option_create"===a)&&(e=e.replace(h,"<$1 data-selectable")),"optgroup"===a&&(d=b[g.settings.optgroupValueField]||"",e=e.replace(h,'<$1 data-group="'+B(A(d))+'"')),("option"===a||"item"===a)&&(e=e.replace(h,'<$1 data-value="'+B(A(c||""))+'"')),f&&(g.renderCache[a][c]=e),e)},clearCache:function(a){var b=this;"undefined"==typeof a?b.renderCache={}:delete b.renderCache[a]},canCreate:function(a){var b=this;if(!b.settings.create)return!1;var c=b.settings.createFilter;return!(!a.length||"function"==typeof c&&!c.apply(b,[a])||"string"==typeof c&&!new RegExp(c).test(a)||c instanceof RegExp&&!c.test(a))}}),L.count=0,L.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:!1,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:!1,selectOnTab:!1,preload:!1,allowEmptyOption:!1,closeAfterSelect:!1,scrollDuration:60,loadThrottle:300,loadingClass:"loading",dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:!0,render:{}},a.fn.selectize=function(b){var c=a.fn.selectize.defaults,d=a.extend({},c,b),e=d.dataAttr,f=d.labelField,g=d.valueField,h=d.optgroupField,i=d.optgroupLabelField,j=d.optgroupValueField,k=function(b,c){var h,i,j,k,l=b.attr(e);if(l)for(c.options=JSON.parse(l),h=0,i=c.options.length;i>h;h++)c.items.push(c.options[h][g]);else{var m=a.trim(b.val()||"");if(!d.allowEmptyOption&&!m.length)return;for(j=m.split(d.delimiter),h=0,i=j.length;i>h;h++)k={},k[f]=j[h],k[g]=j[h],c.options.push(k);c.items=j}},l=function(b,c){var k,l,m,n,o=c.options,p={},q=function(a){var b=e&&a.attr(e);return"string"==typeof b&&b.length?JSON.parse(b):null},r=function(b,e){b=a(b);var i=z(b.attr("value"));if(i||d.allowEmptyOption)if(p.hasOwnProperty(i)){if(e){var j=p[i][h];j?a.isArray(j)?j.push(e):p[i][h]=[j,e]:p[i][h]=e}}else{var k=q(b)||{};k[f]=k[f]||b.text(),k[g]=k[g]||i,k[h]=k[h]||e,p[i]=k,o.push(k),b.is(":selected")&&c.items.push(i)}},s=function(b){var d,e,f,g,h;for(b=a(b),f=b.attr("label"),f&&(g=q(b)||{},g[i]=f,g[j]=f,c.optgroups.push(g)),h=a("option",b),d=0,e=h.length;e>d;d++)r(h[d],f)};for(c.maxItems=b.attr("multiple")?null:1,n=b.children(),k=0,l=n.length;l>k;k++)m=n[k].tagName.toLowerCase(),"optgroup"===m?s(n[k]):"option"===m&&r(n[k])};return this.each(function(){if(!this.selectize){var e,f=a(this),g=this.tagName.toLowerCase(),h=f.attr("placeholder")||f.attr("data-placeholder");h||d.allowEmptyOption||(h=f.children('option[value=""]').text());var i={placeholder:h,options:[],optgroups:[],items:[]};"select"===g?l(f,i):k(f,i),e=new L(f,a.extend(!0,{},c,i,b))}})},a.fn.selectize.defaults=L.defaults,a.fn.selectize.support={validity:x},L.define("drag_drop",function(){if(!a.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');if("multi"===this.settings.mode){var b=this;b.lock=function(){var a=b.lock;return function(){var c=b.$control.data("sortable");return c&&c.disable(),a.apply(b,arguments)}}(),b.unlock=function(){var a=b.unlock;return function(){var c=b.$control.data("sortable");return c&&c.enable(),a.apply(b,arguments)}}(),b.setup=function(){var c=b.setup;return function(){c.apply(this,arguments);var d=b.$control.sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:b.isLocked,start:function(a,b){b.placeholder.css("width",b.helper.css("width")),d.css({overflow:"visible"})},stop:function(){d.css({overflow:"hidden"});var c=b.$activeItems?b.$activeItems.slice():null,e=[];d.children("[data-value]").each(function(){e.push(a(this).attr("data-value"))}),b.setValue(e),b.setActiveItem(c)}})}}()}}),L.define("dropdown_header",function(b){var c=this;b=a.extend({title:"Untitled",headerClass:"selectize-dropdown-header",titleRowClass:"selectize-dropdown-header-title",labelClass:"selectize-dropdown-header-label",closeClass:"selectize-dropdown-header-close",html:function(a){return'
'}},b),c.setup=function(){var d=c.setup;return function(){d.apply(c,arguments),c.$dropdown_header=a(b.html(b)),c.$dropdown.prepend(c.$dropdown_header)}}()}),L.define("optgroup_columns",function(b){var c=this;b=a.extend({equalizeWidth:!0,equalizeHeight:!0},b),this.getAdjacentOption=function(b,c){var d=b.closest("[data-group]").find("[data-selectable]"),e=d.index(b)+c;return e>=0&&e
',a=a.firstChild,c.body.appendChild(a),b=d.width=a.offsetWidth-a.clientWidth,c.body.removeChild(a)),b},e=function(){var e,f,g,h,i,j,k;if(k=a("[data-group]",c.$dropdown_content),f=k.length,f&&c.$dropdown_content.width()){if(b.equalizeHeight){for(g=0,e=0;f>e;e++)g=Math.max(g,k.eq(e).height());k.css({height:g})}b.equalizeWidth&&(j=c.$dropdown_content.innerWidth()-d(),h=Math.round(j/f),k.css({width:h}),f>1&&(i=j-h*(f-1),k.eq(f-1).css({width:i})))}};(b.equalizeHeight||b.equalizeWidth)&&(C.after(this,"positionDropdown",e),C.after(this,"refreshOptions",e))}),L.define("remove_button",function(b){if("single"!==this.settings.mode){b=a.extend({label:"×",title:"Remove",className:"remove",append:!0},b);var c=this,d=''+b.label+"",e=function(a,b){var c=a.search(/(<\/[^>]+>\s*)$/);return a.substring(0,c)+b+a.substring(c)};this.setup=function(){var f=c.setup;return function(){if(b.append){var g=c.settings.render.item;c.settings.render.item=function(){return e(g.apply(this,arguments),d)}}f.apply(this,arguments),this.$control.on("click","."+b.className,function(b){if(b.preventDefault(),!c.isLocked){var d=a(b.currentTarget).parent();c.setActiveItem(d),c.deleteSelection()&&c.setCaret(c.items.length)}})}}()}}),L.define("restore_on_backspace",function(a){var b=this;a.text=a.text||function(a){return a[this.settings.labelField]},this.onKeyDown=function(){var c=b.onKeyDown;return function(b){var d,e;return b.keyCode===p&&""===this.$control_input.val()&&!this.$activeItems.length&&(d=this.caretPos-1,d>=0&&d>0}function ToUint32(v){return v>>>0}var LN2=Math.LN2,abs=Math.abs,floor=Math.floor,log=Math.log,max=Math.max,min=Math.min,pow=Math.pow,round=Math.round;(function(){var orig=Object.defineProperty;var dom_only=!function(){try{return Object.defineProperty({},"x",{})}catch(_){return false}}();if(!orig||dom_only){Object.defineProperty=function(o,prop,desc){if(orig)try{return orig(o,prop,desc)}catch(_){}if(o!==Object(o))throw TypeError("Object.defineProperty called on non-object");if(Object.prototype.__defineGetter__&&"get"in desc)Object.prototype.__defineGetter__.call(o,prop,desc.get);if(Object.prototype.__defineSetter__&&"set"in desc)Object.prototype.__defineSetter__.call(o,prop,desc.set);if("value"in desc)o[prop]=desc.value;return o}}})();function makeArrayAccessors(obj){if(obj.length>MAX_ARRAY_LENGTH)throw RangeError("Array too large for polyfill");function makeArrayAccessor(index){Object.defineProperty(obj,index,{get:function(){return obj._getter(index)},set:function(v){obj._setter(index,v)},enumerable:true,configurable:false})}var i;for(i=0;i>s}function as_unsigned(value,bits){var s=32-bits;return value<>>s}function packI8(n){return[n&255]}function unpackI8(bytes){return as_signed(bytes[0],8)}function packU8(n){return[n&255]}function unpackU8(bytes){return as_unsigned(bytes[0],8)}function packU8Clamped(n){n=round(Number(n));return[n<0?0:n>255?255:n&255]}function packI16(n){return[n>>8&255,n&255]}function unpackI16(bytes){return as_signed(bytes[0]<<8|bytes[1],16)}function packU16(n){return[n>>8&255,n&255]}function unpackU16(bytes){return as_unsigned(bytes[0]<<8|bytes[1],16)}function packI32(n){return[n>>24&255,n>>16&255,n>>8&255,n&255]}function unpackI32(bytes){return as_signed(bytes[0]<<24|bytes[1]<<16|bytes[2]<<8|bytes[3],32)}function packU32(n){return[n>>24&255,n>>16&255,n>>8&255,n&255]}function unpackU32(bytes){return as_unsigned(bytes[0]<<24|bytes[1]<<16|bytes[2]<<8|bytes[3],32)}function packIEEE754(v,ebits,fbits){var bias=(1<.5)return w+1;return w%2?w+1:w}if(v!==v){e=(1<=pow(2,1-bias)){e=min(floor(log(v)/LN2),1023);f=roundToEven(v/pow(2,e)*pow(2,fbits));if(f/pow(2,fbits)>=2){e=e+1;f=1}if(e>bias){e=(1<>1}}bits.reverse();str=bits.join("");bias=(1<0){return s*pow(2,e-bias)*(1+f/pow(2,fbits))}else if(f!==0){return s*pow(2,-(bias-1))*(f/pow(2,fbits))}else{return s<0?-0:0}}function unpackF64(b){return unpackIEEE754(b,11,52)}function packF64(v){return packIEEE754(v,11,52)}function unpackF32(b){return unpackIEEE754(b,8,23)}function packF32(v){return packIEEE754(v,8,23)}(function(){function ArrayBuffer(length){length=ToInt32(length);if(length<0)throw RangeError("ArrayBuffer size is not a small enough positive integer.");Object.defineProperty(this,"byteLength",{value:length});Object.defineProperty(this,"_bytes",{value:Array(length)});for(var i=0;i=1&&Type(arguments[0])==="object"&&arguments[0]instanceof $TypedArray$){return function(typedArray){if(this.constructor!==typedArray.constructor)throw TypeError();var byteLength=typedArray.length*this.BYTES_PER_ELEMENT;Object.defineProperty(this,"buffer",{value:new ArrayBuffer(byteLength)});Object.defineProperty(this,"byteLength",{value:byteLength});Object.defineProperty(this,"byteOffset",{value:0});Object.defineProperty(this,"length",{value:typedArray.length});for(var i=0;i=1&&Type(arguments[0])==="object"&&!(arguments[0]instanceof $TypedArray$)&&!(arguments[0]instanceof ArrayBuffer||Class(arguments[0])==="ArrayBuffer")){return function(array){var byteLength=array.length*this.BYTES_PER_ELEMENT;Object.defineProperty(this,"buffer",{value:new ArrayBuffer(byteLength)});Object.defineProperty(this,"byteLength",{value:byteLength});Object.defineProperty(this,"byteOffset",{value:0});Object.defineProperty(this,"length",{value:array.length});for(var i=0;i=1&&Type(arguments[0])==="object"&&(arguments[0]instanceof ArrayBuffer||Class(arguments[0])==="ArrayBuffer")){return function(buffer,byteOffset,length){byteOffset=ToUint32(byteOffset);if(byteOffset>buffer.byteLength)throw RangeError("byteOffset out of range");if(byteOffset%this.BYTES_PER_ELEMENT)throw RangeError("buffer length minus the byteOffset is not a multiple of the element size.");if(length===undefined){var byteLength=buffer.byteLength-byteOffset;if(byteLength%this.BYTES_PER_ELEMENT)throw RangeError("length of buffer minus byteOffset not a multiple of the element size");length=byteLength/this.BYTES_PER_ELEMENT}else{length=ToUint32(length);byteLength=length*this.BYTES_PER_ELEMENT}if(byteOffset+byteLength>buffer.byteLength)throw RangeError("byteOffset and length reference an area beyond the end of the buffer");Object.defineProperty(this,"buffer",{value:buffer});Object.defineProperty(this,"byteLength",{value:byteLength});Object.defineProperty(this,"byteOffset",{value:byteOffset});Object.defineProperty(this,"length",{value:length})}.apply(this,arguments)}throw TypeError()}Object.defineProperty($TypedArray$,"from",{value:function(iterable){return new this(iterable)}});Object.defineProperty($TypedArray$,"of",{value:function(){return new this(arguments)}});var $TypedArrayPrototype$={};$TypedArray$.prototype=$TypedArrayPrototype$;Object.defineProperty($TypedArray$.prototype,"_getter",{value:function(index){if(arguments.length<1)throw SyntaxError("Not enough arguments");index=ToUint32(index);if(index>=this.length)return undefined;var bytes=[],i,o;for(i=0,o=this.byteOffset+index*this.BYTES_PER_ELEMENT;i=this.length)return;var bytes=this._pack(value),i,o;for(i=0,o=this.byteOffset+index*this.BYTES_PER_ELEMENT;i0){o._setter(to,o._getter(from));from=from+direction;to=to+direction;count=count-1}return o}});Object.defineProperty($TypedArray$.prototype,"every",{value:function(callbackfn){if(this===undefined||this===null)throw TypeError();var t=Object(this);var len=ToUint32(t.length);if(!IsCallable(callbackfn))throw TypeError();var thisArg=arguments[1];for(var i=0;i1?arguments[1]:undefined;var k=0;while(k1?arguments[1]:undefined;var k=0;while(k0){n=Number(arguments[1]);if(n!==n){n=0}else if(n!==0&&n!==1/0&&n!==-(1/0)){n=(n>0||-1)*floor(abs(n))}}if(n>=len)return-1;var k=n>=0?n:max(len-abs(n),0);for(;k1){n=Number(arguments[1]);if(n!==n){n=0}else if(n!==0&&n!==1/0&&n!==-(1/0)){n=(n>0||-1)*floor(abs(n))}}var k=n>=0?min(n,len-1):len-abs(n);for(;k>=0;k--){if(t._getter(k)===searchElement)return k}return-1}});Object.defineProperty($TypedArray$.prototype,"map",{value:function(callbackfn){if(this===undefined||this===null)throw TypeError();var t=Object(this);var len=ToUint32(t.length);if(!IsCallable(callbackfn))throw TypeError();var res=[];res.length=len;var thisp=arguments[1];for(var i=0;i=2){accumulator=arguments[1]}else{accumulator=t._getter(k++)}while(k=2){accumulator=arguments[1]}else{accumulator=t._getter(k--)}while(k>=0){accumulator=callbackfn.call(undefined,accumulator,t._getter(k),k,t);k--}return accumulator}});Object.defineProperty($TypedArray$.prototype,"reverse",{value:function(){if(this===undefined||this===null)throw TypeError();var t=Object(this);var len=ToUint32(t.length);var half=floor(len/2);for(var i=0,j=len-1;ithis.length){throw RangeError("Offset plus length of array is out of range")}byteOffset=this.byteOffset+offset*this.BYTES_PER_ELEMENT;byteLength=array.length*this.BYTES_PER_ELEMENT;if(array.buffer===this.buffer){tmp=[];for(i=0,s=array.byteOffset;ithis.length){throw RangeError("Offset plus length of array is out of range")}for(i=0;imax?max:v}start=ToInt32(start);end=ToInt32(end);if(arguments.length<1){start=0}if(arguments.length<2){end=this.length}if(start<0){start=this.length+start}if(end<0){end=this.length+end}start=clamp(start,0,this.length);end=clamp(end,0,this.length);var len=end-start;if(len<0){len=0}return new this.constructor(this.buffer,this.byteOffset+start*this.BYTES_PER_ELEMENT,len)}});function makeTypedArray(elementSize,pack,unpack){var TypedArray=function(){Object.defineProperty(this,"constructor",{value:TypedArray});$TypedArray$.apply(this,arguments);makeArrayAccessors(this)};if("__proto__"in TypedArray){TypedArray.__proto__=$TypedArray$}else{TypedArray.from=$TypedArray$.from;TypedArray.of=$TypedArray$.of}TypedArray.BYTES_PER_ELEMENT=elementSize;var TypedArrayPrototype=function(){};TypedArrayPrototype.prototype=$TypedArrayPrototype$;TypedArray.prototype=new TypedArrayPrototype;Object.defineProperty(TypedArray.prototype,"BYTES_PER_ELEMENT",{value:elementSize});Object.defineProperty(TypedArray.prototype,"_pack",{value:pack});Object.defineProperty(TypedArray.prototype,"_unpack",{value:unpack});return TypedArray}var Int8Array=makeTypedArray(1,packI8,unpackI8);var Uint8Array=makeTypedArray(1,packU8,unpackU8);var Uint8ClampedArray=makeTypedArray(1,packU8Clamped,unpackU8);var Int16Array=makeTypedArray(2,packI16,unpackI16);var Uint16Array=makeTypedArray(2,packU16,unpackU16);var Int32Array=makeTypedArray(4,packI32,unpackI32);var Uint32Array=makeTypedArray(4,packU32,unpackU32);var Float32Array=makeTypedArray(4,packF32,unpackF32);var Float64Array=makeTypedArray(8,packF64,unpackF64);global.Int8Array=global.Int8Array||Int8Array;global.Uint8Array=global.Uint8Array||Uint8Array;global.Uint8ClampedArray=global.Uint8ClampedArray||Uint8ClampedArray;global.Int16Array=global.Int16Array||Int16Array;global.Uint16Array=global.Uint16Array||Uint16Array;global.Int32Array=global.Int32Array||Int32Array;global.Uint32Array=global.Uint32Array||Uint32Array;global.Float32Array=global.Float32Array||Float32Array;global.Float64Array=global.Float64Array||Float64Array})();(function(){function r(array,index){return IsCallable(array.get)?array.get(index):array[index]}var IS_BIG_ENDIAN=function(){var u16array=new Uint16Array([4660]),u8array=new Uint8Array(u16array.buffer);return r(u8array,0)===18}();function DataView(buffer,byteOffset,byteLength){if(!(buffer instanceof ArrayBuffer||Class(buffer)==="ArrayBuffer"))throw TypeError();byteOffset=ToUint32(byteOffset);if(byteOffset>buffer.byteLength)throw RangeError("byteOffset out of range");if(byteLength===undefined)byteLength=buffer.byteLength-byteOffset;else byteLength=ToUint32(byteLength);if(byteOffset+byteLength>buffer.byteLength)throw RangeError("byteOffset and length reference an area beyond the end of the buffer");Object.defineProperty(this,"buffer",{value:buffer});Object.defineProperty(this,"byteLength",{value:byteLength});Object.defineProperty(this,"byteOffset",{value:byteOffset})}function makeGetter(arrayType){return function GetViewValue(byteOffset,littleEndian){byteOffset=ToUint32(byteOffset);if(byteOffset+arrayType.BYTES_PER_ELEMENT>this.byteLength)throw RangeError("Array index out of range");byteOffset+=this.byteOffset;var uint8Array=new Uint8Array(this.buffer,byteOffset,arrayType.BYTES_PER_ELEMENT),bytes=[];for(var i=0;ithis.byteLength)throw RangeError("Array index out of range");var typeArray=new arrayType([value]),byteArray=new Uint8Array(typeArray.buffer),bytes=[],i,byteView;for(i=0;i 0) { + var ev = JSON.stringify(event); + for (var i = 0; i < selectionHistory.length; i++) { + var sel = JSON.stringify(selectionHistory[i]); + if (sel == ev) { + return; + } + } + } + + // accumulate history for persistent selection + if (!x.highlight.persistent) { + selectionHistory = [event]; + } else { + selectionHistory.push(event); + } + crosstalk.var("plotlySelectionHistory").set(selectionHistory); + + // do the actual updating of traces, frames, and the selectize widget + traceManager.updateSelection(set, e.value); + // https://github.com/selectize/selectize.js/blob/master/docs/api.md#methods_items + if (x.selectize) { + if (!x.highlight.persistent || e.value === null) { + selectize.clear(true); + } + selectize.addItems(e.value, true); + selectize.close(); + } + } + selection.on("change", selectionChange); + + // Set a crosstalk variable selection value, triggering an update + var turnOn = function(e) { + if (e) { + var selectedKeys = pointsToKeys(e.points); + // Keys are group names, values are array of selected keys from group. + for (var set in selectedKeys) { + if (selectedKeys.hasOwnProperty(set)) { + selection.set(selectedKeys[set].value, {sender: el}); + } + } + } + }; + if (x.highlight.debounce > 0) { + turnOn = debounce(turnOn, x.highlight.debounce); + } + graphDiv.on(x.highlight.on, turnOn); + + graphDiv.on(x.highlight.off, function turnOff(e) { + // remove any visual clues + removeBrush(el); + // remove any selection history + crosstalk.var("plotlySelectionHistory").set(null); + // trigger the actual removal of selection traces + selection.set(null, {sender: el}); + }); + + // register a callback for selectize so that there is bi-directional + // communication between the widget and direct manipulation events + if (x.selectize) { + var selectizeID = Object.keys(x.selectize)[i]; + var options = x.selectize[selectizeID]; + var first = [{value: "", label: "(All)"}]; + var opts = $.extend({ + options: first.concat(options.items), + searchField: "label", + valueField: "value", + labelField: "label", + maxItems: 50 + }, + options + ); + var select = $("#" + selectizeID).find("select")[0]; + var selectize = $(select).selectize(opts)[0].selectize; + // NOTE: this callback is triggered when *directly* altering + // dropdown items + selectize.on("change", function() { + var currentItems = traceManager.groupSelections[set] || []; + if (!x.highlight.persistent) { + removeBrush(el); + for (var i = 0; i < currentItems.length; i++) { + selectize.removeItem(currentItems[i], true); + } + } + var newItems = selectize.items.filter(function(idx) { + return currentItems.indexOf(idx) < 0; + }); + if (newItems.length > 0) { + traceManager.updateSelection(set, newItems); + } else { + // Item has been removed... + // TODO: this logic won't work for dynamically changing palette + traceManager.updateSelection(set, null); + traceManager.updateSelection(set, selectize.items); + } + }); + } + } // end of selectionChange + + } // end of renderValue +}); // end of widget definition + +/** + * @param graphDiv The Plotly graph div + * @param highlight An object with options for updating selection(s) + */ +function TraceManager(graphDiv, highlight) { + // The Plotly graph div + this.gd = graphDiv; + + // Preserve the original data. + // TODO: try using Lib.extendFlat() as done in + // https://github.com/plotly/plotly.js/pull/1136 + this.origData = JSON.parse(JSON.stringify(graphDiv.data)); + + // avoid doing this over and over + this.origOpacity = []; + for (var i = 0; i < this.origData.length; i++) { + this.origOpacity[i] = this.origData[i].opacity === 0 ? 0 : (this.origData[i].opacity || 1); + } + + // key: group name, value: null or array of keys representing the + // most recently received selection for that group. + this.groupSelections = {}; + + // selection parameters (e.g., transient versus persistent selection) + this.highlight = highlight; +} + +TraceManager.prototype.close = function() { + // TODO: Unhook all event handlers +}; + +TraceManager.prototype.updateFilter = function(group, keys) { + + if (typeof(keys) === "undefined" || keys === null) { + + this.gd.data = JSON.parse(JSON.stringify(this.origData)); + + } else { + + var traces = []; + for (var i = 0; i < this.origData.length; i++) { + var trace = this.origData[i]; + if (!trace.key || trace.set !== group) { + continue; + } + var matchFunc = getMatchFunc(trace); + var matches = matchFunc(trace.key, keys); + + if (matches.length > 0) { + if (!trace._isSimpleKey) { + // subsetArrayAttrs doesn't mutate trace (it makes a modified clone) + trace = subsetArrayAttrs(trace, matches); + } + traces.push(trace); + } + } + this.gd.data = traces; + } + + Plotly.redraw(this.gd); + + // NOTE: we purposely do _not_ restore selection(s), since on filter, + // axis likely will update, changing the pixel -> data mapping, leading + // to a likely mismatch in the brush outline and highlighted marks + +}; + +TraceManager.prototype.updateSelection = function(group, keys) { + + if (keys !== null && !Array.isArray(keys)) { + throw new Error("Invalid keys argument; null or array expected"); + } + + // if selection has been cleared, or if this is transient + // selection, delete the "selection traces" + var nNewTraces = this.gd.data.length - this.origData.length; + if (keys === null || !this.highlight.persistent && nNewTraces > 0) { + var tracesToRemove = []; + for (var i = 0; i < this.gd.data.length; i++) { + if (this.gd.data[i]._isCrosstalkTrace) tracesToRemove.push(i); + } + Plotly.deleteTraces(this.gd, tracesToRemove); + this.groupSelections[group] = keys; + } else { + // add to the groupSelection, rather than overwriting it + // TODO: can this be removed? + this.groupSelections[group] = this.groupSelections[group] || []; + for (var i = 0; i < keys.length; i++) { + var k = keys[i]; + if (this.groupSelections[group].indexOf(k) < 0) { + this.groupSelections[group].push(k); + } } } -}); + if (keys === null) { + + Plotly.restyle(this.gd, {"opacity": this.origOpacity}); + + } else if (keys.length >= 1) { + + // placeholder for new "selection traces" + var traces = []; + // this variable is set in R/highlight.R + var selectionColour = crosstalk.group(group).var("plotlySelectionColour").get() || + this.highlight.color[0]; + + for (var i = 0; i < this.origData.length; i++) { + // TODO: try using Lib.extendFlat() as done in + // https://github.com/plotly/plotly.js/pull/1136 + var trace = JSON.parse(JSON.stringify(this.gd.data[i])); + if (!trace.key || trace.set !== group) { + continue; + } + // Get sorted array of matching indices in trace.key + var matchFunc = getMatchFunc(trace); + var matches = matchFunc(trace.key, keys); + + if (matches.length > 0) { + // If this is a "simple" key, that means select the entire trace + if (!trace._isSimpleKey) { + trace = subsetArrayAttrs(trace, matches); + } + // reach into the full trace object so we can properly reflect the + // selection attributes in every view + var d = this.gd._fullData[i]; + + /* + / Recursively inherit selection attributes from various sources, + / in order of preference: + / (1) official plotly.js selected attribute + / (2) highlight(selected = attrs_selected(...)) + */ + // TODO: it would be neat to have a dropdown to dynamically specify these! + $.extend(true, trace, this.highlight.selected); + + // if it is defined, override color with the "dynamic brush color"" + if (d.marker) { + trace.marker = trace.marker || {}; + trace.marker.color = selectionColour || trace.marker.color || d.marker.color; + } + if (d.line) { + trace.line = trace.line || {}; + trace.line.color = selectionColour || trace.line.color || d.line.color; + } + if (d.textfont) { + trace.textfont = trace.textfont || {}; + trace.textfont.color = selectionColour || trace.textfont.color || d.textfont.color; + } + if (d.fillcolor) { + // TODO: should selectionColour inherit alpha from the existing fillcolor? + trace.fillcolor = selectionColour || trace.fillcolor || d.fillcolor; + } + // attach a sensible name/legendgroup + trace.name = trace.name || keys.join("
"); + trace.legendgroup = trace.legendgroup || keys.join("
"); + + // keep track of mapping between this new trace and the trace it targets + // (necessary for updating frames to reflect the selection traces) + trace._originalIndex = i; + trace._newIndex = this.gd._fullData.length + traces.length; + trace._isCrosstalkTrace = true; + traces.push(trace); + } + } + + if (traces.length > 0) { + + Plotly.addTraces(this.gd, traces).then(function(gd) { + // incrementally add selection traces to frames + // (this is heavily inspired by Plotly.Plots.modifyFrames() + // in src/plots/plots.js) + var _hash = gd._transitionData._frameHash; + var _frames = gd._transitionData._frames || []; + + for (var i = 0; i < _frames.length; i++) { + + // add to _frames[i].traces *if* this frame references selected trace(s) + var newIndices = []; + for (var j = 0; j < traces.length; j++) { + var tr = traces[j]; + if (_frames[i].traces.indexOf(tr._originalIndex) > -1) { + newIndices.push(tr._newIndex); + _frames[i].traces.push(tr._newIndex); + } + } + + // nothing to do... + if (newIndices.length === 0) { + continue; + } + + var ctr = 0; + var nFrameTraces = _frames[i].data.length; + + for (var j = 0; j < nFrameTraces; j++) { + var frameTrace = _frames[i].data[j]; + if (!frameTrace.key || frameTrace.set !== group) { + continue; + } + + var matchFunc = getMatchFunc(frameTrace); + var matches = matchFunc(frameTrace.key, keys); + + if (matches.length > 0) { + if (!trace._isSimpleKey) { + frameTrace = subsetArrayAttrs(frameTrace, matches); + } + var d = gd._fullData[newIndices[ctr]]; + if (d.marker) { + frameTrace.marker = d.marker; + } + if (d.line) { + frameTrace.line = d.line; + } + if (d.textfont) { + frameTrace.textfont = d.textfont; + } + ctr = ctr + 1; + _frames[i].data.push(frameTrace); + } + } + + // update gd._transitionData._frameHash + _hash[_frames[i].name] = _frames[i]; + } + + }); + + // dim traces that have a set matching the set of selection sets + var tracesToDim = [], + opacities = [], + sets = Object.keys(this.groupSelections), + n = this.origData.length; + + for (var i = 0; i < n; i++) { + var opacity = this.origOpacity[i] || 1; + // have we already dimmed this trace? Or is this even worth doing? + if (opacity !== this.gd._fullData[i].opacity || this.highlight.opacityDim === 1) { + continue; + } + // is this set an element of the set of selection sets? + var matches = findMatches(sets, [this.gd.data[i].set]); + if (matches.length) { + tracesToDim.push(i); + opacities.push(opacity * this.highlight.opacityDim); + } + } + + if (tracesToDim.length > 0) { + Plotly.restyle(this.gd, {"opacity": opacities}, tracesToDim); + // turn off the selected/unselected API + Plotly.restyle(this.gd, {"selectedpoints": null}); + } + + } + + } +}; + +/* +Note: in all of these match functions, we assume needleSet (i.e. the selected keys) +is a 1D (or flat) array. The real difference is the meaning of haystack. +findMatches() does the usual thing you'd expect for +linked brushing on a scatterplot matrix. findSimpleMatches() returns a match iff +haystack is a subset of the needleSet. findNestedMatches() returns +*/ + +function getMatchFunc(trace) { + return (trace._isNestedKey) ? findNestedMatches : + (trace._isSimpleKey) ? findSimpleMatches : findMatches; +} + +// find matches for "flat" keys +function findMatches(haystack, needleSet) { + var matches = []; + haystack.forEach(function(obj, i) { + if (obj === null || needleSet.indexOf(obj) >= 0) { + matches.push(i); + } + }); + return matches; +} + +// find matches for "simple" keys +function findSimpleMatches(haystack, needleSet) { + var match = haystack.every(function(val) { + return val === null || needleSet.indexOf(val) >= 0; + }); + // yes, this doesn't make much sense other than conforming + // to the output type of the other match functions + return (match) ? [0] : [] +} + +// find matches for a "nested" haystack (2D arrays) +function findNestedMatches(haystack, needleSet) { + var matches = []; + for (var i = 0; i < haystack.length; i++) { + var hay = haystack[i]; + var match = hay.every(function(val) { + return val === null || needleSet.indexOf(val) >= 0; + }); + if (match) { + matches.push(i); + } + } + return matches; +} + +function isPlainObject(obj) { + return ( + Object.prototype.toString.call(obj) === '[object Object]' && + Object.getPrototypeOf(obj) === Object.prototype + ); +} + +function subsetArrayAttrs(obj, indices) { + var newObj = {}; + Object.keys(obj).forEach(function(k) { + var val = obj[k]; + + if (k.charAt(0) === "_") { + newObj[k] = val; + } else if (k === "transforms" && Array.isArray(val)) { + newObj[k] = val.map(function(transform) { + return subsetArrayAttrs(transform, indices); + }); + } else if (k === "colorscale" && Array.isArray(val)) { + newObj[k] = val; + } else if (isPlainObject(val)) { + newObj[k] = subsetArrayAttrs(val, indices); + } else if (Array.isArray(val)) { + newObj[k] = subsetArray(val, indices); + } else { + newObj[k] = val; + } + }); + return newObj; +} + +function subsetArray(arr, indices) { + var result = []; + for (var i = 0; i < indices.length; i++) { + result.push(arr[indices[i]]); + } + return result; +} + +// Convenience function for removing plotly's brush +function removeBrush(el) { + var outlines = el.querySelectorAll(".select-outline"); + for (var i = 0; i < outlines.length; i++) { + outlines[i].remove(); + } +} + + +// https://davidwalsh.name/javascript-debounce-function + +// Returns a function, that, as long as it continues to be invoked, will not +// be triggered. The function will be called after it stops being called for +// N milliseconds. If `immediate` is passed, trigger the function on the +// leading edge, instead of the trailing. +function debounce(func, wait, immediate) { + var timeout; + return function() { + var context = this, args = arguments; + var later = function() { + timeout = null; + if (!immediate) func.apply(context, args); + }; + var callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) func.apply(context, args); + }; +}; diff --git a/inst/htmlwidgets/plotly.yaml b/inst/htmlwidgets/plotly.yaml index a8f8da40a9..e69de29bb2 100644 --- a/inst/htmlwidgets/plotly.yaml +++ b/inst/htmlwidgets/plotly.yaml @@ -1,5 +0,0 @@ -dependencies: - - name: plotlyjs - version: 1.4.1 - src: "htmlwidgets/lib/plotlyjs" - script: plotly-latest.min.js diff --git a/inst/plotlyjs.R b/inst/plotlyjs.R deleted file mode 100644 index c784098879..0000000000 --- a/inst/plotlyjs.R +++ /dev/null @@ -1,13 +0,0 @@ -library(httr) -x <- GET('https://api.github.com/repos/plotly/plotly.js/releases/latest') -zip <- content(x)$zipball_url -tmp <- tempfile(fileext = ".zip") -download.file(zip, tmp) -unzip(tmp) -p <- Sys.glob("plotly-plotly.js*/dist/plotly.min.js") -file.copy(p, "inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js", overwrite = T) -l <- Sys.glob("plotly-plotly.js*/LICENSE") -file.copy(l, "inst/htmlwidgets/lib/plotlyjs/LICENSE", overwrite = T) -unlink("plotly-plotly.js*", recursive = T) -# update plotly.yml with version -basename(zip) diff --git a/inst/stars.R b/inst/stars.R new file mode 100644 index 0000000000..6404ad7cea --- /dev/null +++ b/inst/stars.R @@ -0,0 +1,22 @@ +library(jsonlite) +library(ggplot2) + +stars <- fromJSON( + "https://raw.githubusercontent.com/cpsievert/starline/master/data/stars.json", + simplifyDataFrame = FALSE +) + +dats <- lapply(stars$repos, function(r) { + starz <- unlist(r$stars$dates) + starz <- starz[sort(names(starz))] + data.frame( + date = as.Date(names(starz)), + value = cumsum(starz), + repo = r$uri, + stringsAsFactors = FALSE + ) +}) + +d <- dplyr::bind_rows(dats) +ggplot(d, aes(date, value, color = repo)) + + geom_line() + ylab("Number of stars") diff --git a/man/TeX.Rd b/man/TeX.Rd new file mode 100644 index 0000000000..fc72fb1a26 --- /dev/null +++ b/man/TeX.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/mathjax.R +\name{TeX} +\alias{TeX} +\title{Render TeX in a plotly graph using MathJax} +\usage{ +TeX(x) +} +\arguments{ +\item{x}{a character vector} +} +\description{ +This function makes it slightly easier to render TeX in a plotly graph -- +it ensures that MathJax is included with the final result and also +ensures the provided string is surrounded with \code{$} (this is what plotly.js +uses to declare a string as TeX). +} +\examples{ +\dontshow{if (interactive() || !identical(.Platform$OS.type, "windows")) withAutoprint(\{ # examplesIf} + +plot_ly(x = c(1, 2, 3, 4), y = c(1, 4, 9, 16)) \%>\% + layout(title = TeX("\\\\text{Some mathjax: }\\\\alpha+\\\\beta x")) \%>\% + config(mathjax = "cdn") +\dontshow{\}) # examplesIf} +} +\seealso{ +\link{config} +} diff --git a/man/add_annotations.Rd b/man/add_annotations.Rd new file mode 100644 index 0000000000..ff32fe8069 --- /dev/null +++ b/man/add_annotations.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/add.R +\name{add_annotations} +\alias{add_annotations} +\title{Add an annotation(s) to a plot} +\usage{ +add_annotations(p, text = NULL, ..., data = NULL, inherit = TRUE) +} +\arguments{ +\item{p}{a plotly object} + +\item{text}{annotation text (required).} + +\item{...}{these arguments are documented at +\url{https://github.com/plotly/plotly.js/blob/master/src/components/annotations/attributes.js}} + +\item{data}{a data frame.} + +\item{inherit}{inherit attributes from \code{\link[=plot_ly]{plot_ly()}}?} +} +\description{ +Add an annotation(s) to a plot +} +\author{ +Carson Sievert +} diff --git a/man/add_data.Rd b/man/add_data.Rd new file mode 100644 index 0000000000..6dac1702ff --- /dev/null +++ b/man/add_data.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/add.R +\name{add_data} +\alias{add_data} +\title{Add data to a plotly visualization} +\usage{ +add_data(p, data = NULL) +} +\arguments{ +\item{p}{a plotly visualization} + +\item{data}{a data frame.} +} +\description{ +Add data to a plotly visualization +} +\examples{ +\dontshow{if (interactive() || !identical(.Platform$OS.type, "windows")) withAutoprint(\{ # examplesIf} + +plot_ly() \%>\% add_data(economics) \%>\% add_trace(x = ~date, y = ~pce) +\dontshow{\}) # examplesIf} +} diff --git a/man/add_fun.Rd b/man/add_fun.Rd new file mode 100644 index 0000000000..c9ac09708a --- /dev/null +++ b/man/add_fun.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/add.R +\name{add_fun} +\alias{add_fun} +\title{Apply function to plot, without modifying data} +\usage{ +add_fun(p, fun, ...) +} +\arguments{ +\item{p}{a plotly object.} + +\item{fun}{a function. Should take a plotly object as input and return a +modified plotly object.} + +\item{...}{arguments passed to \code{fun}.} +} +\description{ +Useful when you need two or more layers that apply a summary statistic +to the original data. +} diff --git a/man/add_trace.Rd b/man/add_trace.Rd index 756480adec..72700f6fde 100644 --- a/man/add_trace.Rd +++ b/man/add_trace.Rd @@ -1,49 +1,288 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/plotly.R +% Please edit documentation in R/add.R \name{add_trace} \alias{add_trace} -\title{Add a trace to a plotly visualization} +\alias{add_markers} +\alias{add_text} +\alias{add_paths} +\alias{add_lines} +\alias{add_segments} +\alias{add_polygons} +\alias{add_sf} +\alias{add_table} +\alias{add_ribbons} +\alias{add_image} +\alias{add_area} +\alias{add_pie} +\alias{add_bars} +\alias{add_histogram} +\alias{add_histogram2d} +\alias{add_histogram2dcontour} +\alias{add_heatmap} +\alias{add_contour} +\alias{add_boxplot} +\alias{add_surface} +\alias{add_mesh} +\alias{add_scattergeo} +\alias{add_choropleth} +\title{Add trace(s) to a plotly visualization} \usage{ -add_trace(p = last_plot(), ..., group, color, colors, symbol, symbols, size, - data = NULL, evaluate = FALSE) +add_trace(p, ..., data = NULL, inherit = TRUE) + +add_markers(p, x = NULL, y = NULL, z = NULL, ..., data = NULL, inherit = TRUE) + +add_text( + p, + x = NULL, + y = NULL, + z = NULL, + text = NULL, + ..., + data = NULL, + inherit = TRUE +) + +add_paths(p, x = NULL, y = NULL, z = NULL, ..., data = NULL, inherit = TRUE) + +add_lines(p, x = NULL, y = NULL, z = NULL, ..., data = NULL, inherit = TRUE) + +add_segments( + p, + x = NULL, + y = NULL, + xend = NULL, + yend = NULL, + ..., + data = NULL, + inherit = TRUE +) + +add_polygons(p, x = NULL, y = NULL, ..., data = NULL, inherit = TRUE) + +add_sf(p, ..., x = ~x, y = ~y, data = NULL, inherit = TRUE) + +add_table(p, ..., rownames = TRUE, data = NULL, inherit = TRUE) + +add_ribbons( + p, + x = NULL, + ymin = NULL, + ymax = NULL, + ..., + data = NULL, + inherit = TRUE +) + +add_image(p, z = NULL, colormodel = NULL, ..., data = NULL, inherit = TRUE) + +add_area(p, r = NULL, theta = NULL, t = NULL, ..., data = NULL, inherit = TRUE) + +add_pie(p, values = NULL, labels = NULL, ..., data = NULL, inherit = TRUE) + +add_bars(p, x = NULL, y = NULL, ..., data = NULL, inherit = TRUE) + +add_histogram(p, x = NULL, y = NULL, ..., data = NULL, inherit = TRUE) + +add_histogram2d( + p, + x = NULL, + y = NULL, + z = NULL, + ..., + data = NULL, + inherit = TRUE +) + +add_histogram2dcontour( + p, + x = NULL, + y = NULL, + z = NULL, + ..., + data = NULL, + inherit = TRUE +) + +add_heatmap(p, x = NULL, y = NULL, z = NULL, ..., data = NULL, inherit = TRUE) + +add_contour(p, z = NULL, ..., data = NULL, inherit = TRUE) + +add_boxplot(p, x = NULL, y = NULL, ..., data = NULL, inherit = TRUE) + +add_surface(p, z = NULL, ..., data = NULL, inherit = TRUE) + +add_mesh(p, x = NULL, y = NULL, z = NULL, ..., data = NULL, inherit = TRUE) + +add_scattergeo(p, ...) + +add_choropleth(p, z = NULL, ..., data = NULL, inherit = TRUE) } \arguments{ -\item{p}{A plotly object.} +\item{p}{a plotly object} + +\item{...}{Arguments (i.e., attributes) passed along to the trace \code{type}. +See \code{\link[=schema]{schema()}} for a list of acceptable attributes for a given trace \code{type} +(by going to \code{traces} -> \code{type} -> \code{attributes}). Note that attributes +provided at this level may override other arguments +(e.g. \code{plot_ly(x = 1:10, y = 1:10, color = I("red"), marker = list(color = "blue"))}).} + +\item{data}{A data frame (optional) or \link[crosstalk:SharedData]{crosstalk::SharedData} object.} + +\item{inherit}{inherit attributes from \code{\link[=plot_ly]{plot_ly()}}?} + +\item{x}{the x variable.} + +\item{y}{the y variable.} + +\item{z}{a numeric matrix (unless \code{\link[=add_image]{add_image()}}, which wants a raster object, see \code{\link[=as.raster]{as.raster()}}).} -\item{...}{These arguments are documented in the references section below. -Note that acceptable arguments depend on the trace type.} +\item{text}{textual labels.} -\item{group}{Either a variable name or a vector to use for grouping. If used, -a different trace will be created for each unique value.} +\item{xend}{"final" x position (in this context, x represents "start")} -\item{color}{Either a variable name or a vector to use for color mapping.} +\item{yend}{"final" y position (in this context, y represents "start")} -\item{colors}{Either a colorbrewer2.org palette name (e.g. "YlOrRd" or "Blues"), -or a vector of colors to interpolate in hexadecimal "#RRGGBB" format, -or a color interpolation function like \code{colorRamp}.} +\item{rownames}{whether or not to display the rownames of \code{data}.} -\item{symbol}{Either a variable name or a (discrete) vector to use for symbol encoding.} +\item{ymin}{a variable used to define the lower boundary of a polygon.} -\item{symbols}{A character vector of symbol types. Possible values: -'dot', 'cross', 'diamond', 'square', 'triangle-down', 'triangle-left', 'triangle-right', 'triangle-up'} +\item{ymax}{a variable used to define the upper boundary of a polygon.} -\item{size}{A variable name or numeric vector to encode the size of markers.} +\item{colormodel}{Sets the colormodel for image traces if \code{z} is not a raster object. +If \code{z} is a raster object (see \code{\link[=as.raster]{as.raster()}}), the \code{'rgba'} colormodel is always used.} -\item{data}{A data frame to associate with this trace (optional). If not -provided, arguments are evaluated using the data frame in \code{\link{plot_ly}()}.} +\item{r}{Sets the radial coordinates.} -\item{evaluate}{logical. Evaluate arguments when this function is called?} +\item{theta}{Sets the angular coordinates.} + +\item{t}{Deprecated. Use \code{theta} instead.} + +\item{values}{the value to associated with each slice of the pie.} + +\item{labels}{the labels (categories) corresponding to \code{values}.} } \description{ -Add a trace to a plotly visualization +Add trace(s) to a plotly visualization } -\author{ -Carson Sievert +\examples{ +\dontshow{if (interactive() || !identical(.Platform$OS.type, "windows")) withAutoprint(\{ # examplesIf} + +# the `plot_ly()` function initiates an object, and if no trace type +# is specified, it sets a sensible default +p <- plot_ly(economics, x = ~date, y = ~uempmed) +p + +# some `add_*()` functions are a specific case of a trace type +# for example, `add_markers()` is a scatter trace with mode of markers +add_markers(p) + +# scatter trace with mode of text +add_text(p, text = "\%") + +# scatter trace with mode of lines +add_paths(p) + +# like `add_paths()`, but ensures points are connected according to `x` +add_lines(p) + +# if you prefer to work with plotly.js more directly, can always +# use `add_trace()` and specify the type yourself +add_trace(p, type = "scatter", mode = "markers+lines") + +# mappings provided to `plot_ly()` are "global", but can be overwritten +plot_ly(economics, x = ~date, y = ~uempmed, color = I("red"), showlegend = FALSE) \%>\% + add_lines() \%>\% + add_markers(color = ~pop) + +# a number of `add_*()` functions are special cases of the scatter trace +plot_ly(economics, x = ~date) \%>\% + add_ribbons(ymin = ~pce - 1e3, ymax = ~pce + 1e3) + +# use `group_by()` (or `group2NA()`) to apply visual mapping +# once per group (e.g. one line per group) +txhousing \%>\% + group_by(city) \%>\% + plot_ly(x = ~date, y = ~median) \%>\% + add_lines(color = I("black")) + +\dontrun{ +# use `add_sf()` or `add_polygons()` to create geo-spatial maps +# http://blog.cpsievert.me/2018/03/30/visualizing-geo-spatial-data-with-sf-and-plotly/ +if (requireNamespace("sf", quietly = TRUE)) { + nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) + plot_ly() \%>\% add_sf(data = nc) +} + +# univariate summary statistics +plot_ly(mtcars, x = ~factor(vs), y = ~mpg) \%>\% + add_boxplot() +plot_ly(mtcars, x = ~factor(vs), y = ~mpg) \%>\% + add_trace(type = "violin") + +# `add_histogram()` does binning for you... +mtcars \%>\% + plot_ly(x = ~factor(vs)) \%>\% + add_histogram() + +# ...but you can 'pre-compute' bar heights in R +mtcars \%>\% + dplyr::count(vs) \%>\% + plot_ly(x = ~vs, y = ~n) \%>\% + add_bars() + +# the 2d analogy of add_histogram() is add_histogram2d()/add_histogram2dcontour() +library(MASS) +(p <- plot_ly(geyser, x = ~waiting, y = ~duration)) +add_histogram2d(p) +add_histogram2dcontour(p) + +# the 2d analogy of add_bars() is add_heatmap()/add_contour() +# (i.e., bin counts must be pre-specified) +den <- kde2d(geyser$waiting, geyser$duration) +p <- plot_ly(x = den$x, y = den$y, z = den$z) +add_heatmap(p) +add_contour(p) + +# `add_table()` makes it easy to map a data frame to the table trace type +plot_ly(economics) \%>\% + add_table() + +# pie charts! +ds <- data.frame(labels = c("A", "B", "C"), values = c(10, 40, 60)) +plot_ly(ds, labels = ~labels, values = ~values) \%>\% + add_pie() \%>\% + layout(title = "Basic Pie Chart using Plotly") + +data(wind) +plot_ly(wind, r = ~r, theta = ~t) \%>\% + add_area(color = ~nms) \%>\% + layout( + polar = list( + radialaxis = list(ticksuffix = "\%"), + angularaxis = list(rotation = 90) + ) + ) + +# ------------------------------------------------------------ +# 3D chart types +# ------------------------------------------------------------ +plot_ly(z = ~volcano) \%>\% + add_surface() +plot_ly(x = c(0, 0, 1), y = c(0, 1, 0), z = c(0, 0, 0)) \%>\% + add_mesh() +} +\dontshow{\}) # examplesIf} } \references{ -\url{https://plot.ly/r/reference/} +\url{https://plotly-r.com/overview.html} + +\url{https://plotly.com/r/} + +\url{https://plotly.com/r/reference/} } \seealso{ -\code{\link{plot_ly}()} +\code{\link[=plot_ly]{plot_ly()}} +} +\author{ +Carson Sievert } - diff --git a/man/animation.Rd b/man/animation.Rd new file mode 100644 index 0000000000..db96700a09 --- /dev/null +++ b/man/animation.Rd @@ -0,0 +1,102 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/animate.R +\name{animation_opts} +\alias{animation_opts} +\alias{animation} +\alias{animation_slider} +\alias{animation_button} +\title{Animation configuration options} +\usage{ +animation_opts( + p, + frame = 500, + transition = frame, + easing = "linear", + redraw = TRUE, + mode = "immediate" +) + +animation_slider(p, hide = FALSE, ...) + +animation_button(p, ..., label) +} +\arguments{ +\item{p}{a plotly object.} + +\item{frame}{The amount of time between frames (in milliseconds). +Note that this amount should include the \code{transition}.} + +\item{transition}{The duration of the smooth transition between +frames (in milliseconds).} + +\item{easing}{The type of transition easing. See the list of options here +\url{https://github.com/plotly/plotly.js/blob/master/src/plots/animation_attributes.js}} + +\item{redraw}{Trigger a redraw of the plot at completion of the transition? +A redraw may significantly impact performance, but may be necessary to +update graphical elements that can't be transitioned.} + +\item{mode}{Describes how a new animate call interacts with currently-running +animations. If \code{immediate}, current animations are interrupted and +the new animation is started. If \code{next}, the current frame is allowed +to complete, after which the new animation is started. If \code{afterall} +all existing frames are animated to completion before the new animation +is started.} + +\item{hide}{remove the animation slider?} + +\item{...}{for \code{animation_slider}, attributes are passed to a special +layout.sliders object tied to the animation frames. +The definition of these attributes may be found here +\url{https://github.com/plotly/plotly.js/blob/master/src/components/sliders/attributes.js} +For \code{animation_button}, arguments are passed to a special +layout.updatemenus button object tied to the animation +\url{https://github.com/plotly/plotly.js/blob/master/src/components/updatemenus/attributes.js}} + +\item{label}{a character string used for the animation button's label} +} +\description{ +Animations can be created by either using the \code{frame} argument in +\code{\link[=plot_ly]{plot_ly()}} or the (unofficial) \code{frame} ggplot2 aesthetic in +\code{\link[=ggplotly]{ggplotly()}}. By default, animations populate a play button +and slider component for controlling the state of the animation +(to pause an animation, click on a relevant location on the slider bar). +Both the play button and slider component transition between frames according +rules specified by \code{\link[=animation_opts]{animation_opts()}}. +} +\examples{ +\dontshow{if (interactive() || !identical(.Platform$OS.type, "windows")) withAutoprint(\{ # examplesIf} + +df <- data.frame( + x = c(1, 2, 2, 1, 1, 2), + y = c(1, 2, 2, 1, 1, 2), + z = c(1, 1, 2, 2, 3, 3) +) +plot_ly(df) \%>\% + add_markers(x = 1.5, y = 1.5) \%>\% + add_markers(x = ~x, y = ~y, frame = ~z) + +# it's a good idea to remove smooth transitions when there is +# no relationship between objects in each view +plot_ly(mtcars, x = ~wt, y = ~mpg, frame = ~cyl) \%>\% + animation_opts(transition = 0) + +# works the same way with ggplotly +if (interactive()) { + p <- ggplot(txhousing, aes(month, median)) + + geom_line(aes(group = year), alpha = 0.3) + + geom_smooth() + + geom_line(aes(frame = year, ids = month), color = "red") + + facet_wrap(~ city) + + ggplotly(p, width = 1200, height = 900) \%>\% + animation_opts(1000) +} + + +#' # for more, see https://plotly.com/r/animating-views.html +\dontshow{\}) # examplesIf} +} +\author{ +Carson Sievert +} diff --git a/man/api.Rd b/man/api.Rd new file mode 100644 index 0000000000..16f002afcf --- /dev/null +++ b/man/api.Rd @@ -0,0 +1,162 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/api_exports.R +\name{api_create} +\alias{api_create} +\alias{api_create.plotly} +\alias{api_create.ggplot} +\alias{api_create.data.frame} +\alias{api_download_plot} +\alias{api_download_grid} +\alias{api} +\title{Tools for working with plotly's REST API (v2)} +\usage{ +api_create( + x = last_plot(), + filename = NULL, + fileopt = c("overwrite", "new"), + sharing = c("public", "private", "secret"), + ... +) + +\method{api_create}{plotly}( + x = last_plot(), + filename = NULL, + fileopt = "overwrite", + sharing = "public", + ... +) + +\method{api_create}{ggplot}( + x = last_plot(), + filename = NULL, + fileopt = "overwrite", + sharing = "public", + ... +) + +\method{api_create}{data.frame}(x, filename = NULL, fileopt = "overwrite", sharing = "public", ...) + +api_download_plot(id, username) + +api_download_grid(id, username) + +api(endpoint = "/", verb = "GET", body = NULL, ...) +} +\arguments{ +\item{x}{An R object to hosted on plotly's web platform. +Can be a plotly/ggplot2 object or a \link{data.frame}.} + +\item{filename}{character vector naming file(s). If \code{x} is a plot, +can be a vector of length 2 naming both the plot AND the underlying grid.} + +\item{fileopt}{character string describing whether to "overwrite" existing +files or ensure "new" file(s) are always created.} + +\item{sharing}{If 'public', anyone can view this graph. It will appear in +your profile and can appear in search engines. You do not need to be +logged in to Plotly to view this chart. +If 'private', only you can view this plot. It will not appear in the +Plotly feed, your profile, or search engines. You must be logged in to +Plotly to view this graph. You can privately share this graph with other +Plotly users in your online Plotly account and they will need to be logged +in to view this plot. +If 'secret', anyone with this secret link can view this chart. It will +not appear in the Plotly feed, your profile, or search engines. +If it is embedded inside a webpage or an IPython notebook, anybody who is +viewing that page will be able to view the graph. +You do not need to be logged in to view this plot.} + +\item{...}{For \code{api()}, these arguments are passed onto +\code{\link[httr:RETRY]{httr::RETRY()}}. For \code{api_create()}, these arguments are +included in the body of the HTTP request.} + +\item{id}{a filename id.} + +\item{username}{a plotly username.} + +\item{endpoint}{the endpoint (i.e., location) for the request. +To see a list of all available endpoints, call \code{api()}. +Any relevant query parameters should be included here (see examples).} + +\item{verb}{name of the HTTP verb to use (as in, \code{\link[httr:RETRY]{httr::RETRY()}}).} + +\item{body}{body of the HTTP request(as in, \code{\link[httr:RETRY]{httr::RETRY()}}). +If this value is not already converted to JSON +(via \code{\link[jsonlite:fromJSON]{jsonlite::toJSON()}}), it uses the internal \code{to_JSON()} +to ensure values are "automatically unboxed" (i.e., vec.} +} +\description{ +Convenience functions for working with version 2 of plotly's REST API. +Upload R objects to a plotly account via \code{api_create()} and download +plotly objects via \code{api_download_plot()}/\code{api_download_grid()}. +For anything else, use \code{api()}. +} +\examples{ +\dontshow{if (interactive() || !identical(.Platform$OS.type, "windows")) withAutoprint(\{ # examplesIf} + +\dontrun{ + +# ------------------------------------------------------------ +# api_create() makes it easy to upload ggplot2/plotly objects +# and/or data frames to your plotly account +# ------------------------------------------------------------ + +# A data frame creates a plotly "grid". Printing one will take you +# to the it's web address so you can start creating! +(m <- api_create(mtcars)) + +# A plotly/ggplot2 object create a plotly "plot". +p <- plot_ly(mtcars, x = ~factor(vs)) +(r <- api_create(p)) + +# api_create() returns metadata about the remote "file". Here is +# one way you could use that metadata to download a plot for local use: +fileID <- strsplit(r$file$fid, ":")[[1]] +layout( + api_download_plot(fileID[2], fileID[1]), + title = sprintf("Local version of this plot", r$file$web_url) +) + +------------------------------------------------------------ +# The api() function provides a low-level interface for performing +# any action at any endpoint! It always returns a list. +# ------------------------------------------------------------ + +# list all the endpoints +api() + +# search the entire platform! +api("search?q=overdose") +api("search?q=plottype:pie trump fake") + +# these examples will require a user account +usr <- Sys.getenv("plotly_username", NA) +if (!is.na(usr)) { + # your account info + api(sprintf("users/\%s", usr)) + # your folders/files + api(sprintf("folders/home?user=\%s", usr)) +} + +# Retrieve a specific file +api("files/cpsievert:14681") + +# change the filename +# (note: this won't work unless you have proper credentials to the relevant account) +api("files/cpsievert:14681", "PATCH", list(filename = "toy file")) + +# Copy a file +api("files/cpsievert:14681/copy", "POST") + +# Create a folder +api("folders", "POST", list(path = "/starts/at/root/and/ends/here")) + +} +\dontshow{\}) # examplesIf} +} +\seealso{ +\code{\link[=signup]{signup()}} +} +\author{ +Carson Sievert +} diff --git a/man/as.widget.Rd b/man/as.widget.Rd index 9f86bf8bfa..99281b4bfc 100644 --- a/man/as.widget.Rd +++ b/man/as.widget.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/print.R +% Please edit documentation in R/deprecated.R \name{as.widget} \alias{as.widget} \title{Convert a plotly object to an htmlwidget object} @@ -12,13 +12,7 @@ as.widget(x, ...) \item{...}{other options passed onto \code{htmlwidgets::createWidget}} } \description{ -Convert a plotly object to an htmlwidget object +This function was deprecated in 4.0.0, +as plotly objects are now htmlwidget objects, +so there is no need to convert them. } -\examples{ -\dontrun{ -p <- plot_ly(mtcars, x = mpg, y = disp, mode = "markers") -htmlwidgets::saveWidget(as.widget(p), "index.html") -} - -} - diff --git a/man/as_widget.Rd b/man/as_widget.Rd new file mode 100644 index 0000000000..a438aa6651 --- /dev/null +++ b/man/as_widget.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plotly.R +\name{as_widget} +\alias{as_widget} +\title{Convert a list to a plotly htmlwidget object} +\usage{ +as_widget(x, ...) +} +\arguments{ +\item{x}{a plotly object.} + +\item{...}{other options passed onto \code{htmlwidgets::createWidget}} +} +\description{ +Convert a list to a plotly htmlwidget object +} +\examples{ +\dontshow{if (interactive() || !identical(.Platform$OS.type, "windows")) withAutoprint(\{ # examplesIf} + +trace <- list(x = 1, y = 1) +obj <- list(data = list(trace), layout = list(title = "my plot")) +as_widget(obj) +\dontshow{\}) # examplesIf} +} diff --git a/man/attrs_selected.Rd b/man/attrs_selected.Rd new file mode 100644 index 0000000000..995d6bf66e --- /dev/null +++ b/man/attrs_selected.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/highlight.R +\name{attrs_selected} +\alias{attrs_selected} +\title{Specify attributes of selection traces} +\usage{ +attrs_selected(opacity = 1, ...) +} +\arguments{ +\item{opacity}{a number between 0 and 1 specifying the overall opacity of +the selected trace} + +\item{...}{other trace attributes attached to the selection trace.} +} +\description{ +By default the name of the selection trace derives from the selected values. +} +\author{ +Carson Sievert +} diff --git a/man/bbox.Rd b/man/bbox.Rd new file mode 100644 index 0000000000..00fd4b32b6 --- /dev/null +++ b/man/bbox.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ggplotly.R +\name{bbox} +\alias{bbox} +\title{Estimate bounding box of a rotated string} +\usage{ +bbox(txt = "foo", angle = 0, size = 12) +} +\arguments{ +\item{txt}{a character string of length 1} + +\item{angle}{sets the angle of the tick labels with respect to the +horizontal (e.g., \code{tickangle} of -90 draws the tick labels vertically)} + +\item{size}{vertical size of a character} +} +\description{ +Estimate bounding box of a rotated string +} +\references{ +https://www.dropbox.com/s/nc6968prgw8ne4w/bbox.pdf?dl=0 +} diff --git a/man/colorbar.Rd b/man/colorbar.Rd new file mode 100644 index 0000000000..ce9c4978b0 --- /dev/null +++ b/man/colorbar.Rd @@ -0,0 +1,46 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/helpers.R +\name{colorbar} +\alias{colorbar} +\title{Modify the colorbar} +\usage{ +colorbar(p, ..., limits = NULL, which = 1) +} +\arguments{ +\item{p}{a plotly object} + +\item{...}{arguments are documented here +\url{https://plotly.com/r/reference/#scatter-marker-colorbar}.} + +\item{limits}{numeric vector of length 2. Set the extent of the colorbar scale.} + +\item{which}{colorbar to modify? Should only be relevant for subplots with +multiple colorbars.} +} +\description{ +Modify the colorbar +} +\examples{ +\dontshow{if (interactive() || !identical(.Platform$OS.type, "windows")) withAutoprint(\{ # examplesIf} + +p <- plot_ly(mtcars, x = ~wt, y = ~mpg, color = ~cyl) + +# pass any colorbar attribute -- +# https://plotly.com/r/reference/#scatter-marker-colorbar +colorbar(p, len = 0.5) + +# Expand the limits of the colorbar +colorbar(p, limits = c(0, 20)) +# values outside the colorbar limits are considered "missing" +colorbar(p, limits = c(5, 6)) + +# also works on colorbars generated via a z value +corr <- cor(diamonds[vapply(diamonds, is.numeric, logical(1))]) +plot_ly(x = rownames(corr), y = colnames(corr), z = corr) \%>\% + add_heatmap() \%>\% + colorbar(limits = c(-1, 1)) +\dontshow{\}) # examplesIf} +} +\author{ +Carson Sievert +} diff --git a/man/config.Rd b/man/config.Rd index fd1785f8ca..15917165c0 100644 --- a/man/config.Rd +++ b/man/config.Rd @@ -1,50 +1,73 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/plotly.R +% Please edit documentation in R/layout.R \name{config} \alias{config} \title{Set the default configuration for plotly} \usage{ -config(p = last_plot(), staticPlot = F, workspace = F, editable = F, - autosizable = F, fillFrame = F, scrollZoom = F, - doubleClick = "reset+autosize", showTips = F, showLink = T, - sendData = T, linkText = "Edit chart", displayModeBar = "hover", - displaylogo = T, plot3dPixelRatio = 2) +config( + p, + ..., + cloud = FALSE, + showSendToCloud = cloud, + locale = NULL, + mathjax = NULL +) } \arguments{ \item{p}{a plotly object} -\item{staticPlot}{for export or image generation} +\item{...}{these arguments are documented at +\url{https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js}} -\item{workspace}{we're in the workspace, so need toolbar etc (TODO describe functionality instead)?} +\item{cloud}{deprecated. Use \code{showSendToCloud} instead.} -\item{editable}{edit titles, move annotations, etc} +\item{showSendToCloud}{include the send data to cloud button?} -\item{autosizable}{respect layout.autosize=true and infer its container size?} +\item{locale}{locale to use. See \href{https://github.com/plotly/plotly.js/tree/master/dist#to-include-localization}{here} for more info.} -\item{fillFrame}{if we DO autosize, do we fill the container or the screen?} - -\item{scrollZoom}{mousewheel or two-finger scroll zooms the plot} - -\item{doubleClick}{double click interaction (false, 'reset', 'autosize' or 'reset+autosize')} - -\item{showTips}{see some hints about interactivity} - -\item{showLink}{link to open this plot in plotly} - -\item{sendData}{if we show a link, does it contain data or just link to a plotly file?} +\item{mathjax}{add \href{https://github.com/plotly/plotly.js/tree/master/dist#to-support-mathjax}{MathJax rendering support}. +If \code{"cdn"}, mathjax is loaded externally (meaning an internet connection is needed for +TeX rendering). If \code{"local"}, the PLOTLY_MATHJAX_PATH environment variable must be +set to the location (a local file path) of MathJax. IMPORTANT: \strong{plotly} uses SVG-based +mathjax rendering which doesn't play nicely with HTML-based rendering +(e.g., \strong{rmarkdown} documents and \strong{shiny} apps). To leverage both types of rendering, +you must \verb{